ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/services.h
Revision: 1.6
Committed: Sun Sep 16 18:54:42 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.5: +9 -4 lines
Log Message:
#defines to enum

File Contents

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