ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/services.h
Revision: 1.5
Committed: Thu Aug 30 19:56:20 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.4: +2 -2 lines
Log Message:
- put faultcodes into their own namespace
- removed old files
- limited header garbage in atheme.h
- macros to inline bools for connection_t::is_*
- put some connection_t functions into the connection_t class

File Contents

# Content
1 /*
2 * Copyright © 2005 William Pitcock, et al.
3 * Rights to this code are as documented in doc/pod/license.pod.
4 *
5 * Data structures related to services psuedo-clients.
6 *
7 * $Id: services.h,v 1.4 2007-08-28 17:08:07 pippijn Exp $
8 */
9
10 #ifndef SERVICES_H
11 #define SERVICES_H
12
13 #include <map>
14 #include <stdexcept>
15
16 // service base class
17 struct svs_t
18 {
19 char *nick; /* the IRC client's nickname */
20 char *user; /* the IRC client's username */
21 char *host; /* the IRC client's hostname */
22 char *real; /* the IRC client's realname */
23 char *disp; /* the IRC client's dispname */
24
25 service_t *me; /* our service struct */
26 };
27
28 /* core services */
29 struct chansvs_t : svs_t
30 {
31 bool fantasy; /* enable fantasy commands */
32
33 unsigned int ca_vop; /* xop access levels */
34 unsigned int ca_hop;
35 unsigned int ca_aop;
36 unsigned int ca_sop;
37
38 char *trigger; /* trigger, e.g. !, ` or . */
39
40 bool changets; /* use TS to better deop people */
41
42 time_t expiry; /* expiry time */
43
44 unsigned maxchanacs; /* max entries in chanacs list */
45 unsigned maxfounders; /* max founders per channel */
46 };
47
48 struct globsvs_t : svs_t
49 {
50 };
51
52 struct opersvs_t : svs_t
53 {
54 };
55
56 struct memosvs_t : svs_t
57 {
58 };
59
60 struct gamesvs_t : svs_t
61 {
62 };
63
64
65 /* authentication services */
66 struct nicksvs_t : svs_t
67 {
68 bool spam;
69 bool no_nick_ownership;
70
71 time_t expiry; /* expiry time */
72 };
73
74 struct saslsvs_t : svs_t
75 {
76 };
77
78 /* help us keep consistent messages */
79 #define STR_INSUFFICIENT_PARAMS _("Insufficient parameters for \2%s\2.")
80 #define STR_INVALID_PARAMS _("Invalid parameters for \2%s\2.")
81
82 /* global.C */
83 E chansvs_t chansvs;
84 E globsvs_t globsvs;
85 E opersvs_t opersvs;
86 E memosvs_t memosvs;
87 E gamesvs_t gamesvs;
88 E nicksvs_t nicksvs;
89 E saslsvs_t saslsvs;
90
91 /* servtree.c */
92 E service_t *fcmd_agent;
93
94 /* services.c */
95 typedef std::pair<char const * const, service_t *> service_pair;
96 typedef std::map<char const * const, service_t *, str_lt> service_map;
97 E service_map services;
98
99 E unsigned authservice_loaded;
100 E int use_myuser_access;
101 E int use_svsignore;
102
103 E int ban (user_t *source, channel_t *chan, user_t *target);
104 E int remove_banlike (user_t *source, channel_t *chan, int type, user_t *target);
105 E int remove_ban_exceptions (user_t *source, channel_t *chan, user_t *target);
106 E void join (char const * const chan, char const * const nick);
107 E void joinall (char *name);
108 E void part (char *chan, char *nick);
109 E void partall (char *name);
110 E void verbose (mychan_t *mychan, char const * const fmt, ...);
111 E void snoop (char const * const fmt, ...);
112 E void notice (char const * const from, char const * const to, char const * const message, ...);
113 E void notice (char const * const from, char const * const to, char const * const message, va_list va);
114 E void command_fail (sourceinfo_t *si, fault::code code, char const * const fmt, ...);
115 E void command_success_nodata (sourceinfo_t *si, char const * const fmt, ...);
116 E void command_success_string (sourceinfo_t *si, char const * const result, char const * const fmt, ...);
117 E void command_success_table (sourceinfo_t *si, table_t * table);
118 E char const * const get_source_name (sourceinfo_t *si);
119 E char const * const get_source_mask (sourceinfo_t *si);
120 E char const * const get_oper_name (sourceinfo_t *si);
121 E void wallops (char const * const , ...);
122 E void verbose_wallops (char const * const, ...);
123
124 /* ptasks.c */
125 E void handle_topic (channel_t *c, char const * const setter, time_t ts, char const * const topic);
126 E int floodcheck (user_t *u, user_t *t);
127
128 /* ctcp-common.c */
129 E void common_ctcp_init (void);
130 E unsigned int handle_ctcp_common (sourceinfo_t *si, char *, char *);
131
132 #endif