ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/services.h
Revision: 1.4
Committed: Tue Aug 28 17:08:07 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.3: +46 -75 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.1 /*
2 pippijn 1.4 * Copyright © 2005 William Pitcock, et al.
3 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * Data structures related to services psuedo-clients.
6     *
7 pippijn 1.4 * $Id: services.h,v 1.3 2007-07-21 15:01:26 pippijn Exp $
8 pippijn 1.1 */
9    
10     #ifndef SERVICES_H
11     #define SERVICES_H
12    
13 pippijn 1.4 #include <map>
14     #include <stdexcept>
15    
16     // service base class
17     struct svs_t
18 pippijn 1.1 {
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 pippijn 1.4 service_t *me; /* our service struct */
26     };
27    
28     /* core services */
29     struct chansvs_t : svs_t
30     {
31 pippijn 1.1 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 pippijn 1.4 unsigned maxchanacs; /* max entries in chanacs list */
45     unsigned maxfounders; /* max founders per channel */
46 pippijn 1.1 };
47    
48 pippijn 1.4 struct globsvs_t : svs_t
49 pippijn 1.1 {
50 pippijn 1.4 };
51 pippijn 1.1
52 pippijn 1.4 struct opersvs_t : svs_t
53     {
54 pippijn 1.1 };
55    
56 pippijn 1.4 struct memosvs_t : svs_t
57 pippijn 1.1 {
58     };
59    
60 pippijn 1.4 struct gamesvs_t : svs_t
61 pippijn 1.1 {
62 pippijn 1.4 };
63 pippijn 1.1
64    
65     /* authentication services */
66 pippijn 1.4 struct nicksvs_t : svs_t
67 pippijn 1.1 {
68     bool spam;
69     bool no_nick_ownership;
70    
71     time_t expiry; /* expiry time */
72     };
73    
74 pippijn 1.4 struct saslsvs_t : svs_t
75 pippijn 1.1 {
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 pippijn 1.4 /* global.C */
83 pippijn 1.1 E chansvs_t chansvs;
84     E globsvs_t globsvs;
85     E opersvs_t opersvs;
86     E memosvs_t memosvs;
87 pippijn 1.4 E gamesvs_t gamesvs;
88 pippijn 1.1 E nicksvs_t nicksvs;
89     E saslsvs_t saslsvs;
90    
91     /* servtree.c */
92     E service_t *fcmd_agent;
93    
94     /* services.c */
95 pippijn 1.4 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 pippijn 1.1 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 pippijn 1.4 E void join (char const * const chan, char const * const nick);
107 pippijn 1.1 E void joinall (char *name);
108     E void part (char *chan, char *nick);
109     E void partall (char *name);
110 pippijn 1.4 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, faultcode_t 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 pippijn 1.1 E void command_success_table (sourceinfo_t *si, table_t * table);
118 pippijn 1.4 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 pippijn 1.1
124     /* ptasks.c */
125 pippijn 1.4 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 pippijn 1.1
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