home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk459.lzh / XprZmodem / xproto.h < prev    next >
C/C++ Source or Header  |  1991-02-18  |  5KB  |  115 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. *   Flags returned by XProtocolSetup()
  41. */
  42. #define XPRS_FAILURE    0x00000000L
  43. #define XPRS_SUCCESS    0x00000001L
  44. #define XPRS_NORECREQ   0x00000002L
  45. #define XPRS_NOSNDREQ   0x00000004L
  46. #define XPRS_HOSTMON    0x00000008L
  47. #define XPRS_USERMON    0x00000010L
  48. #define XPRS_HOSTNOWAIT 0x00000020L
  49. /*
  50. *   The update structure
  51. */
  52. struct XPR_UPDATE {     long  xpru_updatemask;
  53.                         char *xpru_protocol;
  54.                         char *xpru_filename;
  55.                         long  xpru_filesize;
  56.                         char *xpru_msg;
  57.                         char *xpru_errormsg;
  58.                         long  xpru_blocks;
  59.                         long  xpru_blocksize;
  60.                         long  xpru_bytes;
  61.                         long  xpru_errors;
  62.                         long  xpru_timeouts;
  63.                         long  xpru_packettype;
  64.                         long  xpru_packetdelay;
  65.                         long  xpru_chardelay;
  66.                         char *xpru_blockcheck;
  67.                         char *xpru_expecttime;
  68.                         char *xpru_elapsedtime;
  69.                         long  xpru_datarate;
  70.                         long  xpru_reserved1;
  71.                         long  xpru_reserved2;
  72.                         long  xpru_reserved3;
  73.                         long  xpru_reserved4;
  74.                         long  xpru_reserved5;
  75.                    };
  76. /*
  77. *   The possible bit values for the xpru_updatemask are:
  78. */
  79. #define XPRU_PROTOCOL           0x00000001L
  80. #define XPRU_FILENAME           0x00000002L
  81. #define XPRU_FILESIZE           0x00000004L
  82. #define XPRU_MSG                0x00000008L
  83. #define XPRU_ERRORMSG           0x00000010L
  84. #define XPRU_BLOCKS             0x00000020L
  85. #define XPRU_BLOCKSIZE          0x00000040L
  86. #define XPRU_BYTES              0x00000080L
  87. #define XPRU_ERRORS             0x00000100L
  88. #define XPRU_TIMEOUTS           0x00000200L
  89. #define XPRU_PACKETTYPE         0x00000400L
  90. #define XPRU_PACKETDELAY        0x00000800L
  91. #define XPRU_CHARDELAY          0x00001000L
  92. #define XPRU_BLOCKCHECK         0x00002000L
  93. #define XPRU_EXPECTTIME         0x00004000L
  94. #define XPRU_ELAPSEDTIME        0x00008000L
  95. #define XPRU_DATARATE           0x00010000L
  96. /*
  97. *   The xpro_option structure
  98. */
  99. struct xpr_option {
  100.    char *xpro_description;      /* description of the option                  */
  101.    long  xpro_type;             /* type of option                             */
  102.    char *xpro_value;            /* pointer to a buffer with the current value */
  103.    long  xpro_length;           /* buffer size                                */
  104. };
  105. /*
  106. *   Valid values for xpro_type are:
  107. */
  108. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  109. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  110. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  111. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  112. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  113. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  114.  
  115.