/[cvs]/eggdrop1.4/src/tclegg.h
ViewVC logotype

Contents of /eggdrop1.4/src/tclegg.h

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


Revision 1.3 - (show annotations) (download) (as text)
Wed Dec 15 02:32:58 1999 UTC (20 years, 5 months ago) by guppy
Branch: MAIN
Changes since 1.2: +27 -12 lines
File MIME type: text/x-csrc
id-header patch, finally, we have id tags for each file

1 /*
2 * tclegg.h
3 * stuff used by tcl.c and tclhash.c
4 *
5 * $Id$
6 */
7 /*
8 * Copyright (C) 1997 Robey Pointer
9 * Copyright (C) 1999 Eggheads
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25 #ifndef _EGG_TCLEGG_H
26 #define _EGG_TCLEGG_H
27
28 #include "../lush.h" /* include this here, since it's needed
29 * in this file */
30 #ifndef MAKING_MODS
31 # include "proto.h" /* this file needs this */
32 #endif
33
34 /* types of commands */
35 #define CMD_MSG 0
36 #define CMD_DCC 1
37 #define CMD_FIL 2
38 #define CMD_PUB 3
39 #define CMD_MSGM 4
40 #define CMD_PUBM 5
41 #define CMD_JOIN 6
42 #define CMD_PART 7
43 #define CMD_SIGN 8
44 #define CMD_KICK 9
45 #define CMD_TOPC 10
46 #define CMD_MODE 11
47 #define CMD_CTCP 12
48 #define CMD_CTCR 13
49 #define CMD_NICK 14
50 #define CMD_RAW 15
51 #define CMD_BOT 16
52 #define CMD_CHON 17
53 #define CMD_CHOF 18
54 #define CMD_SENT 19
55 #define CMD_RCVD 20
56 #define CMD_CHAT 21
57 #define CMD_LINK 22
58 #define CMD_DISC 23
59 #define CMD_SPLT 24
60 #define CMD_REJN 25
61 #define CMD_FILT 26
62 #define CMD_FLUD 27
63 #define CMD_NOTE 28
64 #define CMD_ACT 29
65 #define CMD_NOTC 30
66 #define CMD_WALL 31
67 #define CMD_BCST 32
68 #define CMD_CHJN 33
69 #define CMD_CHPT 34
70 #define CMD_TIME 35
71 #define BINDS 36
72
73 /* match types for check_tcl_bind */
74 #define MATCH_PARTIAL 0
75 #define MATCH_EXACT 1
76 #define MATCH_MASK 2
77 #define MATCH_CASE 3
78
79 /* bitwise 'or' these: */
80 #define BIND_USE_ATTR 4
81 #define BIND_STACKABLE 8
82 #define BIND_HAS_BUILTINS 16
83 #define BIND_WANTRET 32
84 #define BIND_ALTER_ARGS 64
85
86 /* return values */
87 #define BIND_NOMATCH 0
88 #define BIND_AMBIGUOUS 1
89 #define BIND_MATCHED 2 /* but the proc couldn't be found */
90 #define BIND_EXECUTED 3
91 #define BIND_EXEC_LOG 4 /* proc returned 1 -> wants to be logged */
92 #define BIND_EXEC_BRK 5 /* proc returned BREAK (quit) */
93
94 /* extra commands are stored in Tcl hash tables (one hash table for each type
95 * of command: msg, dcc, etc) */
96 typedef struct timer_str {
97 unsigned int mins; /* time to elapse */
98 char *cmd; /* command linked to */
99 unsigned long id; /* used to remove timers */
100 struct timer_str *next;
101 } tcl_timer_t;
102
103 /* used for stub functions : */
104 #define STDVAR (cd,irp,argc,argv) \
105 ClientData cd; Tcl_Interp *irp; int argc; char *argv[];
106 #define BADARGS(nl,nh,example) \
107 if ((argc<(nl)) || (argc>(nh))) { \
108 Tcl_AppendResult(irp,"wrong # args: should be \"",argv[0], \
109 (example),"\"",NULL); \
110 return TCL_ERROR; \
111 }
112
113 unsigned long add_timer(tcl_timer_t **, int, char *, unsigned long);
114 int remove_timer(tcl_timer_t **, unsigned long);
115 void list_timers(Tcl_Interp *, tcl_timer_t *);
116 void wipe_timers(Tcl_Interp *, tcl_timer_t **);
117 void do_check_timers(tcl_timer_t **);
118
119 typedef struct _tcl_strings {
120 char *name;
121 char *buf;
122 int length;
123 int flags;
124 } tcl_strings;
125
126 typedef struct _tcl_int {
127 char *name;
128 int *val;
129 int readonly;
130 } tcl_ints;
131
132 typedef struct _tcl_coups {
133 char *name;
134 int *lptr;
135 int *rptr;
136 } tcl_coups;
137
138 typedef struct _tcl_cmds {
139 char *name;
140 void *func;
141 } tcl_cmds;
142
143 void add_tcl_commands(tcl_cmds *);
144 void rem_tcl_commands(tcl_cmds *);
145 void add_tcl_strings(tcl_strings *);
146 void rem_tcl_strings(tcl_strings *);
147 void add_tcl_coups(tcl_coups *);
148 void rem_tcl_coups(tcl_coups *);
149 void add_tcl_ints(tcl_ints *);
150 void rem_tcl_ints(tcl_ints *);
151
152 #endif /* _EGG_TCLEGG_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23