00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _EGG_TCLHASH_H
00026 #define _EGG_TCLHASH_H
00027
00028
00029 #define TC_DELETED 0x0001
00030
00031 typedef struct tcl_cmd_b {
00032 struct tcl_cmd_b *next;
00033
00034 struct flag_record flags;
00035 char *func_name;
00036
00037 int hits;
00038 u_8bit_t attributes;
00039 } tcl_cmd_t;
00040
00041 struct threaddata {
00042 int (*mainloopfunc)(int);
00043
00044 sock_list *socklist;
00045 struct timeval blocktime;
00046 int mainthread;
00047 int MAXSOCKS;
00048 };
00049
00050 #define TBM_DELETED 0x0001
00051
00052 typedef struct tcl_bind_mask_b {
00053 struct tcl_bind_mask_b *next;
00054
00055 tcl_cmd_t *first;
00056 char *mask;
00057 u_8bit_t flags;
00058 } tcl_bind_mask_t;
00059
00060
00061 #define HT_STACKABLE 0x0001
00062 #define HT_DELETED 0x0002
00063
00064
00065 typedef struct tcl_bind_list_b {
00066 struct tcl_bind_list_b *next;
00067
00068 tcl_bind_mask_t *first;
00069 char name[5];
00070 u_8bit_t flags;
00071 IntFunc func;
00072
00073 } tcl_bind_list_t, *p_tcl_bind_list;
00074
00075
00076 #ifndef MAKING_MODS
00077
00078 inline void garbage_collect_tclhash(void);
00079
00080 void init_bind(void);
00081 void kill_bind(void);
00082 int expmem_tclhash(void);
00083
00084 tcl_bind_list_t *add_bind_table(const char *nme, int flg, IntFunc func);
00085 void del_bind_table(tcl_bind_list_t *tl_which);
00086
00087 tcl_bind_list_t *find_bind_table(const char *nme);
00088
00089 int check_tcl_bind(tcl_bind_list_t *, const char *, struct flag_record *,
00090 const char *, int);
00091 int check_tcl_dcc(const char *, int, const char *);
00092 void check_tcl_chjn(const char *, const char *, int, char, int, const char *);
00093 void check_tcl_chpt(const char *, const char *, int, int);
00094 void check_tcl_bot(const char *, const char *, const char *);
00095 void check_tcl_link(const char *, const char *);
00096 void check_tcl_disc(const char *);
00097 const char *check_tcl_filt(int, const char *);
00098 int check_tcl_note(const char *, const char *, const char *);
00099 void check_tcl_listen(const char *, int);
00100 void check_tcl_time(struct tm *);
00101 void check_tcl_cron(struct tm *);
00102 void tell_binds(int, char *);
00103 void check_tcl_nkch(const char *, const char *);
00104 void check_tcl_away(const char *, int, const char *);
00105 void check_tcl_chatactbcst(const char *, int, const char *, tcl_bind_list_t *);
00106 void check_tcl_event(const char *);
00107 void check_tcl_log(int, char *, char *);
00108
00109 #define check_tcl_chat(a, b, c) check_tcl_chatactbcst(a ,b, c, H_chat)
00110 #define check_tcl_act(a, b, c) check_tcl_chatactbcst(a, b, c, H_act)
00111 #define check_tcl_bcst(a, b, c) check_tcl_chatactbcst(a, b, c, H_bcst)
00112 void check_tcl_chonof(char *, int, tcl_bind_list_t *);
00113
00114 #define check_tcl_chon(a, b) check_tcl_chonof(a, b, H_chon)
00115 #define check_tcl_chof(a, b) check_tcl_chonof(a, b, H_chof)
00116 void check_tcl_loadunld(const char *, tcl_bind_list_t *);
00117
00118 #define check_tcl_load(a) check_tcl_loadunld(a, H_load)
00119 #define check_tcl_unld(a) check_tcl_loadunld(a, H_unld)
00120
00121 void rem_builtins(tcl_bind_list_t *, cmd_t *);
00122 void add_builtins(tcl_bind_list_t *, cmd_t *);
00123
00124 int check_validity(char *, IntFunc);
00125 extern p_tcl_bind_list H_chat, H_act, H_bcst, H_chon, H_chof;
00126 extern p_tcl_bind_list H_load, H_unld, H_dcc, H_bot, H_link;
00127 extern p_tcl_bind_list H_away, H_nkch, H_filt, H_disc, H_event, H_log;
00128
00129 #endif
00130
00131 #endif