home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / bbs / termv4.6 / extras / source / term-source.lha / xproto.h < prev   
Encoding:
C/C++ Source or Header  |  1996-03-18  |  5.7 KB  |  134 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.                 STRPTR          xpr_filename;
  11.                   LONG (* __asm xpr_fopen)(register __a0 STRPTR,register __a1 STRPTR);
  12.                   LONG (* __asm xpr_fclose)(register __a0 struct Buffer *);
  13.                   LONG (* __asm xpr_fread)(register __a0 APTR,register __d0 LONG,register __d1 LONG,register __a1 struct Buffer *);
  14.                   LONG (* __asm xpr_fwrite)(register __a0 APTR,register __d0 LONG,register __d1 LONG,register __a1 struct Buffer *);
  15.                  ULONG (* __asm xpr_sread)(register __a0 APTR,register __d0 LONG,register __d1 ULONG);
  16.                   LONG (* __asm xpr_swrite)(register __a0 APTR,register __d0 LONG);
  17.                   LONG (* __asm xpr_sflush)(VOID);
  18.                   LONG (* __asm xpr_update)(register __a0 struct XPR_UPDATE *);
  19.                   LONG (* __asm xpr_chkabort)(VOID);
  20.                   LONG (* __asm xpr_chkmisc)(VOID);
  21.                   LONG (* __asm xpr_gets)(register __a0 STRPTR,register __a1 STRPTR);
  22.                   LONG (* __asm xpr_setserial)(register __d0 LONG);
  23.                   LONG (* __asm xpr_ffirst)(register __a0 STRPTR,register __a1 STRPTR);
  24.                   LONG (* __asm xpr_fnext)(register __d0 LONG,register __a0 STRPTR,register __a1 STRPTR);
  25.                   LONG (* __asm xpr_finfo)(register __a0 STRPTR,register __d0 LONG);
  26.                   LONG (* __asm xpr_fseek)(register __a0 struct Buffer *,register __d0 LONG,register __d1 LONG);
  27.                   LONG          xpr_extension;
  28.                   LONG         *xpr_data;
  29.                  ULONG (* __asm xpr_options)(register __d0 LONG,register __a0 struct xpr_option **);
  30.                   LONG (* __asm xpr_unlink)(register __a0 STRPTR);
  31.                   LONG (* __asm xpr_squery)(VOID);
  32.                   LONG (* __asm xpr_getptr)(register __d0 LONG);
  33.               };
  34.  
  35. /*
  36. *   Number of defined extensions
  37. */
  38. #define XPR_EXTENSION 4L
  39.  
  40. /*
  41. *   The functions
  42. */
  43.  
  44. LONG XProtocolCleanup(struct XPR_IO *);
  45. LONG XProtocolSetup(struct XPR_IO *);
  46. LONG XProtocolSend(struct XPR_IO *);
  47. LONG XProtocolReceive(struct XPR_IO *);
  48. LONG XProtocolHostMon(struct XPR_IO *,APTR,LONG,LONG);
  49. LONG XProtocolUserMon(struct XPR_IO *,APTR,LONG,LONG);
  50.  
  51. /* Pragmas for SAS/Lattice-C V5.0 */
  52. #pragma libcall XProtocolBase XProtocolCleanup 1e 801
  53. #pragma libcall XProtocolBase XProtocolSetup 24 801
  54. #pragma libcall XProtocolBase XProtocolSend 2a 801
  55. #pragma libcall XProtocolBase XProtocolReceive 30 801
  56. #pragma libcall XProtocolBase XProtocolHostMon 36 109804
  57. #pragma libcall XProtocolBase XProtocolUserMon 3c 109804
  58.  
  59. /*
  60. *   Flags returned by XProtocolSetup()
  61. */
  62. #define XPRS_FAILURE    0x00000000L
  63. #define XPRS_SUCCESS    0x00000001L
  64. #define XPRS_NORECREQ   0x00000002L
  65. #define XPRS_NOSNDREQ   0x00000004L
  66. #define XPRS_HOSTMON    0x00000008L
  67. #define XPRS_USERMON    0x00000010L
  68. #define XPRS_HOSTNOWAIT 0x00000020L
  69. /*
  70. *   The update structure
  71. */
  72. struct XPR_UPDATE {     ULONG  xpru_updatemask;
  73.                         STRPTR xpru_protocol;
  74.                         STRPTR xpru_filename;
  75.                         LONG   xpru_filesize;
  76.                         STRPTR xpru_msg;
  77.                         STRPTR xpru_errormsg;
  78.                         LONG   xpru_blocks;
  79.                         LONG   xpru_blocksize;
  80.                         LONG   xpru_bytes;
  81.                         LONG   xpru_errors;
  82.                         LONG   xpru_timeouts;
  83.                         LONG   xpru_packettype;
  84.                         LONG   xpru_packetdelay;
  85.                         LONG   xpru_chardelay;
  86.                         STRPTR xpru_blockcheck;
  87.                         STRPTR xpru_expecttime;
  88.                         STRPTR xpru_elapsedtime;
  89.                         LONG   xpru_datarate;
  90.                         LONG   xpru_reserved1;
  91.                         LONG   xpru_reserved2;
  92.                         LONG   xpru_reserved3;
  93.                         LONG   xpru_reserved4;
  94.                         LONG   xpru_reserved5;
  95.                    };
  96. /*
  97. *   The possible bit values for the xpru_updatemask are:
  98. */
  99. #define XPRU_PROTOCOL           0x00000001L
  100. #define XPRU_FILENAME           0x00000002L
  101. #define XPRU_FILESIZE           0x00000004L
  102. #define XPRU_MSG                0x00000008L
  103. #define XPRU_ERRORMSG           0x00000010L
  104. #define XPRU_BLOCKS             0x00000020L
  105. #define XPRU_BLOCKSIZE          0x00000040L
  106. #define XPRU_BYTES              0x00000080L
  107. #define XPRU_ERRORS             0x00000100L
  108. #define XPRU_TIMEOUTS           0x00000200L
  109. #define XPRU_PACKETTYPE         0x00000400L
  110. #define XPRU_PACKETDELAY        0x00000800L
  111. #define XPRU_CHARDELAY          0x00001000L
  112. #define XPRU_BLOCKCHECK         0x00002000L
  113. #define XPRU_EXPECTTIME         0x00004000L
  114. #define XPRU_ELAPSEDTIME        0x00008000L
  115. #define XPRU_DATARATE           0x00010000L
  116. /*
  117. *   The xpro_option structure
  118. */
  119. struct xpr_option {
  120.    STRPTR xpro_description;      /* description of the option                  */
  121.    LONG   xpro_type;             /* type of option                             */
  122.    STRPTR xpro_value;            /* pointer to a buffer with the current value */
  123.    LONG   xpro_length;           /* buffer size                                */
  124. };
  125. /*
  126. *   Valid values for xpro_type are:
  127. */
  128. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  129. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  130. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  131. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  132. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  133. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  134.