#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | queue_t |
struct | log_file_rec |
Typedefs | |
typedef queue_t | QueueList |
typedef log_file_rec | LogFileRec |
Functions | |
FILE * | LogFile (LogFileRec *) |
void | CloseLogFile (LogFileRec *) |
int | LogMessage (char *, void *) |
char * | ParseCmp (char *, char *) |
char * | RmSpace (char *) |
QueueList * | ListAdd (char *, QueueList *, char) |
QueueList * | ListDel (char *, QueueList *, int *) |
void | ListClear (QueueList *) |
void | DumpBuffer (unsigned char *, int, FILE *) |
typedef struct log_file_rec LogFileRec |
Struct used to keep names/handlers/etc of log files. This is mainly used by action alert file.
void CloseLogFile | ( | LogFileRec * | log | ) |
If the log file is still opened - and we're opening/closing it at every access - then close it. The KEEP_LOGFILE_OPEN define controls how this function works.
Definition at line 39 of file hlbrlib.c.
References log_file_rec::fp, and NULL.
Referenced by AlertFileMessage(), and LogMessage().
void DumpBuffer | ( | unsigned char * | , | |
int | , | |||
FILE * | ||||
) |
Breaks up a string in a list and store it into a QueueList linked list. The character defined by the 'separator' parameter is searched in the string 'ss' and the elements in-between are copied as items in the list; note that all elements will have any leading and trailing spaces removed (with RmSpace()).
Definition at line 144 of file hlbrlib.c.
References FREE, queue_t::item, MALLOC, MALLOC_CHECK, queue_t::next, NULL, and RmSpace().
Referenced by AlertSyslogParseArgs().
void ListClear | ( | QueueList * | ) |
Definition at line 223 of file hlbrlib.c.
References FREE, queue_t::item, queue_t::next, and NULL.
Referenced by AlertSyslogParseArgs().
Remove an item from a list queue.
Definition at line 191 of file hlbrlib.c.
References FREE, queue_t::item, queue_t::next, and NULL.
FILE* LogFile | ( | LogFileRec * | log | ) |
If the log file has not been opened yet, open it, otherwise return the file pointer previously opened. The KEEP_LOGFILE_OPEN define controls how this function works.
Definition at line 17 of file hlbrlib.c.
References log_file_rec::fname, log_file_rec::fp, NULL, and PRINTERROR1.
Referenced by AlertFileMessage(), and LogMessage().
int LogMessage | ( | char * | Message, | |
void * | Data | |||
) |
Handle the message (write to a log file). Basically it gets a file name (inside the LogFileRec type) and writes the message to it. If the LogFileRec passed is NULL, then writes to standard output.
Definition at line 53 of file hlbrlib.c.
References CloseLogFile(), DEBUGPATH, FALSE, fp, LogFile(), and TRUE.
Referenced by FindPortPair(), and RemovePort().
char* ParseCmp | ( | char * | , | |
char * | ||||
) |
Definition at line 108 of file hlbrlib.c.
References DBG, NULL, and PRINTERROR3.
Referenced by AlertSyslogParseArgs().
char* RmSpace | ( | char * | s | ) |