G:/ScriptBasic/source/logger.c File Reference

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "filesys.h"
#include "thread.h"
#include "logger.h"
#include "mygmtime.h"

Go to the source code of this file.

Defines

#define ALLOC(X)   (pLOG->memory_allocating_function((X),pLOG->pMemorySegment))
#define FREE(X)   (pLOG->memory_releasing_function((X),pLOG->pMemorySegment))

Functions

static void * _mya (size_t x, void *y)
static void _myf (void *x, void *y)
static void log_thread (void *q)
int log_state (ptLogger pLOG)
int log_init (ptLogger pLOG, void *(*memory_allocating_function)(size_t, void *), void(*memory_releasing_function)(void *, void *), void *pMemorySegment, char *pszLogFileName, int iLogType)
int log_printf (ptLogger pLOG, char *pszFormat,...)
int log_shutdown (ptLogger pLOG)


Define Documentation

#define ALLOC  )     (pLOG->memory_allocating_function((X),pLOG->pMemorySegment))
 

Definition at line 79 of file logger.c.

#define FREE  )     (pLOG->memory_releasing_function((X),pLOG->pMemorySegment))
 

Definition at line 80 of file logger.c.


Function Documentation

static void* _mya size_t  x,
void *  y
[static]
 

Definition at line 82 of file logger.c.

static void _myf void *  x,
void *  y
[static]
 

Definition at line 85 of file logger.c.

References free().

int log_init ptLogger  pLOG,
void *(*)(size_t, void *)  memory_allocating_function,
void(*)(void *, void *)  memory_releasing_function,
void *  pMemorySegment,
char *  pszLogFileName,
int  iLogType
 

Definition at line 226 of file logger.c.

References _mya(), _myf(), log_thread(), NULL, thread_CreateThread(), thread_InitMutex(), and thread_LockMutex().

Referenced by AppStart(), and modu_Init().

int log_printf ptLogger  pLOG,
char *  pszFormat,
  ...
 

Definition at line 278 of file logger.c.

References ALLOC, fflush(), FREE, log_state(), mygmtime(), NULL, thread_LockMutex(), and thread_UnlockMutex().

Referenced by AppStart(), ExecuteProgram(), ExecuteProgramThread(), ftp_report(), FtpProc(), GuardThread(), httpd_report(), log_shutdown(), main(), and modu_Init().

int log_shutdown ptLogger  pLOG  ) 
 

Definition at line 360 of file logger.c.

References log_printf(), NULL, thread_LockMutex(), and thread_UnlockMutex().

Referenced by modu_Init().

int log_state ptLogger  pLOG  ) 
 

Definition at line 170 of file logger.c.

References NULL, thread_LockMutex(), and thread_UnlockMutex().

Referenced by log_printf(), log_thread(), and modu_Init().

static void log_thread void *  q  )  [static]
 

Definition at line 95 of file logger.c.

References fflush(), FREE, log_state(), mygmtime(), NULL, sprintf(), thread_LockMutex(), and thread_UnlockMutex().

Referenced by log_init().


Generated on Sun Mar 12 23:56:37 2006 for ScriptBasic by  doxygen 1.4.6-NO