home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit4f / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  6KB  |  218 lines

  1. /*  C K C D E B . H  */
  2. /*
  3.  This file is included by all C-Kermit modules, including the modules
  4.  that aren't specific to Kermit (like the command parser and the ck?tio and
  5.  ck?fio modules.  It specifies format codes for debug(), tlog(), and similar
  6.  functions, and includes any necessary typedefs to be used by all C-Kermit
  7.  modules, and also includes some feature selection compile-time switches.
  8. */
  9. /*
  10.  Copyright (C) 1987, 1989, Trustees of Columbia University in the City of New 
  11.  York. Permission is granted to any individual or institution to use, copy, or
  12.  redistribute this software so long as it is not sold for profit, provided this
  13.  copyright notice is retained.
  14. */
  15.  
  16. /*
  17.  DEBUG and TLOG should be defined in the Makefile if you want debugging
  18.  and transaction logs.  Don't define them if you want to save the space
  19.  and overhead.  (Note, in version 4F these definitions changed from "{}"
  20.  to the null string to avoid problems with semicolons after braces, as in:
  21.  "if (x) tlog(this); else tlog(that);"
  22. */
  23. #ifndef DEBUG
  24. #define debug(a,b,c,d)
  25. #endif
  26.  
  27. #ifndef TLOG
  28. #define tlog(a,b,c,d)
  29. #endif
  30.  
  31. /* Formats for debug(), tlog(), etc */
  32.  
  33. #define F000 0
  34. #define F001 1
  35. #define F010 2
  36. #define F011 3
  37. #define F100 4
  38. #define F101 5
  39. #define F110 6
  40. #define F111 7
  41.  
  42. /* Structure definitions for Kermit file attributes */
  43. /* All strings come as pointer and length combinations */
  44. /* Empty string (or for numeric variables, -1) = unused attribute. */
  45.  
  46. struct zstr {             /* string format */
  47.     int len;              /* length */
  48.     char *val;            /* value */
  49. };
  50. struct zattr {            /* Kermit File Attribute structure */
  51.     long lengthk;         /* (!) file length in K */
  52.     struct zstr type;     /* (") file type (text or binary) */
  53.     struct zstr date;     /* (#) file creation date [yy]yymmdd[ hh:mm[:ss]] */
  54.     struct zstr creator;  /* ($) file creator id */
  55.     struct zstr account;  /* (%) file account */
  56.     struct zstr area;     /* (&) area (e.g. directory) for file */
  57.     struct zstr passwd;   /* (') password for area */
  58.     long blksize;         /* (() file blocksize */
  59.     struct zstr access;   /* ()) file access: new, supersede, append, warn */
  60.     struct zstr encoding; /* (*) encoding (transfer syntax) */
  61.     struct zstr disp;     /* (+) disposition (mail, message, print, etc) */
  62.     struct zstr lprotect; /* (,) protection (local syntax) */
  63.     struct zstr gprotect; /* (-) protection (generic syntax) */
  64.     struct zstr systemid; /* (.) ID for system of origin */
  65.     struct zstr recfm;    /* (/) record format */
  66.     struct zstr sysparam; /* (0) system-dependent parameter string */
  67.     long length;          /* (1) exact length on system of origin */
  68. };
  69.  
  70. /* Unix Version Dependencies */
  71.  
  72. /* signal() type, void or int? */
  73. #ifdef SVR3
  74. typedef void SIGTYP;            /* System V R3 and later */
  75. #else
  76. #ifdef SUNOS4
  77. typedef void SIGTYP;            /* SUNOS V 4.0 and later */
  78. #else
  79. typedef int SIGTYP;
  80. #endif
  81. #endif
  82.  
  83. /* Systems that expand tilde at the beginning of file or directory names */
  84. #ifdef BSD4
  85. #define DTILDE
  86. #endif
  87. #ifdef UXIII
  88. #define DTILDE
  89. #endif
  90. #ifdef OSK
  91. #define DTILDE
  92. #endif
  93.  
  94. /* C Compiler Dependencies */
  95.  
  96. #ifdef ZILOG
  97. #define setjmp setret
  98. #define longjmp longret
  99. #define jmp_buf ret_buf
  100. #define getcwd curdir
  101. /* typedef int ret_buf[10]; (apparently duplicated in setret.h) */
  102. #endif /* zilog */
  103.  
  104. #ifdef PROVX1
  105. typedef char CHAR;
  106. typedef long LONG;
  107. typedef int void;
  108. #else
  109. #ifdef V7
  110. typedef char CHAR;
  111. typedef long LONG;
  112. #else
  113. #ifdef C70
  114. typedef char CHAR;
  115. typedef long LONG;
  116. #else
  117. #ifdef BSD29
  118. typedef char CHAR;
  119. typedef long LONG;
  120. #else
  121. typedef unsigned char CHAR;
  122. typedef long LONG;
  123. #endif
  124. #endif
  125. #endif
  126. #endif
  127.  
  128. #ifdef TOWER1
  129. typedef int void;
  130. #endif
  131.  
  132. /* Line delimiter for text files */
  133.  
  134. /*
  135.  If the system uses a single character for text file line delimitation,
  136.  define NLCHAR to the value of that character.  For text files, that
  137.  character will be converted to CRLF upon output, and CRLF will be converted
  138.  to that character on input during text-mode (default) packet operations.
  139. */
  140. #ifdef MAC                              /* Macintosh */
  141. #define NLCHAR 015
  142. #else
  143. #ifdef OSK                /* OS-9/68K */
  144. #define NLCHAR 015
  145. #else                                   /* All Unix-like systems */
  146. #define NLCHAR 012
  147. #endif
  148. #endif
  149.  
  150. /*
  151.  At this point, if there's a system that uses ordinary CRLF line
  152.  delimitation AND the C compiler actually returns both the CR and
  153.  the LF when doing input from a file, then #undef NLCHAR.
  154. */
  155. #ifdef OS2
  156. #undef NLCHAR
  157. #endif
  158.  
  159. /* The device name of a job's controlling terminal */
  160. /* Special for VMS, same for all Unixes (?), not used by Macintosh */
  161.  
  162. #ifdef vms
  163. #define CTTNAM "TT:"
  164. #else
  165. #ifdef datageneral
  166. #define CTTNAM "@output"
  167. #else
  168. #ifdef OSK
  169. extern char myttystr[];
  170. #define CTTNAM myttystr
  171. #else
  172. #define CTTNAM "/dev/tty"
  173. #endif
  174. #endif
  175. #endif
  176.  
  177. /* Some special includes for VAX/VMS */
  178.  
  179. #ifndef vms
  180. /* The following #includes cause problems for some preprocessors. */
  181. /*
  182. #endif
  183. #ifdef vms
  184. #include ssdef
  185. #include stsdef
  186. #endif
  187. #ifndef vms
  188. */
  189. #endif
  190.  
  191. /* Program return codes for VMS, DECUS C, and Unix */
  192.  
  193. #ifdef vms
  194. #define GOOD_EXIT   (SS$_NORMAL | STS$M_INHIB_MSG)
  195. #define BAD_EXIT    SS$_ABORT
  196. #else
  197. #ifdef decus
  198. #define GOOD_EXIT   IO_NORMAL
  199. #define BAD_EXIT    IO_ERROR
  200. #else
  201. #define GOOD_EXIT   0
  202. #define BAD_EXIT    1
  203. #endif
  204. #endif
  205.  
  206. /* Special hack for Fortune, which doesn't have <sys/file.h>... */
  207.  
  208. #ifdef FT18
  209. #define FREAD 0x01
  210. #define FWRITE 0x10
  211. #endif
  212.  
  213. /* special hack for os9/68k */
  214. #ifdef OSK
  215. #define SIGARB    5342            /* arbitrary user signal */
  216. #define SIGALRM 5343            /* and another */
  217. #endif
  218.