|
|
1.1 ! root 1: /* ckcker.h -- Symbol and macro definitions for C-Kermit */ ! 2: ! 3: /* ! 4: Author: Frank da Cruz ([email protected], [email protected]), ! 5: Columbia University Center for Computing Activities. ! 6: First released January 1985. ! 7: Copyright (C) 1985, 1992, Trustees of Columbia University in the City of New ! 8: York. Permission is granted to any individual or institution to use, copy, or ! 9: redistribute this software so long as it is not sold for profit, provided this ! 10: copyright notice is retained. ! 11: */ ! 12: ! 13: #ifndef CKCKER_H ! 14: #define CKCKER_H ! 15: ! 16: #ifdef NOICP /* No Interactive Command Parser */ ! 17: #ifndef NOSPL /* implies... */ ! 18: #define NOSPL /* No Script Programming Language */ ! 19: #endif /* NOSPL */ ! 20: #endif /* NOICP */ ! 21: ! 22: /* Codes for what we are doing now */ ! 23: ! 24: #define W_NOTHING 0 /* Nothing */ ! 25: #define W_SEND 2 /* SENDing or MAILing */ ! 26: #define W_RECV 4 /* RECEIVEing or GETting */ ! 27: #define W_REMO 8 /* Doing a REMOTE command */ ! 28: #define W_CONNECT 16 /* CONNECT mode */ ! 29: #define W_COMMAND 32 /* Command mode */ ! 30: ! 31: /* Terminal types */ ! 32: #define VT100 0 /* Also for VT52 mode */ ! 33: #define TEKTRONIX 1 ! 34: ! 35: /* Normal packet and window size */ ! 36: ! 37: #define MAXPACK 94 /* Maximum unextended packet size */ ! 38: /* Can't be more than 94! */ ! 39: #define MAXWS 31 /* Maximum window size */ ! 40: /* Can't be more than 31! */ ! 41: ! 42: /* Maximum long packet size for sending packets */ ! 43: /* Override these from cc command line via -DMAXSP=nnn */ ! 44: ! 45: #ifdef DYNAMIC ! 46: #ifndef MAXSP ! 47: #define MAXSP 9024 ! 48: #endif /* MAXSP */ ! 49: #else /* not DYNAMIC */ ! 50: #ifndef MAXSP ! 51: #define MAXSP 2048 ! 52: #endif /* MAXSP */ ! 53: #endif /* DYNAMIC */ ! 54: ! 55: /* Maximum long packet size for receiving packets */ ! 56: /* Override these from cc command line via -DMAXRP=nnn */ ! 57: ! 58: #ifdef DYNAMIC ! 59: #ifndef MAXRP ! 60: #define MAXRP 9024 ! 61: #endif /* MAXRP */ ! 62: #else /* not DYNAMIC */ ! 63: #ifndef MAXRP ! 64: #define MAXRP 2048 ! 65: #endif /* MAXRP */ ! 66: #endif /* DYNAMIC */ ! 67: ! 68: #ifdef VMS /* Dynamic or not, */ ! 69: #undef MAXSP /* VMS seems to have an intrinsic */ ! 70: #define MAXSP 1920 /* limit of about 1920. */ ! 71: #undef MAXRP ! 72: #define MAXRP 1920 ! 73: #endif /* VMS */ ! 74: ! 75: /* Default sizes for windowed packet buffers */ ! 76: /* Override these from cc command line via -DSBSIZ=nnn, -DRBSIZ=nnn */ ! 77: ! 78: #ifdef DYNAMIC ! 79: #ifndef SBSIZ ! 80: #define SBSIZ 9050 ! 81: #endif /* SBSIZ */ ! 82: #ifndef RBSIZ ! 83: #define RBSIZ 9050 ! 84: #endif /* RBSIZ */ ! 85: #else /* not DYNAMIC */ ! 86: #ifndef SBSIZ ! 87: #define SBSIZ (MAXPACK * (MAXWS + 1)) ! 88: #endif /* SBSIZ */ ! 89: #ifndef RBSIZ ! 90: #define RBSIZ (MAXPACK * (MAXWS + 1)) ! 91: #endif /* RBSIZ */ ! 92: #endif /* DYNAMIC */ ! 93: ! 94: #ifdef VMS /* VMS again... */ ! 95: #undef SBSIZ ! 96: #define SBSIZ 1930 ! 97: #undef RBSIZ ! 98: #define RBSIZ 1930 ! 99: #endif ! 100: ! 101: /* Kermit parameters and defaults */ ! 102: ! 103: #define CTLQ '#' /* Control char prefix I will use */ ! 104: #define MYEBQ '&' /* 8th-Bit prefix char I will use */ ! 105: #define MYRPTQ '~' /* Repeat count prefix I will use */ ! 106: ! 107: #define MAXTRY 10 /* Times to retry a packet */ ! 108: #define MYPADN 0 /* How many padding chars I need */ ! 109: #define MYPADC '\0' /* Which padding character I need */ ! 110: ! 111: #define DMYTIM 7 /* Default timeout interval to use. */ ! 112: #define URTIME 10 /* Timeout interval to use on me. */ ! 113: #define DSRVTIM 0 /* Default server cmd wait timeout. */ ! 114: ! 115: #define DEFTRN 0 /* Default line turnaround handshake */ ! 116: #define DEFPAR 0 /* Default parity */ ! 117: #define MYEOL CR /* Incoming packet terminator. */ ! 118: ! 119: #define DRPSIZ 90 /* Default incoming packet size. */ ! 120: #define DSPSIZ 90 /* Default outbound packet size. */ ! 121: ! 122: #define DDELAY 5 /* Default delay. */ ! 123: #define DSPEED 9600 /* Default line speed. */ ! 124: ! 125: #ifdef OS2 /* Default CONNECT-mode */ ! 126: #define DFESC 29 /* escape character */ ! 127: #else ! 128: #ifdef NEXT /* Ctrl-] for PC and NeXT */ ! 129: #define DFESC 29 ! 130: #else ! 131: #ifdef GEMDOS /* And Atari ST */ ! 132: #define DFESC 29 ! 133: #else ! 134: #define DFESC 28 /* Ctrl-backslash for others */ ! 135: #endif /* GEMDOS */ ! 136: #endif /* NEXT */ ! 137: #endif /* OS2 */ ! 138: ! 139: #ifdef NOPUSH /* NOPUSH implies NOJC */ ! 140: #ifndef NOJC /* (no job control) */ ! 141: #define NOJC ! 142: #endif /* NOJC */ ! 143: #endif /* NOPUSH */ ! 144: ! 145: #ifdef UNIX /* Default for SET SUSPEND */ ! 146: #ifdef NOJC /* UNIX but job control disabled */ ! 147: #define DFSUSP 0 ! 148: #else /* UNIX, job control enabled. */ ! 149: #define DFSUSP 1 ! 150: #endif /* NOJC */ ! 151: #else ! 152: #define DFSUSP 0 ! 153: #endif /* UNIX */ ! 154: ! 155: /* Files */ ! 156: ! 157: #define ZCTERM 0 /* Console terminal */ ! 158: #define ZSTDIO 1 /* Standard input/output */ ! 159: #define ZIFILE 2 /* Current input file (SEND, etc) (in) */ ! 160: #define ZOFILE 3 /* Current output file (RECEIVE, GET) (out) */ ! 161: #define ZDFILE 4 /* Current debugging log file (out) */ ! 162: #define ZTFILE 5 /* Current transaction log file (out) */ ! 163: #define ZPFILE 6 /* Current packet log file (out) */ ! 164: #define ZSFILE 7 /* Current session log file (out) */ ! 165: #define ZSYSFN 8 /* Input/Output from a system function */ ! 166: #define ZRFILE 9 /* Local file for READ (in) */ ! 167: #define ZWFILE 10 /* Local file for WRITE (out) */ ! 168: #define ZNFILS 11 /* How many defined file numbers */ ! 169: ! 170: /* ! 171: Buffered file i/o is used to avoid gratuitous function calls while encoding a ! 172: packet. The previous way involved 2 nested function calls for EACH character ! 173: of the file. This way, we only do 2 calls per K of data. This reduces ! 174: packet encoding time to 1% of its former cost. Originally added by Paul ! 175: Placeway. ! 176: */ ! 177: #ifdef VMS /* In VMS, allow for longest possible RMS record */ ! 178: #ifdef DYNAMIC ! 179: #define INBUFSIZE 32768 /* File input buffer size */ ! 180: #define OBUFSIZE 32768 /* File output buffer size */ ! 181: #else ! 182: #define INBUFSIZE 4096 /* File input buffer size */ ! 183: #define OBUFSIZE 4096 /* File output buffer size */ ! 184: #endif /* DYNAMIC */ ! 185: #else /* Not VMS */ /* For all others, just use a 1K buffer */ ! 186: #define INBUFSIZE 1024 ! 187: #define OBUFSIZE 1024 ! 188: #endif /* VMS */ ! 189: ! 190: /* get the next char; sorta like a getc() macro */ ! 191: #define zminchar() (((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill()) ! 192: ! 193: /* stuff a character into the input buffer */ ! 194: #define zmstuff(c) zinptr--, *zinptr = c, zincnt++ ! 195: ! 196: /* put a character to a file, like putchar() macro */ ! 197: #define zmchout(c) \ ! 198: ((*zoutptr++=(char)(c)),(((++zoutcnt)>=OBUFSIZE)?zoutdump():0)) ! 199: ! 200: /* Screen functions */ ! 201: ! 202: #define SCR_FN 1 /* filename */ ! 203: #define SCR_AN 2 /* as-name */ ! 204: #define SCR_FS 3 /* file-size */ ! 205: #define SCR_XD 4 /* x-packet data */ ! 206: #define SCR_ST 5 /* File status: */ ! 207: #define ST_OK 0 /* Transferred OK */ ! 208: #define ST_DISC 1 /* Discarded */ ! 209: #define ST_INT 2 /* Interrupted */ ! 210: #define ST_SKIP 3 /* Skipped */ ! 211: #define ST_ERR 4 /* Fatal Error */ ! 212: #define ST_REFU 5 /* Refused (use Attribute codes for reason) */ ! 213: #define SCR_PN 6 /* packet number */ ! 214: #define SCR_PT 7 /* packet type or pseudotype */ ! 215: #define SCR_TC 8 /* transaction complete */ ! 216: #define SCR_EM 9 /* error message */ ! 217: #define SCR_WM 10 /* warning message */ ! 218: #define SCR_TU 11 /* arbitrary undelimited text */ ! 219: #define SCR_TN 12 /* arbitrary new text, delimited at beginning */ ! 220: #define SCR_TZ 13 /* arbitrary text, delimited at end */ ! 221: #define SCR_QE 14 /* quantity equals (e.g. "foo: 7") */ ! 222: ! 223: /* Macros */ ! 224: ! 225: #define tochar(ch) (((ch) + SP ) & 0xFF ) /* Number to character */ ! 226: #define xunchar(ch) (((ch) - SP ) & 0xFF ) /* Character to number */ ! 227: #define ctl(ch) (((ch) ^ 64 ) & 0xFF ) /* Controllify/Uncontrollify */ ! 228: #define unpar(ch) (((ch) & 127) & 0xFF ) /* Clear parity bit */ ! 229: ! 230: /* Symbols for File Attributes */ ! 231: ! 232: #define AT_XALL 0 /* All of them */ ! 233: #define AT_ALLY 1 /* All of them on (Yes) */ ! 234: #define AT_ALLN 2 /* All of them off (no) */ ! 235: #define AT_LENK 3 /* Length in K */ ! 236: #define AT_FTYP 4 /* File Type */ ! 237: #define AT_DATE 5 /* Creation date */ ! 238: #define AT_CREA 6 /* Creator */ ! 239: #define AT_ACCT 7 /* Account */ ! 240: #define AT_AREA 8 /* Area */ ! 241: #define AT_PSWD 9 /* Password for area */ ! 242: #define AT_BLKS 10 /* Blocksize */ ! 243: #define AT_ACCE 11 /* Access */ ! 244: #define AT_ENCO 12 /* Encoding */ ! 245: #define AT_DISP 13 /* Disposition */ ! 246: #define AT_LPRO 14 /* Local Protection */ ! 247: #define AT_GPRO 15 /* Generic Protection */ ! 248: #define AT_SYSI 16 /* System ID */ ! 249: #define AT_RECF 17 /* Record Format */ ! 250: #define AT_SYSP 18 /* System-Dependent Parameters */ ! 251: #define AT_LENB 19 /* Length in Bytes */ ! 252: ! 253: /* Kermit packet information structure */ ! 254: ! 255: struct pktinfo { /* Packet information structure */ ! 256: CHAR *bf_adr; /* buffer address */ ! 257: int bf_len; /* buffer length */ ! 258: CHAR *pk_adr; /* Packet address within buffer */ ! 259: int pk_len; /* length of data within buffer */ ! 260: int pk_typ; /* packet type */ ! 261: int pk_seq; /* packet sequence number */ ! 262: int pk_flg; /* ack'd bit */ ! 263: int pk_rtr; /* retransmission count */ ! 264: }; ! 265: ! 266: /* File-related symbols and structures (moved from ckcfil.h) */ ! 267: ! 268: #define XYFILN 0 /* Naming */ ! 269: #define XYFILT 1 /* Type */ ! 270: #define XYFT_T 0 /* Text */ ! 271: #define XYFT_B 1 /* Binary */ ! 272: #define XYFT_I 2 /* Image or Block (VMS) */ ! 273: #define XYFT_L 3 /* Labeled (tagged binary) (VMS) */ ! 274: #define XYFT_U 4 /* Binary Undefined (VMS) */ ! 275: #define XYFILW 2 /* Warning */ ! 276: #define XYFILD 3 /* Display */ ! 277: #define XYFILC 4 /* Character set */ ! 278: #define XYFILF 5 /* Record Format */ ! 279: #define XYFF_S 0 /* Stream */ ! 280: #define XYFF_V 1 /* Variable */ ! 281: #define XYFF_VB 2 /* Variable with RCW's */ ! 282: #define XYFF_F 3 /* Fixed length */ ! 283: #define XYFF_U 4 /* Undefined */ ! 284: #define XYFILR 6 /* Record length */ ! 285: #define XYFILO 7 /* Organization */ ! 286: #define XYFO_S 0 /* Sequential */ ! 287: #define XYFO_I 1 /* Indexed */ ! 288: #define XYFO_R 2 /* Relative */ ! 289: #define XYFILP 8 /* Printer carriage control */ ! 290: #define XYFP_N 0 /* Newline (imbedded control characters) */ ! 291: #define XYFP_F 1 /* FORTRAN (space, 1, +, etc, in column 1 */ ! 292: #define XYFP_P 2 /* Special printer carriage controls */ ! 293: #define XYFP_X 4 /* None */ ! 294: #define XYFILX 9 /* Collision Action */ ! 295: #define XYFX_A 3 /* Append */ ! 296: #define XYFX_Q 5 /* Ask */ ! 297: #define XYFX_B 2 /* Backup */ ! 298: #define XYFX_D 4 /* Discard */ ! 299: #define XYFX_R 0 /* Rename */ ! 300: #define XYFX_X 1 /* Replace */ ! 301: #define XYFX_U 6 /* Update */ ! 302: #define XYFILB 10 /* Blocksize */ ! 303: #define XYFILZ 11 /* Disposition */ ! 304: #define XYFZ_N 0 /* New, Create */ ! 305: #define XYFZ_A 1 /* New, append if file exists, else create */ ! 306: #define XYFZ_O 2 /* Old, file must exist */ ! 307: #define XYFZ_X 3 /* Output to pipe/process */ ! 308: #define XYFZ_Y 4 /* Input from pipe/process */ ! 309: #define XYFILS 12 /* File Byte Size */ ! 310: #define XYFILL 13 /* File Label (VMS) */ ! 311: ! 312: /* ANSI-style forward declarations for protocol-related functions. */ ! 313: ! 314: _PROTOTYP( int input, (void) ); ! 315: _PROTOTYP( int inibufs, (int, int) ); ! 316: _PROTOTYP( int makebuf, (int, int, CHAR *, struct pktinfo *) ); ! 317: _PROTOTYP( int mksbuf, (int) ); ! 318: _PROTOTYP( int mkrbuf, (int) ); ! 319: _PROTOTYP( int spack, (char, int, int, CHAR *) ); ! 320: _PROTOTYP( VOID proto, (void) ); ! 321: _PROTOTYP( int rpack, (void) ); ! 322: _PROTOTYP( int ack1, (CHAR *) ); ! 323: _PROTOTYP( int ackn, (int) ); ! 324: _PROTOTYP( int ackns, (int, CHAR *) ); ! 325: _PROTOTYP( int nack, (int) ); ! 326: _PROTOTYP( int resend, (int) ); ! 327: _PROTOTYP( int errpkt, (CHAR *) ); ! 328: _PROTOTYP( VOID logpkt, (char, int, CHAR *) ); ! 329: _PROTOTYP( CHAR dopar, (CHAR) ); ! 330: _PROTOTYP( int chk1, (CHAR *) ); ! 331: _PROTOTYP( unsigned int chk2, (CHAR *) ); ! 332: _PROTOTYP( unsigned int chk3, (CHAR *) ); ! 333: _PROTOTYP( int sipkt, (char) ); ! 334: _PROTOTYP( int sinit, (void) ); ! 335: _PROTOTYP( VOID rinit, (CHAR *) ); ! 336: _PROTOTYP( int spar, (CHAR *) ); ! 337: _PROTOTYP( int rcvfil, (char *) ); ! 338: _PROTOTYP( CHAR * rpar, (void) ); ! 339: _PROTOTYP( CHAR * rpar, (void) ); ! 340: _PROTOTYP( int gnfile, (void) ); ! 341: _PROTOTYP( int getsbuf, (int) ); ! 342: _PROTOTYP( int getrbuf, (void) ); ! 343: _PROTOTYP( int freesbuf, (int) ); ! 344: _PROTOTYP( int freerbuf, (int) ); ! 345: _PROTOTYP( int dumpsbuf, (void) ); ! 346: _PROTOTYP( int dumprbuf, (void) ); ! 347: _PROTOTYP( VOID freerpkt, (int) ); ! 348: _PROTOTYP( int chkwin, (int, int, int) ); ! 349: _PROTOTYP( int rsattr, (CHAR *) ); ! 350: _PROTOTYP( int scmd, (char, CHAR *) ); ! 351: _PROTOTYP( int encstr, (CHAR *) ); ! 352: _PROTOTYP( int decode, (CHAR *, int (*)(char), int) ); ! 353: _PROTOTYP( int fnparse, (char *) ); ! 354: _PROTOTYP( int syscmd, (char *, char *) ); ! 355: _PROTOTYP( int cwd, (char *) ); ! 356: _PROTOTYP( VOID screen, (int, char, long, char *) ); ! 357: _PROTOTYP( int remset, (char *) ); ! 358: _PROTOTYP( int initattr, (struct zattr *) ); ! 359: _PROTOTYP( int gattr, (CHAR *, struct zattr *) ); ! 360: _PROTOTYP( int adebu, (char *, struct zattr *) ); ! 361: _PROTOTYP( int canned, (CHAR *) ); ! 362: _PROTOTYP( int opent, (struct zattr *) ); ! 363: _PROTOTYP( int opena, (char *, struct zattr *) ); ! 364: _PROTOTYP( int openi, (char *) ); ! 365: _PROTOTYP( int openo, (char *, struct zattr *, struct filinfo *) ); ! 366: _PROTOTYP( int reof, (char *, struct zattr *) ); ! 367: _PROTOTYP( VOID reot, (void) ); ! 368: _PROTOTYP( int sfile, (int) ); ! 369: _PROTOTYP( int sattr, (int) ); ! 370: _PROTOTYP( int sdata, (void) ); ! 371: _PROTOTYP( int seof, (CHAR *) ); ! 372: _PROTOTYP( int sxeof, (CHAR *) ); ! 373: _PROTOTYP( int seot, (void) ); ! 374: _PROTOTYP( int window, (int) ); ! 375: _PROTOTYP( int errmsg, (char *) ); ! 376: _PROTOTYP( int clsif, (void) ); ! 377: _PROTOTYP( int clsof, (int) ); ! 378: _PROTOTYP( CHAR setgen, (char, char *, char *, char *) ); ! 379: _PROTOTYP( int getpkt, (int, int) ); ! 380: _PROTOTYP( int putsrv, (char) ); ! 381: _PROTOTYP( int puttrm, (char) ); ! 382: _PROTOTYP( int putfil, (char) ); ! 383: _PROTOTYP( VOID zdstuff, (CHAR) ); ! 384: _PROTOTYP( int tinit, (void) ); ! 385: _PROTOTYP( VOID pktinit, (void) ); ! 386: _PROTOTYP( VOID rinit, (CHAR *) ); ! 387: _PROTOTYP( VOID resetc, (void) ); ! 388: _PROTOTYP( VOID xsinit, (void) ); ! 389: _PROTOTYP( int adjpkl, (int,int,int) ); ! 390: _PROTOTYP( VOID chktimo, (void) ); ! 391: _PROTOTYP( int nxtpkt, (void) ); ! 392: _PROTOTYP( int ack, (void) ); ! 393: _PROTOTYP( int ackns, (int, CHAR *) ); ! 394: _PROTOTYP( int ackn, (int) ); ! 395: _PROTOTYP( int ack1, (CHAR *) ); ! 396: _PROTOTYP( int nack, (int) ); ! 397: _PROTOTYP( VOID rcalcpsz, (void) ); ! 398: _PROTOTYP( int resend, (int) ); ! 399: _PROTOTYP( int errpkt, (CHAR *) ); ! 400: _PROTOTYP( VOID srinit, (void) ); ! 401: _PROTOTYP( VOID tstats, (void) ); ! 402: _PROTOTYP( VOID fstats, (void) ); ! 403: _PROTOTYP( VOID intmsg, (long) ); ! 404: _PROTOTYP( VOID ermsg, (char *) ); ! 405: _PROTOTYP( int chkint, (void) ); ! 406: _PROTOTYP( VOID sdebu, (int) ); ! 407: _PROTOTYP( VOID rdebu, (CHAR *, int) ); ! 408: _PROTOTYP( char * dbchr, ( int ) ); ! 409: #ifdef COMMENT ! 410: _PROTOTYP( SIGTYP stptrap, (int, int) ); ! 411: _PROTOTYP( SIGTYP trap, (int, int) ); ! 412: #else ! 413: _PROTOTYP( SIGTYP stptrap, (int) ); ! 414: _PROTOTYP( SIGTYP trap, (int) ); ! 415: #endif /* COMMENT */ ! 416: ! 417: /* User interface functions needed by main program */ ! 418: ! 419: _PROTOTYP( VOID prescan, (void) ); ! 420: _PROTOTYP( VOID setint, (void) ); ! 421: _PROTOTYP( VOID cmdini, (void) ); ! 422: _PROTOTYP( int dotake, (char *) ); ! 423: _PROTOTYP( int cmdlin, (void) ); ! 424: _PROTOTYP( int conect, (void) ); ! 425: _PROTOTYP( VOID herald, (void) ); ! 426: _PROTOTYP( VOID fixcmd, (void) ); ! 427: _PROTOTYP( int doarg, (char) ); ! 428: _PROTOTYP( VOID usage, (void) ); ! 429: _PROTOTYP( VOID doclean, (void) ); ! 430: _PROTOTYP( int sndhlp, (void) ); ! 431: _PROTOTYP( VOID ckhost, (char *, int) ); ! 432: #ifdef KANJI ! 433: _PROTOTYP( int xkanjf, (void) ); ! 434: _PROTOTYP( int xkanjz, (int (*)(char)) ); ! 435: _PROTOTYP( int xkanji, (int, int (*)(char)) ); ! 436: #endif /* KANJI */ ! 437: ! 438: #endif /* CKCKER_H */ ! 439: ! 440: /* End of ckcker.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.