diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-16 00:15:47 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-16 00:15:47 +0100 |
commit | a299b62e913df71bdd1c4b41d61d3fb098f12be7 (patch) | |
tree | 4e3061c884ef8636a94a773de30893bbff84cd52 /logging.h | |
parent | 0cebf7c6d557d0b76d069af908a2a47366033fde (diff) |
Implement normal logging (file per channel/user).
Diffstat (limited to 'logging.h')
-rw-r--r-- | logging.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/logging.h b/logging.h new file mode 100644 index 0000000..289f348 --- /dev/null +++ b/logging.h @@ -0,0 +1,26 @@ +#ifndef LOGGING_H_INCLUDED +#define LOGGING_H_INCLUDED + +#include <stdio.h> +#include <string.h> +#include <time.h> + +#include "functions.h" + +#define MAXTOKENS 100 +#define MAXDATASIZE 513 // max number of bytes we can get at once (RFC2812 says 512, plus one for null terminator) +#define MAXCHAR 1000 + +#define SOURCE_SERVER 0 +#define SOURCE_CLIENT 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. +// Expects a string in the format: +// :from!bar@baz PRIVMSG to :hello world +// With the ":foo!bar@baz "prefix being important. +// Returns 1 on success or 0 on failure. +int logprivmsg(char *str, char *ournick); + +#endif |