/* * cf_log.c */ #include "cf_log.h" #include "cf_thread.h" #include #ifdef _WIN32 #else // #ifdef _WIN32 # include #endif // #ifdef _WIN32 typedef struct __cf_log_ctx__ { char path[NAME_LENGTH + 1]; int fd; char * buffer; int entireLength; int bufferLength; CF_Mutex mutex; } S_CF_LOG_CTX, CF_LOG_CTX; typedef struct __cf_log_environment__ { __blksize_t fsBlockSize; } S_CF_Log_Environment, CF_Log_Environment; CF_Log_Environment gLogEnvironment; int CF_Log_Initialize (void) { struct stat fsstat; memset (&gLogEnvironment, 0x00, sizeof (CF_Log_Environment)); if (stat ("./", &fsstat) < 0) return CF_ERROR_LOG_INITIALIZE; gLogEnvironment.fsBlockSize = fsstat.st_blksize; return CF_OK; } int CF_Log_Finalize (void) { memset (&gLogEnvironment, 0x00, sizeof (CF_Log_Environment)); return CF_OK; }