/* * This file is part of blabouncer (https://www.blatech.co.uk/l_bratch/blabouncer). * Copyright (C) 2019 Luke Bratch . * * Blabouncer is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. * * Blabouncer is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with blabouncer. If not, see . */ #ifndef REPLAY_H_INCLUDED #define REPLAY_H_INCLUDED #define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED #include #include #include #include #include #include #include "functions.h" #define DEBUG_CRIT 0 #define DEBUG_SOME 1 #define DEBUG_FULL 2 #define MAXCHAR 1000 #define TIMELEN 11 // 32-bit unixtime is up to 10 characters (+1 for null char) // TODO - Make this Year 2038 proof #define TIMELENF 11 // [HH:MM:SS] = 10 characters + 1 for null char #define DATETIMELEN 50 // Should be enough for a full datetime string // TODO - Is it!? I think it will only ever be as long as [DD/MM/YY HH:MM:SS] (20 including null) int replaylines(int seconds, char *basedir); int readreplayline(int seconds, int linenum, char *str, char *basedir, int replaydates); // Returns the number of seconds ago that 'nick' last spoke, or -1 if there is a problem. // 'basedir' is the directory in which to find 'replay.log'. int lastspokesecondsago(char *nick, char *basedir); int writereplayline(char *str, char *basedir); #endif