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

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.                   UBYTE  *xpr_filename;      /* File name(s)             */
  11.                   long (*xpr_fopen)();      /* Open file                */
  12.                   long (*xpr_fclose)();     /* Close file               */
  13.                   long (*xpr_fread)();      /* Get UBYTE from file       */
  14.                   long (*xpr_fwrite)();     /* Put string to file       */
  15.                   long (*xpr_sread)();      /* Get UBYTE 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.  
  43. LONG __stdargs XProtocolCleanup(struct XPR_IO *);
  44. LONG __stdargs XProtocolSetup(struct XPR_IO *);
  45. LONG __stdargs XProtocolSend(struct XPR_IO *);
  46. LONG __stdargs XProtocolReceive(struct XPR_IO *);
  47.  
  48. /*
  49. *   Flags returned by XProtocolSetup()
  50. */
  51. #define XPRS_FAILURE    0x00000000L
  52. #define XPRS_SUCCESS    0x00000001L
  53. #define XPRS_NORECREQ   0x00000002L
  54. #define XPRS_NOSNDREQ   0x00000004L
  55. #define XPRS_HOSTMON    0x00000008L
  56. #define XPRS_USERMON    0x00000010L
  57. #define XPRS_HOSTNOWAIT 0x00000020L
  58. /*
  59. *   The update structure
  60. */
  61. struct XPR_UPDATE {     long  xpru_updatemask;
  62.                         UBYTE *xpru_protocol;
  63.                         UBYTE *xpru_filename;
  64.                         long  xpru_filesize;
  65.                         UBYTE *xpru_msg;
  66.                         UBYTE *xpru_errormsg;
  67.                         long  xpru_blocks;
  68.                         long  xpru_blocksize;
  69.                         long  xpru_bytes;
  70.                         long  xpru_errors;
  71.                         long  xpru_timeouts;
  72.                         long  xpru_packettype;
  73.                         long  xpru_packetdelay;
  74.                         long  xpru_chardelay;
  75.                         UBYTE *xpru_blockcheck;
  76.                         UBYTE *xpru_expecttime;
  77.                         UBYTE *xpru_elapsedtime;
  78.                         long  xpru_datarate;
  79.                         long  xpru_reserved1;
  80.                         long  xpru_reserved2;
  81.                         long  xpru_reserved3;
  82.                         long  xpru_reserved4;
  83.                         long  xpru_reserved5;
  84.                    };
  85. /*
  86. *   The possible bit values for the xpru_updatemask are:
  87. */
  88. #define XPRU_PROTOCOL           0x00000001L
  89. #define XPRU_FILENAME           0x00000002L
  90. #define XPRU_FILESIZE           0x00000004L
  91. #define XPRU_MSG                0x00000008L
  92. #define XPRU_ERRORMSG           0x00000010L
  93. #define XPRU_BLOCKS             0x00000020L
  94. #define XPRU_BLOCKSIZE          0x00000040L
  95. #define XPRU_BYTES              0x00000080L
  96. #define XPRU_ERRORS             0x00000100L
  97. #define XPRU_TIMEOUTS           0x00000200L
  98. #define XPRU_PACKETTYPE         0x00000400L
  99. #define XPRU_PACKETDELAY        0x00000800L
  100. #define XPRU_CHARDELAY          0x00001000L
  101. #define XPRU_BLOCKCHECK         0x00002000L
  102. #define XPRU_EXPECTTIME         0x00004000L
  103. #define XPRU_ELAPSEDTIME        0x00008000L
  104. #define XPRU_DATARATE           0x00010000L
  105. /*
  106. *   The xpro_option structure
  107. */
  108. struct xpr_option {
  109.    UBYTE *xpro_description;      /* description of the option                  */
  110.    long  xpro_type;             /* type of option                             */
  111.    UBYTE *xpro_value;            /* pointer to a buffer with the current value */
  112.    long  xpro_length;           /* buffer size                                */
  113. };
  114. /*
  115. *   Valid values for xpro_type are:
  116. */
  117. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  118. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  119. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  120. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  121. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  122. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  123.