Go to the source code of this file.
Data Structures | |
struct | tcl_cmd_b |
struct | threaddata |
struct | tcl_bind_mask_b |
struct | tcl_bind_list_b |
Defines | |
#define | TC_DELETED 0x0001 |
#define | TBM_DELETED 0x0001 |
#define | HT_STACKABLE 0x0001 |
#define | HT_DELETED 0x0002 |
#define | check_tcl_chat(a, b, c) check_tcl_chatactbcst(a ,b, c, H_chat) |
#define | check_tcl_act(a, b, c) check_tcl_chatactbcst(a, b, c, H_act) |
#define | check_tcl_bcst(a, b, c) check_tcl_chatactbcst(a, b, c, H_bcst) |
#define | check_tcl_chon(a, b) check_tcl_chonof(a, b, H_chon) |
#define | check_tcl_chof(a, b) check_tcl_chonof(a, b, H_chof) |
#define | check_tcl_load(a) check_tcl_loadunld(a, H_load) |
#define | check_tcl_unld(a) check_tcl_loadunld(a, H_unld) |
Typedefs | |
typedef struct tcl_cmd_b | tcl_cmd_t |
typedef struct tcl_bind_mask_b | tcl_bind_mask_t |
typedef struct tcl_bind_list_b | tcl_bind_list_t |
typedef struct tcl_bind_list_b * | p_tcl_bind_list |
Functions | |
void | garbage_collect_tclhash (void) |
void | init_bind (void) |
void | kill_bind (void) |
int | expmem_tclhash (void) |
tcl_bind_list_t *p_tcl_bind_list char | global (const char *nme, int flg, IntFunc func) |
void ((void(*)(p_tcl_bind_list)) global[9])(tcl_bind_list_t *tl_which) | |
tcl_bind_list_t *p_tcl_bind_list char | global (const char *nme) |
int ((int(*)(p_tcl_bind_list, const char *, struct flag_record *, const char *, int)) global[11])(tcl_bind_list_t * | |
int | check_tcl_dcc (const char *, int, const char *) |
void ((void(*)(const char *, const char *, int, char, int, const char *)) global[213])(const char * | |
const char const char *void | check_tcl_chpt (const char *, const char *, int, int) |
void | check_tcl_bot (const char *, const char *, const char *) |
void | check_tcl_link (const char *, const char *) |
void | check_tcl_disc (const char *) |
const char *const char *int | global (int, const char *) |
int | check_tcl_note (const char *, const char *, const char *) |
void | check_tcl_listen (const char *, int) |
void | check_tcl_time (struct tm *) |
void | check_tcl_cron (struct tm *) |
void | tell_binds (int, char *) |
void | check_tcl_nkch (const char *, const char *) |
void | check_tcl_away (const char *, int, const char *) |
void | check_tcl_chatactbcst (const char *, int, const char *, tcl_bind_list_t *) |
void ((void *(*)(const char *)) global[88])(const char *) | |
void | check_tcl_log (int, char *, char *) |
void | check_tcl_chonof (char *, int, tcl_bind_list_t *) |
void | check_tcl_loadunld (const char *, tcl_bind_list_t *) |
void ((int(*)(p_tcl_bind_list, cmd_t *)) global[13])(tcl_bind_list_t * | |
cmd_t * | void ((int(*)(p_tcl_bind_list, cmd_t *)) global[12])(tcl_bind_list_t * |
cmd_t *cmd_t * | int ((int(*)(char *, IntFunc)) global[72])(char * |
p_tcl_bind_list(*) | p_tcl_bind_list (global[180])) |
p_tcl_bind_list(*)(*) | p_tcl_bind_list (global[181])) |
p_tcl_bind_list(*)(*)(*) | p_tcl_bind_list (global[182])) |
p_tcl_bind_list(*)(*)(*)(*) | p_tcl_bind_list (global[176])) |
p_tcl_bind_list(*)(*)(*)(*)(*) | p_tcl_bind_list (global[177])) |
p_tcl_bind_list(*) | p_tcl_bind_list (global[178])) |
p_tcl_bind_list(*)(*) | p_tcl_bind_list (global[179])) |
p_tcl_bind_list(*)(*)(*) | p_tcl_bind_list (global[174])) |
p_tcl_bind_list(*)(*)(*)(*) | p_tcl_bind_list (global[183])) |
p_tcl_bind_list(*)(*)(*)(*)(*) | p_tcl_bind_list (global[184])) |
p_tcl_bind_list(*) | p_tcl_bind_list (global[186])) |
p_tcl_bind_list(*)(*) | p_tcl_bind_list (global[187])) |
p_tcl_bind_list(*)(*)(*) | p_tcl_bind_list (global[175])) |
p_tcl_bind_list(*)(*)(*)(*) | p_tcl_bind_list (global[185])) |
p_tcl_bind_list(*)(*)(*)(*)(*) | p_tcl_bind_list (global[224])) |
Variables | |
const char struct flag_record const char | int |
const char | char |
cmd_t *cmd_t * | IntFunc |
p_tcl_bind_list(*)(*)(*)(*)(*) | H_log |
#define check_tcl_act | ( | a, | |||
b, | |||||
c | ) | check_tcl_chatactbcst(a, b, c, H_act) |
Definition at line 110 of file tclhash.h.
Referenced by bot_actchan(), and cmd_me().
#define check_tcl_bcst | ( | a, | |||
b, | |||||
c | ) | check_tcl_chatactbcst(a, b, c, H_bcst) |
Definition at line 111 of file tclhash.h.
Referenced by bot_chan2(), and bot_chat().
#define check_tcl_chat | ( | a, | |||
b, | |||||
c | ) | check_tcl_chatactbcst(a ,b, c, H_chat) |
Definition at line 109 of file tclhash.h.
Referenced by bot_chan2(), and dcc_chat().
#define check_tcl_chof | ( | a, | |||
b | ) | check_tcl_chonof(a, b, H_chof) |
Definition at line 115 of file tclhash.h.
Referenced by cont_tandem_relay(), dcc_chat(), detect_dcc_flood(), do_boot(), and eof_dcc_chat().
#define check_tcl_chon | ( | a, | |||
b | ) | check_tcl_chonof(a, b, H_chon) |
Definition at line 114 of file tclhash.h.
Referenced by dcc_chatter(), dcc_relaying(), dcc_script(), eof_dcc_relay(), and restart_chons().
#define check_tcl_load | ( | a | ) | check_tcl_loadunld(a, H_load) |
#define check_tcl_unld | ( | a | ) | check_tcl_loadunld(a, H_unld) |
#define HT_DELETED 0x0002 |
Definition at line 62 of file tclhash.h.
Referenced by dump_bind_tables(), garbage_collect_tclhash(), global(), kill_bind(), tcl_binds(), and void().
#define HT_STACKABLE 0x0001 |
Definition at line 61 of file tclhash.h.
Referenced by bind_bind_entry(), init_bind(), irc_start(), server_start(), and transfer_start().
#define TBM_DELETED 0x0001 |
Definition at line 50 of file tclhash.h.
Referenced by bind_bind_entry(), garbage_collect_tclhash(), tcl_binds(), tcl_getbinds(), and unbind_bind_entry().
#define TC_DELETED 0x0001 |
Definition at line 29 of file tclhash.h.
Referenced by bind_bind_entry(), garbage_collect_tclhash(), tcl_binds(), tcl_getbinds(), and unbind_bind_entry().
p_tcl_bind_list(* p_tcl_bind_list)(global[186])) |
typedef struct tcl_bind_list_b tcl_bind_list_t |
typedef struct tcl_bind_mask_b tcl_bind_mask_t |
void check_tcl_away | ( | const char * | , | |
int | , | |||
const char * | ||||
) |
void check_tcl_bot | ( | const char * | , | |
const char * | , | |||
const char * | ||||
) |
void check_tcl_chatactbcst | ( | const char * | , | |
int | , | |||
const char * | , | |||
tcl_bind_list_t * | ||||
) |
void check_tcl_chonof | ( | char * | , | |
int | , | |||
tcl_bind_list_t * | ||||
) |
const char const char* void check_tcl_chpt | ( | const char * | , | |
const char * | , | |||
int | , | |||
int | ||||
) |
Referenced by bot_join(), bot_part(), botunlink(), cmd_chat(), cont_tandem_relay(), dcc_chat(), eof_dcc_chat(), and rempartybot().
void check_tcl_cron | ( | struct tm * | ) |
int check_tcl_dcc | ( | const char * | , | |
int | , | |||
const char * | ||||
) |
void check_tcl_disc | ( | const char * | ) |
void check_tcl_link | ( | const char * | , | |
const char * | ||||
) |
void check_tcl_listen | ( | const char * | , | |
int | ||||
) |
void check_tcl_loadunld | ( | const char * | , | |
tcl_bind_list_t * | ||||
) |
void check_tcl_log | ( | int | , | |
char * | , | |||
char * | ||||
) |
void check_tcl_nkch | ( | const char * | , | |
const char * | ||||
) |
int check_tcl_note | ( | const char * | , | |
const char * | , | |||
const char * | ||||
) |
void check_tcl_time | ( | struct tm * | ) |
int expmem_tclhash | ( | void | ) |
Definition at line 195 of file tclhash.c.
References tcl_bind_list_b::next, and tcl_bind_list_expmem().
00196 { 00197 int tot = 0; 00198 tcl_bind_list_t *tl; 00199 00200 for (tl = bind_table_list; tl; tl = tl->next) 00201 tot += tcl_bind_list_expmem(tl); 00202 return tot; 00203 }
void garbage_collect_tclhash | ( | void | ) | [inline] |
Definition at line 112 of file tclhash.c.
References tcl_cmd_b::attributes, tcl_bind_mask_b::first, tcl_bind_list_b::first, tcl_bind_mask_b::flags, tcl_bind_list_b::flags, HT_DELETED, tcl_cmd_b::next, tcl_bind_mask_b::next, tcl_bind_list_b::next, NULL, TBM_DELETED, TC_DELETED, tcl_bind_list_delete(), tcl_bind_mask_delete(), and tcl_cmd_delete().
Referenced by garbage_collect().
00113 { 00114 tcl_bind_list_t *tl, *tl_next, *tl_prev; 00115 tcl_bind_mask_t *tm, *tm_next, *tm_prev; 00116 tcl_cmd_t *tc, *tc_next, *tc_prev; 00117 00118 for (tl = bind_table_list, tl_prev = NULL; tl; tl = tl_next) { 00119 tl_next = tl->next; 00120 00121 if (tl->flags & HT_DELETED) { 00122 if (tl_prev) 00123 tl_prev->next = tl->next; 00124 else 00125 bind_table_list = tl->next; 00126 tcl_bind_list_delete(tl); 00127 } else { 00128 for (tm = tl->first, tm_prev = NULL; tm; tm = tm_next) { 00129 tm_next = tm->next; 00130 00131 if (!(tm->flags & TBM_DELETED)) { 00132 for (tc = tm->first, tc_prev = NULL; tc; tc = tc_next) { 00133 tc_next = tc->next; 00134 00135 if (tc->attributes & TC_DELETED) { 00136 if (tc_prev) 00137 tc_prev->next = tc->next; 00138 else 00139 tm->first = tc->next; 00140 tcl_cmd_delete(tc); 00141 } else 00142 tc_prev = tc; 00143 } 00144 } 00145 00146 /* Delete the bind when it's marked as deleted or when it's empty. */ 00147 if ((tm->flags & TBM_DELETED) || tm->first == NULL) { 00148 if (tm_prev) 00149 tm_prev->next = tm->next; 00150 else 00151 tl->first = tm_next; 00152 tcl_bind_mask_delete(tm); 00153 } else 00154 tm_prev = tm; 00155 } 00156 tl_prev = tl; 00157 } 00158 } 00159 }
const char* const char* int global | ( | int | , | |
const char * | ||||
) |
tcl_bind_list_t* p_tcl_bind_list char global | ( | const char * | nme | ) |
Definition at line 313 of file tclhash.c.
References egg_strcasecmp, tcl_bind_list_b::flags, HT_DELETED, tcl_bind_list_b::name, tcl_bind_list_b::next, and NULL.
00314 { 00315 tcl_bind_list_t *tl; 00316 int v; 00317 00318 for (tl = bind_table_list; tl; tl = tl->next) { 00319 if (tl->flags & HT_DELETED) 00320 continue; 00321 v = egg_strcasecmp(tl->name, nme); 00322 if (!v) 00323 return tl; 00324 if (v > 0) 00325 return NULL; 00326 } 00327 return NULL; 00328 }
tcl_bind_list_t* p_tcl_bind_list char global | ( | const char * | nme, | |
int | flg, | |||
IntFunc | func | |||
) |
Definition at line 261 of file tclhash.c.
References Assert, egg_strcasecmp, HT_DELETED, LOG_DEBUG, tcl_bind_list_b::next, nmalloc_null, NULL, and putlog.
00262 { 00263 tcl_bind_list_t *tl, *tl_prev; 00264 int v; 00265 00266 /* Do not allow coders to use bind table names longer than 00267 * 4 characters. */ 00268 Assert(strlen(nme) <= 4); 00269 00270 for (tl = bind_table_list, tl_prev = NULL; tl; tl_prev = tl, tl = tl->next) { 00271 if (tl->flags & HT_DELETED) 00272 continue; 00273 v = egg_strcasecmp(tl->name, nme); 00274 if (!v) 00275 return tl; /* Duplicate, just return old value. */ 00276 if (v > 0) 00277 break; /* New. Insert at start of list. */ 00278 } 00279 00280 tl = nmalloc_null(sizeof *tl); 00281 strcpy(tl->name, nme); 00282 tl->flags = flg; 00283 tl->func = func; 00284 00285 if (tl_prev) { 00286 tl->next = tl_prev->next; 00287 tl_prev->next = tl; 00288 } else { 00289 tl->next = bind_table_list; 00290 bind_table_list = tl; 00291 } 00292 00293 putlog(LOG_DEBUG, "*", "Allocated bind table %s (flags %d)", nme, flg); 00294 return tl; 00295 }
void init_bind | ( | void | ) |
Definition at line 215 of file tclhash.c.
References add_bind_table, add_builtins, add_cd_tcl_cmds(), builtin_2char(), builtin_3char(), builtin_5int(), builtin_char(), builtin_charidx(), builtin_chat(), builtin_chjn(), builtin_chpt(), builtin_cron(), builtin_dcc(), builtin_idxchar(), builtin_log(), Context, H_away, H_bot, H_chjn, H_chpt, H_cron, H_dcc, H_disc, H_event, H_filt, H_log, H_nkch, H_note, H_time, HT_STACKABLE, and NULL.
Referenced by init_tcl().
00216 { 00217 bind_table_list = NULL; 00218 Context; 00219 add_cd_tcl_cmds(cd_cmd_table); 00220 H_unld = add_bind_table("unld", HT_STACKABLE, builtin_char); 00221 H_time = add_bind_table("time", HT_STACKABLE, builtin_5int); 00222 H_cron = add_bind_table("cron", HT_STACKABLE, builtin_cron); 00223 H_note = add_bind_table("note", 0, builtin_3char); 00224 H_nkch = add_bind_table("nkch", HT_STACKABLE, builtin_2char); 00225 H_load = add_bind_table("load", HT_STACKABLE, builtin_char); 00226 H_link = add_bind_table("link", HT_STACKABLE, builtin_2char); 00227 H_filt = add_bind_table("filt", HT_STACKABLE, builtin_idxchar); 00228 H_disc = add_bind_table("disc", HT_STACKABLE, builtin_char); 00229 H_dcc = add_bind_table("dcc", 0, builtin_dcc); 00230 H_chpt = add_bind_table("chpt", HT_STACKABLE, builtin_chpt); 00231 H_chon = add_bind_table("chon", HT_STACKABLE, builtin_charidx); 00232 H_chof = add_bind_table("chof", HT_STACKABLE, builtin_charidx); 00233 H_chjn = add_bind_table("chjn", HT_STACKABLE, builtin_chjn); 00234 H_chat = add_bind_table("chat", HT_STACKABLE, builtin_chat); 00235 H_bot = add_bind_table("bot", 0, builtin_3char); 00236 H_bcst = add_bind_table("bcst", HT_STACKABLE, builtin_chat); 00237 H_away = add_bind_table("away", HT_STACKABLE, builtin_chat); 00238 H_act = add_bind_table("act", HT_STACKABLE, builtin_chat); 00239 H_event = add_bind_table("evnt", HT_STACKABLE, builtin_char); 00240 H_log = add_bind_table("log", HT_STACKABLE, builtin_log); 00241 add_builtins(H_dcc, C_dcc); 00242 Context; 00243 }
int | ( | (int(*)(p_tcl_bind_list, const char *, struct flag_record *, const char *, int)) | global[11] | ) |
void kill_bind | ( | void | ) |
Definition at line 245 of file tclhash.c.
References tcl_bind_list_b::flags, H_dcc, H_log, HT_DELETED, LOG_DEBUG, tcl_bind_list_b::name, tcl_bind_list_b::next, NULL, putlog, rem_builtins, and tcl_bind_list_delete().
Referenced by kill_tcl().
00246 { 00247 tcl_bind_list_t *tl, *tl_next; 00248 00249 rem_builtins(H_dcc, C_dcc); 00250 for (tl = bind_table_list; tl; tl = tl_next) { 00251 tl_next = tl->next; 00252 00253 if (!(tl->flags |= HT_DELETED)) 00254 putlog(LOG_DEBUG, "*", "De-Allocated bind table %s", tl->name); 00255 tcl_bind_list_delete(tl); 00256 } 00257 H_log = NULL; 00258 bind_table_list = NULL; 00259 }
p_tcl_bind_list(*)(*)(*)(*)(*) p_tcl_bind_list | ( | global | [224] | ) |
p_tcl_bind_list(*)(*)(*)(*) p_tcl_bind_list | ( | global | [185] | ) |
p_tcl_bind_list(*)(*)(*) p_tcl_bind_list | ( | global | [175] | ) |
p_tcl_bind_list(*)(*) p_tcl_bind_list | ( | global | [187] | ) |
p_tcl_bind_list(*) p_tcl_bind_list | ( | global | [186] | ) |
p_tcl_bind_list(*)(*)(*)(*)(*) p_tcl_bind_list | ( | global | [184] | ) |
p_tcl_bind_list(*)(*)(*)(*) p_tcl_bind_list | ( | global | [183] | ) |
p_tcl_bind_list(*)(*)(*) p_tcl_bind_list | ( | global | [174] | ) |
p_tcl_bind_list(*)(*) p_tcl_bind_list | ( | global | [179] | ) |
p_tcl_bind_list(*) p_tcl_bind_list | ( | global | [178] | ) |
p_tcl_bind_list(*)(*)(*)(*)(*) p_tcl_bind_list | ( | global | [177] | ) |
p_tcl_bind_list(*)(*)(*)(*) p_tcl_bind_list | ( | global | [176] | ) |
p_tcl_bind_list(*)(*)(*) p_tcl_bind_list | ( | global | [182] | ) |
p_tcl_bind_list(*)(*) p_tcl_bind_list | ( | global | [181] | ) |
p_tcl_bind_list(*) p_tcl_bind_list | ( | global | [180] | ) |
void tell_binds | ( | int | , | |
char * | ||||
) |
cmd_t* void | ( | (int(*)(p_tcl_bind_list, cmd_t *)) | global[12] | ) |
void | ( | (int(*)(p_tcl_bind_list, cmd_t *)) | global[13] | ) |
void | ( | (void *(*)(const char *)) | global[88] | ) | const |
void | ( | (void(*)(const char *, const char *, int, char, int, const char *)) | global[213] | ) | const |
void | ( | (void(*)(p_tcl_bind_list)) | global[9] | ) |
Definition at line 297 of file tclhash.c.
References tcl_bind_list_b::flags, HT_DELETED, LOG_DEBUG, tcl_bind_list_b::name, tcl_bind_list_b::next, and putlog.
00298 { 00299 tcl_bind_list_t *tl; 00300 00301 for (tl = bind_table_list; tl; tl = tl->next) { 00302 if (tl->flags & HT_DELETED) 00303 continue; 00304 if (tl == tl_which) { 00305 tl->flags |= HT_DELETED; 00306 putlog(LOG_DEBUG, "*", "De-Allocated bind table %s", tl->name); 00307 return; 00308 } 00309 } 00310 putlog(LOG_DEBUG, "*", "??? Tried to delete not listed bind table ???"); 00311 }
p_tcl_bind_list(*)(*)(*)(*)(*) H_log |