Log: Some cleanup.

Stuff that does not need to be in the header moved to the
implementation file.
This commit is contained in:
Johan Wikman
2015-11-14 23:07:44 +02:00
parent bcb918e60b
commit b8fda016c9
2 changed files with 43 additions and 42 deletions

View File

@ -49,6 +49,35 @@ static const char LOGFILE_NAME_SUFFIX[] = ".log";
extern char *program_invocation_name;
extern char *program_invocation_short_name;
typedef enum
{
BB_READY = 0x00,
BB_FULL,
BB_CLEARED
} blockbuf_state_t;
typedef enum
{
FILEWRITER_INIT,
FILEWRITER_RUN,
FILEWRITER_DONE
} filewriter_state_t;
/**
* UNINIT means zeroed memory buffer allocated for the struct.
* INIT means that struct members may have values, and memory may
* have been allocated. Done function must check and free it.
* RUN Struct is valid for run-time checking.
* DONE means that possible memory allocations have been released.
*/
typedef enum
{
UNINIT = 0,
INIT,
RUN,
DONE
} flat_obj_state_t;
/**
* LOG_FLUSH_NO Do not flush after writing.
* LOG_FLUSH_YES Flush after writing.
@ -124,9 +153,6 @@ ssize_t log_ses_count[LOGFILE_LAST] = {0};
*/
const char* shm_pathname_prefix = "/dev/shm/";
/** Errors are written to syslog too by default */
char* syslog_id_str = strdup("LOGFILE_ERROR");
/** Forward declarations
*/
typedef struct filewriter filewriter_t;