diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-12 16:29:58 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-12 16:29:58 +0100 |
commit | 62fe87f6052dc28e38f2edc940b2002ede087277 (patch) | |
tree | e55830502e0bc29bf0210674aafbe5c9c3295f2d /replay.c | |
parent | 44ed93cdc6a2d7dda355266bfc69134e30278259 (diff) |
Add a settings structure for passing around everywhere to store config/settings. Also fix the insanely inconsistent spelling/naming of replay log related things.
Diffstat (limited to 'replay.c')
-rw-r--r-- | replay.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -139,11 +139,11 @@ void formattime(char *str) { strncpy(str, newline, len + TIMELEN); str[len + TIMELEN] = '\0'; - printf("Ended up with relay string of: '%s'.\n", str); + printf("Ended up with replay string of: '%s'.\n", str); } // Return the number of lines in the replay log since 'seconds' seconds ago, or -1 if there a problem. -int relaylines(int seconds) { +int replaylines(int seconds) { FILE *fp; char str[MAXCHAR]; char* filename = "replay.log"; @@ -187,7 +187,7 @@ int relaylines(int seconds) { // Also modify the line to include a timestamp in the form "[HH:MM:SS]". // Returns 1 on success, or 0 on failure. // TODO - This is horribly inefficient since it re-reads the entire file each call, rewrite this! -int readrelayline(int seconds, int linenum, char *str) { +int readreplayline(int seconds, int linenum, char *str) { FILE *fp; char line[MAXCHAR]; char* filename = "replay.log"; @@ -234,13 +234,13 @@ int readrelayline(int seconds, int linenum, char *str) { return 0; } -// Write the line 'str' to the relay log file after prepending it with +// Write the line 'str' to the replay log file after prepending it with // the current unixtime timestamp. // Expects a string in the format: // :foo!bar@baz PRIVMSG foo :[17:41:41] hello world // With the ":foo!bar@baz "prefix being important. // Returns 1 on success or 0 on failure. -int writerelayline(char *str) { +int writereplayline(char *str) { FILE *fp; char line[MAXCHAR]; char* filename = "replay.log"; |