ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/services.h
Revision: 1.7
Committed: Sat Sep 22 14:27:26 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +16 -10 lines
Log Message:
split up ermyth into ermyth-modules, libermyth (currently just ermyth-util) and ermyth-core

File Contents

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