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

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

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


Revision 1.2 - (hide annotations) (download) (as text)
Mon Nov 1 17:01:01 1999 UTC (20 years, 5 months ago) by guppy
Branch: MAIN
Changes since 1.1: +0 -3 lines
File MIME type: text/x-csrc
blah last patches I hope

1 segfault 1.1 /* stuff used by tcl.c & tclhash.c */
2     /*
3     * This file is part of the eggdrop source code
4     * copyright (c) 1997 Robey Pointer
5     * and is distributed according to the GNU general public license.
6     * For full details, read the top of 'main.c' or the file called
7     * COPYING that was distributed with this code.
8     */
9    
10     #ifndef _H_TCLEGG
11     #define _H_TCLEGG
12    
13     #include "../lush.h" /* include this here, since it's needed
14     * in this file */
15     #ifndef MAKING_MODS
16     #include "proto.h" /* this file needs this */
17     #endif
18    
19     /* types of commands */
20     #define CMD_MSG 0
21     #define CMD_DCC 1
22     #define CMD_FIL 2
23     #define CMD_PUB 3
24     #define CMD_MSGM 4
25     #define CMD_PUBM 5
26     #define CMD_JOIN 6
27     #define CMD_PART 7
28     #define CMD_SIGN 8
29     #define CMD_KICK 9
30     #define CMD_TOPC 10
31     #define CMD_MODE 11
32     #define CMD_CTCP 12
33     #define CMD_CTCR 13
34     #define CMD_NICK 14
35     #define CMD_RAW 15
36     #define CMD_BOT 16
37     #define CMD_CHON 17
38     #define CMD_CHOF 18
39     #define CMD_SENT 19
40     #define CMD_RCVD 20
41     #define CMD_CHAT 21
42     #define CMD_LINK 22
43     #define CMD_DISC 23
44     #define CMD_SPLT 24
45     #define CMD_REJN 25
46     #define CMD_FILT 26
47     #define CMD_FLUD 27
48     #define CMD_NOTE 28
49     #define CMD_ACT 29
50     #define CMD_NOTC 30
51     #define CMD_WALL 31
52     #define CMD_BCST 32
53     #define CMD_CHJN 33
54     #define CMD_CHPT 34
55     #define CMD_TIME 35
56     #define BINDS 36
57    
58     /* match types for check_tcl_bind */
59     #define MATCH_PARTIAL 0
60     #define MATCH_EXACT 1
61     #define MATCH_MASK 2
62     #define MATCH_CASE 3
63    
64     /* bitwise 'or' these: */
65     #define BIND_USE_ATTR 4
66     #define BIND_STACKABLE 8
67     #define BIND_HAS_BUILTINS 16
68     #define BIND_WANTRET 32
69     #define BIND_ALTER_ARGS 64
70    
71     /* return values */
72     #define BIND_NOMATCH 0
73     #define BIND_AMBIGUOUS 1
74     #define BIND_MATCHED 2 /* but the proc couldn't be found */
75     #define BIND_EXECUTED 3
76     #define BIND_EXEC_LOG 4 /* proc returned 1 -> wants to be logged */
77     #define BIND_EXEC_BRK 5 /* proc returned BREAK (quit) */
78    
79     /* extra commands are stored in Tcl hash tables (one hash table for each type
80     * of command: msg, dcc, etc) */
81     typedef struct timer_str {
82     unsigned int mins; /* time to elapse */
83     char *cmd; /* command linked to */
84     unsigned long id; /* used to remove timers */
85     struct timer_str *next;
86     } tcl_timer_t;
87    
88     /* used for stub functions : */
89     #define STDVAR (cd,irp,argc,argv) \
90     ClientData cd; Tcl_Interp *irp; int argc; char *argv[];
91     #define BADARGS(nl,nh,example) \
92     if ((argc<(nl)) || (argc>(nh))) { \
93     Tcl_AppendResult(irp,"wrong # args: should be \"",argv[0], \
94     (example),"\"",NULL); \
95     return TCL_ERROR; \
96     }
97    
98     unsigned long add_timer(tcl_timer_t **, int, char *, unsigned long);
99     int remove_timer(tcl_timer_t **, unsigned long);
100     void list_timers(Tcl_Interp *, tcl_timer_t *);
101     void wipe_timers(Tcl_Interp *, tcl_timer_t **);
102     void do_check_timers(tcl_timer_t **);
103    
104     typedef struct _tcl_strings {
105     char *name;
106     char *buf;
107     int length;
108     int flags;
109     } tcl_strings;
110    
111     typedef struct _tcl_int {
112     char *name;
113     int *val;
114     int readonly;
115     } tcl_ints;
116    
117     typedef struct _tcl_coups {
118     char *name;
119     int *lptr;
120     int *rptr;
121     } tcl_coups;
122    
123     typedef struct _tcl_cmds {
124     char *name;
125     void *func;
126     } tcl_cmds;
127    
128     void add_tcl_commands(tcl_cmds *);
129     void rem_tcl_commands(tcl_cmds *);
130     void add_tcl_strings(tcl_strings *);
131     void rem_tcl_strings(tcl_strings *);
132     void add_tcl_coups(tcl_coups *);
133     void rem_tcl_coups(tcl_coups *);
134     void add_tcl_ints(tcl_ints *);
135     void rem_tcl_ints(tcl_ints *);
136    
137     #endif

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23