From 3baa830afb085941da4f759f0e0996ed60000693 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 25 Mar 2014 08:25:10 -0400 Subject: [PATCH] move log struct to proper place --- src/global_commands.c | 1 + src/log.c | 1 + src/log.h | 9 +++++++++ src/prompt.c | 1 + src/toxic_windows.h | 9 --------- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/global_commands.c b/src/global_commands.c index 44e10af..a4260ef 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -30,6 +30,7 @@ #include "toxic_windows.h" #include "misc_tools.h" #include "friendlist.h" +#include "log.h" #include "line_info.h" extern char *DATA_FILE; diff --git a/src/log.c b/src/log.c index c86f804..72c7cdb 100644 --- a/src/log.c +++ b/src/log.c @@ -31,6 +31,7 @@ #include "configdir.h" #include "toxic_windows.h" #include "misc_tools.h" +#include "log.h" /* Creates/fetches log file by appending to the config dir the name and a pseudo-unique identity */ void init_logging_session(uint8_t *name, uint8_t *key, struct chatlog *log) diff --git a/src/log.h b/src/log.h index 510a429..9473eeb 100644 --- a/src/log.h +++ b/src/log.h @@ -20,6 +20,15 @@ * */ +#define LOG_FLUSH_LIMIT 2 /* limits calls to fflush(logfile) to a max of one per LOG_FLUSH_LIMIT seconds */ + +struct chatlog { + FILE *file; + uint64_t lastwrite; + int pos; + bool log_on; /* specific to current chat window */ +}; + /* Creates/fetches log file by appending to the config dir the name and a pseudo-unique identity */ void init_logging_session(uint8_t *name, uint8_t *key, struct chatlog *log); diff --git a/src/prompt.c b/src/prompt.c index f09930e..d525a9c 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -32,6 +32,7 @@ #include "execute.h" #include "misc_tools.h" #include "toxic_strings.h" +#include "log.h" #include "line_info.h" uint8_t pending_frnd_requests[MAX_FRIENDS_NUM][TOX_CLIENT_ID_SIZE] = {0}; diff --git a/src/toxic_windows.h b/src/toxic_windows.h index ef941aa..3d727db 100644 --- a/src/toxic_windows.h +++ b/src/toxic_windows.h @@ -165,15 +165,6 @@ struct StatusBar { bool is_online; }; -#define LOG_FLUSH_LIMIT 2 /* limits calls to fflush(logfile) to a max of one per LOG_FLUSH_LIMIT seconds */ - -struct chatlog { - FILE *file; - uint64_t lastwrite; - int pos; - bool log_on; /* specific to current chat window */ -}; - #define MAX_LINE_HIST 128 /* chat and groupchat window/buffer holder */