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

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

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


Revision 1.52 - (show annotations) (download) (as text)
Wed Oct 10 10:44:04 2001 UTC (18 years ago) by tothwolf
Branch: MAIN
Changes since 1.51: +3 -15 lines
File MIME type: text/x-csrc
all expmem functions and support removed
all memory status/debugging code removed
all #ifdef DEBUG_MEM code removed

nmalloc macro/n_malloc function removed, use malloc() now
mod_malloc function removed
my_strdup function removed, use malloc_strcpy macro now
channel_malloc removed, use malloc_memset macro now
n_malloc_null function removed, use malloc_memset macro now
user_malloc macro/_user_malloc function removed, use malloc() now

nrealloc macro/n_realloc function removed, use realloc() now
mod_realloc function removed

nfree macro/n_free function removed, use free() now
mod_free function removed
my_free macro removed, use free_null macro now
Tcl_Free compat macro now uses free() instead of removed n_free function

malloc->strcpy now uses malloc_strcpy macro
free(ptr);ptr=NULL; now uses free_null macro
malloc->bzero now uses malloc_memset macro
get_data_ptr macro/_get_data_ptr function removed, use malloc_memset macro now

compat memcpy removed
compat memset removed
egg_memcpy/my_memcpy misuse/mess changed to memcpy
egg_bzero/bzero macro removed, use memset() now

many uninitialized pointers now default to NULL

match.c is now compiled on it's own instead of being included into tclhash.c
match.c cleanup, removed broken/incomplete ircII compat code
wild_match macro removed, _wild_match function renamed to wild_match
wild_match_per function no longer declared static
added prototypes for wild_match and wild_match_per functions

Major function/macro changes:
  nmalloc -> malloc()
  nrealloc -> realloc()
  nfree -> free()

Bugs found and fixed during audit:
  buffer overflow in adduser()

Bugs fixed when code was removed:
  typo in filedb3.c: EBUG_MEM -> DEBUG_MEM
  extra egg_bzero call from filesys.c

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.51 2001/08/19 02:49:40 drummer Exp $
11 */
12 /*
13 * Copyright (C) 1997 Robey Pointer
14 * Copyright (C) 1999, 2000, 2001 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 #ifdef HAVE_DPRINTF
38 #define dprintf dprintf_eggdrop
39 #endif
40
41 struct chanset_t; /* keeps the compiler warnings down :) */
42 struct userrec;
43 struct maskrec;
44 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 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 #endif
59
60 /* 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 int simple_sprintf EGG_VARARGS(char *, arg1);
95 void tandout_but EGG_VARARGS(int, arg1);
96 char *int_to_base10(int);
97 char *unsigned_int_to_base10(unsigned int);
98 char *int_to_base64(unsigned int);
99
100 /* chanprog.c */
101 void tell_verbose_status(int);
102 void tell_settings(int);
103 int logmodes(char *);
104 int isowner(char *);
105 char *masktype(int);
106 char *maskname(int);
107 void reaffirm_owners();
108 void rehash();
109 void reload();
110 void chanprog();
111 void check_timers();
112 void check_utimers();
113 void rmspace(char *s);
114 void check_timers();
115 void set_chanlist(const char *host, struct userrec *rec);
116 void clear_chanlist(void);
117 void clear_chanlist_member(const char *nick);
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 dupwait_notify(char *);
128
129 /* dccutil.c */
130 void dprintf EGG_VARARGS(int, arg1);
131 void chatout EGG_VARARGS(char *, arg1);
132 extern void (*shareout) ();
133 extern void (*sharein) (int, char *);
134 void chanout_but EGG_VARARGS(int, arg1);
135 void dcc_chatter(int);
136 void lostdcc(int);
137 void removedcc(int);
138 void makepass(char *);
139 void tell_dcc(int);
140 void not_away(int);
141 void set_away(int, char *);
142 void dcc_remove_lost(void);
143
144 void flush_lines(int, struct chat_info *);
145 struct dcc_t *find_idx(int);
146 int new_dcc(struct dcc_table *, int);
147 void del_dcc(int);
148 char *add_cr(char *);
149 void changeover_dcc(int, struct dcc_table *, int);
150
151 /* dns.c */
152 void dns_hostbyip(char *);
153 void dns_ipbyhost(char *);
154 void call_hostbyip(char *, char *, int);
155 void call_ipbyhost(char *, char *, int);
156 void dcc_dnshostbyip(char *);
157 void dcc_dnsipbyhost(char *);
158
159 /* gotdcc.c */
160 void gotdcc(char *, char *, struct userrec *, char *);
161 void do_boot(int, char *, char *);
162 int detect_dcc_flood(time_t *, struct chat_info *, int);
163
164 /* main.c */
165 void fatal(const char *, int);
166 void patch(const char *);
167 void eggContext(const char *, int, const char *);
168 void eggContextNote(const char *, int, const char *, const char *);
169 void eggAssert(const char *, int, const char *);
170 void backup_userfile(void);
171
172 /* match.c */
173 int wild_match(register unsigned char *, register unsigned char *);
174 int wild_match_per(register unsigned char *, register unsigned char *);
175
176 /* misc.c */
177 int egg_strcatn(char *dst, const char *src, size_t max);
178 int my_strcpy(char *, char *);
179 void putlog EGG_VARARGS(int, arg1);
180 void flushlogs();
181 void check_logsize();
182 void maskhost(const char *, char *);
183 char *stristr(char *, char *);
184 void splitc(char *, char *, char);
185 void splitcn(char *, char *, char, size_t);
186 char *newsplit(char **);
187 char *splitnick(char **);
188 void stridx(char *, char *, int);
189 void dumplots(int, const char *, char *);
190 void daysago(time_t, time_t, char *);
191 void days(time_t, time_t, char *);
192 void daysdur(time_t, time_t, char *);
193 void help_subst(char *, char *, struct flag_record *, int, char *);
194 void sub_lang(int, char *);
195 void show_motd(int);
196 void tellhelp(int, char *, struct flag_record *, int);
197 void tellwildhelp(int, char *, struct flag_record *);
198 void tellallhelp(int, char *, struct flag_record *);
199 void showhelp(char *, char *, struct flag_record *, int);
200 void rem_help_reference(char *file);
201 void add_help_reference(char *file);
202 void debug_help(int);
203 void reload_help_data(void);
204 char *extracthostname(char *);
205 void show_telnet_banner(int i);
206 void make_rand_str(char *, int);
207 int oatoi(const char *);
208 int is_file(const char *);
209 void logsuffix_change(char *);
210 char *str_escape(const char *str, const char div, const char mask);
211 char *strchr_unescape(char *str, const char div, register const char esc_char);
212 void str_unescape(char *str, register const char esc_char);
213 #if (TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 1) || (TCL_MAJOR_VERSION >= 9)
214 void str_nutf8tounicode(char *str, int len);
215 #endif
216 void kill_bot(char *, char *);
217
218 /* net.c */
219 IP my_atoul(char *);
220 unsigned long iptolong(IP);
221 IP getmyip();
222 struct in6_addr getmyip6();
223 void neterror(char *);
224 void setsock(int, int);
225 int allocsock(int, int);
226 int getsock(int);
227 void killsock(int);
228 int answer(int, char *, char *, unsigned short *, int);
229 inline int open_listen(int *, int);
230 int open_address_listen(char *, int *);
231 int open_telnet(char *, int);
232 int open_telnet_dcc(int, char *, char *);
233 int open_telnet_raw(int, char *, int);
234 void tputs(int, char *, unsigned int);
235 void dequeue_sockets();
236 int sockgets(char *, int *);
237 void tell_netdebug(int);
238 char *iptostr(IP);
239 char *getlocaladdr(int);
240 int sock_has_data(int, int);
241 int sockoptions(int sock, int operation, int sock_options);
242 int flush_inbuf(int idx);
243
244 /* tcl.c */
245 void protect_tcl();
246 void unprotect_tcl();
247 void do_tcl(char *, char *);
248 int readtclprog(char *fname);
249 int findidx(int);
250 int findanyidx(int);
251
252 /* userent.c */
253 void list_type_kill(struct list_type *);
254 int xtra_set();
255
256 /* userrec.c */
257 struct userrec *adduser(struct userrec *, char *, char *, char *, int);
258 void addhost_by_handle(char *, char *);
259 void clear_masks(struct maskrec *);
260 void clear_userlist(struct userrec *);
261 int u_pass_match(struct userrec *, char *);
262 int delhost_by_handle(char *, char *);
263 int ishost_for_handle(char *, char *);
264 int count_users(struct userrec *);
265 int deluser(char *);
266 void freeuser(struct userrec *);
267 int change_handle(struct userrec *, char *);
268 void correct_handle(char *);
269 int write_user(struct userrec *u, FILE * f, int shr);
270 void write_userfile(int);
271 struct userrec *check_dcclist_hand(char *);
272 void touch_laston(struct userrec *, char *, time_t);
273 void user_del_chan(char *);
274
275 /* users.c */
276 void addignore(char *, char *, char *, time_t);
277 int delignore(char *);
278 void tell_ignores(int, char *);
279 int match_ignore(char *);
280 void check_expired_ignores();
281 void autolink_cycle(char *);
282 void tell_file_stats(int, char *);
283 void tell_user_ident(int, char *, int);
284 void tell_users_match(int, char *, int, int, int, char *);
285 int readuserfile(char *, struct userrec **);
286
287 /* rfc1459.c */
288 int _rfc_casecmp(const char *, const char *);
289 int _rfc_ncasecmp(const char *, const char *, int);
290 int _rfc_toupper(int);
291 int _rfc_tolower(int);
292
293 #endif /* _EGG_PROTO_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23