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

99 lines
2.6 KiB
C
Raw Normal View History

2003-12-31 07:21:52 +00:00
/* NeoStats - IRC Statistical Services
2005-01-24 22:24:43 +00:00
** Copyright (c) 1999-2005 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. */
typedef struct CL_ {
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];
time_t fdopened;
int dostat;
2003-12-31 07:21:52 +00:00
} ChannelLog;
/* settings for LogServ */
struct LogServ {
int logtype;
char logdir[MAXPATH];
char savedir[MAXPATH];
long maxlogsize;
long maxopentime;
2003-12-31 07:21:52 +00:00
} LogServ;
/* Definitions for flags */
#define LGSFDOPENED 0x1
#define LGSFDNEEDFLUSH 0x2
#define LGSPUBSTATS 0x4
#define LGSACTIVE 0x8
/* the hash that stores the monitored channels */
hash_t *lgschans;
typedef enum {
LGSMSG_JOIN=0,
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 */
2005-10-13 22:37:03 +00:00
typedef int (*log_proc) (ChannelLog *chandata, const CmdParams *cmdparams);
2003-12-31 07:21:52 +00:00
/* log_procssing.c decl */
2005-10-13 22:37:03 +00:00
int lgs_send_to_logproc (LGSMSG_TYPE msgtype, Channel *c, const CmdParams *cmdparams);
2005-08-09 12:20:07 +00:00
int lgs_RotateLogs(void *);
void lgs_close_logs();
2004-01-13 04:56:33 +00:00
void lgs_switch_file(ChannelLog *cl);
2004-08-04 22:23:10 +00:00
void lgs_write_log(ChannelLog *cl, 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[];
2004-08-08 22:46:08 +00:00
extern const char *lgs_help_add[];
extern const char *lgs_help_del[];
extern const char *lgs_help_list[];
extern const char *lgs_help_url[];
2004-03-08 22:26:43 +00:00
extern const char *lgs_help_stats[];
extern const char *lgs_help_set_logtype[];
extern const char *lgs_help_set_logsize[];
extern const char *lgs_help_set_logtime[];
extern const char *lgs_help_set_logdir[];
extern const char *lgs_help_set_savedir[];
2004-03-08 22:26:43 +00:00
2004-08-04 22:23:10 +00:00
extern char timebuf[TIMEBUFSIZE];
extern char startlog[BUFSIZE];
2003-12-31 07:21:52 +00:00
#endif