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

  1. /* Version 0.8(35) - Jim Noble at Planning Research Corporation, June 1987. */
  2. /* Ported to Megamax native Macintosh C compiler. */
  3.  
  4. /* Symbol Definitions */
  5.  
  6. #define TRUE      1        /* Boolean constants */
  7. #define FALSE     0
  8. #define NIL                0
  9. #define NULL            0
  10. #define NILPTR        (Ptr) NIL
  11. #define NILPROC        (ProcPtr) NIL
  12. #define ALLTYPES -1        /* All types for SFGetFile */
  13.  
  14. #define MYBUFSIZE   2048    /* Serial driver replacement buffer */
  15.  
  16. #define OKBtn    ok        /* OK and Cancel constants */
  17. #define QuitBtn    cancel        /* Defined by Dialog Mgr */
  18.  
  19. #define btnOff    0
  20. #define btnOn    1
  21.  
  22. #define getctlhdl(item,dp) (ControlHandle) gethdl(item,dp)
  23.  
  24. #define ApplCreator 'KR09'
  25.  
  26. /* settings for parity */
  27.  
  28. #define MPARITY_ODD (oddParity+stop10+data7)
  29. #define MPARITY_EVEN (evenParity+stop10+data7)
  30. #define MPARITY_MARK (noParity+stop20+data7)
  31. #define MPARITY_SPACE (noParity+stop10+data8)
  32. #define MPARITY_NONE (noParity+stop10+data8)
  33.  
  34. #define KPARITY_ODD 'o'
  35. #define KPARITY_EVEN 'e'
  36. #define KPARITY_MARK 'm'
  37. #define KPARITY_SPACE 's'
  38. #define KPARITY_NONE 0
  39.  
  40. typedef struct {        /* file arguments since Kermit */
  41.     char fillcl[64], filrem[64];/* doesn't pass all the info */
  42.     int filflg;            /* we need... */
  43.     int fildflg;        /* default flags */
  44.     short filvol;        /* file volume */
  45.     int filfldr;        /* file folder for new files */
  46.     long filsiz;        /* size of file after open */
  47. }   FILINF;
  48.  
  49. /* Flags in filflg, fildflg */
  50.  
  51. #define FIL_BINA     1
  52. #define FIL_TEXT     2
  53. #define FIL_RSRC     4
  54. #define FIL_DATA     8
  55. #define FIL_OKILL 16        /* same as kermit's !warn */
  56. #define FIL_DODLG 32        /* show dialogs on recv */
  57. #define FIL_ALLFL 64        /* send all files from the curr folder */
  58.  
  59. #define FIL_RBDT (FIL_RSRC | FIL_BINA | FIL_DATA | FIL_TEXT)
  60.  
  61.  
  62. /* type definitions for keyboard macro structures */
  63. typedef struct {
  64.     short code;            /* key and modification code for this
  65.                  * keymacro */
  66.     char flags;            /* flags for this key macro definition */
  67.     char len;            /* length of the macro string in bytes */
  68.     long macro;            /* if len <=4 contains the macrostring else */
  69. }   macrorec;            /* it contains a pointer to the macrostring */
  70.  
  71. #define shortBreak 1        /* flag for short break */
  72. #define longBreak     2    /* flag for long break */
  73.  
  74. #define NUMOFMODS 4
  75. typedef struct {
  76.     short modbits;        /* modifier combination */
  77.     char prefix[20];        /* prefix string */
  78. }   modrec;
  79.  
  80. /* the following type is used as an overlay for a memory     */
  81. /* block which contains the macros. It is !not! used for a */
  82. /* static variable. So don't worry about its size                  */
  83. typedef struct {
  84.     modrec modtab[NUMOFMODS];    /* modifier table */
  85.     short numOfMacros;        /* number of macros the table contains */
  86.     macrorec mcr[1024];        /* array of macro definitions */
  87. }   macrodefs;
  88.  
  89. typedef struct {        /* dummy struct definiton to get the size of */
  90.     /* the base fields in macrodefs easily */
  91.     modrec modtab[NUMOFMODS];    /* modifier table */
  92.     short numOfMacros;        /* number of macros the table contains */
  93. }   macrodefsize;
  94.  
  95. #define MacroBaseSize sizeof(macrodefsize)
  96.  
  97. typedef macrodefs **hmacrodefs;    /* handle to a macrodefs structure */
  98.  
  99.  
  100. /* Globals Kermit variables */
  101.  
  102. extern char *cmarg,        /* pointer to cmd argument (file) */
  103.    *cmarg2,            /* pointer to second cmd argument */
  104.     mypadc,            /* padding char to ask for */
  105.     padch, eol,            /* end of line char to send */
  106.     seol, mystch,        /* outbound packet start character */
  107.     stchr, sstate;        /* kermit protocol state */
  108.  
  109. extern long ffc;        /* file character count  */
  110.  
  111. extern int speed,        /* speed of port */
  112.     parity,            /* current parity setting */
  113.     duplex,            /* TRUE if full duplex */
  114.     binary,            /* TRUE if file mode is binary */
  115.     displa,            /* TRUE for calls to screen() */
  116.     seslog,            /* TRUE if writing session log */
  117.     tralog,            /* TRUE if writing transaction log */
  118.     bctr,            /* block check type (1, 2, or 3) */
  119.     delay,            /* initial delay before sending */
  120.     mypadn,            /* something to do with padding */
  121.     npad, timint,        /* timeout interval in seconds */
  122.     rtimo, spsiz,        /* max packet size we send */
  123.     rpsiz, urpsiz,        /* user requested packet size */
  124.     turnch,            /* line "turnaround" character */
  125.     turn,            /* if TRUE "turnaround" enabled */
  126.     quiet,            /* if TRUE screen() should be quiet */
  127.     nfils,            /* */
  128.     warn,            /* TRUE does name conversion, else */
  129.                 /* deletes duplicate names on recv */
  130.     server,            /* TRUE if we are in server mode */
  131.     cxseen,            /* if TRUE abort file */
  132.     czseen,            /* if TRUE abort group */
  133.     keep,            /* Keep incomplete files */
  134.     tlevel,            /* > -1 if take file is running */
  135.     newline,            /* TRUE if linefeed after carriage return */
  136.     autowrap,            /* TRUE if autowrap is on */
  137.     screeninvert,        /* TRUE if inverted screen */
  138.     autorepeat,            /* TRUE if auto repeat is on */
  139.     smoothscroll,        /* TRUE if smooth scrolling is on */
  140.     transparent,        /* TRUE if control characters are not shown */
  141.     blockcursor,        /* TRUE if block cursor is used */
  142.     mouse_arrows,        /* TRUE if we send arrow keys on mouse downs */
  143.     visible_bell,        /* true if we do blink instead of bell */
  144.     nat_chars,            /* half transparent -- show undef. control
  145.                  * chars */
  146.     blinkcursor;        /* TRUE if we make the cursor blink */
  147.  
  148. extern Boolean mcmdactive,    /* TRUE if menu command keys are active */
  149.     fkeysactive;        /* TRUE if FKEYs are enabled */
  150.  
  151. /* Mac global variables */
  152.  
  153. extern short innum,        /* serial line input number */
  154.     outnum;            /* serial line output number */
  155.  
  156. extern int protocmd;        /* current cmd that made us enter */
  157.  /* protocol or 0 if protocol is */
  158.  /* not running, or -1 if remote cmd */
  159. extern FILINF filargs;        /* file information flags */
  160.  
  161. /*
  162.  * ScrDmpEnb is a flag byte used by the toolbox event manager to say
  163.  * whether command-shift-1 through command-shift-9 do anything special
  164.  * like dump the screen, eject the diskettes, etc.  This byte is used in
  165.  * INIT0, the keyboard mapping routine (see IM index under scrdmpenb).
  166.  *
  167.  * N.B: The location of this value may change if MAC comes out with a
  168.  * new SYSTEM.
  169.  *
  170.  */
  171.  
  172. #define ScrDmpEnb (*(unsigned char *) 0x2f8)
  173. #define scrdmpenabled ((unsigned char) 0xff)
  174. #define scrdmpdisabled ((unsigned char) 0x00)
  175.  
  176.  
  177. /****************************************************************************/
  178. pascal void
  179. Debugger ()
  180. /****************************************************************************/
  181. extern 0xA9FF;            /* invoke MacsBug */
  182.