1 /* dircproxy
2  * Copyright (C) 2000-2003 Scott James Remnant <scott at netsplit dot com>
3  *
4  * Copyright (C) 2004-2008 Francois Harvey <contact at francoisharvey dot ca>
5  *
6  * Copyright (C) 2008-2009 Noel Shrum <noel dot w8tvi at gmail dot com>
7  *                         Francois Harvey <contact at francoisharvey dot ca>
8  *
9  *
10  * irc_log.h
11  * --
12  * $Id: irc_log.h,v 1.15 2003/03/03 18:06:29 scott Exp $
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 #ifndef DIRCPROXY_IRC_LOG_H
30 #define DIRCPROXY_IRC_LOG_H
31 
32 /* Required includes */
33 #include <stdio.h>
34 
35 #include "irc_net.h"
36 
37 /* Special log destination parameters */
38 #define IRC_LOGFILE_ALL ((char *)-1)
39 #define IRC_LOGFILE_SERVER ((char *)0)
40 
41 /* Types of event we can log */
42 #define IRC_LOG_NONE   0x0000
43 #define IRC_LOG_MSG    0x0001
44 #define IRC_LOG_NOTICE 0x0002
45 #define IRC_LOG_ACTION 0x0004
46 #define IRC_LOG_CTCP   0x0008
47 #define IRC_LOG_JOIN   0x0010
48 #define IRC_LOG_PART   0x0020
49 #define IRC_LOG_KICK   0x0040
50 #define IRC_LOG_QUIT   0x0080
51 #define IRC_LOG_NICK   0x0100
52 #define IRC_LOG_MODE   0x0200
53 #define IRC_LOG_TOPIC  0x0400
54 #define IRC_LOG_CLIENT 0x0800
55 #define IRC_LOG_SERVER 0x1000
56 #define IRC_LOG_ERROR  0x2000
57 #define IRC_LOG_ALL    0x3fff
58 
59 /* Functions to initialise internal logging */
60 int irclog_maketempdir(IRCProxy *);
61 int irclog_init(IRCProxy *, const char *);
62 int irclog_open(IRCProxy *, const char *);
63 
64 /* Functions to clean up internal logging */
65 void irclog_close(IRCProxy *, const char *);
66 void irclog_free(LogFile *);
67 void irclog_closetempdir(IRCProxy *);
68 
69 /* Log a message */
70 int irclog_log(IRCProxy *, int, const char *, const char *, const char *, ...);
71 
72 /* Recall log messages from the internal log */
73 extern int irclog_autorecall(struct ircproxy *, const char *);
74 extern int irclog_recall(struct ircproxy *, const char *, long, long,
75                          const char *);
76 
77 /* Convert numeric flags to string names and back again */
78 int	    irclog_strtoflag(const char *);
79 const char *irclog_flagtostr(int);
80 
81 #endif /* !DIRCPROXY_IRC_LOG_H */
82