diff options
Diffstat (limited to 'logging.h')
-rw-r--r-- | logging.h | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -6,6 +6,7 @@ #include <time.h> #include <limits.h> #include <sys/stat.h> +#include <ctype.h> #include "functions.h" @@ -15,16 +16,29 @@ #define SOURCE_SERVER 0 #define SOURCE_CLIENT 1 +#define LOG_PRIVMSG 0 +#define LOG_JOINPART 1 // Write the line 'str' to the relevant log file such as // '#channel.log' or 'nickname.log'. 'ournick' is our own -// nick and is used to determine which log file to write to. +// nick and is used to determine which log file to write to +// if the type is LOG_PRIVMSG. // 'basedir' is the directory in which the 'logs' directory // will be created in which logs are to be written. -// Expects a string in the format: +// +// If LOG_PRIVMSG then it expects a string in the format: // :from!bar@baz PRIVMSG to :hello world -// With the ":foo!bar@baz "prefix being important. +// +// If LOG_JOINPART then +// Expects a string in the format: +// :nick!bar@baz JOIN :#blabouncer +// or +// :nick!bar@baz PART #blabouncer +// +// With the ":foo!bar@baz "prefix being important for either +// type. +// // Returns 1 on success or 0 on failure. -int logprivmsg(char *str, char *ournick, char *basedir); +int logline(char *str, char *ournick, char *basedir, int type); #endif |