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

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

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


Revision 1.3 - (hide annotations) (download) (as text)
Tue Dec 21 17:35:10 1999 UTC (19 years, 11 months ago) by fabian
Branch: MAIN
Changes since 1.2: +27 -11 lines
File MIME type: text/x-csrc
Tothwolf's id-header

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23