This repository has been archived on 2025-02-12. You can view files and clone it, but cannot push or open issues or pull requests.
NeoStats-logserv/logserv.h

97 lines
2.6 KiB
C
Raw Normal View History

2003-12-31 07:21:52 +00:00
/* NeoStats - IRC Statistical Services
2006-01-26 15:33:47 +00:00
** Copyright (c) 1999-2006 Adam Rutter, Justin Hammond, Mark Hetherington
2003-12-31 07:21:52 +00:00
** 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$
*/
#ifndef LOGSERV_H
#define LOGSERV_H
/* Channel Logging Struct. */
2005-10-15 22:34:33 +00:00
typedef struct ChannelLog {
2004-08-01 21:23:58 +00:00
char channame[MAXCHANLEN];
Channel *c;
2003-12-31 07:21:52 +00:00
FILE *logfile;
char filename[MAXPATH];
2003-12-31 07:21:52 +00:00
unsigned long flags;
char statsurl[MAXPATH];
2005-10-15 22:34:33 +00:00
time_t ts_open;
int writecount;
2003-12-31 07:21:52 +00:00
} ChannelLog;
/* settings for LogServ */
2005-10-20 20:52:55 +00:00
typedef struct LogServcfg {
2003-12-31 07:21:52 +00:00
int logtype;
char logdir[MAXPATH];
char savedir[MAXPATH];
long maxlogsize;
long maxopentime;
2005-10-20 20:52:55 +00:00
} LogServcfg;
extern LogServcfg LogServ;
2003-12-31 07:21:52 +00:00
/* Definitions for flags */
2005-10-20 20:52:55 +00:00
#define LGSPUBSTATS 0x1
#define LGSACTIVE 0x2
2003-12-31 07:21:52 +00:00
/* the hash that stores the monitored channels */
2005-10-15 21:34:59 +00:00
extern hash_t *lschannelhash;
2003-12-31 07:21:52 +00:00
typedef enum {
2005-10-17 22:04:14 +00:00
LGSMSG_START = 0,
LGSMSG_JOIN,
2003-12-31 07:21:52 +00:00
LGSMSG_PART,
LGSMSG_MSG,
LGSMSG_NOTICE,
LGSMSG_CTCPACTION,
2003-12-31 07:21:52 +00:00
LGSMSG_QUIT,
LGSMSG_TOPIC,
LGSMSG_KICK,
LGSMSG_NICK,
LGSMSG_CHANMODE,
LGSMSG_NUMTYPES
} LGSMSG_TYPE;
2003-12-31 07:21:52 +00:00
/* logging function prototype */
typedef void (*log_proc) ( ChannelLog *chandata, const CmdParams *cmdparams );
2003-12-31 07:21:52 +00:00
/* log_procssing.c decl */
2005-10-15 22:34:33 +00:00
void ls_send_to_logproc ( LGSMSG_TYPE msgtype, const Channel *c, const CmdParams *cmdparams );
2005-10-17 22:04:14 +00:00
int ls_rotate_logs( void * );
2005-10-15 22:34:33 +00:00
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 ) ) );
2003-12-31 07:21:52 +00:00
2004-08-01 21:23:58 +00:00
extern const char *ls_about[];
2005-10-15 22:02:28 +00:00
extern const char *ls_help_add[];
extern const char *ls_help_del[];
extern const char *ls_help_list[];
extern const char *ls_help_url[];
2005-10-17 22:04:14 +00:00
extern const char *ls_help_status[];
2005-10-15 22:02:28 +00:00
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[];
2004-03-08 22:26:43 +00:00
2003-12-31 07:21:52 +00:00
#endif