-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogserv.h
More file actions
96 lines (83 loc) · 2.6 KB
/
logserv.h
File metadata and controls
96 lines (83 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* NeoStats - IRC Statistical Services
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
** http://www.neostats.net/
**
** This program 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; either version 2 of the License, or
** (at your option) any later version.
**
** This program 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 this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
** USA
**
** NeoStats CVS Identification
** $Id: logserv.h 124 2006-01-26 15:33:47Z Fish $
*/
#ifndef LOGSERV_H
#define LOGSERV_H
/* Channel Logging Struct. */
typedef struct ChannelLog {
char channame[MAXCHANLEN];
Channel *c;
FILE *logfile;
char filename[MAXPATH];
unsigned long flags;
char statsurl[MAXPATH];
time_t ts_open;
int writecount;
} ChannelLog;
/* settings for LogServ */
typedef struct LogServcfg {
int logtype;
char logdir[MAXPATH];
char savedir[MAXPATH];
long maxlogsize;
long maxopentime;
} LogServcfg;
extern LogServcfg LogServ;
/* Definitions for flags */
#define LGSPUBSTATS 0x1
#define LGSACTIVE 0x2
/* the hash that stores the monitored channels */
extern hash_t *lschannelhash;
typedef enum {
LGSMSG_START = 0,
LGSMSG_JOIN,
LGSMSG_PART,
LGSMSG_MSG,
LGSMSG_NOTICE,
LGSMSG_CTCPACTION,
LGSMSG_QUIT,
LGSMSG_TOPIC,
LGSMSG_KICK,
LGSMSG_NICK,
LGSMSG_CHANMODE,
LGSMSG_NUMTYPES
} LGSMSG_TYPE;
/* logging function prototype */
typedef void (*log_proc) ( ChannelLog *chandata, const CmdParams *cmdparams );
/* log_procssing.c decl */
void ls_send_to_logproc ( LGSMSG_TYPE msgtype, const Channel *c, const CmdParams *cmdparams );
int ls_rotate_logs( void * );
void ls_close_logs( void );
void ls_switch_file( ChannelLog *cl );
void ls_write_log( ChannelLog *cl, const char *fmt, ...) __attribute__( ( format( printf,2,3 ) ) );
extern const char *ls_about[];
extern const char *ls_help_add[];
extern const char *ls_help_del[];
extern const char *ls_help_list[];
extern const char *ls_help_url[];
extern const char *ls_help_status[];
extern const char *ls_help_set_logtype[];
extern const char *ls_help_set_logsize[];
extern const char *ls_help_set_logtime[];
extern const char *ls_help_set_logdir[];
extern const char *ls_help_set_savedir[];
#endif