1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #ifndef __INSPIRCD_H__
18 #define __INSPIRCD_H__
20 #include "inspircd_config.h"
29 #include <sys/types.h>
31 #ifndef _LINUX_C_LIB_VERSION
32 #include <sys/socket.h>
34 #include <netinet/in.h>
37 #include <arpa/inet.h>
41 #include "inspircd_io.h"
54 // flags for use with WriteMode
59 // flags for use with OnUserPreMessage and OnUserPreNotice
62 #define TYPE_CHANNEL 2
65 #define IS_LOCAL(x) (x->fd > -1)
66 #define IS_REMOTE(x) (x->fd < 0)
67 #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER)
69 typedef void (handlerfunc) (char**, int, userrec*);
88 statsAccept = statsRefused = statsUnknown = 0;
89 statsCollisions = statsDns = statsDnsGood = 0;
90 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
101 void erase_factory(int j);
102 void erase_module(int j);
107 std::string GetRevision();
108 std::string GetVersionString();
110 bool LoadModule(const char* filename);
111 bool UnloadModule(const char* filename);
112 InspIRCd(int argc, char** argv);
118 void call_handler(std::string &commandname,char **parameters, int pcnt, userrec *user);
119 bool is_valid_cmd(std::string &commandname, int pcnt, userrec * user);
120 int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
121 /* userrec optimization stuff */
122 void AddServerName(std::string servername);
123 const char* FindServerNamePtr(std::string servername);
124 void* dns_task(void* arg);
125 void process_buffer(const char* cmdbuf,userrec *user);