-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckuusr.c
13586 lines (12652 loc) · 355 KB
/
ckuusr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifdef SSHTEST
#define SSHBUILTIN
#endif /* SSHTEST */
#include "ckcsym.h"
char *userv = "User Interface 9.0.314, 25 Apr 2017";
/* C K U U S R -- "User Interface" for C-Kermit (Part 1) */
/*
Authors:
Frank da Cruz <fdc@columbia.edu>,
The Kermit Project, New York City
Jeffrey E Altman <jaltman@secure-endpoints.com>
Secure Endpoints Inc., New York City
Copyright (C) 1985, 2017,
Trustees of Columbia University in the City of New York.
All rights reserved. See the C-Kermit COPYING.TXT file or the
copyright text in the ckcmai.c module for disclaimer and permissions.
*/
/*
Originally the entire user interface was in one module, ckuusr.c. Over
the years it has been split into many modules: ckuus2.c, ckuus3.c, ...,
ckuus7.c. ckuus2.c contains the HELP command parser and help-text strings;
ckuusy.c contains the UNIX-style command-line interface; ckuusx.c contains
routines needed by both the command-line interface and the interactive
command parser.
*/
/*
The ckuus*.c modules depend on the existence of C library features like
fopen, fgets, feof, (f)printf, argv/argc, etc. Other functions that are
likely to vary among different platforms -- like setting terminal modes or
interrupts -- are invoked via calls to functions that are defined in the
system- dependent modules, ck?[ft]io.c. The command line parser processes
any arguments found on the command line, as passed to main() via argv/argc.
The interactive parser uses the facilities of the cmd package (developed for
this program, but usable by any program). Any command parser may be
substituted for this one. The only requirements for the Kermit command
parser are these:
. Set parameters via global variables like duplex, speed, ttname, etc. See
ckcmai.c for the declarations and descriptions of these variables.
. If a command can be executed without the use of Kermit protocol, then
execute the command directly and set the variable sstate to 0. Examples
include 'set' commands, local directory listings, the 'connect' command.
. If a command requires the Kermit protocol, set the following variables:
sstate string data
'x' (enter server mode) (none)
'r' (send a 'get' command) cmarg, cmarg2
'v' (enter receive mode) cmarg2
'g' (send a generic command) cmarg
's' (send files) nfils, cmarg & cmarg2 OR cmlist
'c' (send a remote host command) cmarg
cmlist is an array of pointers to strings.
cmarg, cmarg2 are pointers to strings.
nfils is an integer.
cmarg can be a filename string (possibly wild), or
a pointer to a prefabricated generic command string, or
a pointer to a host command string.
cmarg2 is an "as-name" - the name to send file(s) under, or
the name under which to store incoming file(s); must not be wild.
A null or empty value means to use the file's own name.
cmlist is a list of filenames, such as passed via argv.
nfils is an integer, interpreted as follows:
-1: filespec (possibly wild) in cmarg, must be expanded internally.
0: send from stdin (standard input).
>0: number of files to send, from cmlist.
The screen() function is used to update the screen during file transfer.
The tlog() function writes to a transaction log.
The debug() function writes to a debugging log.
The intmsg() and chkint() functions provide the user i/o for interrupting
file transfers.
*/
/* Includes */
#ifdef MULTINET
#define MULTINET_OLD_STYLE /* Leave select prototype undefined */
#endif /* MULTINET */
#include "ckcdeb.h"
#include "ckcasc.h"
#include "ckcker.h"
#include "ckcnet.h" /* Network symbols */
#include "ckuusr.h"
#include "ckcxla.h"
int g_fncact = -1; /* Needed for NOICP builds */
int noinit = 0; /* Flag for skipping init file */
int nscanfile = SCANFILEBUF;
int rcdactive = 0; /* RCD active */
int keepallchars = 0; /* See cmfld() */
int locus = 1; /* Current LOCUS is LOCAL */
#ifdef OS2
int autolocus = 2; /* Automatic LOCUS switching: ASK */
#else /* OS2 */
int autolocus = 1; /* Automatic LOCUS switching enabled */
#endif /* OS2 */
#ifndef NOICP
#ifdef CKLEARN
#ifdef VMS
#include <time.h> /* For CKLEARN */
#endif /* VMS */
#endif /* CKLEARN */
#ifdef OS2
#ifndef NT
#define INCL_NOPM
#define INCL_VIO /* Needed for ckocon.h */
#include <os2.h>
#undef COMMENT
#else
#define APIRET ULONG
#include <windows.h>
#include <tapi.h>
#include "cknwin.h"
#include "ckntap.h" /* CK_TAPI definition */
#endif /* NT */
#include "ckowin.h"
#include "ckocon.h"
extern int tcp_avail;
extern bool viewonly;
extern int k95stdout;
extern int tt_scroll;
#ifndef NOTERM
extern tt_status[VNUM];
#endif /* NOTERM */
#include "ckossh.h"
#ifdef KUI
#include "ikui.h"
#endif /* KUI */
#endif /* OS2 */
int optlines = 0;
int didsetlin = 0;
#ifdef NEWFTP
extern int ftpget, ftpisopen(), doftpres();
_PROTOTYP(int doftptyp,(int));
_PROTOTYP(VOID doftpglobaltype,(int));
#endif /* NEWFTP */
#ifdef VMS
extern int batch;
#endif /* VMS */
#ifdef datageneral
#include <packets:common.h>
#define fgets(stringbuf,max,fd) dg_fgets(stringbuf,max,fd)
#endif /* datageneral */
extern int xcmdsrc, hints, cmflgs, whyclosed;
int isinternal = 0; /* Flag for internally-defined macro */
char * hlptok = NULL;
#ifdef CK_TTGWSIZ /* Whether to use more-prompting */
int xaskmore = 1; /* Momentary setting */
int saveask = 1; /* Permanent setting */
#else
int xaskmore = 0;
int saveask = 0;
#endif /* CK_TTGWSIZ */
#ifndef NOCSETS
extern int nfilc;
extern struct keytab fcstab[];
extern int fcharset;
#endif /* NOCSETS */
char * g_pswd = NULL;
int g_pcpt = -1;
int g_pflg = -1;
extern int cmd_rows, cmd_cols;
#ifdef CKROOT
extern int ckrooterr;
#endif /* CKROOT */
extern int inserver, filepeek;
#ifdef CKLEARN
FILE * learnfp = NULL;
char * learnfile = NULL;
int learning = 0;
#endif /* CKLEARN */
#ifndef NOXFER
extern int atcapr, atdiso, nfils, moving, protocol, sendmode, epktflg, size,
sndsrc, server, displa, fncnv, fnspath, fnrpath, xfermode, urpsiz,
spsizf, spsiz, spsizr, spmax, wslotr, prefixing, fncact, reliable,
setreliable;
#ifdef IKSDCONF
extern int iksdcf;
#endif /* IKSDCONF */
#ifdef CK_LOGIN
extern int isguest;
#endif /* CK_LOGIN */
extern CK_OFF_T sendstart;
extern char *cmarg, *cmarg2, **cmlist, *dftty;
extern struct keytab fntab[]; extern int nfntab;
extern struct ck_p ptab[NPROTOS];
int sndcmd = 0; /* Last command was a SEND-class command. */
int g_xfermode = -1;
int g_proto = -1;
int g_urpsiz = -1;
int g_spsizf = -1;
int g_spsiz = -1;
int g_spsizr = -1;
int g_spmax = -1;
int g_wslotr = -1;
int g_prefixing = -1;
int g_fncnv = -1;
int g_fnspath = -1;
int g_fnrpath = -1;
int g_fnact = -1;
int g_displa = -1;
int g_spath = -1;
int g_rpath = -1;
char * g_sfilter = NULL;
char * g_rfilter = NULL;
extern int patterns;
#ifdef PATTERNS
extern char *txtpatterns[], *binpatterns[];
int g_patterns = -1;
#endif /* PATTERNS */
int g_skipbup = -1;
#ifdef PIPESEND
extern int usepipes, pipesend;
extern char * sndfilter;
#endif /* PIPESEND */
#ifndef NOSPL
extern int sndxlo, sndxhi, sndxin;
#endif /* NOSPL */
extern char fspec[]; /* Most recent filespec */
extern int fspeclen; /* Length of fspec[] buffer */
#ifndef NOFRILLS
extern int rmailf; /* MAIL command items */
extern char optbuf[];
#endif /* NOFRILLS */
extern int
en_cpy, en_cwd, en_del, en_dir, en_fin, en_get, en_bye, en_mai, en_pri,
en_hos, en_ren, en_sen, en_spa, en_set, en_typ, en_who, en_ret, en_xit,
en_mkd, en_rmd, en_asg;
#ifndef NOMSEND /* Multiple SEND */
extern char *msfiles[];
int filesinlist = 0; /* And ADD ... */
extern struct filelist * filehead;
extern struct filelist * filetail;
extern struct filelist * filenext;
extern int addlist;
#endif /* NOMSEND */
static struct keytab addtab[] = {
#ifdef PATTERNS
{ "binary-patterns", ADD_BIN, 0 },
#endif /* PATTERNS */
#ifndef NOMSEND
{ "send-list", ADD_SND, 0 },
#endif /* NOMSEND */
#ifdef PATTERNS
{ "text-patterns", ADD_TXT, 0 },
#endif /* PATTERNS */
{ "", 0, 0 }
};
static int naddtab = sizeof(addtab)/sizeof(struct keytab) - 1;
#ifndef NOCSETS
struct keytab assoctab[] = {
{ "file-character-set", ASSOC_FC, 0 },
{ "transfer-character-set", ASSOC_TC, 0 },
{ "xfer-character-set", ASSOC_TC, CM_INV }
};
static int nassoc = sizeof(assoctab)/sizeof(struct keytab);
extern int afcset[MAXFCSETS+1]; /* Character-set associations */
extern int axcset[MAXTCSETS+1];
#endif /* NOCSETS */
#ifndef ADDCMD
#ifndef NOMSEND
#define ADDCMD
#endif /* NOMSEND */
#ifndef ADDCMD
#ifdef PATTERNS
#define ADDCMD
#endif /* PATTERNS */
#endif /* ADDCMD */
#endif /* ADDCMD */
#endif /* NOXFER */
/* External Kermit Variables, see ckmain.c for description. */
extern xx_strp xxstring;
extern long xvernum;
extern int local, xitsta, binary, msgflg, escape, duplex, quiet, tlevel,
pflag, zincnt, ckxech, carrier, what, nopush, haveline, bye_active;
#ifdef TNCODE
extern int debses;
extern char tn_msg[];
#endif /* TNCODE */
int sleepcan = 1;
int g_binary = -1;
int g_recursive = -1;
int g_matchdot = -1;
extern int nolinks;
extern long vernum;
extern char *versio, *copyright[];
extern char *ckxsys;
#ifndef NOHELP
extern char *introtxt[];
extern char *newstxt[];
#endif /* NOHELP */
#ifndef OS2
#ifndef UNIX
extern char *PWDCMD;
#endif /* UNIX */
extern char *WHOCMD;
#endif /* OS2 */
extern char ttname[];
extern CHAR sstate;
extern int network; /* Have active network connection */
extern int nettype; /* Type of network */
extern int ttnproto; /* NET_TCPB protocol */
#ifndef NODIAL
extern int dialsta, dialatmo, dialcon, dialcq; /* DIAL status, etc. */
#endif /* NODIAL */
#ifdef CK_APC
extern int apcactive, apcstatus;
#endif /* CK_APC */
#ifndef NOPUSH
#ifndef NOFRILLS
extern char editor[];
extern char editopts[];
extern char editfile[];
#endif /* NOFRILLS */
#endif /* NOPUSH */
#ifdef BROWSER
extern char browser[]; /* Web browser application */
extern char browsopts[]; /* Web browser options */
extern char browsurl[]; /* Most recent URL */
#endif /* BROWSER */
#ifndef NOFTP
char ftpapp[CKMAXPATH+1] = { NUL, NUL }; /* ftp executable */
char ftpopts[128] = { NUL, NUL }; /* ftp command-line options */
#endif /* NOFTP */
extern struct keytab onoff[]; /* On/Off keyword table */
#ifdef CK_TMPDIR
int f_tmpdir = 0; /* Directory changed temporarily */
char savdir[TMPDIRLEN]; /* For saving current directory */
#endif /* CK_TMPDIR */
int activecmd = -1; /* Keyword index of active command */
int doconx = -1; /* CONNECT-class command active */
int ooflag = 0; /* User-settable on/off flag */
int rcflag = 0; /* Pointer to home directory string */
int repars, /* Reparse needed */
techo = 0; /* Take echo */
int secho = 1; /* SCRIPT echo */
int xitwarn = /* Warn about open connection on exit */
#ifdef NOWARN
0
#else
1
#endif /* NOWARN */
;
struct keytab onoffsw[] = {
{ "/off", 0, 0 },
{ "/on", 1, 0 }
};
#ifdef CKEXEC
struct keytab redirsw[] = {
{ "/redirect", 1, 0 }
};
#endif /* CKEXEC */
#ifndef NOXMIT
/* Variables for TRANSMIT command */
int xmitx = 1; /* Whether to echo during TRANSMIT */
int xmitf = 0; /* Character to fill empty lines */
int xmitl = 0; /* 0 = Don't send linefeed too */
int xmitp = LF; /* Host line prompt */
int xmits = 0; /* Use shift-in/shift-out, 0 = no */
int xmitw = 0; /* Milliseconds to pause during TRANSMIT */
int xmitt = 1; /* Seconds to wait for each char to echo */
int xmita = 1; /* Action upon timeout */
#define XMI_BIN 1
#define XMI_TXT 2
#define XMI_CMD 3
#define XMI_TRA 4
#define XMI_VRB 5
#define XMI_QUI 6
#define XMI_NOW 7
#define XMI_NOE 8
static struct keytab xmitsw[] = { /* TRANSMIT command options */
{ "/binary", XMI_BIN, 0 },
#ifdef PIPESEND
{ "/command", XMI_CMD, CM_INV|CM_PSH },
#endif /* PIPESEND */
{ "/noecho", XMI_NOE, 0 },
{ "/nowait", XMI_NOW, 0 },
#ifdef PIPESEND
{ "/pipe", XMI_CMD, 0 },
#endif /* PIPESEND */
#ifdef COMMENT
{ "/quiet", XMI_QUI, 0 },
#endif /* COMMENT */
{ "/text", XMI_TXT, 0 },
{ "/transparent", XMI_TRA, 0 },
#ifdef COMMENT
{ "/verbose", XMI_VRB, 0 },
#endif /* COMMENT */
{ "", 0, 0 }
};
#define NXMITSW sizeof(xmitsw)/sizeof(struct keytab) - 1
static int nxmitsw = NXMITSW;
#endif /* NOXMIT */
/* Declarations from ck?fio.c module */
extern char *SPACMD, *SPACM2; /* SPACE commands */
/* Command-oriented items */
#ifdef DCMDBUF
extern char *cmdbuf; /* Command buffers */
extern char *atmbuf;
extern char *line; /* Character buffer for anything */
extern char *tmpbuf; /* Short temporary string buffer */
extern int *ifcmd;
extern int *intime;
extern int *inpcas;
#else
extern char cmdbuf[]; /* Command buffers */
extern char atmbuf[];
extern char line[]; /* Character buffer for anything */
extern char tmpbuf[]; /* Temporary buffer */
extern int ifcmd[];
extern int intime[];
extern int inpcas[];
#endif /* DCMDBUF */
#ifndef NOSPL
extern char * prstring[];
#endif /* NOSPL */
char *lp; /* Pointer to line buffer */
#ifndef NOSPL
int vareval = 1; /* Evaluation method */
int unkmacro = 0; /* Flag for in ON_UNKNOWN_COMMAND */
int oldeval = 0;
char evalbuf[33]; /* EVALUATE result */
extern char * inpbuf; /* Buffer for INPUT and REINPUT */
char *inpbp; /* And pointer to same */
int m_found; /* MINPUT result */
int i_active = 0; /* INPUT command is active */
char *ms[MINPMAX]; /* Pointers to MINPUT strings */
static int mpinited = 0; /* Flag they have been initialized */
static int mp[MINPMAX]; /* and MINPUT flags */
extern int fndiags, fnerror, fnsuccess; /* Function diagnostics */
#ifndef NOSEXP
char * lastsexp = NULL; /* S-Expressions */
char * sexpval = NULL;
int sexpecho = SET_AUTO;
#endif /* NOSEXP */
#endif /* NOSPL */
char psave[PROMPTL] = { NUL }; /* For saving & restoring prompt */
extern int success; /* Command success/failure flag */
extern int cmdlvl; /* Current position in command stack */
#ifndef NOSPL
int /* SET INPUT parameters. */
/* Note, INPUT TIMEOUT, intime[], is on the command-level stack. */
inbufsize = 0, /* INPUT buffer size */
indef = 1, /* default timeout, seconds */
inecho = 1, /* 1 = echo on */
inautodl = 0, /* INPUT autodownload */
inintr = 1, /* INPUT interrupion allowed */
insilence = 0; /* 0 = no silence constraint */
#ifdef CKFLOAT
CKFLOAT inscale = 1.0; /* Timeout scale factor */
#endif /* CKFLOAT */
#ifdef OS2
int interm = 1; /* Terminal emulator displays input */
#endif /* OS2 */
int maclvl = -1; /* Macro nesting level */
int mecho = 0; /* Macro echo, 0 = don't */
char varnam[6]; /* For variable names */
extern int macargc[]; /* ARGC from macro invocation */
extern char *m_arg[MACLEVEL][NARGS]; /* Stack of macro arguments */
extern char *mrval[];
extern char **a_ptr[]; /* Array pointers */
extern int a_dim[]; /* Array dimensions */
extern int a_link[];
#ifdef DCMDBUF
extern struct cmdptr *cmdstk; /* The command stack itself */
#else
extern struct cmdptr cmdstk[]; /* The command stack itself */
#endif /* DCMDBUF */
long ck_alarm = 0; /* SET ALARM value */
char alrm_date[24] = { ' ',' ',' ',' ',' ',' ',' ',' ',' ' };
char alrm_time[24] = { ' ',' ',' ',' ',' ',' ',' ' };
struct keytab inputsw[] = {
{ "/clear", INPSW_CLR, 0 },
{ "/count", INPSW_COU, CM_ARG },
{ "/nomatch", INPSW_NOM, 0 },
{ "/nowrap", INPSW_NOW, 0 }
};
static int ninputsw = sizeof(inputsw)/sizeof(struct keytab);
/* The following should be reconciled with the above */
#ifdef COMMENT /* INPUT switches not used yet... */
static struct keytab inswtab[] = {
#ifdef COMMENT
{ "/assign", IN_ASG, CM_ARG },
#endif /* COMMENT */
{ "/autodownload", IN_ADL, CM_ARG },
{ "/case", IN_CAS, CM_ARG },
{ "/echo", IN_ECH, CM_ARG },
{ "/interrupts", IN_NOI, CM_ARG },
{ "/silence", IN_SIL, CM_ARG },
#ifdef COMMENT
{ "/pattern", IN_PAT, CM_ARG },
#endif /* COMMENT */
{ "", 0, 0 }
};
static int ninswtab = (sizeof(inswtab) / sizeof(struct keytab)) - 1;
#endif /* COMMENT */
#endif /* NOSPL */
static int x, y, z = 0; /* Local workers */
static char *s;
#ifdef CK_MINPUT
static char c1chars[] = { /* C1 control chars escept NUL */
001,002,003,004,005,006,007,010,011,012,013,014,015,016,017,020,
021,022,023,024,025,026,027,030,031,032,033,034,035,036,037
};
#endif /* CK_MINPUT */
#define xsystem(s) zsyscmd(s)
/* Top-Level Interactive Command Keyword Table */
/* Keywords must be in lowercase and in alphabetical order. */
struct keytab cmdtab[] = {
#ifndef NOPUSH
{ "!", XXSHE, CM_INV|CM_PSH }, /* Shell escape */
#else
{ "!", XXNOTAV, CM_INV|CM_PSH },
#endif /* NOPUSH */
{ "#", XXCOM, CM_INV }, /* Comment */
#ifndef NOSPL
{ "(", XXSEXP,CM_INV }, /* S-Expression */
{ ".", XXDEF, CM_INV }, /* Assignment */
{ ":", XXLBL, CM_INV }, /* Label */
#endif /* NOSPL */
#ifdef CK_REDIR
#ifndef NOPUSH
{ "<", XXFUN, CM_INV|CM_PSH }, /* REDIRECT */
#else
{ "<", XXNOTAV, CM_INV|CM_PSH }, /* REDIRECT */
#endif /* NOPUSH */
#endif /* CK_REDIR */
#ifndef NOPUSH
{ "@", XXSHE, CM_INV|CM_PSH }, /* DCL escape */
#else
{ "@", XXNOTAV, CM_INV|CM_PSH }, /* DCL escape */
#endif /* NOPUSH */
#ifdef CK_RECALL
{ "^", XXREDO,CM_INV|CM_NOR }, /* Synonym for REDO */
#endif /* CK_RECALL */
#ifndef NOSPL
{ "_asg", XXASX, CM_INV }, /* Used internally by FOR, etc */
{ "_assign", XXASX, CM_INV }, /* Used internally by FOR, etc */
{ "_decrement", XX_DECR, CM_INV },
{ "_define", XXDFX, CM_INV }, /* Used internally by FOR, etc */
{ "_evaluate", XX_EVAL, CM_INV },
{ "_forward", XXXFWD, CM_INV }, /* Used internally by SWITCH */
{ "_getargs", XXGTA, CM_INV }, /* Used internally by FOR, etc */
{ "_increment", XX_INCR, CM_INV },
{ "_putargs", XXPTA, CM_INV }, /* Used internally by FOR, etc */
{ "_undefine", XXUNDFX, CM_INV },
#endif /* NOSPL */
{ "about", XXVER, CM_INV }, /* Synonym for VERSION */
#ifndef NOSPL
#ifdef NEWFTP
{ "account", XXACCT, CM_INV }, /* (FTP) Account */
#endif /* NEWFTP */
#ifdef ADDCMD
{ "add", XXADD, 0 }, /* ADD */
#endif /* ADDCMD */
#ifndef NODIAL
{ "answer", XXANSW, CM_LOC }, /* ANSWER the phone */
#else
{ "answer", XXNOTAV, CM_INV|CM_LOC }, /* ANSWER the phone */
#endif /* NODIAL */
{ "apc", XXAPC, 0 }, /* Application Program Command */
#ifndef NOSPL
{ "array", XXARRAY, 0 }, /* Array operations */
#endif /* NOSPL */
{ "ascii", XXASC, CM_INV }, /* == SET FILE TYPE TEXT */
{ "asg", XXASS, CM_INV }, /* Invisible synonym for ASSIGN */
{ "ask", XXASK, 0 }, /* ASK for text, assign to variable */
{ "askq", XXASKQ,0 }, /* ASK quietly (no echo) */
#ifndef NOSPL
{ "ass", XXASS, CM_INV|CM_ABR }, /* ASSIGN */
{ "assert", XXASSER, CM_INV }, /* ASSERT */
{ "assign", XXASS, 0 }, /* ASSIGN */
#endif /* NOSPL */
#ifndef NOXFER
#ifndef NOCSETS
{ "associate", XXASSOC, 0 }, /* ASSOCIATE */
#else
{ "associate", XXNOTAV, CM_INV }, /* ASSOCIATE */
#endif /* NOCSETS */
#endif /* NOXFER */
#ifdef CK_KERBEROS
#ifdef CK_AUTHENTICATION
{ "authenticate",XXAUTH, 0 }, /* Authentication */
#else
{ "authenticate",XXAUTH, CM_INV },
#endif /* CK_AUTHENTICATION */
#endif /* CK_KERBEROS */
#endif /* NOSPL */
#ifndef NOFRILLS
{ "back", XXBACK, 0 }, /* BACK to previous directory */
#else
{ "back", XXNOTAV,CM_INV },
#endif /* NOFRILLS */
{ "beep", XXBEEP,CM_INV }, /* BEEP */
#ifndef NOXFER
{ "binary", XXBIN, CM_INV }, /* == SET FILE TYPE BINARY */
#endif /* NOXFER */
#ifndef NOFRILLS
{ "bug", XXBUG, CM_INV }, /* BUG report instructions */
#else
{ "bug", XXNOTAV, CM_INV },
#endif /* NOFRILLS */
#ifdef BROWSER
{ "browse", XXBROWS, CM_PSH|CM_LOC }, /* BROWSE (start browser) */
#else
{ "browse", XXNOTAV, CM_INV|CM_PSH|CM_LOC },
#endif /* BROWSER */
#ifndef NOXFER
{ "bye", XXBYE, 0 }, /* BYE to remote server */
#endif /* NOXFER */
#ifndef NOLOCAL
{ "c", XXCON, CM_INV|CM_ABR|CM_LOC }, /* (CONNECT) */
#endif /* NOLOCAL */
#ifndef NOFRILLS
{ "cat", XXCAT, CM_INV }, /* Invisible synonym for TYPE */
#endif /* NOFRILLS */
#ifndef NOSPL
#ifndef NOXFER
{ "cautious", XXCAU, CM_INV },
#endif /* NOXFER */
#endif /* NOSPL */
{ "cd", XXCWD, 0 }, /* Change Directory */
{ "cdup", XXCDUP, CM_INV }, /* Change Directory Up */
#ifndef NOXFER
#ifdef PIPESEND
{ "cget", XXCGET, CM_INV|CM_PSH }, /* CGET */
#else
{ "cget", XXNOTAV, CM_INV|CM_PSH }, /* CGET */
#endif /* PIPESEND */
#endif /* NOXFER */
{ "ch", XXCHK, CM_INV|CM_ABR },
{ "change", XXCHG, 0 }, /* CHANGE strings in file 2013-04-18 */
{ "check", XXCHK, 0 }, /* CHECK for a feature */
#ifdef CK_PERMS
#ifdef UNIX
{ "chmod", XXCHMOD, 0 }, /* CHMOD */
#else
{ "chmod", XXNOTAV, CM_INV },
#endif /* UNIX */
#else
{ "chmod", XXNOTAV, CM_INV },
#endif /* CK_PERMS */
#ifdef CKROOT
{ "chroot", XXCHRT, CM_INV }, /* CHROOT */
#endif /* CKROOT */
{ "ckermit", XXKERMI, CM_INV }, /* CKERMIT (like KERMIT) */
{ "cl", XXCLO, CM_ABR|CM_INV },
#ifndef NOFRILLS
{ "clear", XXCLE, 0 }, /* CLEAR input and/or device buffer */
#else
{ "clear", XXNOTAV, CM_INV },
#endif /* NOFRILLS */
{ "close", XXCLO, 0 }, /* CLOSE a log or other file */
{ "cls", XXCLS, CM_INV }, /* Clear Screen (CLS) */
{ "comment", XXCOM, CM_INV }, /* Introduce a comment */
#ifndef NOLOCAL
{ "connect", XXCON, CM_LOC }, /* Begin terminal connection */
#else
{ "connect", XXNOTAV, CM_LOC },
#endif /* NOLOCAL */
{ "continue", XXCONT, CM_INV }, /* CONTINUE */
#ifndef NOFRILLS
#ifdef ZCOPY
{ "co", XXCPY, CM_INV|CM_ABR },
{ "cop", XXCPY, CM_INV|CM_ABR },
{ "copy", XXCPY, 0 }, /* COPY a file */
#else
{ "copy", XXNOTAV, CM_INV },
#endif /* ZCOPY */
{ "copyright", XXCPR, CM_INV }, /* COPYRIGHT */
#ifdef ZCOPY
{ "cp", XXCPY, CM_INV }, /* COPY a file */
#endif /* ZCOPY */
#ifndef NOLOCAL
#ifndef OS2
{ "cq", XXCQ, CM_INV|CM_LOC }, /* CQ (connect quietly) */
#endif /* OS2 */
#endif /* NOLOCAL */
#ifndef NOXFER
#ifdef PIPESEND
{ "creceive", XXCREC,CM_INV|CM_PSH }, /* RECEIVE to a command */
{ "csend", XXCSEN,CM_INV|CM_PSH }, /* SEND from command */
#else
{ "creceive", XXNOTAV,CM_INV|CM_PSH },
{ "csend", XXNOTAV,CM_INV|CM_PSH },
#endif /* PIPESEND */
#endif /* NOXFER */
#endif /* NOFRILLS */
{ "cwd", XXCWD, CM_INV }, /* Traditional synonym for cd */
#ifndef NOSPL
{ "date", XXDATE, 0 }, /* DATE */
{ "dcl", XXDCL, CM_INV }, /* DECLARE an array (see ARRAY) */
{ "debug", XXDEBUG, 0 }, /* Print a debugging msg [9.0] */
{ "declare", XXDCL, CM_INV }, /* DECLARE an array (see ARRAY) */
{ "decrement", XXDEC, 0 }, /* DECREMENT a numeric variable */
{ "define", XXDEF, 0 }, /* DEFINE a macro or variable */
#else
{ "date", XXNOTAV, CM_INV },
{ "dcl", XXNOTAV, CM_INV },
{ "declare", XXNOTAV, CM_INV },
{ "decrement", XXNOTAV, CM_INV },
{ "define", XXNOTAV, CM_INV },
#endif /* NOSPL */
#ifndef NOFRILLS
{ "delete", XXDEL, 0 }, /* DELETE a file */
#else
{ "delete", XXNOTAV, CM_INV },
#endif /* NOFRILLS */
#ifndef NODIAL
{ "dial", XXDIAL, CM_LOC }, /* DIAL a phone number */
#else
{ "dial", XXNOTAV, CM_INV|CM_LOC },
#endif /* NODIAL */
#ifdef NT
{ "dialer", XXDIALER, CM_INV }, /* K95 Dialer */
#endif /* NT */
{ "directory", XXDIR, 0 }, /* DIRECTORY of files */
#ifndef NOFRILLS
#ifndef NOSERVER
{ "disable", XXDIS, 0 }, /* DISABLE a server function */
#else
{ "disable", XXNOTAV, CM_INV },
#endif /* NOSERVER */
#endif /* NOFRILLS */
#ifndef NOSPL
{ "do", XXDO, 0 }, /* DO (execute) a macro */
#else
{ "do", XXNOTAV, CM_INV },
#endif /* NOSPL */
{ "e", XXEXI, CM_INV|CM_ABR },
#ifndef NOFRILLS
#ifndef NOXFER
{ "e-packet", XXERR, CM_INV }, /* Send an Error-Packet */
#endif /* NOXFER */
#endif /* NOFRILLS */
{ "echo", XXECH, 0 }, /* ECHO text */
#ifndef NOFRILLS
#ifndef NOPUSH
{ "edit", XXEDIT, CM_PSH }, /* EDIT */
#else
{ "edit", XXNOTAV, CM_INV|CM_PSH }, /* EDIT */
#endif /* NOPUSH */
#endif /* NOFRILLS */
{ "eightbit", XXEIGHT, CM_INV }, /* EIGHTBIT */
#ifndef NOSPL
{ "else", XXELS, CM_INV }, /* ELSE part of IF statement */
#else
{ "else", XXNOTAV, CM_INV }, /* ELSE part of IF statement */
#endif /* NOSPL */
#ifndef NOSERVER
#ifndef NOFRILLS
{ "enable", XXENA, 0 }, /* ENABLE a server function */
#else
{ "enable", XXNOTAV, CM_INV },
#endif /* NOFRILLS */
#endif /* NOSERVER */
#ifndef NOSPL
{ "end", XXEND, 0 }, /* END command file or macro */
#else
{ "end", XXNOTAV, CM_INV },
#endif /* NOSPL */
{ "erase", XXDEL, CM_INV }, /* Synonym for DELETE */
#ifndef NOSPL
{ "evaluate", XXEVAL, 0 }, /* EVALUATE */
#else
{ "evaluate", XXNOTAV, CM_INV },
#endif /* NOSPL */
{ "ex", XXEXI, CM_INV|CM_ABR }, /* Let "ex" still be EXIT */
#ifdef CKEXEC
{ "exec", XXEXEC, CM_INV|CM_LOC }, /* exec() */
#else
{ "exec", XXNOTAV, CM_INV|CM_LOC },
#endif /* CKEXEC */
{ "exit", XXEXI, 0 }, /* EXIT from C-Kermit */
{ "extended-options", XXXOPTS,CM_INV|CM_HLP }, /* Extended-Options */
#ifdef OS2
{ "extproc", XXCOM, CM_INV }, /* Dummy command for OS/2 */
#endif /* OS2 */
#ifndef NOXFER
{ "f", XXFIN, CM_INV|CM_ABR }, /* Invisible abbrev for FIN */
#endif /* NOXFER */
#ifndef NOSPL
{ "fail", XXFAIL, CM_INV }, /* FAIL */
#ifndef NOXFER
{ "fast", XXFAST, CM_INV },
#endif /* NOXFER */
#ifdef CKCHANNELIO
{ "fclose", XXF_CL, CM_INV }, /* FCLOSE */
{ "fcount", XXF_CO, CM_INV }, /* FCOUNT */
{ "fflush", XXF_FL, CM_INV }, /* FFLUSH */
#endif /* CKCHANNELIO */
#ifndef NOXFER
{ "fi", XXFIN, CM_INV|CM_ABR }, /* FINISH */
#endif /* NOXFER */
#ifdef CKCHANNELIO
{ "file", XXFILE, 0 }, /* FILE */
#endif /* CKCHANNELIO */
#endif /* NOSPL */
#ifndef NOXFER
{ "fin", XXFIN, CM_INV|CM_ABR }, /* FINISH */
#endif /* NOXFER */
#ifndef UNIXOROSK
{ "find", XXGREP, 0 }, /* FIND (grep) */
#else
{ "find", XXGREP,CM_INV },
#endif /* UNIXOROSK */
#ifndef NOXFER
{ "finish", XXFIN, 0 }, /* FINISH */
#endif /* NOXFER */
#ifdef TCPSOCKET
{ "firewall", XXFIREW, CM_INV|CM_HLP },
#endif /* TCPSOCKET */
#ifdef CKCHANNELIO
{ "flist", XXF_LI, CM_INV }, /* FLIST */
{ "fopen", XXF_OP, CM_INV }, /* FOPEN */
#endif /* CKCHANNELIO */
#ifndef NOSPL
{ "fo", XXFOR, CM_INV|CM_ABR }, /* Invisible abbrev for... */
{ "for", XXFOR, 0 }, /* FOR loop */
{ "forward", XXFWD, CM_INV }, /* FORWARD */
#endif /* NOSPL */
#ifndef NOFRILLS
{ "fot", XXDIR, CM_INV }, /* "fot" = "dir" (for Chris) */
#endif /* NOFRILLS */
#ifdef CKCHANNELIO
{ "fread", XXF_RE, CM_INV }, /* FREAD */
{ "frewind", XXF_RW, CM_INV }, /* FREWIND */
{ "fseek", XXF_SE, CM_INV }, /* FSEEK */
{ "fstatus", XXF_ST, CM_INV }, /* FSTATUS */
#endif /* CKCHANNELIO */
#ifdef TCPSOCKET
#ifndef NOFTP
#ifdef SYSFTP
#ifndef NOPUSH
{ "ftp", XXFTP, CM_INV|CM_PSH|CM_LOC }, /* System FTP */
#else
{ "ftp", XXNOTAV, CM_INV|CM_PSH|CM_LOC },
#endif /* NOPUSH */
#else /* SYSFTP */
{ "ftp", XXFTP, 0 }, /* Built-in FTP */
#endif /* SYSFTP */
#else /* NOFTP */
{ "ftp", XXNOTAV, CM_INV }, /* No FTP */
#endif /* NOFTP */
#endif /* TCPSOCKET */
#ifndef NOSPL
{ "function", XXFUNC, CM_INV|CM_HLP }, /* (for HELP FUNCTION) */
#endif /* NOSPL */
#ifdef CKCHANNELIO
{ "fwrite", XXF_WR, CM_INV }, /* FWRITE */
#endif /* CKCHANNELIO */
#ifndef NOXFER
{ "g", XXGET, CM_INV|CM_ABR }, /* Invisible abbrev for GET */
#ifndef NOSPL
{ "ge", XXGET, CM_INV|CM_ABR }, /* Ditto */
#endif /* NOSPL */
{ "get", XXGET, 0 }, /* GET */
#endif /* NOXFER */
#ifndef NOSPL