1 | /* C K U C M D . H -- Header file for Unix cmd package */ |
---|
2 | |
---|
3 | /* |
---|
4 | Author: Frank da Cruz (fdc@columbia.edu, FDCCU@CUVMA.BITNET), |
---|
5 | Columbia University Academic Information Systems, New York City. |
---|
6 | |
---|
7 | Copyright (C) 1985, 1996, Trustees of Columbia University in the City of New |
---|
8 | York. The C-Kermit software may not be, in whole or in part, licensed or |
---|
9 | sold for profit as a software product itself, nor may it be included in or |
---|
10 | distributed with commercial products or otherwise distributed by commercial |
---|
11 | concerns to their clients or customers without written permission of the |
---|
12 | Office of Kermit Development and Distribution, Columbia University. This |
---|
13 | copyright notice must not be removed, altered, or obscured. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef CKUCMD_H |
---|
17 | #define CKUCMD_H |
---|
18 | |
---|
19 | /* Command recall */ |
---|
20 | |
---|
21 | #ifdef pdp11 /* Not enough room */ |
---|
22 | #ifndef NORECALL |
---|
23 | #define NORECALL |
---|
24 | #endif /* NORECALL */ |
---|
25 | #endif /* pdp11 */ |
---|
26 | |
---|
27 | #ifdef DYNAMIC /* Dynamic command buffers */ |
---|
28 | /* |
---|
29 | Use malloc() to allocate the many command-related buffers in ckucmd.c. |
---|
30 | */ |
---|
31 | #ifndef DCMDBUF |
---|
32 | #ifndef NORECALL |
---|
33 | #define NORECALL |
---|
34 | #endif /* NORECALL */ |
---|
35 | #endif /* DCMDBUF */ |
---|
36 | |
---|
37 | #ifndef NORECALL |
---|
38 | #define CK_RECALL |
---|
39 | #else |
---|
40 | #ifdef CK_RECALL |
---|
41 | #undef CK_RECALL |
---|
42 | #endif /* CK_RECALL */ |
---|
43 | #endif /* NORECALL */ |
---|
44 | #else |
---|
45 | #ifndef NORECALL |
---|
46 | #define NORECALL |
---|
47 | #endif /* NORECALL */ |
---|
48 | #endif /* DYNAMIC */ |
---|
49 | |
---|
50 | #ifdef NORECALL |
---|
51 | #ifdef CK_RECALL |
---|
52 | #undef CK_RECALL |
---|
53 | #endif /* CK_RECALL */ |
---|
54 | #endif /* NORECALL */ |
---|
55 | |
---|
56 | /* Special getchars */ |
---|
57 | |
---|
58 | #ifdef VMS |
---|
59 | #ifdef getchar /* This is for VMS GCC */ |
---|
60 | #undef getchar |
---|
61 | #endif /* getchar */ |
---|
62 | #define getchar() vms_getchar() |
---|
63 | int vms_getchar(void); |
---|
64 | #endif /* VMS */ |
---|
65 | |
---|
66 | #ifdef aegis |
---|
67 | #undef getchar |
---|
68 | #define getchar() coninc(0) |
---|
69 | #endif /* aegis */ |
---|
70 | |
---|
71 | #ifdef AMIGA |
---|
72 | #undef getchar |
---|
73 | #define getchar() coninc(0) |
---|
74 | #endif /* AMIGA */ |
---|
75 | |
---|
76 | #ifdef Plan9 |
---|
77 | #undef getchar |
---|
78 | #define getchar() coninc(0) |
---|
79 | #undef putchar |
---|
80 | #define putchar(c) conoc(c) |
---|
81 | #define printf conprint |
---|
82 | #endif /* Plan9 */ |
---|
83 | |
---|
84 | /* Sizes of things */ |
---|
85 | |
---|
86 | #ifndef CMDDEP |
---|
87 | #ifdef BIGBUFOK |
---|
88 | #define CMDDEP 64 /* Maximum command recursion depth */ |
---|
89 | #else |
---|
90 | #define CMDDEP 20 |
---|
91 | #endif /* BIGBUFOK */ |
---|
92 | #endif /* CMDDEP */ |
---|
93 | #define HLPLW 78 /* Width of ?-help line */ |
---|
94 | #define HLPCW 19 /* Width of ?-help column */ |
---|
95 | #define HLPBL 100 /* Help string buffer length */ |
---|
96 | #ifdef BIGBUFOK |
---|
97 | #define ATMBL 4072 /* Command atom buffer length*/ |
---|
98 | #else |
---|
99 | #ifdef NOSPL |
---|
100 | #define ATMBL 256 |
---|
101 | #else |
---|
102 | #define ATMBL 1024 |
---|
103 | #endif /* NOSPL */ |
---|
104 | #endif /* BIGBUFOK */ |
---|
105 | |
---|
106 | #ifndef CMDBL |
---|
107 | #ifdef NOSPL |
---|
108 | /* No script programming language, save some space */ |
---|
109 | #define CMDBL 512 /* Command buffer length */ |
---|
110 | #else |
---|
111 | #ifdef BIGBUFOK |
---|
112 | #define CMDBL 4072 /* Max size to fit in one page */ |
---|
113 | #else |
---|
114 | #define CMDBL 1024 /* Command buffer length */ |
---|
115 | #endif /* OS2 */ |
---|
116 | #endif /* NOSPL */ |
---|
117 | #endif /* CMDBL */ |
---|
118 | |
---|
119 | /* Special characters */ |
---|
120 | |
---|
121 | #define RDIS 0022 /* Redisplay (^R) */ |
---|
122 | #define LDEL 0025 /* Delete line (^U) */ |
---|
123 | #define WDEL 0027 /* Delete word (^W) */ |
---|
124 | #ifdef CK_RECALL |
---|
125 | #define C_UP 0020 /* Go Up in recall buffer (^P) */ |
---|
126 | #define C_UP2 0002 /* Alternate Go Up (^B) for VMS */ |
---|
127 | #define C_DN 0016 /* Go Down in recall buffer (^N) */ |
---|
128 | #endif /* CK_RECALL */ |
---|
129 | /* Keyword table flags */ |
---|
130 | |
---|
131 | #define CM_INV 1 /* Invisible keyword */ |
---|
132 | #define CM_ABR 2 /* Abbreviation */ |
---|
133 | |
---|
134 | /* Token flags */ |
---|
135 | |
---|
136 | #define CMT_COM 0 /* Comment (; or #) */ |
---|
137 | #define CMT_SHE 1 /* Shell escape (!) */ |
---|
138 | #define CMT_LBL 2 /* Label (:) */ |
---|
139 | #define CMT_FIL 3 /* Indirect filespec (@) */ |
---|
140 | |
---|
141 | /* Path separator for path searches */ |
---|
142 | |
---|
143 | #ifdef OS2 |
---|
144 | #define PATHSEP ';' |
---|
145 | #else |
---|
146 | #ifdef UNIX |
---|
147 | #define PATHSEP ':' |
---|
148 | #else |
---|
149 | #define PATHSEP ',' |
---|
150 | #endif /* UNIX */ |
---|
151 | #endif /* OS2 */ |
---|
152 | |
---|
153 | /* Keyword Table Template */ |
---|
154 | |
---|
155 | struct keytab { /* Keyword table */ |
---|
156 | char *kwd; /* Pointer to keyword string */ |
---|
157 | int kwval; /* Associated value */ |
---|
158 | int flgs; /* Flags (as defined above) */ |
---|
159 | }; |
---|
160 | |
---|
161 | /* Function prototypes */ |
---|
162 | |
---|
163 | #ifdef CK_ANSIC /* ANSI C */ |
---|
164 | #ifdef M_SYSV /* SCO Microsoft C wants no args */ |
---|
165 | typedef int (*xx_strp)(); |
---|
166 | #else |
---|
167 | typedef int (*xx_strp)(char *, char **, int *); |
---|
168 | #endif /* M_SYSV */ |
---|
169 | #else /* Not ANSI C */ |
---|
170 | typedef int (*xx_strp)(); |
---|
171 | #endif /* CK_ANSIC */ |
---|
172 | |
---|
173 | _PROTOTYP( int xxesc, (char **) ); |
---|
174 | _PROTOTYP( int cmrini, (int) ); |
---|
175 | _PROTOTYP( VOID cmsetp, (char *) ); |
---|
176 | _PROTOTYP( VOID cmsavp, (char [], int) ); |
---|
177 | _PROTOTYP( VOID prompt, (xx_strp) ); |
---|
178 | _PROTOTYP( VOID pushcmd, (void) ); |
---|
179 | _PROTOTYP( VOID cmres, (void) ); |
---|
180 | _PROTOTYP( VOID cmini, (int) ); |
---|
181 | _PROTOTYP( int cmpush, (void) ); |
---|
182 | _PROTOTYP( int cmpop, (void) ); |
---|
183 | _PROTOTYP( VOID untab, (char *) ); |
---|
184 | _PROTOTYP( int cmnum, (char *, char *, int, int *, xx_strp ) ); |
---|
185 | _PROTOTYP( int cmofi, (char *, char *, char **, xx_strp ) ); |
---|
186 | _PROTOTYP( int cmifi, (char *, char *, char **, int *, xx_strp ) ); |
---|
187 | _PROTOTYP( int cmifip,(char *, char *, char **, int *, int, char *, xx_strp )); |
---|
188 | _PROTOTYP( int cmifi2,(char *, char *, char **, int *, int, char *, xx_strp )); |
---|
189 | _PROTOTYP( int cmdir, (char *, char *, char **, xx_strp ) ); |
---|
190 | _PROTOTYP( int cmfld, (char *, char *, char **, xx_strp ) ); |
---|
191 | _PROTOTYP( int cmtxt, (char *, char *, char **, xx_strp ) ); |
---|
192 | _PROTOTYP( int cmkey, (struct keytab [], int, char *, char *, xx_strp) ); |
---|
193 | _PROTOTYP( int cmkeyx, (struct keytab [], int, char *, char *, xx_strp) ); |
---|
194 | _PROTOTYP( int cmkey2,(struct keytab [],int,char *,char *,char *,xx_strp,int)); |
---|
195 | _PROTOTYP( int chktok, (char *) ); |
---|
196 | _PROTOTYP( int cmcfm, (void) ); |
---|
197 | _PROTOTYP( int rdigits, (char *) ); |
---|
198 | _PROTOTYP( int chknum, (char *) ); |
---|
199 | _PROTOTYP( int lower, (char *) ); |
---|
200 | _PROTOTYP( int lookup, (struct keytab [], char *, int, int *) ); |
---|
201 | _PROTOTYP( VOID kwdhelp, (struct keytab[], int, char *, char *, char *, int) ); |
---|
202 | _PROTOTYP( int ungword, (void) ); |
---|
203 | _PROTOTYP( int cmdsquo, (int) ); |
---|
204 | _PROTOTYP( int cmdgquo, (void) ); |
---|
205 | |
---|
206 | #ifdef DCMDBUF |
---|
207 | _PROTOTYP( int cmsetup, (void) ); |
---|
208 | #endif /* DCMDBUF */ |
---|
209 | |
---|
210 | #endif /* CKUCMD_H */ |
---|
211 | |
---|
212 | /* End of ckucmd.h */ |
---|