1 /* $Id: qlog.h 448 2010-08-22 09:20:48Z tsaviran $
2  * -------------------------------------------------------
3  * Copyright (C) 2003-2006 Tommi Saviranta <wnd@iki.fi>
4  * -------------------------------------------------------
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  */
15 
16 #ifndef QLOG_H_
17 #define QLOG_H_
18 
19 #ifdef HAVE_CONFIG_H
20 #include <config.h>
21 #endif /* ifdef HAVE_CONFIG_H */
22 
23 #ifdef QUICKLOG
24 
25 #include "conntype.h"
26 
27 #include <time.h>
28 
29 
30 
31 #ifdef QLOGSTAMP
32 #define TS_TYPES	"nbe"
33 #define TS_NONE		0
34 #define TS_BEGINNING	1
35 #define TS_END		2
36 #endif /* ifdef QLOGSTAMP */
37 
38 
39 
40 /* Entry per line in quicklog. */
41 typedef struct {
42 	char	*text;
43 	time_t	timestamp;
44 #ifdef INBOX
45 	int	privmsg;
46 #endif /* ifdef INBOX */
47 } qlogentry;
48 
49 
50 void qlog_check(int age);
51 void qlog_replay_header(connection_type *client);
52 void qlog_replay_footer(connection_type *client);
53 void qlog_replay(connection_type *client, time_t oldest);
54 void qlog_flush(time_t oldest, int move_to_inbox);
55 void qlog_write(const int privmsg, char *format, ...);
56 
57 
58 
59 #endif /* ifdef QUICKLOG */
60 
61 #endif /* ifdef QLOG_H_ */
62