]> jfr.im git - irc/quakenet/snircd.git/blame - include/ircd.h
forward port of asuka-check.patch to .12
[irc/quakenet/snircd.git] / include / ircd.h
CommitLineData
189935b1 1/** @file ircd.h
2 * @brief Global data for the daemon.
3 * @version $Id: ircd.h,v 1.14 2004/10/05 04:14:44 entrope Exp $
4 */
5#ifndef INCLUDED_ircd_h
6#define INCLUDED_ircd_h
7#ifndef INCLUDED_struct_h
8#include "struct.h" /* struct Client */
9#endif
10#ifndef INCLUDED_sys_types_h
11#include <sys/types.h> /* size_t, time_t */
12#endif
13
14/** Describes status for a daemon. */
15struct Daemon
16{
17 int argc; /**< Number of command-line arguments. */
18 char** argv; /**< Array of command-line arguments. */
19 pid_t pid; /**< %Daemon's process id. */
20 uid_t uid; /**< %Daemon's user id. */
21 uid_t euid; /**< %Daemon's effective user id. */
22 unsigned int bootopt; /**< Boot option flags. */
23 int pid_fd; /**< File descriptor for process id file. */
24};
25
26/*
27 * Macros
28 */
29#define TStime() (CurrentTime + TSoffset) /**< Current network time*/
30#define OLDEST_TS 780000000 /**< Any TS older than this is bogus */
31#define BadPtr(x) (!(x) || (*(x) == '\0')) /**< Is \a x a bad string? */
32
33/* Miscellaneous defines */
34
35#define UDP_PORT "7007" /**< Default port for server-to-server pings. */
36#define MINOR_PROTOCOL "09" /**< Minimum protocol version supported. */
37#define MAJOR_PROTOCOL "10" /**< Current protocol version. */
38#define BASE_VERSION "u2.10" /**< Base name of IRC daemon version. */
39
40/*
41 * Proto types
42 */
43extern void server_die(const char* message);
44extern void server_panic(const char* message);
45extern void server_restart(const char* message);
46
47extern struct Client me;
48extern time_t CurrentTime;
49extern struct Client* GlobalClientList;
50extern time_t TSoffset;
51extern int GlobalRehashFlag; /* 1 if SIGHUP is received */
52extern int GlobalRestartFlag; /* 1 if SIGINT is received */
53extern char* configfile;
54extern int debuglevel;
55extern char* debugmode;
56extern int running;
57
58#endif /* INCLUDED_ircd_h */
59