engine/hlbrlib.h File Reference

#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 *)
QueueListListAdd (char *, QueueList *, char)
QueueListListDel (char *, QueueList *, int *)
void ListClear (QueueList *)
void DumpBuffer (unsigned char *, int, FILE *)


Typedef Documentation

typedef struct log_file_rec LogFileRec

Struct used to keep names/handlers/etc of log files. This is mainly used by action alert file.

typedef struct queue_t QueueList

Definition at line 15 of file hlbrlib.h.


Function Documentation

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 *   
)

Definition at line 241 of file hlbrlib.c.

References NULL.

QueueList* ListAdd ( char *  ss,
QueueList q,
char  separator 
)

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()).

See also:
QueueList

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().

QueueList* ListDel ( char *  s,
QueueList q,
int *  retval 
)

Remove an item from a list queue.

See also:
QueueList

ListAdd

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  ) 

Removes all spaces from the start and end of a string.

Definition at line 88 of file hlbrlib.c.

Referenced by ListAdd().


Generated on Sat Jul 7 23:33:10 2007 for HLBR by  doxygen 1.5.2