1 |
guppy |
1.42 |
/* |
2 |
fabian |
1.12 |
* proto.h |
3 |
|
|
* prototypes for every function used outside its own module |
4 |
guppy |
1.42 |
* |
5 |
segfault |
1.1 |
* (i guess i'm not very modular, cuz there are a LOT of these.) |
6 |
|
|
* with full prototyping, some have been moved to other .h files |
7 |
fabian |
1.12 |
* because they use structures in those |
8 |
|
|
* (saves including those .h files EVERY time) - Beldin |
9 |
guppy |
1.42 |
* |
10 |
guppy |
1.49 |
* $Id: proto.h,v 1.48 2001/08/13 16:21:48 guppy Exp $ |
11 |
segfault |
1.1 |
*/ |
12 |
guppy |
1.42 |
/* |
13 |
|
|
* Copyright (C) 1997 Robey Pointer |
14 |
|
|
* Copyright (C) 1999, 2000, 2001 Eggheads Development Team |
15 |
|
|
* |
16 |
fabian |
1.12 |
* This program is free software; you can redistribute it and/or |
17 |
|
|
* modify it under the terms of the GNU General Public License |
18 |
|
|
* as published by the Free Software Foundation; either version 2 |
19 |
|
|
* of the License, or (at your option) any later version. |
20 |
guppy |
1.42 |
* |
21 |
fabian |
1.12 |
* This program is distributed in the hope that it will be useful, |
22 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
23 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
24 |
|
|
* GNU General Public License for more details. |
25 |
guppy |
1.42 |
* |
26 |
fabian |
1.12 |
* You should have received a copy of the GNU General Public License |
27 |
|
|
* along with this program; if not, write to the Free Software |
28 |
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
29 |
segfault |
1.1 |
*/ |
30 |
|
|
|
31 |
fabian |
1.12 |
#ifndef _EGG_PROTO_H |
32 |
|
|
#define _EGG_PROTO_H |
33 |
segfault |
1.1 |
|
34 |
fabian |
1.21 |
#include "lush.h" |
35 |
|
|
#include "misc_file.h" |
36 |
segfault |
1.1 |
|
37 |
|
|
#ifdef HAVE_DPRINTF |
38 |
|
|
#define dprintf dprintf_eggdrop |
39 |
|
|
#endif |
40 |
|
|
|
41 |
|
|
struct chanset_t; /* keeps the compiler warnings down :) */ |
42 |
|
|
struct userrec; |
43 |
fabian |
1.2 |
struct maskrec; |
44 |
segfault |
1.1 |
struct igrec; |
45 |
|
|
struct flag_record; |
46 |
|
|
struct list_type; |
47 |
|
|
struct tand_t_struct; |
48 |
|
|
|
49 |
|
|
#if !defined(MAKING_MODS) |
50 |
|
|
extern void (*encrypt_pass) (char *, char *); |
51 |
|
|
extern char *(*encrypt_string) (char *, char *); |
52 |
|
|
extern char *(*decrypt_string) (char *, char *); |
53 |
fabian |
1.2 |
extern int (*rfc_casecmp) (const char *, const char *); |
54 |
|
|
extern int (*rfc_ncasecmp) (const char *, const char *, int); |
55 |
|
|
extern int (*rfc_toupper) (int); |
56 |
|
|
extern int (*rfc_tolower) (int); |
57 |
|
|
extern int (*match_noterej) (struct userrec *, char *); |
58 |
segfault |
1.1 |
#endif |
59 |
fabian |
1.2 |
|
60 |
segfault |
1.1 |
/* botcmd.c */ |
61 |
|
|
void bot_share(int, char *); |
62 |
|
|
int base64_to_int(char *); |
63 |
|
|
|
64 |
|
|
/* botnet.c */ |
65 |
|
|
void answer_local_whom(int, int); |
66 |
|
|
char *lastbot(char *); |
67 |
|
|
int nextbot(char *); |
68 |
|
|
int in_chain(char *); |
69 |
|
|
void tell_bots(int); |
70 |
|
|
void tell_bottree(int, int); |
71 |
|
|
int botlink(char *, int, char *); |
72 |
|
|
int botunlink(int, char *, char *); |
73 |
|
|
void dump_links(int); |
74 |
|
|
void addbot(char *, char *, char *, char, int); |
75 |
|
|
void updatebot(int, char *, char, int); |
76 |
|
|
void rembot(char *); |
77 |
|
|
struct tand_t_struct *findbot(char *); |
78 |
|
|
void unvia(int, struct tand_t_struct *); |
79 |
|
|
void check_botnet_pings(); |
80 |
|
|
int partysock(char *, char *); |
81 |
|
|
int addparty(char *, char *, int, char, int, char *, int *); |
82 |
|
|
void remparty(char *, int); |
83 |
|
|
void partystat(char *, int, int, int); |
84 |
|
|
int partynick(char *, int, char *); |
85 |
|
|
int partyidle(char *, char *); |
86 |
|
|
void partysetidle(char *, int, int); |
87 |
|
|
void partyaway(char *, int, char *); |
88 |
|
|
void zapfbot(int); |
89 |
|
|
void tandem_relay(int, char *, int); |
90 |
|
|
int getparty(char *, int); |
91 |
|
|
|
92 |
|
|
/* botmsg.c */ |
93 |
|
|
int add_note(char *, char *, char *, int, int); |
94 |
fabian |
1.4 |
int simple_sprintf EGG_VARARGS(char *, arg1); |
95 |
|
|
void tandout_but EGG_VARARGS(int, arg1); |
96 |
fabian |
1.2 |
char *int_to_base10(int); |
97 |
|
|
char *unsigned_int_to_base10(unsigned int); |
98 |
segfault |
1.1 |
char *int_to_base64(unsigned int); |
99 |
|
|
|
100 |
|
|
/* chanprog.c */ |
101 |
|
|
void tell_verbose_uptime(int); |
102 |
|
|
void tell_verbose_status(int); |
103 |
|
|
void tell_settings(int); |
104 |
|
|
int logmodes(char *); |
105 |
|
|
int isowner(char *); |
106 |
|
|
char *masktype(int); |
107 |
|
|
char *maskname(int); |
108 |
|
|
void reaffirm_owners(); |
109 |
|
|
void rehash(); |
110 |
|
|
void reload(); |
111 |
|
|
void chanprog(); |
112 |
|
|
void check_timers(); |
113 |
|
|
void check_utimers(); |
114 |
fabian |
1.31 |
void rmspace(char *s); |
115 |
segfault |
1.1 |
void check_timers(); |
116 |
fabian |
1.31 |
void set_chanlist(const char *host, struct userrec *rec); |
117 |
|
|
void clear_chanlist(void); |
118 |
fabian |
1.32 |
void clear_chanlist_member(const char *nick); |
119 |
segfault |
1.1 |
|
120 |
|
|
/* cmds.c */ |
121 |
|
|
int check_dcc_attrs(struct userrec *, int); |
122 |
|
|
int check_dcc_chanattrs(struct userrec *, char *, int, int); |
123 |
|
|
int stripmodes(char *); |
124 |
|
|
char *stripmasktype(int); |
125 |
|
|
|
126 |
|
|
/* dcc.c */ |
127 |
|
|
void failed_link(int); |
128 |
fabian |
1.8 |
void dupwait_notify(char *); |
129 |
segfault |
1.1 |
|
130 |
|
|
/* dccutil.c */ |
131 |
fabian |
1.4 |
void dprintf EGG_VARARGS(int, arg1); |
132 |
|
|
void chatout EGG_VARARGS(char *, arg1); |
133 |
segfault |
1.1 |
extern void (*shareout) (); |
134 |
|
|
extern void (*sharein) (int, char *); |
135 |
fabian |
1.4 |
void chanout_but EGG_VARARGS(int, arg1); |
136 |
segfault |
1.1 |
void dcc_chatter(int); |
137 |
|
|
void lostdcc(int); |
138 |
fabian |
1.13 |
void removedcc(int); |
139 |
segfault |
1.1 |
void makepass(char *); |
140 |
|
|
void tell_dcc(int); |
141 |
|
|
void not_away(int); |
142 |
|
|
void set_away(int, char *); |
143 |
|
|
void *_get_data_ptr(int, char *, int); |
144 |
fabian |
1.14 |
void dcc_remove_lost(void); |
145 |
fabian |
1.6 |
|
146 |
segfault |
1.1 |
#define get_data_ptr(x) _get_data_ptr(x,__FILE__,__LINE__) |
147 |
|
|
void flush_lines(int, struct chat_info *); |
148 |
|
|
struct dcc_t *find_idx(int); |
149 |
|
|
int new_dcc(struct dcc_table *, int); |
150 |
|
|
void del_dcc(int); |
151 |
|
|
char *add_cr(char *); |
152 |
fabian |
1.3 |
void changeover_dcc(int, struct dcc_table *, int); |
153 |
|
|
|
154 |
|
|
/* dns.c */ |
155 |
drummer |
1.45 |
void dns_hostbyip(char *); |
156 |
|
|
void dns_ipbyhost(char *); |
157 |
|
|
void call_hostbyip(char *, char *, int); |
158 |
|
|
void call_ipbyhost(char *, char *, int); |
159 |
|
|
void dcc_dnshostbyip(char *); |
160 |
fabian |
1.15 |
void dcc_dnsipbyhost(char *); |
161 |
segfault |
1.1 |
|
162 |
|
|
/* gotdcc.c */ |
163 |
|
|
void gotdcc(char *, char *, struct userrec *, char *); |
164 |
|
|
void do_boot(int, char *, char *); |
165 |
|
|
int detect_dcc_flood(time_t *, struct chat_info *, int); |
166 |
|
|
|
167 |
|
|
/* main.c */ |
168 |
fabian |
1.33 |
void fatal(const char *, int); |
169 |
|
|
int expected_memory(void); |
170 |
|
|
void patch(const char *); |
171 |
|
|
void eggContext(const char *, int, const char *); |
172 |
|
|
void eggContextNote(const char *, int, const char *, const char *); |
173 |
|
|
void eggAssert(const char *, int, const char *); |
174 |
|
|
void backup_userfile(void); |
175 |
segfault |
1.1 |
|
176 |
|
|
/* match.c */ |
177 |
|
|
int _wild_match(register unsigned char *, register unsigned char *); |
178 |
|
|
#define wild_match(a,b) _wild_match((unsigned char *)(a),(unsigned char *)(b)) |
179 |
|
|
|
180 |
|
|
/* mem.c */ |
181 |
fabian |
1.34 |
void *n_malloc(int, const char *, int); |
182 |
|
|
void *n_realloc(void *, int, const char *, int); |
183 |
|
|
void n_free(void *, const char *, int); |
184 |
segfault |
1.1 |
void tell_mem_status(char *); |
185 |
|
|
void tell_mem_status_dcc(int); |
186 |
|
|
void debug_mem_to_dcc(int); |
187 |
|
|
|
188 |
|
|
/* misc.c */ |
189 |
fabian |
1.30 |
int egg_strcatn(char *dst, const char *src, size_t max); |
190 |
segfault |
1.1 |
int my_strcpy(char *, char *); |
191 |
fabian |
1.4 |
void putlog EGG_VARARGS(int, arg1); |
192 |
segfault |
1.1 |
void flushlogs(); |
193 |
|
|
void check_logsize(); |
194 |
fabian |
1.29 |
void maskhost(const char *, char *); |
195 |
segfault |
1.1 |
char *stristr(char *, char *); |
196 |
|
|
void splitc(char *, char *, char); |
197 |
fabian |
1.28 |
void splitcn(char *, char *, char, size_t); |
198 |
segfault |
1.1 |
char *newsplit(char **); |
199 |
|
|
char *splitnick(char **); |
200 |
|
|
void stridx(char *, char *, int); |
201 |
guppy |
1.36 |
void dumplots(int, const char *, char *); |
202 |
segfault |
1.1 |
void daysago(time_t, time_t, char *); |
203 |
|
|
void days(time_t, time_t, char *); |
204 |
|
|
void daysdur(time_t, time_t, char *); |
205 |
|
|
void help_subst(char *, char *, struct flag_record *, int, char *); |
206 |
|
|
void sub_lang(int, char *); |
207 |
|
|
void show_motd(int); |
208 |
|
|
void tellhelp(int, char *, struct flag_record *, int); |
209 |
|
|
void tellwildhelp(int, char *, struct flag_record *); |
210 |
|
|
void tellallhelp(int, char *, struct flag_record *); |
211 |
|
|
void showhelp(char *, char *, struct flag_record *, int); |
212 |
|
|
void rem_help_reference(char *file); |
213 |
|
|
void add_help_reference(char *file); |
214 |
|
|
void debug_help(int); |
215 |
|
|
void reload_help_data(void); |
216 |
|
|
char *extracthostname(char *); |
217 |
guppy |
1.48 |
void show_telnet_banner(int i); |
218 |
fabian |
1.2 |
void make_rand_str(char *, int); |
219 |
fabian |
1.17 |
int oatoi(const char *); |
220 |
fabian |
1.24 |
int is_file(const char *); |
221 |
fabian |
1.26 |
void logsuffix_change(char *); |
222 |
fabian |
1.29 |
char *str_escape(const char *str, const char div, const char mask); |
223 |
|
|
char *strchr_unescape(char *str, const char div, register const char esc_char); |
224 |
|
|
void str_unescape(char *str, register const char esc_char); |
225 |
guppy |
1.41 |
#if (TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 1) || (TCL_MAJOR_VERSION >= 9) |
226 |
guppy |
1.40 |
void str_nutf8tounicode(char *str, int len); |
227 |
guppy |
1.39 |
#endif |
228 |
guppy |
1.46 |
void kill_bot(char *, char *); |
229 |
segfault |
1.1 |
|
230 |
|
|
/* net.c */ |
231 |
|
|
IP my_atoul(char *); |
232 |
|
|
unsigned long iptolong(IP); |
233 |
|
|
IP getmyip(); |
234 |
drummer |
1.45 |
struct in6_addr getmyip6(); |
235 |
segfault |
1.1 |
void neterror(char *); |
236 |
|
|
void setsock(int, int); |
237 |
fabian |
1.3 |
int allocsock(int, int); |
238 |
segfault |
1.1 |
int getsock(int); |
239 |
fabian |
1.3 |
char *hostnamefromip(unsigned long); |
240 |
segfault |
1.1 |
void killsock(int); |
241 |
drummer |
1.45 |
int answer(int, char *, char *, unsigned short *, int); |
242 |
|
|
inline int open_listen(int *, int); |
243 |
|
|
int open_address_listen(char *, int *); |
244 |
segfault |
1.1 |
int open_telnet(char *, int); |
245 |
|
|
int open_telnet_dcc(int, char *, char *); |
246 |
|
|
int open_telnet_raw(int, char *, int); |
247 |
|
|
void tputs(int, char *, unsigned int); |
248 |
|
|
void dequeue_sockets(); |
249 |
|
|
int sockgets(char *, int *); |
250 |
|
|
void tell_netdebug(int); |
251 |
fabian |
1.3 |
char *iptostr(IP); |
252 |
drummer |
1.45 |
char *getlocaladdr(int); |
253 |
fabian |
1.19 |
int sock_has_data(int, int); |
254 |
fabian |
1.35 |
int sockoptions(int sock, int operation, int sock_options); |
255 |
poptix |
1.43 |
int flush_inbuf(int idx); |
256 |
segfault |
1.1 |
|
257 |
|
|
/* tcl.c */ |
258 |
|
|
void protect_tcl(); |
259 |
|
|
void unprotect_tcl(); |
260 |
|
|
void do_tcl(char *, char *); |
261 |
guppy |
1.37 |
int readtclprog(char *fname); |
262 |
segfault |
1.1 |
int findidx(int); |
263 |
|
|
int findanyidx(int); |
264 |
|
|
|
265 |
|
|
/* userent.c */ |
266 |
|
|
void list_type_kill(struct list_type *); |
267 |
|
|
int list_type_expmem(struct list_type *); |
268 |
fabian |
1.2 |
int xtra_set(); |
269 |
segfault |
1.1 |
|
270 |
|
|
/* userrec.c */ |
271 |
|
|
struct userrec *adduser(struct userrec *, char *, char *, char *, int); |
272 |
|
|
void addhost_by_handle(char *, char *); |
273 |
fabian |
1.2 |
void clear_masks(struct maskrec *); |
274 |
segfault |
1.1 |
void clear_userlist(struct userrec *); |
275 |
|
|
int u_pass_match(struct userrec *, char *); |
276 |
|
|
int delhost_by_handle(char *, char *); |
277 |
|
|
int ishost_for_handle(char *, char *); |
278 |
|
|
int count_users(struct userrec *); |
279 |
|
|
int deluser(char *); |
280 |
|
|
void freeuser(struct userrec *); |
281 |
|
|
int change_handle(struct userrec *, char *); |
282 |
|
|
void correct_handle(char *); |
283 |
|
|
int write_user(struct userrec *u, FILE * f, int shr); |
284 |
|
|
void write_userfile(int); |
285 |
|
|
struct userrec *check_dcclist_hand(char *); |
286 |
|
|
void touch_laston(struct userrec *, char *, time_t); |
287 |
fabian |
1.9 |
void user_del_chan(char *); |
288 |
segfault |
1.1 |
|
289 |
|
|
/* users.c */ |
290 |
|
|
void addignore(char *, char *, char *, time_t); |
291 |
|
|
int delignore(char *); |
292 |
|
|
void tell_ignores(int, char *); |
293 |
|
|
int match_ignore(char *); |
294 |
|
|
void check_expired_ignores(); |
295 |
|
|
void autolink_cycle(char *); |
296 |
|
|
void tell_file_stats(int, char *); |
297 |
|
|
void tell_user_ident(int, char *, int); |
298 |
|
|
void tell_users_match(int, char *, int, int, int, char *); |
299 |
|
|
int readuserfile(char *, struct userrec **); |
300 |
|
|
|
301 |
|
|
/* rfc1459.c */ |
302 |
fabian |
1.2 |
int _rfc_casecmp(const char *, const char *); |
303 |
|
|
int _rfc_ncasecmp(const char *, const char *, int); |
304 |
|
|
int _rfc_toupper(int); |
305 |
|
|
int _rfc_tolower(int); |
306 |
segfault |
1.1 |
|
307 |
fabian |
1.12 |
#endif /* _EGG_PROTO_H */ |