/[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.30 - (show annotations) (download) (as text)
Fri May 17 07:29:25 2002 UTC (17 years, 5 months ago) by stdarg
Branch: MAIN
Changes since 1.29: +9 -9 lines
File MIME type: text/x-csrc
* Bind table cleanups, especially renaming bind table functions and making
add/rem_builtins take a char * instead of a bind_table_t *.

1 /*
2 * tclhash.h --
3 */
4 /*
5 * Copyright (C) 1997 Robey Pointer
6 * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22 /*
23 * $Id: tclhash.h,v 1.29 2002/05/05 16:40:39 tothwolf Exp $
24 */
25
26 #ifndef _EGG_TCLHASH_H
27 #define _EGG_TCLHASH_H
28
29 #include "flags.h" /* flag_record */
30
31 /* Flags for bind entries */
32 /* Does the callback want their client_data inserted as the first argument? */
33 #define BIND_WANTS_CD 1
34
35 /* Flags for bind tables */
36 #define BIND_STRICT_ATTR 0x80
37 #define BIND_BREAKABLE 0x100
38
39 /* Flags for return values from bind callbacks */
40 #define BIND_RET_LOG 1
41 #define BIND_RET_BREAK 2
42
43 /* This holds the final information for a function listening on a bind
44 table. */
45 typedef struct bind_entry_b {
46 struct bind_entry_b *next;
47 struct flag_record user_flags;
48 char *function_name;
49 Function callback;
50 void *client_data;
51 int hits;
52 int bind_flags;
53 } bind_entry_t;
54
55 /* This is the list of bind masks in a given table.
56 For instance, in the "msg" table you might have "pass", "op",
57 and "invite". */
58 typedef struct bind_chain_b {
59 struct bind_chain_b *next;
60 bind_entry_t *entries;
61 char *mask;
62 int flags;
63 } bind_chain_t;
64
65 /* This is the highest-level structure. It's like the "msg" table
66 or the "pubm" table. */
67 typedef struct bind_table_b {
68 struct bind_table_b *next;
69 bind_chain_t *chains;
70 char *name;
71 char *syntax;
72 int nargs;
73 int match_type;
74 int flags;
75 } bind_table_t;
76
77 #ifndef MAKING_MODS
78
79 void kill_binds(void);
80
81 void check_tcl_dcc(const char *, int, const char *);
82 void check_tcl_chjn(const char *, const char *, int, char, int, const char *);
83 void check_tcl_chpt(const char *, const char *, int, int);
84 void check_tcl_bot(const char *, const char *, const char *);
85 void check_tcl_link(const char *, const char *);
86 void check_tcl_disc(const char *);
87 const char *check_tcl_filt(int, const char *);
88 int check_tcl_note(const char *, const char *, const char *);
89 void check_tcl_listen(const char *, int);
90 void check_tcl_time(struct tm *);
91 void check_tcl_nkch(const char *, const char *);
92 void check_tcl_away(const char *, int, const char *);
93 void check_tcl_event(const char *);
94 int check_tcl_chat(const char *, int, const char *);
95 void check_tcl_act(const char *, int, const char *);
96 void check_tcl_bcst(const char *, int, const char *);
97 void check_tcl_chon(char *, int);
98 void check_tcl_chof(char *, int);
99
100 int check_bind(bind_table_t *table, const char *match, struct flag_record *_flags, ...);
101
102 bind_table_t *bind_table_add(const char *name, int nargs, const char *syntax, int match_type, int flags);
103
104 void bind_table_del(bind_table_t *table);
105
106 bind_table_t *bind_table_find(const char *name);
107
108 int bind_entry_add(bind_table_t *table, const char *flags, const char *mask, const char *function_name, int bind_flags, Function callback, void *client_data);
109
110 int bind_entry_del(bind_table_t *table, const char *flags, const char *mask, const char *function_name, void *cdata);
111
112 void add_builtins(const char *table_name, cmd_t *cmds);
113
114 void rem_builtins(const char *table_name, cmd_t *cmds);
115
116 #endif /* !MAKING_MODS */
117
118 #endif /* !_EGG_TCLHASH_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23