-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckuus4.c
15914 lines (14928 loc) · 512 KB
/
ckuus4.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
#include "ckcsym.h"
/* C K U U S 4 -- "User Interface" for C-Kermit, part 4 */
/*
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, 2020,
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.
Last update:
Fri Sep 18 14:54:00 2020
*/
/*
File ckuus4.c -- Functions moved from other ckuus*.c modules to even
out their sizes.
*/
#include "ckcdeb.h"
#include "ckcasc.h"
#include "ckcker.h"
#include "ckcnet.h" /* Network symbols */
#include "ckuusr.h"
#include "ckuver.h"
#include "ckcxla.h" /* Character sets */
#ifdef HAVE_LOCALE
#include <locale.h>
#endif /* HAVE_LOCALE */
#ifdef CK_AUTHENTICATION
#include "ckuath.h"
#endif /* CK_AUTHENTICATION */
#ifdef CK_SSL
#include "ck_ssl.h"
#endif /* CK_SSL */
#ifdef VMS
#include <errno.h> /* For \v(errno) */
extern char * ckvmserrstr(unsigned long);
#ifndef OLD_VMS
#include <lib$routines.h> /* Not for VAX C 2.4 */
#else
#include <libdef.h>
#endif /* OLD_VMS */
_PROTOTYP(int vmsttyfd, (void) );
#endif /* VMS */
#ifdef OS2
#ifndef NT
#define INCL_NOPM
#define INCL_VIO /* Needed for ckocon.h */
#include <os2.h>
#undef COMMENT
#else
#include <windows.h>
#include <tapi.h>
#include "ckntap.h"
#define APIRET ULONG
#endif /* NT */
#include "ckocon.h"
#include "ckodir.h" /* [jt] 2013/11/21 - for MAXPATHLEN */
#include "ckoetc.h"
int StartedFromDialer = 0;
HWND hwndDialer = 0;
LONG KermitDialerID = 0;
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(x) conoc(x)
#ifdef CK_PID
#include <process.h>
#endif /* CK_PID */
#endif /* OS2 */
#ifdef KUI
extern struct keytab * term_font;
extern int ntermfont, tt_font, tt_font_size;
#endif /* KUI */
extern xx_strp xxstring;
#ifdef DEC_TCPIP
#include <descrip>
#include <dvidef>
#include <dcdef>
#endif /* DEC_TCPIP */
#ifndef NOICP
extern char *tfnam[];
extern int tlevel;
#endif /* NOICP */
#ifdef FNFLOAT
#include <math.h> /* Floating-point functions */
#endif /* FNFLOAT */
int fp_rounding = 0; /* Nonzero if printf("%f") rounds */
int fp_digits = 0; /* Digits of floating point precision */
extern int quiet, network, xitsta, escape, nopush, xferstat,
exitonclose, tn_exit, ttnproto, autodl, flow, byteorder, what, lastxfer;
extern int filepeek, nscanfile, makestrlen;
extern char * k_info_dir;
#ifndef MAC
#ifndef AMIGA
extern int ttyfd;
#endif /* MAC */
#endif /* AMIGA */
#ifdef TNCODE
extern int tn_nlm, tn_b_nlm, tn_b_xfer, tn_sb_bug;
extern int tn_rem_echo;
extern int tn_b_meu, tn_b_ume, tn_auth_krb5_des_bug;
#endif /* TNCODE */
static char * lastkwval = NULL;
char * xferfile = NULL;
int xferlog = 0;
extern int local, xargc, stayflg, rcflag, bgset, backgrd, cfilef,
inserver, srvcdmsg, success;
#ifdef VMS
extern int batch;
#endif /* VMS */
extern char cmdfil[], *versio, *ckxsys, **xargv;
extern char lasttakeline[];
#ifdef DEBUG
extern char debfil[]; /* Debug log file name */
extern int debtim;
#endif /* DEBUG */
extern int noinit;
static char ndatbuf[10];
char *months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
char *
zzndate() { /* Returns today's date as yyyymmdd */
char * p = NULL;
int x;
/* WARNING - This will fail if asctime() returns non-English month names */
ztime(&p); /* Get "asctime" string */
if (p == NULL || *p == NUL) return("");
for (x = 20; x < 24; x++) /* yyyy */
ndatbuf[x - 20] = p[x];
ndatbuf[6] = (char) ((p[8] == ' ') ? '0' : p[8]);
ndatbuf[7] = p[9]; /* dd */
for (x = 0; x < 12; x++) /* mm */
if (!strncmp(p+4,months[x],3)) break;
if (x == 12) {
ndatbuf[4] = ndatbuf[5] = '?';
} else {
x++;
ndatbuf[4] = (char) ((x < 10) ? '0' : '1');
ndatbuf[5] = (char) ((x % 10) + 48);
}
ndatbuf[8] = NUL;
debug(F110,"zzndate return",ndatbuf,0);
return((char *)ndatbuf);
}
#ifdef DCMDBUF
extern struct cmdptr *cmdstk;
extern char *line, *tmpbuf;
#else
extern struct cmdptr cmdstk[];
extern char line[], tmpbuf[];
#endif /* DCMDBUF */
#ifdef OS2
extern char exedir[];
#else
extern char * exedir;
#endif /* OS2 */
extern int nettype;
#ifndef NOICP /* Most of this file... */
#ifdef CKLOGDIAL
extern char diafil[];
#endif /* CKLOGDIAL */
#ifndef AMIGA
#ifndef MAC
#include <signal.h>
#endif /* MAC */
#endif /* AMIGA */
#ifdef SV68 /* July 2006 believe it or not */
#ifndef SEEK_CUR
#include <unistd.h>
#endif /* SEEK_CUR */
#endif /* SV68 */
#ifdef SCO32 /* June 2011 believe it or not... */
#ifdef XENIX
#ifndef SEEK_CUR
#include <unistd.h>
#endif /* SEEK_CUR */
#endif /* XENIX */
#endif /* SCO32 */
#ifdef STRATUS /* Stratus Computer, Inc. VOS */
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(x) conoc(x)
#ifdef getchar
#undef getchar
#endif /* getchar */
#define getchar(x) coninc(0)
#endif /* STRATUS */
#ifdef ANYX25
extern int revcall, closgr, cudata;
int x25ver;
extern char udata[];
#ifndef IBMX25
extern int npadx3;
extern CHAR padparms[];
extern struct keytab padx3tab[];
#endif /* !IBMX25 */
#ifdef IBMX25
/* global variables only available for IBM X.25 - possibly interesting for
* other implementations
*/
extern x25addr_t local_nua;
extern x25addr_t remote_nua;
#endif /* IBMX25 */
#endif /* ANYX25 */
#ifdef NETCONN
#ifndef NODIAL
extern int nnetdir;
extern char *netdir[];
#endif /* NODIAL */
extern char ipaddr[];
#ifdef CK_NETBIOS
extern unsigned short netbiosAvail;
extern unsigned long NetbeuiAPI;
extern unsigned char NetBiosName[];
extern unsigned char NetBiosAdapter;
extern unsigned char NetBiosLSN;
#endif /* CK_NETBIOS */
#ifdef TCPSOCKET
extern char myipaddr[];
extern int tcp_rdns;
#ifdef CK_DNS_SRV
extern int tcp_dns_srv;
#endif /* CK_DNS_SRV */
extern char * tcp_address;
#ifndef NOHTTP
extern char * tcp_http_proxy;
#endif /* NOHTTP */
#ifdef NT
#ifdef CK_SOCKS
extern char * tcp_socks_svr;
#ifdef CK_SOCKS_NS
extern char * tcp_socks_ns;
#endif /* CK_SOCKS_NS */
#endif /* CK_SOCKS */
#endif /* NT */
#ifndef NOTCPOPTS
#ifdef SOL_SOCKET
#ifdef SO_LINGER
extern int tcp_linger;
extern int tcp_linger_tmo;
#endif /* SO_LINGER */
#ifdef SO_DONTROUTE
extern int tcp_dontroute;
#endif /* SO_DONTROUTE */
#ifdef TCP_NODELAY
extern int tcp_nodelay;
#endif /* TCP_NODELAY */
#ifdef SO_SNDBUF
extern int tcp_sendbuf;
#endif /* SO_SNDBUF */
#ifdef SO_RCVBUF
extern int tcp_recvbuf;
#endif /* SO_RCVBUF */
#ifdef SO_KEEPALIVE
extern int tcp_keepalive;
#endif /* SO_KEEPALIVE */
#endif /* SOL_SOCKET */
#endif /* NOTCPOPTS */
#endif /* TCPSOCKET */
#endif /* NETCONN */
extern char * floname[];
#ifndef NOSPL
extern int vareval; /* Variable evaluation method */
extern int fndiags; /* Function diagnostics on/off */
extern int divbyzero;
int itsapattern = 0;
int isinbuflen = 0;
int isjoin = 0;
#ifdef CK_APC
extern int apcactive; /* Nonzero = APC command was rec'd */
extern int apcstatus; /* Are APC commands being processed? */
#ifdef DCMDBUF
extern char *apcbuf; /* APC command buffer */
#else
extern char apcbuf[];
#endif /* DCMDBUF */
#endif /* CK_APC */
extern char evalbuf[]; /* EVALUATE result */
extern char uidbuf[], pwbuf[], prmbuf[];
_PROTOTYP( static char * fneval, (char *, char * [], int, char * ) );
_PROTOTYP( static VOID myflsh, (void) );
_PROTOTYP( static char * getip, (char *) );
_PROTOTYP( int delta2sec, (char *, long *) );
#ifdef NEWFTP
_PROTOTYP( char * ftp_cpl_mode, (void) );
_PROTOTYP( char * ftp_dpl_mode, (void) );
_PROTOTYP( char * ftp_authtype, (void) );
#endif /* NEWFTP */
#ifndef NOHTTP
_PROTOTYP( char * http_host, (void) );
_PROTOTYP( int http_isconnected, (void) );
_PROTOTYP( char * http_security, (void) );
#endif /* NOHTTP */
#ifndef NOSEXP
_PROTOTYP( char * dosexp, (char *) );
int fsexpflag = 0;
#endif /* NOSEXP */
static char hexdigits[16] = {
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
};
extern char * tempdir;
#ifdef CK_REXX
extern char rexxbuf[];
#endif /* CK_REXX */
extern int tfline[];
char *wkdays[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
#endif /* NOSPL */
#ifdef OS2
extern char startupdir[], inidir[];
#else
#ifdef VMSORUNIX
extern char startupdir[];
#endif /* VMSORUNIX */
#endif /* OS2 */
#ifdef OS2
_PROTOTYP (int os2getcp, (void) );
#ifdef TCPSOCKET
extern char tcpname[];
#endif /* TCPSOCKET */
extern int tcp_avail;
#ifdef DECNET
extern int dnet_avail;
#endif /* DECNET */
#ifdef SUPERLAT
extern int slat_avail;
#endif /* SUPERLAT */
#ifndef NOTERM
extern int tt_type, max_tt;
extern struct tt_info_rec tt_info[];
#endif /* NOTERM */
extern int tt_rows[], tt_cols[];
#else /* OS2 */
extern int tt_rows, tt_cols;
#endif /* OS2 */
#ifdef CK_TAPI
extern int tttapi;
extern int tapipass;
extern struct keytab * tapilinetab;
extern struct keytab * _tapilinetab;
extern int ntapiline;
#endif /* CK_TAPI */
extern struct keytab colxtab[];
extern int ncolx;
extern char ttname[], *zinptr, *kermrc;
extern char inidir[];
extern int activecmd, remonly, cmd_rows, cmd_cols, parity, seslog,
sessft, sosi, hwparity, tsecs, xargs, zincnt, tlevel, insilence, cmdmsk,
timint, timef, inbufsize, dialog, binary, carrier, cdtimo, cmask, duplex,
fmask, inecho, nmac, turnch, turn, kbchar;
#ifndef NOXFER
extern CHAR eol, mypadc, mystch, padch, seol, stchr, * epktmsg, feol;
extern char *cksysid;
extern struct ck_p ptab[];
extern int
protocol, prefixing, xfrbel, xfrcan, xfrint, xfrchr, xfrnum, pktpaus,
lscapr, lscapu, xfermode, dest, slostart, maxrps, maxsps, maxtry, mypadn,
npad, pkttim, bigrbsiz, bigsbsiz, keep, atcapr, autopar, bctr, bctu,
crunched, ckdelay, ebq, ebqflg, pktlog, retrans, rpackets, rptflg, rptq,
rtimo, spackets, spsiz, spsizf, spsizr, timeouts, fncact, fncnv, urpsiz,
wmax, wslotn, wslotr, fdispla, spmax, fnrpath, fnspath, crc16;
#endif /* NOXFER */
#ifdef OS2
extern int zxpn;
extern int viewonly;
#endif /* OS2 */
#ifndef NOXFER
#ifdef GFTIMER
extern CKFLOAT fptsecs, fpxfsecs;
#endif /* GFTIMER */
extern long xfsecs, tfcps;
#ifdef CK_TMPDIR
extern char *dldir;
#endif /* CK_TMPDIR */
#endif /* NOXFER */
#ifdef RECURSIVE
extern int recursive;
#endif /* RECURSIVE */
#ifdef VMS
extern int frecl;
#endif /* VMS */
extern CK_OFF_T ffc, tfc, tlci, tlco;
extern long filcnt, rptn, speed, ccu, ccp, vernum, xvernum;
#ifndef NOSPL
extern char fspec[], myhost[];
#endif /* NOSPL */
extern char *tfnam[]; /* Command file names */
extern char pktfil[], /* Packet log file name */
#ifdef TLOG
trafil[], /* Transaction log file name */
#endif /* TLOG */
sesfil[]; /* Session log file name */
#ifndef NOXMIT /* TRANSMIT command variables */
extern char xmitbuf[];
extern int xmitf, xmitl, xmitx, xmits, xmitw, xmitt;
#endif /* NOXMIT */
extern int cmdlvl;
#ifndef NOSPL
/* Script programming language items */
extern char **a_ptr[]; /* Arrays */
extern int a_dim[];
static char * inpmatch = NULL;
#ifdef CKFLOAT
char * inpscale = NULL;
#endif /* CKFLOAT */
extern char * inpbuf, inchar[]; /* Buffers for INPUT and REINPUT */
extern char *inpbp; /* And pointer to same */
static char *r3 = (char *)0;
extern int incount; /* INPUT character count */
extern int m_found; /* MINPUT result */
extern int maclvl; /* Macro invocation level */
extern struct mtab *mactab; /* Macro table */
extern char *mrval[];
extern int macargc[], topargc;
#ifdef COMMENT
extern char *m_line[];
extern char *topline;
#endif /* COMMENT */
extern char *m_arg[MACLEVEL][10]; /* You have to put in the dimensions */
extern char *g_var[GVARS]; /* for external 2-dimensional arrays. */
#ifdef DCMDBUF
extern int *count, *inpcas;
#else
extern int count[], inpcas[];
#endif /* DCMDBUF */
#endif /* NOSPL */
#ifdef UNIX
extern int haslock; /* For UUCP locks */
extern char flfnam[];
#ifndef USETTYLOCK
extern char lock2[];
#endif /* USETTYLOCK */
#endif /* UNIX */
#ifdef OS2ORUNIX
extern int maxnam, maxpath; /* Longest name, path length */
#endif /* OS2ORUNIX */
extern int mdmtyp, mdmsav;
#ifndef NODIAL
/* DIAL-related variables */
extern char modemmsg[];
extern MDMINF *modemp[]; /* Pointers to modem info structs */
extern int nmdm, dialhng, dialtmo, dialksp, dialdpy, dialsrt, dialsta;
extern int dialrtr, dialint, dialrstr, dialcon, dialcq, dialfld;
extern int mdmspd, dialec, dialdc, dialmth, dialmauto, dialesc;
extern char *dialnum, *dialini, *dialdir[], *dialcmd, *dialnpr,
*dialdcon, *dialdcoff, *dialecon, *dialecoff, *dialhcmd, *diallac,
*dialhwfc, *dialswfc, *dialnofc, *dialpulse, *dialtone, *dialname,
*dialaaon, *dialaaoff, *dialmac;
extern char *diallcc, *dialixp, *dialixs, *dialldp, *diallds,
*dialpxi, *dialpxo, *dialsfx, *dialtfp;
extern char *diallcp, *diallcs;
extern int ntollfree, ndialpxx, nlocalac;
extern char *dialtfc[], *diallcac[], *dialpxx[], *matchpxx;
extern int ndialpucc, ndialtocc;
extern char *dialtocc[], *dialpucc[];
extern int ndialdir, dialcnf, dialcvt, dialidt, dialpace;
extern long dialmax, dialcapas;
extern struct keytab mdmtab[];
#ifdef BIGBUFOK
#define ARGBUFSIZ 8191
#else
#define ARGBUFSIZ 1023
#endif /* BIGBUFOK */
#ifdef BIGBUFOK
extern char * dialmsg[];
#endif /* BIGBUFOK */
#endif /* NODIAL */
#ifndef NOCSETS
/* Translation stuff */
extern int nfilc;
extern struct keytab fcstab[];
extern int fcharset, tcharset, tslevel, language, nlng, tcsr, tcsl;
extern int dcset7, dcset8;
extern struct keytab lngtab[];
extern struct csinfo fcsinfo[], tcsinfo[];
extern struct langinfo langs[];
#ifdef CK_ANSIC
extern CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(CHAR); /* Character set */
extern CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(CHAR); /* translation functions */
#else
extern CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(); /* Character set */
extern CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(); /* translation functions. */
#endif /* CK_ANSIC */
#ifdef UNICODE
extern int ucsbom, ucsorder;
#endif /* UNICODE */
#endif /* NOCSETS */
#ifndef NOSPL
/* Built-in variable names, maximum length VNAML (20 characters) */
struct keytab vartab[] = {
{ "_line", VN_TFLN, CM_INV}, /* 192 */
{ "apcactive", VN_APC, CM_INV}, /* 192 */
#ifdef NT
{ "appdata", VN_APPDATA, 0}, /* 201 */
#endif /* NT */
{ "argc", VN_ARGC, 0},
{ "args", VN_ARGS, 0},
{ "authname", VN_AUTHN, 0}, /* 196 */
{ "authstate", VN_AUTHS, 0}, /* 195 */
{ "authtype", VN_AUTHT, 0}, /* 195 */
{ "bits", VN_BITS, 0}, /* 212 */
{ "blockcheck",VN_BLK, 0}, /* 195 */
#ifdef BROWSER
{ "browser", VN_BROWSR,0}, /* 193 */
{ "browsopts", VN_BROPT, 0}, /* 193 */
{ "browsurl", VN_URL, 0}, /* 193 */
{ "buildid", VN_BUILD, 0}, /* 199 */
#endif /* BROWSER */
{ "byteorder", VN_BYTE, 0}, /* 195 */
#ifndef NOCSETS
{ "charset", VN_CSET, 0}, /* 192 */
#endif /* NOCSETS */
{ "cmdbufsize",VN_CMDBL, 0}, /* 195 */
{ "cmdfile", VN_CMDF, 0},
{ "cmdlevel", VN_CMDL, 0},
{ "cmdsource", VN_CMDS, 0},
{ "cols", VN_COLS, 0}, /* 190 */
#ifdef NT
{ "common", VN_COMMON, 0}, /* 201 */
#endif /* NT */
{ "connection",VN_CONN, 0}, /* 190 */
{ "count", VN_COUN, 0},
#ifndef NOXFER
{ "cps", VN_CPS, 0}, /* 190 */
#endif /* NOXFER */
{ "cpu", VN_CPU, 0},
#ifndef NOXFER
{ "crc16", VN_CRC16, 0}, /* 192 */
{ "ctty", VN_TTYNAM,0}, /* 196 */
#endif /* NOXFER */
#ifndef NOLOGDIAL
#ifndef NOLOCAL
{ "cx_time", VN_CXTIME,0}, /* 195 */
{ "cx_status", VN_CX_STA,0}, /* 199 */
#endif /* NOLOCAL */
#endif /* NOLOGDIAL */
#ifndef NODIAL
{ "d$ac", VN_D_AC, 0}, /* 192 */
{ "d$cc", VN_D_CC, 0}, /* 192 */
{ "d$ip", VN_D_IP, 0}, /* 192 */
{ "d$lc", VN_D_LCP, 0}, /* 193 */
{ "d$lcp", VN_D_LCP, CM_INV}, /* 193 */
{ "d$lp", VN_D_LP, 0}, /* 192 */
{ "d$px", VN_D_PXX, 0}, /* 195 */
{ "d$pxx", VN_D_PXX, CM_INV}, /* 195 */
#endif /* NODIAL */
{ "date", VN_DATE, 0},
{ "day", VN_DAY, 0},
#ifdef NT
{ "desktop", VN_DESKTOP, 0}, /* 201 */
#endif /* NT */
#ifndef NODIAL
{ "dialcount", VN_DRTR, 0}, /* 195 */
{ "dialmessage",VN_DMSG, 0}, /* 212 */
{ "dialnumber",VN_DNUM, 0}, /* 192 */
{ "dialresult",VN_MDMSG, 0}, /* 192 */
{ "dialstatus",VN_DIAL, 0}, /* 190 */
{ "dialsuffix",VN_PDSFX, 0}, /* 193 */
{ "dialtype", VN_DTYPE, 0}, /* 193 */
#endif /* NODIAL */
{ "directory", VN_DIRE, 0},
#ifndef NODIAL
{ "dm_hf", VN_DM_HF, 0}, /* 199 */
{ "dm_lp", VN_DM_LP, 0}, /* 195 */
{ "dm_sp", VN_DM_SP, 0}, /* 195 */
{ "dm_pd", VN_DM_PD, 0}, /* 195 */
{ "dm_td", VN_DM_TD, 0}, /* 195 */
{ "dm_wa", VN_DM_WA, 0}, /* 195 */
{ "dm_wb", VN_DM_WB, 0}, /* 199 */
{ "dm_wd", VN_DM_WD, 0}, /* 195 */
{ "dm_rc", VN_DM_RC, 0}, /* 195 */
#endif /* NODIAL */
#ifndef NOXFER
{ "download", VN_DLDIR, 0}, /* 192 */
#endif /* NOXFER */
{ "editor", VN_EDITOR,0},
{ "editfile", VN_EDFILE,0},
{ "editopts", VN_EDOPT, 0},
{ "errno", VN_ERRNO, 0}, /* 192 */
{ "errstring", VN_ERSTR, 0}, /* 192 */
{ "escape", VN_ESC, 0}, /* 193 */
{ "evaluate", VN_EVAL, 0}, /* 190 */
#ifdef OS2ORUNIX
{ "exedir", VN_EXEDIR,0}, /* 192 */
#endif /* OS2ORUNIX */
{ "exitstatus",VN_EXIT, 0},
#ifdef CKCHANNELIO
{ "f_count", VN_FCOU, 0}, /* 195 */
{ "f_error", VN_FERR, 0}, /* 195 */
{ "f_max", VN_FMAX, 0}, /* 195 */
{ "fileerror", VN_FERR, CM_INV}, /* 195 */
{ "filemax", VN_FERR, CM_INV}, /* 195 */
#endif /* CKCHANNELIO */
{ "filename", VN_FNAM, 0}, /* 193 */
{ "filenumber",VN_FNUM, 0}, /* 193 */
{ "filespec", VN_FILE, 0},
{ "fsize", VN_FFC, 0}, /* 190 */
#ifdef GFTIMER
{ "ftime", VN_FTIME, 0}, /* 199 */
#else
{ "ftime", VN_NTIM, CM_INV},
#endif /* GFTIMER */
#ifndef NOFTP
#ifndef SYSFTP
{ "ftp_code", VN_FTP_C, 0}, /* 199 */
{ "ftp_cpl", VN_FTP_B, 0}, /* 199 */
{ "ftp_connected", VN_FTP_X, 0}, /* 199 */
{ "ftp_dpl", VN_FTP_D, 0}, /* 199 */
{ "ftp_getputremote", VN_FTP_G, 0}, /* 199 */
{ "ftp_host", VN_FTP_H, 0}, /* 199 */
{ "ftp_loggedin", VN_FTP_L, 0}, /* 199 */
{ "ftp_message", VN_FTP_M, 0}, /* 199 */
{ "ftp_msg", VN_FTP_M, CM_INV}, /* 199 */
{ "ftp_security", VN_FTP_Z, 0}, /* 199 */
{ "ftp_server", VN_FTP_S, 0}, /* 199 */
#endif /* SYSFTP */
#endif /* NOFTP */
{ "ftype", VN_MODE, 0}, /* 190 */
#ifdef KUI
{ "gui_fontname", VN_GUI_FNM, 0}, /* 205 */
{ "gui_fontsize", VN_GUI_FSZ, 0}, /* 205 */
{ "gui_runmode", VN_GUI_RUN, 0}, /* 205 */
{ "gui_xpos", VN_GUI_XP, 0}, /* 205 */
{ "gui_xres", VN_GUI_XR, 0}, /* 205 */
{ "gui_ypos", VN_GUI_YP, 0}, /* 205 */
{ "gui_yres", VN_GUI_YR, 0}, /* 205 */
#endif /* KUI */
{ "herald", VN_HERALD, 0},
{ "home", VN_HOME, 0},
{ "host", VN_HOST, 0},
{ "hour", VN_HOUR, 0}, /* 200 */
#ifndef NOHTTP
{ "http_code", VN_HTTP_C, 0}, /* 199 */
{ "http_connected", VN_HTTP_N, 0}, /* 199 */
{ "http_host", VN_HTTP_H, 0}, /* 199 */
{ "http_message", VN_HTTP_M, 0}, /* 199 */
{ "http_security", VN_HTTP_S, 0}, /* 199 */
#endif /* NOHTTP */
{ "hwparity", VN_HWPAR, 0}, /* 195 */
{ "input", VN_IBUF, 0},
{ "inchar", VN_ICHR, 0},
{ "incount", VN_ICNT, 0},
{ "inidir", VN_INI, 0}, /* 192 */
{ "inmatch", VN_MATCH, 0}, /* 196 */
{ "inmessage", VN_INPMSG,0}, /* 212 */
{ "inscale", VN_ISCALE,0}, /* 210 */
{ "instatus", VN_ISTAT, 0}, /* 192 */
{ "intime", VN_INTIME,0}, /* 193 */
{ "inwait", VN_INTMO, 0}, /* 195 */
{ "ip", VN_IPADDR, CM_ABR|CM_INV},
{ "ipaddress", VN_IPADDR,0}, /* 192 */
{ "iprompt", VN_PROMPT,0}, /* 199 */
{ "kbchar", VN_KBCHAR,0}, /* 196 */
#ifndef NOLOCAL
#ifdef OS2
{ "keyboard", VN_KEYB, 0},
#endif /* OS2 */
#endif /* NOLOCAL */
#ifdef CK_KERBEROS
{ "krb4errmsg", VN_K4EMSG,0},
{ "krb4errno", VN_K4ENO, 0},
{ "krb4principal", VN_K4PRN, 0},
{ "krb4realm", VN_K4RLM, 0},
{ "krb4service", VN_K4SRV, 0},
{ "krb5cc", VN_K5CC, 0},
{ "krb5errmsg", VN_K5EMSG,0},
{ "krb5errno", VN_K5ENO, 0},
{ "krb5principal", VN_K5PRN, 0},
{ "krb5realm", VN_K5RLM, 0},
{ "krb5service", VN_K5SRV, 0},
#endif /* CK_KERBEROS */
{ "lastcommand", VN_PREVCMD, 0}, /* 299 */
#ifndef NOLASTFILE
{ "lastfilespec", VN_LASTFIL, 0}, /* 212 */
#endif /* NOLASTFILE */
{ "lastkeywordvalue", VN_LASTKWV, 0}, /* 212 */
{ "lastkwvalue", VN_LASTKWV, CM_ABR|CM_INV}, /* 212 */
{ "line", VN_LINE, 0},
{ "local", VN_LCL, 0},
#ifdef UNIX
{ "lockdir", VN_LCKDIR,0}, /* 195 */
{ "lockpid", VN_LCKPID,0}, /* 195 */
#endif /* UNIX */
{ "log_connection", VN_LOG_CON, 0}, /* 206 */
{ "log_debug", VN_LOG_DEB, 0}, /* 206 */
{ "log_packet", VN_LOG_PKT, 0}, /* 206 */
{ "log_session", VN_LOG_SES, 0}, /* 206 */
{ "log_transaction", VN_LOG_TRA, 0},/* 206 */
{ "maclevel", VN_MACLVL,0}, /* 195 */
{ "macro", VN_MAC, 0},
#ifdef FNFLOAT
{ "math_e", VN_MA_E, 0}, /* 195 */
{ "math_pi", VN_MA_PI, 0}, /* 195 */
{ "math_precision", VN_MA_PR, 0}, /* 195 */
#endif /* FNFLOAT */
{ "minput", VN_MINP, 0}, /* 192 */
{ "model", VN_MODL, 0}, /* 193 */
{ "modem", VN_MDM, 0},
{ "month", VN_MONTH, 0}, /* 304 */
#ifndef NOLOCAL
#ifdef OS2
{ "mousecurx", VN_MOU_X, 0}, /* K95 1.1.14 */
{ "mousecury", VN_MOU_Y, 0}, /* K95 1.1.14 */
#endif /* OS2 */
#endif /* NOLOCAL */
#ifndef NODIAL
{ "m_aa_off", VN_M_AAX, 0}, /* all 192... */
{ "m_aa_on", VN_M_AAO, 0},
{ "m_dc_off", VN_M_DCX, 0},
{ "m_dc_on", VN_M_DCO, 0},
{ "m_dial", VN_M_DCM, 0},
{ "m_ec_off", VN_M_ECX, 0},
{ "m_ec_on", VN_M_ECO, 0},
{ "m_fc_hw", VN_M_HWF, 0},
{ "m_fc_no", VN_M_NFC, 0},
{ "m_fc_sw", VN_M_SWF, 0},
{ "m_hup", VN_M_HUP, 0},
{ "m_init", VN_M_INI, 0},
{ "m_name", VN_M_NAM, 0}, /* 195 */
{ "m_pulse", VN_M_PDM, 0},
{ "m_sig_cd", VN_MS_CD, 0}, /* 195 */
{ "m_sig_cts", VN_MS_CTS,0}, /* 195 */
{ "m_sig_dsr", VN_MS_DSR,0}, /* 195 */
{ "m_sig_dtr", VN_MS_DTR,0}, /* 195 */
{ "m_sig_ri", VN_MS_RI, 0}, /* 195 */
{ "m_sig_rts", VN_MS_RTS,0}, /* 195 */
{ "m_tone", VN_M_TDM, 0},
#endif /* NODIAL */
{ "name", VN_NAME, 0},
{ "ndate", VN_NDAT, 0},
{ "nday", VN_NDAY, 0},
{ "newline", VN_NEWL, 0},
{ "nmonth", VN_NMONTH,0}, /* 304 */
{ "ntime", VN_NTIM, 0},
{ "osname", VN_OSNAM, 0}, /* 193 */
{ "osrelease", VN_OSREL, 0}, /* 193 */
{ "osversion", VN_OSVER, 0}, /* 193 */
#ifndef NOXFER
{ "packetlen", VN_RPSIZ, 0}, /* 192 */
#endif /* NOXFER */
{ "parity", VN_PRTY, 0}, /* 190 */
{ "password", VN_PWD, CM_INV}, /* 192 */
#ifdef NT
{ "personal", VN_PERSONAL, 0}, /* 201 */
#endif /* NT */
#ifdef PEXITSTAT
{ "pexitstat", VN_PEXIT, 0}, /* 193 */
#endif /* PEXITSTAT */
#ifdef CK_PID
{ "pid", VN_PID, 0}, /* 193 */
#endif /* CK_PID */
{ "platform", VN_SYSV, 0},
{ "printer", VN_PRINT, 0}, /* 193 */
{ "program", VN_PROG, 0},
{ "prompt", VN_PRM, CM_INV}, /* 192 */
#ifndef NOXFER
{ "protocol", VN_PROTO, 0}, /* 192 */
{ "p_8bit", VN_P_8BIT,0}, /* 193 */
{ "p_ctl", VN_P_CTL, 0}, /* 193 */
{ "p_rpt", VN_P_RPT, 0}, /* 193 */
{ "query", VN_QUE, 0}, /* 190 */
#endif /* NOXFER */
{ "remoteip", VN_HOSTIP,0}, /* 212 */
{ "return", VN_RET, 0},
#ifdef CK_REXX
{ "rexx", VN_REXX, 0}, /* 190 */
#endif /* CK_REXX */
#ifdef TN_COMPORT
{ "rfc2217_signature", VN_TNC_SIG, 0}, /* 201 */
{ "rfc2717_signature", VN_TNC_SIG, CM_INV}, /* 202 */
#endif /* TN_COMPORT */
{ "rows", VN_ROWS, 0}, /* 190 */
#ifndef NOSEXP
{ "sdepth", VN_LSEXP,0}, /* 199 */
#endif /* NOSEXP */
{ "secure", VN_SECURE, 0}, /* 199 */
#ifndef NOLOCAL
#ifdef OS2
{ "select", VN_SELCT, 0}, /* 192 */
#endif /* OS2 */
#endif /* NOLOCAL */
{ "sendlist", VN_SNDL, 0},
{ "serial", VN_SERIAL,0}, /* 195 */
{ "setlinemsg",VN_SLMSG, 0}, /* 195 */
#ifndef NOSEXP
{ "sexpression",VN_SEXP, 0}, /* 199 */
#endif /* NOSEXP */
{ "speed", VN_SPEE, 0},
#ifdef OS2
{ "space", VN_SPA, 0},
{ "startup", VN_STAR, 0}, /* 190 */
#else
#ifdef UNIX
{ "startup", VN_STAR, 0}, /* 193 */
#else
#ifdef VMS
{ "startup", VN_STAR, 0}, /* 193 */
#endif /* VMS */
#endif /* UNIX */
#endif /* OS2 */
{ "status", VN_SUCC, 0},
#ifndef NOSEXP
{ "svalue", VN_VSEXP, 0}, /* 199 */
#endif /* NOSEXP */
#ifndef NOXFER
{ "sysid", VN_SYSI, 0},
#endif /* NOXFER */
{ "system", VN_SYST, 0},
{ "terminal", VN_TTYP, 0},
#ifdef OS2
#ifndef NOKVERBS
{ "termkey", VN_TRMK, CM_INV}, /* 192 */
#endif /* NOKVERBS */
#endif /* OS2 */
{ "test", VN_TEST, 0}, /* 193 */
{ "textdir", VN_TXTDIR,0}, /* 195 */
#ifndef NOXFER
{ "tfsize", VN_TFC, 0},
{ "tftime", VN_TFTIM, 0}, /* 195 */
#endif /* NOXFER */
{ "time", VN_TIME, 0},
{ "timestamp", VN_NOW, 0}, /* 200 */
{ "tmpdir", VN_TEMP, 0}, /* 192 */
#ifdef CK_TRIGGER
{ "trigger", VN_TRIG, 0}, /* 193 */
#endif /* CK_TRIGGER */
#ifdef CK_TTYFD
{ "ttyfd", VN_TTYF, 0},
#endif /* CK_TTYFD */
{ "ty_ln", VN_TY_LN, 0}, /* 195 */
{ "ty_lc", VN_TY_LC, 0}, /* 195 */
{ "ty_lm", VN_TY_LM, 0}, /* 195 */
#ifdef BROWSER
{ "url", VN_URL, CM_INV}, /* 193 */
#endif /* BROWSER */
{ "userid", VN_UID, 0}, /* 192 */
{ "vareval", VN_VAREVAL, 0}, /* 212 */
{ "version", VN_VERS, 0},
#ifndef NOXFER
{ "window", VN_WINDO, 0}, /* 192 */
#endif /* NOXFER */
#ifdef IBMX25
{ "x25local_nua", VN_X25LA, 0}, /* 193 */
{ "x25remote_nua", VN_X25RA, 0}, /* 193 */
#endif /* IBMX25 */
#ifdef CK_SSL
{ "x509_issuer", VN_X509_I, 0},
{ "x509_subject", VN_X509_S, 0},
#endif /* CK_SSL */
#ifndef NOXFER
{ "xferstatus",VN_XFSTAT,0}, /* 193 */
{ "xfermsg", VN_XFMSG, 0}, /* 193 */
{ "xfer_badpackets", VN_XF_BC, 0}, /* 195 */
{ "xfer_timeouts", VN_XF_TM, 0}, /* 195 */
{ "xfer_retransmits",VN_XF_RX, 0}, /* 195 */
#endif /* NOXFER */
{ "xprogram", VN_XPROG, 0}, /* 193 */
{ "xversion", VN_XVNUM, 0}, /* 192 */
{ "year", VN_YEAR, 0} /* 304 */
};
int nvars = (sizeof(vartab) / sizeof(struct keytab));
#endif /* NOSPL */
#ifndef NOSPL
struct keytab fnctab[] = { /* Function names */
#ifdef OS2
{ ".oox", FN_OOX, CM_INV}, /* ... */
#endif /* OS2 */
#ifdef CKCHANNELIO
{ "_eof", FN_FEOF, 0},
{ "_errmsg", FN_FERMSG, 0},
{ "_getblock", FN_FGBLK, 0},
{ "_getchar", FN_FGCHAR, 0},
{ "_getline", FN_FGLINE, 0},
{ "_handle", FN_FILNO, 0},
{ "_line", FN_NLINE, 0},
{ "_pos", FN_FPOS, 0},
{ "_putblock", FN_FPBLK, 0},
{ "_putchar", FN_FPCHAR, 0},
{ "_putline", FN_FPLINE, 0},
{ "_status", FN_FSTAT, 0},
#endif /* CKCHANNELIO */
{ "aaconvert", FN_AADUMP, 0}, /* Associative Array conversion */
{ "absolute", FN_ABS, 0}, /* Absolute value */
#ifdef TCPSOCKET
{ "addr2name", FN_HSTADD,CM_INV}, /* IP Address to Hostname */
{ "addrtoname", FN_HSTADD,CM_INV}, /* IP Address to Hostname */
#endif /* TCPSOCKET */
{ "arraylook", FN_ALOOK,0}, /* Array lookup */
{ "b64decode", FN_FMB64,0}, /* Base-64 conversion */
{ "b64encode", FN_TOB64,0}, /* ... */
{ "basename", FN_BSN, 0}, /* Basename */
{ "break", FN_BRK, 0}, /* Break (as in Snobol) */
{ "ca", FN_CAP, CM_INV|CM_ABR}, /* Abbreviation for capitablize */
{ "cap", FN_CAP, CM_INV|CM_ABR}, /* Abbreviation for capitablize */
{ "capitalize", FN_CAP, 0}, /* First Letter -> uppercase */
{ "caps", FN_CAP, CM_INV}, /* ditto */
{ "character", FN_CHR, 0}, /* Character from code */
{ "checksum", FN_CHK, 0}, /* Checksum */
{ "cmdstack", FN_CMDSTK,0}, /* Command stack */
{ "cmpdates", FN_CMPDATE,0}, /* Compare dates */
{ "code", FN_COD, 0}, /* Code from character */
#ifndef NOPUSH
{ "command", FN_CMD, 0}, /* Output from a command */
#endif /* NOPUSH */
{ "contents", FN_CON, 0}, /* Definition (contents) of variable */