/[cvs]/eggdrop1.8/src/proto.h
ViewVC logotype

Contents of /eggdrop1.8/src/proto.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Sun Oct 10 18:22:47 2010 UTC (9 years ago) by pseudo
Branch: MAIN
Changes since 1.2: +2 -1 lines
File MIME type: text/x-csrc
Added the process and parent pids to .status output. Increased the precision of cpu time reporting.
Added a new Tcl command status to provide access to cpu/memory/cache information now and some more in the future.

1 /*
2 * proto.h
3 * prototypes for every function used outside its own module
4 *
5 * (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 * because they use structures in those
8 * (saves including those .h files EVERY time) - Beldin
9 *
10 * $Id: proto.h,v 1.2 2010/08/05 18:12:05 pseudo Exp $
11 */
12 /*
13 * Copyright (C) 1997 Robey Pointer
14 * Copyright (C) 1999 - 2010 Eggheads Development Team
15 *
16 * 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 *
21 * 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 *
26 * 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 */
30
31 #ifndef _EGG_PROTO_H
32 #define _EGG_PROTO_H
33
34 #include "lush.h"
35 #include "misc_file.h"
36
37 #define dprintf dprintf_eggdrop
38
39 struct chanset_t; /* keeps the compiler warnings down :) */
40 struct userrec;
41 struct maskrec;
42 struct igrec;
43 struct flag_record;
44 struct list_type;
45 struct tand_t_struct;
46
47 #ifndef MAKING_MODS
48 extern void (*encrypt_pass) (char *, char *);
49 extern char *(*encrypt_string) (char *, char *);
50 extern char *(*decrypt_string) (char *, char *);
51 extern int (*rfc_casecmp) (const char *, const char *);
52 extern int (*rfc_ncasecmp) (const char *, const char *, int);
53 extern int (*rfc_toupper) (int);
54 extern int (*rfc_tolower) (int);
55 extern int (*match_noterej) (struct userrec *, char *);
56 #endif
57
58 /* botcmd.c */
59 void bot_share(int, char *);
60 int base64_to_int(char *);
61
62 /* botnet.c */
63 void answer_local_whom(int, int);
64 char *lastbot(char *);
65 int nextbot(char *);
66 int in_chain(char *);
67 void tell_bots(int);
68 void tell_bottree(int, int);
69 int botlink(char *, int, char *);
70 int botunlink(int, char *, char *, char *);
71 void dump_links(int);
72 void addbot(char *, char *, char *, char, int);
73 void updatebot(int, char *, char, int);
74 void rembot(char *);
75 struct tand_t_struct *findbot(char *);
76 void unvia(int, struct tand_t_struct *);
77 void check_botnet_pings();
78 int partysock(char *, char *);
79 int addparty(char *, char *, int, char, int, char *, int *);
80 void remparty(char *, int);
81 void partystat(char *, int, int, int);
82 int partynick(char *, int, char *);
83 int partyidle(char *, char *);
84 void partysetidle(char *, int, int);
85 void partyaway(char *, int, char *);
86 void zapfbot(int);
87 void tandem_relay(int, char *, int);
88 int getparty(char *, int);
89
90 /* botmsg.c */
91 int add_note(char *, char *, char *, int, int);
92 int simple_sprintf EGG_VARARGS(char *, arg1);
93 void tandout_but EGG_VARARGS(int, arg1);
94 char *int_to_base10(int);
95 char *unsigned_int_to_base10(unsigned int);
96 char *int_to_base64(unsigned int);
97
98 /* chanprog.c */
99 void tell_verbose_uptime(int);
100 void tell_verbose_status(int);
101 void tell_settings(int);
102 int logmodes(char *);
103 int isowner(char *);
104 char *masktype(int);
105 char *maskname(int);
106 void reaffirm_owners();
107 void rehash();
108 void reload();
109 void chanprog();
110 void check_timers();
111 void check_utimers();
112 void rmspace(char *s);
113 void check_timers();
114 void set_chanlist(const char *host, struct userrec *rec);
115 void clear_chanlist(void);
116 void clear_chanlist_member(const char *nick);
117 float getcputime();
118
119 /* cmds.c */
120 int check_dcc_attrs(struct userrec *, int);
121 int check_dcc_chanattrs(struct userrec *, char *, int, int);
122 int stripmodes(char *);
123 char *stripmasktype(int);
124
125 /* dcc.c */
126 void failed_link(int);
127 void strip_mirc_codes(int, char *);
128 int check_ansi(char *);
129 void dupwait_notify(char *);
130
131 /* dccutil.c */
132 int increase_socks_max();
133 int findidx(int);
134 int findanyidx(int);
135 char *add_cr(char *);
136 void dprintf EGG_VARARGS(int, arg1);
137 void chatout EGG_VARARGS(char *, arg1);
138 extern void (*shareout) ();
139 extern void (*sharein) (int, char *);
140 void chanout_but EGG_VARARGS(int, arg1);
141 void dcc_chatter(int);
142 void lostdcc(int);
143 void killtransfer(int);
144 void removedcc(int);
145 void makepass(char *);
146 void tell_dcc(int);
147 void not_away(int);
148 void set_away(int, char *);
149 void *_get_data_ptr(int, char *, int);
150 void dcc_remove_lost(void);
151 void do_boot(int, char *, char *);
152 int detect_dcc_flood(time_t *, struct chat_info *, int);
153
154 #define get_data_ptr(x) _get_data_ptr(x,__FILE__,__LINE__)
155 void flush_lines(int, struct chat_info *);
156 struct dcc_t *find_idx(int);
157 int new_dcc(struct dcc_table *, int);
158 void del_dcc(int);
159 void changeover_dcc(int, struct dcc_table *, int);
160
161 /* dns.c */
162 extern void (*dns_hostbyip) (sockname_t *);
163 void block_dns_hostbyip(sockname_t *);
164 void call_hostbyip(sockname_t *, char *, int);
165 void call_ipbyhost(char *, sockname_t *, int);
166 void dcc_dnshostbyip(sockname_t *);
167 extern void (*dns_ipbyhost) (char *);
168 void block_dns_ipbyhost(char *);
169 void dcc_dnsipbyhost(char *);
170
171 /* language.c */
172 char *get_language(int);
173 int cmd_loadlanguage(struct userrec *, int, char *);
174 void add_lang_section(char *);
175 int del_lang_section(char *);
176 int exist_lang_section(char *);
177
178 /* main.c */
179 void fatal(const char *, int);
180 int expected_memory(void);
181 void eggContext(const char *, int, const char *);
182 void eggContextNote(const char *, int, const char *, const char *);
183 void eggAssert(const char *, int, const char *);
184 void backup_userfile(void);
185 int mainloop(int);
186
187 /* match.c */
188 int casecharcmp(unsigned char, unsigned char);
189 int charcmp(unsigned char, unsigned char);
190 int _wild_match(register unsigned char *, register unsigned char *);
191 int _wild_match_per(register unsigned char *, register unsigned char *,
192 int (*)(unsigned char, unsigned char),
193 int (*)(unsigned char, unsigned char),
194 unsigned char *);
195 int addr_match(char *, char *, int, int);
196 int mask_match(char *, char *);
197 int cidr_match(char *, char *, int);
198 int cron_match(const char *, const char *);
199
200 #define wild_match(a,b) _wild_match((unsigned char *)(a),(unsigned char *)(b))
201 #define wild_match_per(a,b) _wild_match_per((unsigned char *)(a), \
202 (unsigned char *)(b),casecharcmp,NULL,NULL)
203 #define wild_match_partial_case(a,b) _wild_match_per((unsigned char *)(a), \
204 (unsigned char *)(b),casecharcmp,charcmp, \
205 (unsigned char *)strchr((b),' '))
206 #define match_addr(a,b) addr_match((char *)(a),(char *)(b),0,0)
207 #define match_useraddr(a,b) addr_match((char *)(a),(char *)(b),1,0)
208 #define cmp_masks(a,b) addr_match((char *)(a),(char *)(b),0,1)
209 #define cmp_usermasks(a,b) addr_match((char *)(a),(char *)(b),1,1)
210
211 /* mem.c */
212 void *n_malloc(int, const char *, int);
213 void *n_realloc(void *, int, const char *, int);
214 void n_free(void *, const char *, int);
215 void tell_mem_status(char *);
216 void tell_mem_status_dcc(int);
217 void debug_mem_to_dcc(int);
218
219 /* misc.c */
220 int egg_strcatn(char *, const char *, size_t);
221 int my_strcpy(char *, char *);
222 void putlog EGG_VARARGS(int, arg1);
223 void flushlogs();
224 void check_logsize();
225 void splitc(char *, char *, char);
226 void splitcn(char *, char *, char, size_t);
227 void remove_crlf(char **);
228 char *newsplit(char **);
229 char *splitnick(char **);
230 void stridx(char *, char *, int);
231 void dumplots(int, const char *, const char *);
232 void daysago(time_t, time_t, char *);
233 void days(time_t, time_t, char *);
234 void daysdur(time_t, time_t, char *);
235 void help_subst(char *, char *, struct flag_record *, int, char *);
236 void sub_lang(int, char *);
237 void show_motd(int);
238 void tellhelp(int, char *, struct flag_record *, int);
239 void tellwildhelp(int, char *, struct flag_record *);
240 void tellallhelp(int, char *, struct flag_record *);
241 void showhelp(char *, char *, struct flag_record *, int);
242 void rem_help_reference(char *);
243 void add_help_reference(char *);
244 void debug_help(int);
245 void reload_help_data(void);
246 char *extracthostname(char *);
247 void show_banner(int i);
248 void make_rand_str(char *, int);
249 int oatoi(const char *);
250 int is_file(const char *);
251 void logsuffix_change(char *);
252 char *str_escape(const char *, const char, const char);
253 char *strchr_unescape(char *, const char, register const char);
254 void str_unescape(char *, register const char);
255 int str_isdigit(const char *);
256 void kill_bot(char *, char *);
257
258 void maskaddr(const char *, char *, int);
259 #define maskhost(a,b) maskaddr((a),(b),3)
260 #define maskban(a,b) maskaddr((a),(b),3)
261
262 /* net.c */
263 IP my_atoul(char *);
264 unsigned long iptolong(IP);
265 void setsock(int, int);
266 int allocsock(int, int);
267 int alloctclsock(int, int, Tcl_FileProc *, ClientData);
268 int getsock(int, int);
269 void killsock(int);
270 void killtclsock(int);
271 inline int open_listen(int *);
272 void getvhost(sockname_t *, int);
273 int setsockname(sockname_t *, char *, int, int);
274 int open_address_listen(sockname_t *);
275 int open_telnet_raw(int, sockname_t *);
276 int open_telnet(char *, int);
277 int answer(int, sockname_t *, unsigned short *, int);
278 int getdccaddr(sockname_t *, char *, size_t);
279 void tputs(int, char *, unsigned int);
280 void dequeue_sockets();
281 int preparefdset(fd_set *, sock_list *, int, int, int);
282 int sockread(char *, int *, sock_list *, int, int);
283 int sockgets(char *, int *);
284 void tell_netdebug(int);
285 int sanitycheck_dcc(char *, char *, char *, char *);
286 int hostsanitycheck_dcc(char *, char *, sockname_t *, char *, char *);
287 char *iptostr(struct sockaddr *);
288 int sock_has_data(int, int);
289 int sockoptions(int sock, int operation, int sock_options);
290 int flush_inbuf(int idx);
291
292 /* tcl.c */
293 struct threaddata *threaddata();
294 int init_threaddata(int);
295 void protect_tcl();
296 void unprotect_tcl();
297 void do_tcl(char *, char *);
298 int readtclprog(char *fname);
299
300 /* userent.c */
301 void list_type_kill(struct list_type *);
302 int list_type_expmem(struct list_type *);
303 int xtra_set();
304
305 /* userrec.c */
306 struct userrec *adduser(struct userrec *, char *, char *, char *, int);
307 void addhost_by_handle(char *, char *);
308 void clear_masks(struct maskrec *);
309 void clear_userlist(struct userrec *);
310 int u_pass_match(struct userrec *, char *);
311 int delhost_by_handle(char *, char *);
312 int ishost_for_handle(char *, char *);
313 int count_users(struct userrec *);
314 int deluser(char *);
315 void freeuser(struct userrec *);
316 int change_handle(struct userrec *, char *);
317 void correct_handle(char *);
318 int write_user(struct userrec *, FILE *, int);
319 int write_ignores(FILE *f, int);
320 void write_userfile(int);
321 struct userrec *check_dcclist_hand(char *);
322 void touch_laston(struct userrec *, char *, time_t);
323 void user_del_chan(char *);
324 char *fixfrom(char *);
325 int check_conflags(struct flag_record *fr, int md);
326
327 /* users.c */
328 void addignore(char *, char *, char *, time_t);
329 int delignore(char *);
330 void tell_ignores(int, char *);
331 int match_ignore(char *);
332 void check_expired_ignores();
333 void autolink_cycle(char *);
334 void tell_file_stats(int, char *);
335 void tell_user_ident(int, char *, int);
336 void tell_users_match(int, char *, int, int, int, char *);
337 int readuserfile(char *, struct userrec **);
338
339 /* rfc1459.c */
340 int _rfc_casecmp(const char *, const char *);
341 int _rfc_ncasecmp(const char *, const char *, int);
342 int _rfc_toupper(int);
343 int _rfc_tolower(int);
344
345 #endif /* _EGG_PROTO_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23