libcfe  0.12.1
some useful C-functions
logfile.h File Reference
#include <stdio.h>
Include dependency graph for logfile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

FILE * mk_temp_logfile (void)
 
void remove_temp_logfile (FILE **tmplogfp)
 
FILE * mk_logfile (FILE *tmplogfp, const char *file)
 
void close_logfile (FILE **fd)
 

Function Documentation

◆ close_logfile()

void close_logfile ( FILE **  fd)

Close an opened log file and reset the file descriptor.

Parameters
[in,out]fdPointer to a file descriptor pointer, this will be NULL afterwards.

Definition at line 139 of file logfile.c.

◆ mk_logfile()

FILE* mk_logfile ( FILE *  tmplogfp,
const char *  file 
)

create a new log file and moves the content from the temporary log file in it, afterwards it deletes the temporary log file.

Parameters
[in]tmplogfpFile pointer return by mk_temp_logfile.
[in]filePointer to a string representing the filename for the new log file.
Returns
A file descriptor to the opened log file.

Definition at line 72 of file logfile.c.

◆ mk_temp_logfile()

FILE* mk_temp_logfile ( void  )

Make a temporary log file for early logging. This log file will be copied in an persistent log file by mk_logfile.

Returns
A file descriptor to an opened temporary log file.

Definition at line 26 of file logfile.c.

◆ remove_temp_logfile()

void remove_temp_logfile ( FILE **  tmplogfp)

Remove the temporary log file. If you want to turn the temporary log file in a permanent one see mk_logfile.

Parameters
[in,out]tmplogfpPointer to a file descriptor pointer, this is a reference to the return value of mk_temp_logfile. This will be NULL afterwards.

Definition at line 56 of file logfile.c.