home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d534 / term.lha / Term / Libs.LZH / XprQuickB / xproto.h < prev   
C/C++ Source or Header  |  1991-07-26  |  5KB  |  122 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.                   char  *xpr_filename;      /* File name(s)             */
  11.                   long (*xpr_fopen)();      /* Open file                */
  12.                   long (*xpr_fclose)();     /* Close file               */
  13.                   long (*xpr_fread)();      /* Get char from file       */
  14.                   long (*xpr_fwrite)();     /* Put string to file       */
  15.                   long (*xpr_sread)();      /* Get char from serial     */
  16.                   long (*xpr_swrite)();     /* Put string to serial     */
  17.                   long (*xpr_sflush)();     /* Flush serial input buffer*/
  18.                   long (*xpr_update)();     /* Print stuff              */
  19.                   long (*xpr_chkabort)();   /* Check for abort          */
  20.                   long (*xpr_chkmisc)();    /* Check misc. stuff        */
  21.                   long (*xpr_gets)();       /* Get string interactively */
  22.                   long (*xpr_setserial)();  /* Set and Get serial info  */
  23.                   long (*xpr_ffirst)();     /* Find first file name     */
  24.                   long (*xpr_fnext)();      /* Find next file name      */
  25.                   long (*xpr_finfo)();      /* Return file info         */
  26.                   long (*xpr_fseek)();      /* Seek in a file           */
  27.                   long   xpr_extension;     /* Number of extensions     */
  28.                   long  *xpr_data;          /* Initialized by Setup.    */
  29.                   long (*xpr_options)();    /* Multiple XPR options.    */
  30.                   long (*xpr_unlink)();     /* Delete a file.           */
  31.                   long (*xpr_squery)();     /* Query serial device      */
  32.                   long (*xpr_getptr)();     /* Get various host ptrs    */
  33.               };
  34. /*
  35. *   Number of defined extensions
  36. */
  37. #define XPR_EXTENSION 4L
  38.  
  39. /*
  40. *   The functions
  41. */
  42. #if 0 /* the external attributes are different for Lattice C */
  43. extern long XProtocolSend(),  XProtocolReceive(),
  44.             XProtocolSetup(), XProtocolCleanup();
  45. #endif
  46. /*
  47. *   Flags returned by XProtocolSetup()
  48. */
  49. #define XPRS_FAILURE    0x00000000L
  50. #define XPRS_SUCCESS    0x00000001L
  51. #define XPRS_NORECREQ   0x00000002L
  52. #define XPRS_NOSNDREQ   0x00000004L
  53. #define XPRS_HOSTMON    0x00000008L
  54. #define XPRS_USERMON    0x00000010L
  55. #define XPRS_HOSTNOWAIT 0x00000020L
  56. /*
  57. *   The update structure
  58. */
  59. struct XPR_UPDATE {     long  xpru_updatemask;
  60.                         char *xpru_protocol;
  61.                         char *xpru_filename;
  62.                         long  xpru_filesize;
  63.                         char *xpru_msg;
  64.                         char *xpru_errormsg;
  65.                         long  xpru_blocks;
  66.                         long  xpru_blocksize;
  67.                         long  xpru_bytes;
  68.                         long  xpru_errors;
  69.                         long  xpru_timeouts;
  70.                         long  xpru_packettype;
  71.                         long  xpru_packetdelay;
  72.                         long  xpru_chardelay;
  73.                         char *xpru_blockcheck;
  74.                         char *xpru_expecttime;
  75.                         char *xpru_elapsedtime;
  76.                         long  xpru_datarate;
  77.                         long  xpru_reserved1;
  78.                         long  xpru_reserved2;
  79.                         long  xpru_reserved3;
  80.                         long  xpru_reserved4;
  81.                         long  xpru_reserved5;
  82.                    };
  83. /*
  84. *   The possible bit values for the xpru_updatemask are:
  85. */
  86. #define XPRU_PROTOCOL           0x00000001L
  87. #define XPRU_FILENAME           0x00000002L
  88. #define XPRU_FILESIZE           0x00000004L
  89. #define XPRU_MSG                0x00000008L
  90. #define XPRU_ERRORMSG           0x00000010L
  91. #define XPRU_BLOCKS             0x00000020L
  92. #define XPRU_BLOCKSIZE          0x00000040L
  93. #define XPRU_BYTES              0x00000080L
  94. #define XPRU_ERRORS             0x00000100L
  95. #define XPRU_TIMEOUTS           0x00000200L
  96. #define XPRU_PACKETTYPE         0x00000400L
  97. #define XPRU_PACKETDELAY        0x00000800L
  98. #define XPRU_CHARDELAY          0x00001000L
  99. #define XPRU_BLOCKCHECK         0x00002000L
  100. #define XPRU_EXPECTTIME         0x00004000L
  101. #define XPRU_ELAPSEDTIME        0x00008000L
  102. #define XPRU_DATARATE           0x00010000L
  103. /*
  104. *   The xpro_option structure
  105. */
  106. struct xpr_option {
  107.    char *xpro_description;      /* description of the option                  */
  108.    long  xpro_type;             /* type of option                             */
  109.    char *xpro_value;            /* pointer to a buffer with the current value */
  110.    long  xpro_length;           /* buffer size                                */
  111. };
  112. /*
  113. *   Valid values for xpro_type are:
  114. */
  115. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  116. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  117. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  118. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  119. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  120. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  121.  
  122.