home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 272.lha / xprquickb / xproto.h < prev    next >
C/C++ Source or Header  |  1989-08-05  |  4KB  |  104 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.               };
  31. /*
  32. *   Number of defined extensions
  33. */
  34. #define XPR_EXTENSION 1L
  35.  
  36. /*
  37. *   The functions
  38. */
  39. extern long XProtocolSend(),  XProtocolReceive(),
  40.             XProtocolSetup(), XProtocolCleanup();
  41. /*
  42. *   The update structure
  43. */
  44. struct XPR_UPDATE {     long  xpru_updatemask;
  45.                         char *xpru_protocol;
  46.                         char *xpru_filename;
  47.                         long  xpru_filesize;
  48.                         char *xpru_msg;
  49.                         char *xpru_errormsg;
  50.                         long  xpru_blocks;
  51.                         long  xpru_blocksize;
  52.                         long  xpru_bytes;
  53.                         long  xpru_errors;
  54.                         long  xpru_timeouts;
  55.                         long  xpru_packettype;
  56.                         long  xpru_packetdelay;
  57.                         long  xpru_chardelay;
  58.                         char *xpru_blockcheck;
  59.                         char *xpru_expecttime;
  60.                         char *xpru_elapsedtime;
  61.                         long  xpru_datarate;
  62.                         long  xpru_reserved1;
  63.                         long  xpru_reserved2;
  64.                         long  xpru_reserved3;
  65.                         long  xpru_reserved4;
  66.                         long  xpru_reserved5;
  67.                    };
  68. /*
  69. *   The possible bit values for the xpru_updatemask are:
  70. */
  71. #define XPRU_PROTOCOL           0x00000001L
  72. #define XPRU_FILENAME           0x00000002L
  73. #define XPRU_FILESIZE           0x00000004L
  74. #define XPRU_MSG                0x00000008L
  75. #define XPRU_ERRORMSG           0x00000010L
  76. #define XPRU_BLOCKS             0x00000020L
  77. #define XPRU_BLOCKSIZE          0x00000040L
  78. #define XPRU_BYTES              0x00000080L
  79. #define XPRU_ERRORS             0x00000100L
  80. #define XPRU_TIMEOUTS           0x00000200L
  81. #define XPRU_PACKETTYPE         0x00000400L
  82. #define XPRU_PACKETDELAY        0x00000800L
  83. #define XPRU_CHARDELAY          0x00001000L
  84. #define XPRU_BLOCKCHECK         0x00002000L
  85. #define XPRU_EXPECTTIME         0x00004000L
  86. #define XPRU_ELAPSEDTIME        0x00008000L
  87. #define XPRU_DATARATE           0x00010000L
  88. /*
  89. *   The xpro_option structure
  90. */
  91. struct xpr_option {
  92.    char *xpro_description;    /* description of the option                  */
  93.    long  xpro_type;        /* type of option                             */
  94.    char *xpro_value;        /* pointer to a buffer with the current value */
  95.    long  xpro_length;        /* buffer size                                */
  96. };
  97. /*
  98. *   Valid values for xpro_type are:
  99. */
  100. #define XPRO_BOOLEAN 1L        /* xpro_value is "yes", "no", "on" or "off"   */
  101. #define XPRO_LONG    2L        /* xpro_value is string representing a number */
  102. #define XPRO_STRING  3L        /* xpro_value is a string                     */
  103.  
  104.