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

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

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


Revision 1.8 - (show annotations) (download) (as text)
Thu Apr 12 02:39:43 2001 UTC (18 years, 6 months ago) by guppy
Branch: MAIN
CVS Tags: eggdrop1_6_5, eggdrop1_6_6
Changes since 1.7: +9 -9 lines
File MIME type: text/x-csrc
lets update the copyright info for 2001 k? :P~

1 /*
2 * tclhash.h
3 *
4 * $Id: tclhash.h,v 1.7 2000/10/27 19:32:41 fabian Exp $
5 */
6 /*
7 * Copyright (C) 1997 Robey Pointer
8 * Copyright (C) 1999, 2000, 2001 Eggheads Development Team
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 */
24
25 #ifndef _EGG_TCLHASH_H
26 #define _EGG_TCLHASH_H
27
28
29 #define TC_DELETED 0x0001 /* This command/trigger was deleted. */
30
31 typedef struct tcl_cmd_b {
32 struct tcl_cmd_b *next;
33
34 struct flag_record flags;
35 char *func_name; /* Proc name. */
36 int hits; /* Number of times this proc
37 was triggered. */
38 u_8bit_t attributes; /* Flags for this entry. TC_* */
39 } tcl_cmd_t;
40
41
42 #define TBM_DELETED 0x0001 /* This mask was deleted. */
43
44 typedef struct tcl_bind_mask_b {
45 struct tcl_bind_mask_b *next;
46
47 tcl_cmd_t *first; /* List of commands registered
48 for this bind. */
49 char *mask;
50 u_8bit_t flags; /* Flags for this entry. TBM_* */
51 } tcl_bind_mask_t;
52
53
54 #define HT_STACKABLE 0x0001 /* Triggers in this bind list may be
55 stacked. */
56 #define HT_DELETED 0x0002 /* This bind list was already deleted.
57 Do not use it anymore. */
58
59 typedef struct tcl_bind_list_b {
60 struct tcl_bind_list_b *next;
61
62 tcl_bind_mask_t *first; /* Pointer to registered binds
63 for this list. */
64 char name[5]; /* Name of the bind. */
65 u_8bit_t flags; /* Flags for this element. HT_* */
66 Function func; /* Function used as the Tcl
67 calling interface for procs
68 actually representing C
69 functions. */
70 } tcl_bind_list_t, *p_tcl_bind_list;
71
72
73 #ifndef MAKING_MODS
74
75 inline void garbage_collect_tclhash(void);
76
77 void init_bind(void);
78 void kill_bind(void);
79 int expmem_tclhash(void);
80
81 tcl_bind_list_t *add_bind_table(const char *nme, int flg, Function func);
82 void del_bind_table(tcl_bind_list_t *tl_which);
83
84 tcl_bind_list_t *find_bind_table(const char *nme);
85
86 int check_tcl_bind(tcl_bind_list_t *, const char *, struct flag_record *, const char *, int);
87 int check_tcl_dcc(const char *, int, const char *);
88 void check_tcl_chjn(const char *, const char *, int, char, int, const char *);
89 void check_tcl_chpt(const char *, const char *, int, int);
90 void check_tcl_bot(const char *, const char *, const char *);
91 void check_tcl_link(const char *, const char *);
92 void check_tcl_disc(const char *);
93 const char *check_tcl_filt(int, const char *);
94 int check_tcl_note(const char *, const char *, const char *);
95 void check_tcl_listen(const char *, int);
96 void check_tcl_time(struct tm *);
97 void tell_binds(int, char *);
98 void check_tcl_nkch(const char *, const char *);
99 void check_tcl_away(const char *, int, const char *);
100 void check_tcl_chatactbcst(const char *, int, const char *, tcl_bind_list_t *);
101 void check_tcl_event(const char *);
102
103 #define check_tcl_chat(a, b, c) check_tcl_chatactbcst(a ,b, c, H_chat)
104 #define check_tcl_act(a, b, c) check_tcl_chatactbcst(a, b, c, H_act)
105 #define check_tcl_bcst(a, b, c) check_tcl_chatactbcst(a, b, c, H_bcst)
106 void check_tcl_chonof(char *, int, tcl_bind_list_t *);
107
108 #define check_tcl_chon(a, b) check_tcl_chonof(a, b, H_chon)
109 #define check_tcl_chof(a, b) check_tcl_chonof(a, b, H_chof)
110 void check_tcl_loadunld(const char *, tcl_bind_list_t *);
111
112 #define check_tcl_load(a) check_tcl_loadunld(a, H_load)
113 #define check_tcl_unld(a) check_tcl_loadunld(a, H_unld)
114
115 void rem_builtins(tcl_bind_list_t *, cmd_t *);
116 void add_builtins(tcl_bind_list_t *, cmd_t *);
117
118 int check_validity(char *, Function);
119 extern p_tcl_bind_list H_chat, H_act, H_bcst, H_chon, H_chof;
120 extern p_tcl_bind_list H_load, H_unld, H_dcc, H_bot, H_link;
121 extern p_tcl_bind_list H_away, H_nkch, H_filt, H_disc, H_event;
122
123 #endif
124
125
126 #define CHECKVALIDITY(a) do { \
127 if (!check_validity(argv[0], (a))) { \
128 Tcl_AppendResult(irp, "bad builtin command call!", \
129 NULL); \
130 return TCL_ERROR; \
131 } \
132 } while (0)
133
134 #endif /* _EGG_TCLHASH_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23