home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / acorn / ackerm.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  13KB  |  433 lines

  1. <<< accdeb.h >>>
  2.  
  3.  
  4. #define DEBUG
  5. #define PANOS
  6.  
  7. /*  C K C D E B . H  */
  8.  
  9. /*
  10.  This file is included by all C-Kermit modules, including the modules
  11.  that aren't specific to Kermit (like the command parser and the ck?tio and
  12.  ck?fio modules.  It specifies format codes for debug(), tlog(), and similar
  13.  functions, and includes any necessary typedefs to be used by all C-Kermit
  14.  modules, and also includes some feature selection compile-time switches.
  15. */
  16. /*
  17.  Copyright (C) 1985, Trustees of Columbia University in the City of New York.
  18.  Permission is granted to any individual or institution to use, copy, or
  19.  redistribute this software so long as it is not sold for profit, provided this
  20.  copyright notice is retained.
  21. */
  22.  
  23. /*
  24.  DEBUG and TLOG should be defined in the Makefile if you want debugging
  25.  and transaction logs.  Don't define them if you want to save the space
  26.  and overhead.
  27. */
  28. #ifndef DEBUG
  29. #define debug(a,b,c,d) {}
  30. #endif
  31.  
  32. #ifndef TLOG
  33. #define tlog(a,b,c,d) {}
  34. #endif
  35.  
  36. /* Formats for debug(), tlog(), etc */
  37.  
  38. #define F000 0
  39.  
  40. #define F001 1
  41. #define F010 2
  42. #define F011 3
  43. #define F100 4
  44. #define F101 5
  45. #define F110 6
  46. #define F111 7
  47.  
  48. /* Compiler dependencies */
  49.  
  50. #ifdef PROVX1
  51. typedef char CHAR;
  52. typedef long LONG;
  53. typedef int void;
  54. #else
  55. #ifdef    V7
  56. typedef char CHAR;
  57. typedef long LONG;
  58. #else
  59. #ifdef    C70
  60. typedef char CHAR;
  61. typedef long LONG;
  62. #else
  63. typedef unsigned char CHAR;
  64. typedef long LONG;
  65. #endif
  66. #endif
  67. #endif
  68.  
  69. #ifdef TOWER1
  70. typedef int void;
  71. #endif
  72.  
  73. /* Line delimiter for text files */
  74.  
  75. /*
  76.  If the system uses a single character for text file line delimitation,
  77.  define NLCHAR to the value of that character.  For text files, that
  78.  character will be converted to CRLF upon output, and CRLF will be converted
  79.  to that character on input.
  80. */
  81. #ifdef MAC                /* Macintosh */
  82. #define NLCHAR 015
  83. #else                    /* All Unix-like systems */
  84. #define NLCHAR 012
  85. #endif
  86. /*
  87.  At this point, if there's a system that uses ordinary CRLF line
  88.  delimitation AND the C compiler actually returns both the CR and
  89.  the LF when doing input from a file, then #undef NLCHAR.
  90. */
  91.  
  92. /* The device name of a job's controlling terminal */
  93. /* Special for VMS, same for all Unixes (?), not used by Macintosh */
  94.  
  95. #ifdef vax11c
  96. #define CTTNAM "TT:"
  97. #else
  98. #define CTTNAM "/dev/tty"
  99. #endif
  100.  
  101.  
  102.  
  103. /* Some special includes for VAX/VMS */
  104.  
  105. #ifdef vax11c
  106. #include ssdef
  107. #include stsdef
  108. #endif
  109.  
  110. /* Program return codes for VMS, DECUS C, and Unix */
  111.  
  112. #ifdef vax11c
  113. #define    GOOD_EXIT   (SS$_NORMAL | STS$M_INHIB_MSG)
  114. #define    BAD_EXIT    SS$_ABORT
  115. #else
  116. #ifdef decus
  117. #define    GOOD_EXIT   IO_NORMAL
  118. #define    BAD_EXIT    IO_ERROR
  119. #else
  120. #define GOOD_EXIT   0
  121. #define BAD_EXIT    1
  122. #endif
  123. #endif
  124. <<< accker.h >>>
  125. /* ckcker.h -- Symbol and macro definitions for C-Kermit */
  126.  
  127. /*
  128.  Author: Frank da Cruz (SY.FDC@CU20B),
  129.  Columbia University Center for Computing Activities, January 1985.
  130.  Copyright (C) 1985, Trustees of Columbia University in the City of New York.
  131.  Permission is granted to any individual or institution to use, copy, or
  132.  redistribute this software so long as it is not sold for profit, provided this
  133.  copyright notice is retained. 
  134. */
  135.  
  136. /* Mnemonics for ASCII characters */
  137.  
  138. #define NUL       000            /* ASCII Null */
  139. #define SOH       001            /* ASCII Start of header */
  140. #define BEL        007        /* ASCII Bell (Beep) */
  141. #define BS         010        /* ASCII Backspace */
  142. #define LF         012            /* ASCII Linefeed */
  143. #define CR         015        /* ASCII Carriage Return */
  144. #define XON       021            /* ASCII XON */
  145. #define SP       040        /* ASCII Space */
  146. #define DEL       0177        /* ASCII Delete (Rubout) */
  147.  
  148. /* Kermit parameters and defaults */
  149.  
  150. #define MAXPACK       94        /* Maximum packet size */
  151. #define RBUFL       200             /* Receive buffer length */
  152. #define CTLQ       '#'        /* Control char prefix I will use */
  153. #define MYEBQ       '&'        /* 8th-Bit prefix char I will use */
  154. #define MYRPTQ       '~'        /* Repeat count prefix I will use */
  155.  
  156. #define MAXTRY        10          /* Times to retry a packet */
  157. #define MYPADN        0          /* How many padding chars I need */
  158. #define MYPADC        '\0'      /* Which padding character I need */
  159.  
  160. #define DMYTIM        7          /* Default timeout interval to use. */
  161. #define URTIME        10          /* Timeout interval to be used on me. */
  162.  
  163. #define DEFTRN        0           /* Default line turnaround handshake */
  164. #define DEFPAR        0           /* Default parity */
  165. #define MYEOL        CR          /* End-Of-Line character I need on packets. */
  166.  
  167. #define DRPSIZ        90            /* Default incoming packet size. */
  168. #define DSPSIZ        90            /* Default outbound packet size. */
  169.  
  170. #define DDELAY      5        /* Default delay. */
  171. #define DSPEED        9600     /* Default line speed. */
  172.  
  173. /* Files */
  174.  
  175. #define ZCTERM      0            /* Console terminal */
  176. #define ZSTDIO      1        /* Standard input/output */
  177. #define ZIFILE        2        /* Current input file */
  178. #define ZOFILE      3            /* Current output file */
  179. #define ZDFILE      4            /* Current debugging log file */
  180. #define ZTFILE      5            /* Current transaction log file */
  181. #define ZPFILE      6            /* Current packet log file */
  182. #define ZSFILE      7        /* Current session log file */
  183. #define ZSYSFN        8        /* Input from a system function */
  184. #define ZNFILS      9            /* How many defined file numbers */
  185.  
  186. /* Screen functions */
  187.  
  188. #define SCR_FN 1        /* filename */
  189. #define SCR_AN 2        /* as-name */
  190. #define SCR_FS 3     /* file-size */
  191. #define SCR_XD 4        /* x-packet data */
  192. #define SCR_ST 5          /* File status: */
  193. #define   ST_OK   0       /*  Transferred OK */
  194. #define   ST_DISC 1     /*  Discarded */
  195. #define   ST_INT  2     /*  Interrupted */
  196. #define   ST_SKIP 3     /*  Skipped */
  197. #define   ST_ERR  4     /*  Fatal Error */
  198. #define SCR_PN 6        /* packet number */
  199. #define SCR_PT 7        /* packet type or pseudotype */
  200. #define SCR_TC 8        /* transaction complete */
  201. #define SCR_EM 9        /* error message */
  202. #define SCR_WM 10       /* warning message */
  203. #define SCR_TU 11    /* arbitrary undelimited text */
  204. #define SCR_TN 12       /* arbitrary new text, delimited at beginning */
  205. #define SCR_TZ 13       /* arbitrary text, delimited at end */
  206. #define SCR_QE 14    /* quantity equals (e.g. "foo: 7") */
  207.  
  208. /* Macros */
  209.  
  210. #define tochar(ch)  ((ch) + SP )    /* Number to character */
  211. #define unchar(ch)  ((ch) - SP )    /* Character to number */
  212. #define ctl(ch)     ((ch) ^ 64 )    /* Controllify/Uncontrollify */
  213. #define unpar(ch)   ((ch) & 127)    /* Clear parity bit */
  214. <<< ackerm.h >>>
  215. <<< acsignal.h >>>
  216. /* signal-h */
  217. #define SIGALARM   5
  218. #define SIGPROF    (SIGALARM+256)
  219. #define SIGVTALARM SIGALARM
  220. #define SIGQUIT    6 /* escape */
  221. #define SIGINT     SIGQUIT+256
  222. #define CSignal 12543 /* random no - handle for PANOS event routine */
  223. #define CONDSTOP   1
  224. #define CONDEXCEPTION 2
  225. #define signal(a, b) ckpsig(a, b)
  226. <<< actime.h >>>
  227. /* time-h */
  228. typedef struct { unsigned int low; unsigned int high; } timeval;
  229.  
  230. extern unsigned int timerdiff() ;
  231. extern gettimeofday() ;
  232. extern alarm() ;
  233. <<< acucmd.h >>>
  234. /*  C K U C M D . H  --  Header file for Unix cmd package  */
  235.  
  236. /*
  237.  Author: Frank da Cruz (SY.FDC@CU20B),
  238.  Columbia University Center for Computing Activities, January 1985.
  239.  Copyright (C) 1985, Trustees of Columbia University in the City of New York.
  240.  Permission is granted to any individual or institution to use, copy, or
  241.  redistribute this software so long as it is not sold for profit, provided this
  242.  copyright notice is retained. 
  243. */
  244.  
  245. /* Special getchars... */
  246.  
  247. #ifdef vax11c
  248. #define getchar()   vms_getchar()
  249. #endif
  250.  
  251. #ifdef aegis
  252. #define getchar()   coninc(0)
  253. #endif
  254.  
  255. /* Sizes of things */
  256.  
  257. #define HLPLW  78            /* Width of ?-help line */
  258. #define HLPCW  19            /* Width of ?-help column */
  259. #define CMDBL  200            /* Command buffer length */
  260. #define HLPBL  100            /* Help string buffer length */
  261. #define ATMBL  100            /* Command atom buffer length*/
  262.  
  263. /* Special characters */
  264.  
  265. #ifndef NUL
  266. #define NUL  '\0'            /* Null */
  267. #endif
  268. #define HT   '\t'            /* Horizontal Tab */
  269. #define NL   '\n'            /* Newline */
  270. #ifndef CR
  271. #define CR   '\r'
  272. #endif
  273. #define FF   0014            /* Formfeed    (^L) */
  274. #define RDIS 0022            /* Redisplay   (^R) */
  275. #define LDEL 0025            /* Delete line (^U) */
  276. #define WDEL 0027            /* Delete word (^W) */
  277. #define ESC  0033            /* Escape */
  278. #define RUB  0177            /* Rubout */
  279.  
  280. #ifndef BEL
  281. #define BEL  0007            /* Bell */
  282. #endif
  283.  
  284. #ifndef BS
  285. #define BS   0010            /* Backspace */
  286. #endif
  287.  
  288. #ifndef SP
  289. #define SP   0040            /* Space */
  290. #endif
  291.  
  292. /* Keyword table flags */
  293.  
  294. #define CM_INV 1            /* Invisible keyword */
  295.  
  296. /* Keyword Table Template */
  297.  
  298. struct keytab {                /* Keyword table */
  299.     char *kwd;                /* Pointer to keyword string */
  300.     int val;                /* Associated value */
  301.     int flgs;                /* Flags (as defined above) */
  302. };
  303. <<< acuusr.h >>>
  304. /*  C K U U S R . H  --  Symbol definitions for C-Kermit ckuus*.c modules  */
  305.  
  306. /*
  307.  Author: Frank da Cruz (SY.FDC@CU20B),
  308.  Columbia University Center for Computing Activities, January 1985.
  309.  Copyright (C) 1985, Trustees of Columbia University in the City of New York.
  310.  Permission is granted to any individual or institution to use, copy, or
  311.  redistribute this software so long as it is not sold for profit, provided this
  312.  copyright notice is retained. 
  313. */
  314.  
  315. #ifndef vax11c
  316. /* #include <pwd.h> don't know what this is */
  317. #endif
  318.  
  319. /* Values associated with top-level commands, must be 0 or greater. */
  320.  
  321. #define XXBYE   0    /* BYE */
  322. #define XXCLE   1    /* CLEAR */
  323. #define XXCLO   2    /* CLOSE */
  324. #define XXCON   3    /* CONNECT */
  325. #define XXCPY   4    /* COPY */
  326. #define XXCWD   5    /* CWD (Change Working Directory) */
  327. #define XXDEF    6    /* DEFINE (a command macro) */
  328. #define XXDEL   7    /* (Local) DELETE */
  329. #define XXDIR   8    /* (Local) DIRECTORY */
  330. #define XXDIS   9    /* DISCONNECT */
  331. #define XXECH  10    /* ECHO */
  332. #define XXEXI  11    /* EXIT */
  333. #define XXFIN  12    /* FINISH */
  334. #define XXGET  13    /* GET */
  335. #define XXHLP  14    /* HELP */
  336. #define XXINP  15    /* INPUT */
  337. #define XXLOC  16    /* LOCAL */
  338. #define XXLOG  17    /* LOG */
  339. #define XXMAI  18    /* MAIL */
  340. #define XXMOU  19    /* (Local) MOUNT */
  341. #define XXMSG  20    /* (Local) MESSAGE */
  342. #define XXOUT  21    /* OUTPUT */
  343. #define XXPAU  22    /* PAUSE */
  344. #define XXPRI  23    /* (Local) PRINT */
  345. #define XXQUI  24    /* QUIT */
  346. #define XXREC  25    /* RECEIVE */
  347. #define XXREM  26    /* REMOTE */
  348. #define XXREN  27    /* (Local) RENAME */
  349. #define XXSEN  28    /* SEND */
  350. #define XXSER  29       /* SERVER */
  351. #define XXSET  30    /* SET */
  352. #define XXSHE  31    /* Command for SHELL */
  353. #define XXSHO  32    /* SHOW */
  354. #define XXSPA  33    /* (Local) SPACE */
  355. #define XXSTA  34    /* STATISTICS */
  356. #define XXSUB  35    /* (Local) SUBMIT */
  357. #define XXTAK  36    /* TAKE */
  358. #define XXTRA  37    /* TRANSMIT */
  359. #define XXTYP  38    /* (Local) TYPE */
  360. #define XXWHO  39    /* (Local) WHO */
  361. #define XXDIAL 40    /* (Local) DIAL */
  362. #define XXLOGI 41    /* (Local) SCRIPT */
  363. #define XXCOM  42    /* Comment */
  364.  
  365. /* SET parameters */
  366.  
  367. #define XYBREA  0    /* BREAK simulation */
  368. #define XYCHKT  1    /* Block check type */
  369. #define XYDEBU  2    /* Debugging */
  370. #define XYDELA  3    /* Delay */
  371. #define XYDUPL  4    /* Duplex */
  372. #define XYEOL   5    /* End-Of-Line (packet terminator) */
  373. #define XYESC   6    /* Escape character */
  374. #define XYFILE  7    /* File Parameters */
  375. #define   XYFILN 0      /*  Naming  */
  376. #define   XYFILT 1      /*  Type    */
  377. #define   XYFILW 2      /*  Warning */
  378. #define   XYFILD 3      /*  ...     */
  379. /* empty space to add something */
  380. #define XYFLOW  9    /* Flow Control */
  381. #define XYHAND 10    /* Handshake */
  382. #define XYIFD  11    /* Incomplete File Disposition */
  383. #define XYIMAG 12    /* "Image Mode" */
  384. #define XYINPU 13    /* INPUT command parameters */
  385. #define XYLEN  14    /* Maximum packet length to send */
  386. #define XYLINE 15    /* Communication line to use */
  387. #define XYLOG  16    /* Log file */
  388. #define XYMARK 17    /* Start of Packet mark */
  389. #define XYNPAD 18    /* Amount of padding */
  390. #define XYPADC 19    /* Pad character */
  391. #define XYPARI 20    /* Parity */
  392. #define XYPAUS 21    /* Interpacket pause */
  393. #define XYPROM 22    /* Program prompt string */
  394. #define XYQBIN 23    /* 8th-bit prefix */
  395. #define XYQCTL 24    /* Control character prefix */
  396. #define XYREPT 25    /* Repeat count prefix */
  397. #define XYRETR 26    /* Retry limit */
  398. #define XYSPEE 27    /* Line speed (baud rate) */
  399. #define XYTACH 28    /* Character to be doubled */
  400. #define XYTIMO 29    /* Timeout interval */
  401. #define XYMODM 30    /* Modem type */
  402. #define XYSEND 31    /* SEND parameters, used with some of the above */
  403. #define XYRECV 32       /* RECEIVE parameters, ditto */
  404.  
  405. /* REMOTE command symbols */
  406.  
  407. #define XZCPY  0    /* Copy */
  408. #define XZCWD  1    /* Change Working Directory */
  409. #define XZDEL  2    /* Delete */
  410. #define XZDIR  3    /* Directory */
  411. #define XZHLP  4    /* Help */
  412. #define XZHOS  5    /* Host */
  413. #define XZKER  6    /* Kermit */
  414. #define XZLGI  7    /* Login */
  415. #define XZLGO  8    /* Logout */
  416. #define XZMAI  9    /* Mail */
  417. #define XZMOU 10    /* Mount */
  418. #define XZMSG 11    /* Message */
  419. #define XZPRI 12    /* Print */
  420. #define XZREN 13    /* Rename */
  421. #define XZSET 14    /* Set */
  422. #define XZSPA 15    /* Space */
  423. #define XZSUB 16    /* Submit */
  424. #define XZTYP 17    /* Type */
  425. #define XZWHO 18    /* Who */
  426.  
  427. /* Symbols for logs */
  428.  
  429. #define LOGD 0            /* Debugging */
  430. #define LOGP 1          /* Packets */
  431. #define LOGS 2          /* Session */
  432. #define LOGT 3          /* Transaction */
  433.