module.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /*
  2. * module.h
  3. *
  4. */
  5. /*
  6. * Copyright (C) 1997 Robey Pointer
  7. * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef _EGG_MOD_MODULE_H
  24. #define _EGG_MOD_MODULE_H
  25. /* Just include *all* the include files...it's slower but EASIER */
  26. #include "src/main.h"
  27. #include "modvals.h"
  28. #include "src/tandem.h"
  29. /*
  30. * This file contains all the orrible stuff required to do the lookup
  31. * table for symbols, rather than getting the OS to do it, since most
  32. * OS's require all symbols resolved, this can cause a problem with
  33. * some modules.
  34. *
  35. * This is intimately related to the table in `modules.c'. Don't change
  36. * the files unless you have flamable underwear.
  37. *
  38. * Do not read this file whilst unless heavily sedated, I will not be
  39. * held responsible for mental break-downs caused by this file <G>
  40. */
  41. #undef killsock
  42. #undef nmalloc
  43. #undef nfree
  44. #undef nrealloc
  45. #undef feof
  46. #undef user_malloc
  47. #undef dprintf
  48. #undef sdprintf
  49. #undef get_data_ptr
  50. #undef wild_match
  51. #undef wild_match_per
  52. #undef user_realloc
  53. #undef Context
  54. #undef ContextNote
  55. #undef Assert
  56. /* Compability functions. */
  57. #ifdef egg_inet_aton
  58. # undef egg_inet_aton
  59. #endif
  60. #ifdef egg_inet_ntop
  61. # undef egg_inet_ntop
  62. #endif
  63. #ifdef egg_vsnprintf
  64. # undef egg_vsnprintf
  65. #endif
  66. #ifdef egg_snprintf
  67. # undef egg_snprintf
  68. #endif
  69. #ifdef egg_memset
  70. # undef egg_memset
  71. #endif
  72. #ifdef egg_strcasecmp
  73. # undef egg_strcasecmp
  74. #endif
  75. #ifdef egg_strncasecmp
  76. # undef egg_strncasecmp
  77. #endif
  78. #if defined (__CYGWIN__) && !defined(STATIC)
  79. # define EXPORT_SCOPE __declspec(dllexport)
  80. #else
  81. # define EXPORT_SCOPE
  82. #endif
  83. /* Version checks for modules. */
  84. #define EGG_IS_MIN_VER(ver) ((ver) <= EGG_VERSION)
  85. #define EGG_IS_MAX_VER(ver) ((ver) >= EGG_VERSION)
  86. /* Redefine for module-relevance */
  87. /* 0 - 3 */
  88. #define nmalloc(x) ((void *)(global[0]((x),MODULE_NAME,__FILE__,__LINE__)))
  89. #define nfree(x) (global[1]((x),MODULE_NAME,__FILE__,__LINE__))
  90. #ifdef DEBUG_CONTEXT
  91. # define Context (global[2](__FILE__, __LINE__, MODULE_NAME))
  92. #else
  93. # define Context {}
  94. #endif
  95. #define module_rename ((int (*)(char *, char *))global[3])
  96. /* 4 - 7 */
  97. #define module_register ((int (*)(char *, Function *, int, int))global[4])
  98. #define module_find ((module_entry * (*)(char *,int,int))global[5])
  99. #define module_depend ((Function *(*)(char *,char *,int,int))global[6])
  100. #define module_undepend ((int(*)(char *))global[7])
  101. /* 8 - 11 */
  102. #define add_bind_table ((p_tcl_bind_list(*)(const char *,int,Function))global[8])
  103. #define del_bind_table ((void (*) (p_tcl_bind_list))global[9])
  104. #define find_bind_table ((p_tcl_bind_list(*)(const char *))global[10])
  105. #define check_tcl_bind ((int (*) (p_tcl_bind_list,const char *,struct flag_record *,const char *, int))global[11])
  106. /* 12 - 15 */
  107. #define add_builtins ((int (*) (p_tcl_bind_list, cmd_t *))global[12])
  108. #define rem_builtins ((int (*) (p_tcl_bind_list, cmd_t *))global[13])
  109. #define add_tcl_commands ((void (*) (tcl_cmds *))global[14])
  110. #define rem_tcl_commands ((void (*) (tcl_cmds *))global[15])
  111. /* 16 - 19 */
  112. #define add_tcl_ints ((void (*) (tcl_ints *))global[16])
  113. #define rem_tcl_ints ((void (*) (tcl_ints *))global[17])
  114. #define add_tcl_strings ((void (*) (tcl_strings *))global[18])
  115. #define rem_tcl_strings ((void (*) (tcl_strings *))global[19])
  116. /* 20 - 23 */
  117. #define base64_to_int ((int (*) (char *))global[20])
  118. #define int_to_base64 ((char * (*) (int))global[21])
  119. #define int_to_base10 ((char * (*) (int))global[22])
  120. #define simple_sprintf ((int (*)())global[23])
  121. /* 24 - 27 */
  122. #define botnet_send_zapf ((void (*)(int, char *, char *, char *))global[24])
  123. #define botnet_send_zapf_broad ((void (*)(int, char *, char *, char *))global[25])
  124. #define botnet_send_unlinked ((void (*)(int, char *, char *))global[26])
  125. #define botnet_send_bye ((void(*)(void))global[27])
  126. /* 28 - 31 */
  127. #define botnet_send_chat ((void(*)(int,char*,char*))global[28])
  128. #define botnet_send_filereject ((void(*)(int,char*,char*,char*))global[29])
  129. #define botnet_send_filesend ((void(*)(int,char*,char*,char*))global[30])
  130. #define botnet_send_filereq ((void(*)(int,char*,char*,char*))global[31])
  131. /* 32 - 35 */
  132. #define botnet_send_join_idx ((void(*)(int,int))global[32])
  133. #define botnet_send_part_idx ((void(*)(int,char *))global[33])
  134. #define updatebot ((void(*)(int,char*,char,int))global[34])
  135. #define nextbot ((int (*)(char *))global[35])
  136. /* 36 - 39 */
  137. #define zapfbot ((void (*)(int))global[36])
  138. #define n_free ((void (*)(void *,char *, int))global[37])
  139. #define u_pass_match ((int (*)(struct userrec *,char *))global[38])
  140. #define user_malloc(x) ((void *(*)(int,char *,int))global[39])(x,__FILE__,__LINE__)
  141. /* 40 - 43 */
  142. #define get_user ((void *(*)(struct user_entry_type *,struct userrec *))global[40])
  143. #define set_user ((int(*)(struct user_entry_type *,struct userrec *,void *))global[41])
  144. #define add_entry_type ((int (*) ( struct user_entry_type * ))global[42])
  145. #define del_entry_type ((int (*) ( struct user_entry_type * ))global[43])
  146. /* 44 - 47 */
  147. #define get_user_flagrec ((void (*)(struct userrec *, struct flag_record *, const char *))global[44])
  148. #define set_user_flagrec ((void (*)(struct userrec *, struct flag_record *, const char *))global[45])
  149. #define get_user_by_host ((struct userrec * (*)(char *))global[46])
  150. #define get_user_by_handle ((struct userrec *(*)(struct userrec *,char *))global[47])
  151. /* 48 - 51 */
  152. #define find_entry_type ((struct user_entry_type * (*) ( char * ))global[48])
  153. #define find_user_entry ((struct user_entry * (*)( struct user_entry_type *, struct userrec *))global[49])
  154. #define adduser ((struct userrec *(*)(struct userrec *,char*,char*,char*,int))global[50])
  155. #define deluser ((int (*)(char *))global[51])
  156. /* 52 - 55 */
  157. #define addhost_by_handle ((void (*) (char *, char *))global[52])
  158. #define delhost_by_handle ((int(*)(char *,char *))global[53])
  159. #define readuserfile ((int (*)(char *,struct userrec **))global[54])
  160. #define write_userfile ((void(*)(int))global[55])
  161. /* 56 - 59 */
  162. #define geticon ((char (*) (int))global[56])
  163. #define clear_chanlist ((void (*)(void))global[57])
  164. #define reaffirm_owners ((void (*)(void))global[58])
  165. #define change_handle ((int(*)(struct userrec *,char*))global[59])
  166. /* 60 - 63 */
  167. #define write_user ((int (*)(struct userrec *, FILE *,int))global[60])
  168. #define clear_userlist ((void (*)(struct userrec *))global[61])
  169. #define count_users ((int(*)(struct userrec *))global[62])
  170. #define sanity_check ((int(*)(int))global[63])
  171. /* 64 - 67 */
  172. #define break_down_flags ((void (*)(const char *,struct flag_record *,struct flag_record *))global[64])
  173. #define build_flags ((void (*)(char *, struct flag_record *, struct flag_record *))global[65])
  174. #define flagrec_eq ((int(*)(struct flag_record*,struct flag_record *))global[66])
  175. #define flagrec_ok ((int(*)(struct flag_record*,struct flag_record *))global[67])
  176. /* 68 - 71 */
  177. #define shareout (*(Function *)(global[68]))
  178. #define dprintf (global[69])
  179. #define chatout (global[70])
  180. #define chanout_but ((void(*)())global[71])
  181. /* 72 - 75 */
  182. #define check_validity ((int (*) (char *,Function))global[72])
  183. #define list_delete ((int (*)( struct list_type **, struct list_type *))global[73])
  184. #define list_append ((int (*) ( struct list_type **, struct list_type *))global[74])
  185. #define list_contains ((int (*) (struct list_type *, struct list_type *))global[75])
  186. /* 76 - 79 */
  187. #define answer ((int (*) (int,char *,unsigned long *,unsigned short *,int))global[76])
  188. #define getmyip ((IP (*) (void))global[77])
  189. #define neterror ((void (*) (char *))global[78])
  190. #define tputs ((void (*) (int, char *,unsigned int))global[79])
  191. /* 80 - 83 */
  192. #define new_dcc ((int (*) (struct dcc_table *, int))global[80])
  193. #define lostdcc ((void (*) (int))global[81])
  194. #ifdef USE_IPV6
  195. #define getsock ((int (*) (int,int))global[82])
  196. #else
  197. #define getsock ((int (*) (int))global[82])
  198. #endif /* USE_IPV6 */
  199. #define killsock(x) (((void *(*)())global[83])((x),MODULE_NAME,__FILE__,__LINE__))
  200. /* 84 - 87 */
  201. #define open_listen_by_af ((int (*) (int *, int))global[84])
  202. #define open_telnet_dcc ((int (*) (int,char *,char *))global[85])
  203. #define get_data_ptr(x) ((void *(*)(int,char*,int))global[86])(x,__FILE__,__LINE__)
  204. #define open_telnet ((int (*) (char *, int))global[87])
  205. /* 88 - 91 */
  206. #define check_tcl_event ((void * (*) (const char *))global[88])
  207. #define my_memcpy ((void * (*) (void *, const void *, size_t))global[89])
  208. #define my_atoul ((IP(*)(char *))global[90])
  209. #define my_strcpy ((int (*)(char *, const char *))global[91])
  210. /* 92 - 95 */
  211. #define dcc (*(struct dcc_t **)global[92])
  212. #define chanset (*(struct chanset_t **)(global[93]))
  213. #define userlist (*(struct userrec **)global[94])
  214. #define lastuser (*(struct userrec **)(global[95]))
  215. /* 96 - 99 */
  216. #define global_bans (*(maskrec **)(global[96]))
  217. #define global_ign (*(struct igrec **)(global[97]))
  218. #define password_timeout (*(int *)(global[98]))
  219. #define share_greet (*(int *)global[99])
  220. /* 100 - 103 */
  221. #define max_dcc (*(int *)global[100])
  222. /* 101: require_p -- UNUSED */
  223. #define ignore_time (*(int *)(global[102]))
  224. #define use_console_r (*(int *)(global[103]))
  225. /* 104 - 107 */
  226. #define reserved_port_min (*(int *)(global[104]))
  227. #define reserved_port_max (*(int *)(global[105]))
  228. #define debug_output (*(int *)(global[106]))
  229. #define noshare (*(int *)(global[107]))
  230. /* 108 - 111 */
  231. /* 108: gban_total -- UNUSED (Eule) */
  232. /* 109: make_userfile -- UNUED (bryan) */
  233. #define default_flags (*(int*)global[110])
  234. #define dcc_total (*(int*)global[111])
  235. /* 112 - 115 */
  236. #define tempdir ((char *)(global[112]))
  237. #define natip ((char *)(global[113]))
  238. #define hostname ((char *)(global[114]))
  239. #define origbotname ((char *)(global[115]))
  240. /* 116 - 119 */
  241. #define botuser ((char *)(global[116]))
  242. #define admin ((char *)(global[117]))
  243. #define userfile ((char *)global[118])
  244. #define ver ((char *)global[119])
  245. /* 120 - 123 */
  246. #define notify_new ((char *)global[120])
  247. /* 121 helpdir -- UNUSED */
  248. #define Version ((char *)global[122])
  249. #define botnetnick ((char *)global[123])
  250. /* 124 - 127 */
  251. #define DCC_CHAT_PASS (*(struct dcc_table *)(global[124]))
  252. #define DCC_BOT (*(struct dcc_table *)(global[125]))
  253. #define DCC_LOST (*(struct dcc_table *)(global[126]))
  254. #define DCC_CHAT (*(struct dcc_table *)(global[127]))
  255. /* 128 - 131 */
  256. #define interp (*(Tcl_Interp **)(global[128]))
  257. #define now (*(time_t*)global[129])
  258. #define findanyidx ((int (*)(int))global[130])
  259. #define findchan ((struct chanset_t *(*)(char *))global[131])
  260. /* 132 - 135 */
  261. /* 132 -- UNUSED */
  262. #define days ((void (*)(time_t,time_t,char *))global[133])
  263. #define daysago ((void (*)(time_t,time_t,char *))global[134])
  264. #define daysdur ((void (*)(time_t,time_t,char *))global[135])
  265. /* 136 - 139 */
  266. #define ismember ((memberlist * (*) (struct chanset_t *, char *))global[136])
  267. #define newsplit ((char *(*)(char **))global[137])
  268. #define splitnick ((char *(*)(char **))global[138])
  269. #define splitc ((void (*)(char *,char *,char))global[139])
  270. /* 140 - 143 */
  271. #define addignore ((void (*) (char *, char *, char *,time_t))global[140])
  272. #define match_ignore ((int (*)(char *))global[141])
  273. #define delignore ((int (*)(char *))global[142])
  274. #define fatal (global[143])
  275. /* 144 - 147 */
  276. #define xtra_kill ((void (*)(struct user_entry *))global[144])
  277. #define xtra_unpack ((void (*)(struct userrec *, struct user_entry *))global[145])
  278. #define movefile ((int (*) (char *, char *))global[146])
  279. #define copyfile ((int (*) (char *, char *))global[147])
  280. /* 148 - 151 */
  281. #define do_tcl ((void (*)(char *, char *))global[148])
  282. #define readtclprog ((int (*)(const char *))global[149])
  283. /* #define get_language ((char *(*)(int))global[150]) */
  284. #define def_get ((void *(*)(struct userrec *, struct user_entry *))global[151])
  285. /* 152 - 155 */
  286. #define makepass ((void (*) (char *))global[152])
  287. #define wild_match ((int (*)(const char *, const char *))global[153])
  288. #define maskhost ((void (*)(const char *, char *))global[154])
  289. #define show_motd ((void(*)(int))global[155])
  290. /* 156 - 159 */
  291. /* 160 - 163 */
  292. #define touch_laston ((void (*)(struct userrec *,char *,time_t))global[160])
  293. #define add_mode ((void (*)(struct chanset_t *,char,char,char *))(*(Function**)(global[161])))
  294. #define rmspace ((void (*)(char *))global[162])
  295. #define in_chain ((int (*)(char *))global[163])
  296. /* 164 - 167 */
  297. #define add_note ((int (*)(char *,char*,char*,int,int))global[164])
  298. /* 165 */
  299. #define detect_dcc_flood ((int (*) (time_t *,struct chat_info *,int))global[166])
  300. #define flush_lines ((void(*)(int,struct chat_info*))global[167])
  301. /* 168 - 171 */
  302. #define expected_memory ((int(*)(void))global[168])
  303. #define tell_mem_status ((void(*)(char *))global[169])
  304. #define do_restart (*(int *)(global[170]))
  305. #define check_tcl_filt ((const char *(*)(int, const char *))global[171])
  306. /* 172 - 175 */
  307. #define add_hook(a,b) (((void (*) (int, Function))global[172])(a,b))
  308. #define del_hook(a,b) (((void (*) (int, Function))global[173])(a,b))
  309. #define H_dcc (*(p_tcl_bind_list *)(global[174]))
  310. #define H_filt (*(p_tcl_bind_list *)(global[175]))
  311. /* 176 - 179 */
  312. #define H_chon (*(p_tcl_bind_list *)(global[176]))
  313. #define H_chof (*(p_tcl_bind_list *)(global[177]))
  314. #define H_load (*(p_tcl_bind_list *)(global[178]))
  315. #define H_unld (*(p_tcl_bind_list *)(global[179]))
  316. /* 180 - 183 */
  317. #define H_chat (*(p_tcl_bind_list *)(global[180]))
  318. #define H_act (*(p_tcl_bind_list *)(global[181]))
  319. #define H_bcst (*(p_tcl_bind_list *)(global[182]))
  320. #define H_bot (*(p_tcl_bind_list *)(global[183]))
  321. /* 184 - 187 */
  322. #define H_link (*(p_tcl_bind_list *)(global[184]))
  323. #define H_disc (*(p_tcl_bind_list *)(global[185]))
  324. #define H_away (*(p_tcl_bind_list *)(global[186]))
  325. #define H_nkch (*(p_tcl_bind_list *)(global[187]))
  326. /* 188 - 191 */
  327. #define USERENTRY_BOTADDR (*(struct user_entry_type *)(global[188]))
  328. #define USERENTRY_BOTFL (*(struct user_entry_type *)(global[189]))
  329. #define USERENTRY_HOSTS (*(struct user_entry_type *)(global[190]))
  330. #define USERENTRY_PASS (*(struct user_entry_type *)(global[191]))
  331. /* 192 - 195 */
  332. #define USERENTRY_XTRA (*(struct user_entry_type *)(global[192]))
  333. #define user_del_chan ((void(*)(char *))(global[193]))
  334. #define USERENTRY_INFO (*(struct user_entry_type *)(global[194]))
  335. #define USERENTRY_COMMENT (*(struct user_entry_type *)(global[195]))
  336. /* 196 - 199 */
  337. #define USERENTRY_LASTON (*(struct user_entry_type *)(global[196]))
  338. #define putlog (global[197])
  339. #define botnet_send_chan ((void(*)(int,char*,char*,int,char*))global[198])
  340. #define list_type_kill ((void(*)(struct list_type *))global[199])
  341. /* 200 - 203 */
  342. #define logmodes ((int(*)(char *))global[200])
  343. #define masktype ((const char *(*)(int))global[201])
  344. #define stripmodes ((int(*)(char *))global[202])
  345. #define stripmasktype ((const char *(*)(int))global[203])
  346. /* 204 - 207 */
  347. /* 204: sub_lang -- UNUSED (bryan) */
  348. #define online_since (*(int *)(global[205]))
  349. /* 206: cmd_loadlanguage -- UNUSED (bryan) */
  350. #define check_dcc_attrs ((int (*)(struct userrec *,int))global[207])
  351. /* 208 - 211 */
  352. #define check_dcc_chanattrs ((int (*)(struct userrec *,char *,int,int))global[208])
  353. #define add_tcl_coups ((void (*) (tcl_coups *))global[209])
  354. #define rem_tcl_coups ((void (*) (tcl_coups *))global[210])
  355. #define botname ((char *)(global[211]))
  356. /* 212 - 215 */
  357. /* 212: remove_gunk() -- UNUSED (drummer) */
  358. #define check_tcl_chjn ((void (*) (const char *,const char *,int,char,int,const char *))global[213])
  359. #define sanitycheck_dcc ((int (*)(char *, char *, char *, char *))global[214])
  360. #define isowner ((int (*)(char *))global[215])
  361. /* 216 - 219 */
  362. /* 216: min_dcc_port -- UNUSED (guppy) */
  363. /* 217: max_dcc_port -- UNUSED (guppy) */
  364. #define rfc_casecmp ((int(*)(char *, char *))(*(Function**)(global[218])))
  365. #define rfc_ncasecmp ((int(*)(char *, char *, int *))(*(Function**)(global[219])))
  366. /* 220 - 223 */
  367. #ifdef S_IRCNET
  368. #define global_exempts (*(maskrec **)(global[220]))
  369. #define global_invites (*(maskrec **)(global[221]))
  370. #endif
  371. /* 222: ginvite_total -- UNUSED (Eule) */
  372. /* 223: gexempt_total -- UNUSED (Eule) */
  373. /* 224 - 227 */
  374. #define H_event (*(p_tcl_bind_list *)(global[224]))
  375. #ifdef S_IRCNET
  376. #define use_exempts (*(int *)(global[225])) /* drummer/Jason */
  377. #define use_invites (*(int *)(global[226])) /* drummer/Jason */
  378. #endif
  379. #define force_expire (*(int *)(global[227])) /* Rufus */
  380. /* 228 - 231 */
  381. /* 228 */
  382. #define user_realloc(x,y) ((void *(*)(void *,int,char *,int))global[229])((x),(y),__FILE__,__LINE__)
  383. #define nrealloc(x,y) ((void *)(global[230]((x),(y),MODULE_NAME,__FILE__,__LINE__)))
  384. #define xtra_set ((int(*)(struct userrec *,struct user_entry *, void *))global[231])
  385. /* 232 - 235 */
  386. #ifdef DEBUG_CONTEXT
  387. # define ContextNote(note) (global[232](__FILE__, __LINE__, MODULE_NAME, note))
  388. #else
  389. # define ContextNote(note) do { } while (0)
  390. #endif
  391. #ifdef DEBUG_ASSERT
  392. # define Assert(expr) do { \
  393. if (!(expr)) \
  394. (global[233](__FILE__, __LINE__, MODULE_NAME)); \
  395. } while (0)
  396. #else
  397. # define Assert(expr) do { } while (0)
  398. #endif
  399. #define allocsock ((int(*)(int sock,int options))global[234])
  400. #define call_hostbyip ((void(*)(IP, char *, int))global[235])
  401. /* 236 - 239 */
  402. #define call_ipbyhost ((void(*)(char *, IP, int))global[236])
  403. #define iptostr ((char *(*)(IP))global[237])
  404. #define DCC_DNSWAIT (*(struct dcc_table *)(global[238]))
  405. #define hostsanitycheck_dcc ((int(*)(char *, char *, IP, char *, char *))global[239])
  406. /* 240 - 243 */
  407. #define dcc_dnsipbyhost ((void (*)(char *))global[240])
  408. #define dcc_dnshostbyip ((void (*)(IP))global[241])
  409. #define changeover_dcc ((void (*)(int, struct dcc_table *, int))global[242])
  410. #define make_rand_str ((void (*) (char *, int))global[243])
  411. /* 244 - 247 */
  412. #define protect_readonly (*(int *)(global[244]))
  413. #define findchan_by_dname ((struct chanset_t *(*)(char *))global[245])
  414. #define removedcc ((void (*) (int))global[246])
  415. #define userfile_perm (*(int *)global[247])
  416. /* 248 - 251 */
  417. #define sock_has_data ((int(*)(int, int))global[248])
  418. #define bots_in_subtree ((int (*)(tand_t *))global[249])
  419. #define users_in_subtree ((int (*)(tand_t *))global[250])
  420. #define egg_inet_aton ((int (*)(const char *cp, struct in_addr *addr))global[251])
  421. /* 252 - 255 */
  422. #define egg_snprintf (global[252])
  423. #define egg_vsnprintf ((int (*)(char *, size_t, const char *, va_list))global[253])
  424. #define egg_memset ((void *(*)(void *, int, size_t))global[254])
  425. #define egg_strcasecmp ((int (*)(const char *, const char *))global[255])
  426. /* 256 - 259 */
  427. #define egg_strncasecmp ((int (*)(const char *, const char *, size_t))global[256])
  428. #define is_file ((int (*)(const char *))global[257])
  429. #define must_be_owner (*(int *)(global[258]))
  430. #define tandbot (*(tand_t **)(global[259]))
  431. /* 260 - 263 */
  432. #define party (*(party_t **)(global[260]))
  433. #define open_address_listen ((int (*)(IP addr, int *port))global[261])
  434. #define str_escape ((char *(*)(const char *, const char, const char))global[262])
  435. #define strchr_unescape ((char *(*)(char *, const char, register const char))global[263])
  436. /* 264 - 267 */
  437. #define str_unescape ((void (*)(char *, register const char))global[264])
  438. #define egg_strcatn ((int (*)(char *dst, const char *src, size_t max))global[265])
  439. #define clear_chanlist_member ((void (*)(const char *nick))global[266])
  440. #define fixfrom ((char *(*)(char *))global[267])
  441. /* 268 - 272 */
  442. /* Please don't modify socklist directly, unless there's no other way.
  443. * Its structure might be changed, or it might be completely removed,
  444. * so you can't rely on it without a version-check.
  445. */
  446. #define sockprotocol ((int (*)(int))global[268]) /* get protocol */
  447. #define socklist (*(struct sock_list **)global[269])
  448. #define sockoptions ((int (*)(int, int, int))global[270])
  449. #define flush_inbuf ((int (*)(int))global[271])
  450. #define kill_bot ((void (*)(char *, char *))global[272])
  451. /* 273 - 276 */
  452. #define quit_msg ((char *)(global[273]))
  453. #define module_load ((char *(*)(char *))global[274])
  454. #define module_unload ((char *(*)(char *, char *))global[275])
  455. #define parties (*(int *)global[276])
  456. /* 277 - 280 */
  457. #define ischanhub ((int (*)(void))global[277])
  458. #define rand_dccresp ((char *(*)(void))global[278])
  459. /* 279 unused */
  460. #ifdef LEAF
  461. #define listen_all ((int (*)(int, int))global[280])
  462. #endif
  463. /* 281 - 284 */
  464. /* gay
  465. #define MD5_Init ((void (*)(MD5_CTX))global[281])
  466. #define MD5_Update ((void (*)(MD5_CTX *, void *, unsigned long))global[282])
  467. #define MD5_Final ((void (*)(unsigned char *, MD5_CTX *))global[283])
  468. */
  469. #define _wild_match_per ((int (*)(const char *, const char *))global[284])
  470. /* 285 - 288 */
  471. #define role (*(int*)global[285])
  472. #define loading (*(int*)global[286])
  473. #define localhub (*(int*)global[287])
  474. #define updatebin ((int (*)(int, char *, int))global[288])
  475. /* 289 - 292 */
  476. #define stats_add ((void (*)(struct userrec *, int, int))global[289])
  477. #define lower_bot_linked ((void (*)(int))global[290])
  478. #define add_cfg ((void (*)(struct cfg_entry *))global[291])
  479. #define set_cfg_str ((void (*)(char *, char *, char *))global[292])
  480. /* 293 - 296 */
  481. #define trigger_cfg_changed (global[293])
  482. #define higher_bot_linked ((void (*)(int))global[294])
  483. #define bot_aggressive_to ((int (*)(struct userrec *))global[295])
  484. #define botunlink ((int (*)(int, char *, char *))global[296])
  485. /* 297 - 300 */
  486. #define hostname6 ((char *)(global[297]))
  487. #define timesync (*(int*)global[298])
  488. #define netpass ((char *)(global[299]))
  489. #define kickreason ((char *(*)(int))global[300])
  490. /* 301 - 304 */
  491. #define getting_users ((int (*)())global[301])
  492. #define add_builtins_dcc ((int (*) (tcl_bind_list_t *, dcc_cmd_t *))global[302])
  493. #define rem_builtins_dcc ((int (*) (tcl_bind_list_t *, dcc_cmd_t *))global[303])
  494. #define USERENTRY_ADDED (*(struct user_entry_type *)(global[304]))
  495. /* 305 - 308 */
  496. #define thepass ((char *)(global[305]))
  497. #define isupdatehub ((int (*)(void))global[306])
  498. #define norestruct (*(int*)global[307])
  499. #define botlink ((int (*)(char *, int, char *))global[308])
  500. /* 309 - 312 */
  501. #define makeplaincookie ((void (*)(char *, char *, char *))global[309])
  502. #define kickprefix ((char *)(global[310]))
  503. #define bankickprefix ((char *)(global[311]))
  504. #define deflag_user ((void (*)(struct userrec *, int, char *, struct chanset_t *))global[312])
  505. /* 313 - 316 */
  506. #define dcc_prefix ((char *)(global[313]))
  507. #define goodpass ((int (*)(char *, int, char *))global[314])
  508. #define auth (*(struct auth_t **)global[315])
  509. #define auth_total (*(int*)global[316])
  510. /* 317 - 320 */
  511. #define new_auth ((int (*) (void))global[317])
  512. #define isauthed ((int (*) (char *))global[318])
  513. #define removeauth ((void (*)(int))global[319])
  514. #define makehash ((char *(*)(struct userrec *, char *))global[320])
  515. /* 321 - 324 */
  516. #define USERENTRY_SECPASS (*(struct user_entry_type *)(global[321]))
  517. #define authkey ((char *)(global[322]))
  518. #define myip ((char *)(global[323]))
  519. #define myip6 ((char *)(global[324]))
  520. /* 325 - 328 */
  521. #define cmdprefix ((char *)(global[325]))
  522. #define replace ((char*(*)(char *, char *, char *))global[326])
  523. #define degarble ((char *(*)(int, char *))global[327])
  524. #define open_listen ((int (*) (int *))global[328])
  525. /* 329 - 332 */
  526. #define egg_inet_ntop ((int (*)(int af, const void *src, char *dst, socklen_t size))global[329])
  527. #define hostprotocol ((int (*) (char *))global[330])
  528. #define sdprintf (global[331])
  529. #define putbot ((void (*)(char *, char *))global[332])
  530. /* 333 - 336 */
  531. #define putallbots ((void (*)(char *))global[333])
  532. #define ssl_link ((int (*) (int, int))global[334])
  533. #define dropssl ((void (*) (int))global[335])
  534. #define myipstr ((char*(*)(int))global[336])
  535. /* 337 - 340 */
  536. #define checkchans ((void (*) (int))global[340])
  537. /* This is for blowfish module, couldnt be bothered making a whole new .h
  538. * file for it ;)
  539. */
  540. #ifndef MAKING_ENCRYPTION
  541. # define encrypt_string(a, b) \
  542. (((char *(*)(char *,char*))encryption_funcs[4])(a,b))
  543. # define decrypt_string(a, b) \
  544. (((char *(*)(char *,char*))encryption_funcs[5])(a,b))
  545. #endif
  546. extern int lfprintf(FILE *, char *, ...);
  547. extern void raise_limit(struct chanset_t *);
  548. extern int egg_numver;
  549. extern int cfg_count;
  550. extern struct cfg_entry **cfg;
  551. #define STR(x) x
  552. #endif /* _EGG_MOD_MODULE_H */