home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / fmi.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  33.5 KB  |  733 lines

  1. /* fmi.h */
  2. /*
  3.  * (C) Copyright Data Connection Limited 1989-1992.
  4.  * (C) Copyright Microsoft Corporation 1991.
  5.  * All Rights Reserved.
  6.  */
  7.  
  8. #ifndef FMIH_INCLUDED
  9. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  10. #define FMIH_INCLUDED
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. #ifdef WIN32_SUPPORT
  17.   #pragma pack(1)
  18. #endif
  19.  
  20. /*****************************************************************************/
  21. /* The following type definitions are in os2def.h so are not needed in OS/2  */
  22. /*****************************************************************************/
  23. #if (defined(DOS_SUPPORT) || defined(MSWIN_SUPPORT))
  24. #define CHAR          char      /* ch  */
  25. typedef unsigned char UCHAR;    /* uch */
  26. typedef unsigned short USHORT;  /* us  */
  27. typedef unsigned long ULONG;    /* ul  */
  28. #endif
  29.  
  30. /*****************************************************************************/
  31. /* Type definitions for message fields                                       */
  32. /*****************************************************************************/
  33. typedef signed short         INTEGER;
  34.  
  35. /*****************************************************************************/
  36. /* Macro to convert integer fields other than STARTD and ENDD, SRCI          */
  37. /* and DESTI to In-line format                                               */
  38. /*****************************************************************************/
  39. #ifndef WIN32_SUPPORT
  40. #define DOFLIP(X) ((INTEGER)((((X) & 0xff) << 8) | (((X) >> 8) & 0xff)))
  41. #else
  42. #ifndef ROTL
  43.  #ifndef _CRTAPI1
  44.   unsigned int _rotl(unsigned int, int);
  45.  #else
  46.   unsigned int _CRTAPI1 _rotl(unsigned int, int);
  47.  #endif
  48.   #define ROTL
  49. #endif
  50. #pragma intrinsic(_rotl)
  51. #define DOFLIP(X)   ((INTEGER)_rotl(((unsigned short)(X))*(unsigned long)0x00010001, 8))
  52. #endif
  53. #define DONTFLIP(X) (X)
  54.  
  55.  
  56. #ifdef NON_INTEL_BYTE_ORDER
  57.  #define PFLIPI(X)      DONTFLIP(X)
  58.  #define PANTIFLIPI(X)  DOFLIP(X)
  59. #else
  60.  #define PFLIPI(X)      DOFLIP(X)
  61.  #define PANTIFLIPI(X)  DONTFLIP(X)
  62. #endif
  63.  
  64.  
  65. /*****************************************************************************/
  66. /* Element offset and length definitions                                     */
  67. /*****************************************************************************/
  68.  
  69. #define SBCBELT1 1
  70. #define SBCBELT3 13
  71. #define SNANBEDA 268     /* LENGTH OF BUFFER ELEMENT */
  72.  
  73. /*****************************************************************************/
  74. /* MESSAGE TYPE DECLARATIONS - ELEMENT OPTIONS                               */
  75. /*****************************************************************************/
  76.      typedef
  77. #define RHASENSE     0
  78. #define DATAONLY     1
  79.      signed char ELTDATAT;
  80.  
  81.      typedef CHAR     SNCHARRU[SNANBEDA];        /* LENGTH OF ELT */
  82.  
  83. /*****************************************************************************/
  84. /* MAIN DEFINITION OF MESSAGE ELEMENT                                        */
  85. /*****************************************************************************/
  86.  
  87. /**STRUCT+********************************************************************/
  88. /* Structure: BUFELT                                                         */
  89. /*                                                                           */
  90. /* Description: Main definition of SNAPS Buffer Element                      */
  91. /*****************************************************************************/
  92.  
  93. #ifdef WIN32_SUPPORT
  94.  #define PTRBFELT struct bufelt *
  95. #else
  96.  #define PTRBFELT struct bufelt far *
  97. #endif
  98.  
  99.      typedef struct bufelt{
  100.                      PTRBFELT elteptr;   /* Pointer to next element in buffer*/
  101.                      INTEGER  startd;    /* Offset (from 1) of start of data */
  102.                      INTEGER  endd;      /* Offset (from 1) of last data byte*/
  103.                      CHAR     trpad;
  104.                      /*ELTDATAT*/union {
  105.                        /*RHASENSE*/struct {unsigned char rhpad[8];
  106.                                      signed long BBUFF0V;
  107.                                      INTEGER  BBUFF0W;
  108.                                      INTEGER  BBUFF0X;}BBUFF0T;
  109.                        /*DATAONLY*/struct {SNCHARRU BBUFF0Z;
  110.                                                       }BBUFF0Y;
  111.                    }BBUFF0S;}
  112. #define rh       BBUFF0S.BBUFF0T.BBUFF0V /* The RH bytes themselves          */
  113. #define sense1   BBUFF0S.BBUFF0T.BBUFF0W /* Sense data 1 in negative response*/
  114. #define sense2   BBUFF0S.BBUFF0T.BBUFF0X /* Sense data 2 in negative response*/
  115. #define dataru   BBUFF0S.BBUFF0Y.BBUFF0Z /* The data bytes themselves        */
  116. #define lccpad   BBUFF0S.BBUFF0Y.BBUFF1A /* Pad                              */
  117.                    BUFELT;
  118.  
  119.  
  120. /*****************************************************************************/
  121. /* OPEN MESSAGE TYPE DECLARATIONS                                            */
  122. /*****************************************************************************/
  123.  
  124.      typedef struct tpophdr{                          /* OPEN MESSAGE HEADER */
  125.                       CHAR     openqual;
  126. #define REQU     1
  127. #define RSPOK    2
  128. #define RSPERR   3
  129. #define CONFOK   4
  130. #define CONFERR  5
  131.                       CHAR     opentype;
  132. #define SSCPSEC  1
  133. #define LUSEC    2
  134. #define SBPUSEC  3
  135.                       CHAR     appltype;     /* INTERFACE ID - X'02' FOR FMI */
  136.                       CHAR     opluno;              /* INTERFACE USER NUMBER */
  137.                       INTEGER  opresid;             /* INTERFACE USER ID     */
  138.                       union {
  139.                         struct {INTEGER  B03;
  140.                                 INTEGER  B04;
  141.                                 CHAR     B05;
  142.                                 CHAR     B06;}B02;
  143.                         struct {INTEGER  B08;
  144.                                 INTEGER  B09;}B07;
  145.                     }B01;}
  146. #define icreditr B01.B02.B03
  147. #define icredits B01.B02.B04
  148. #define opninfo1 B01.B02.B05
  149. #define opnpad1  B01.B02.B06
  150. #define operr1   B01.B07.B08
  151. #define operr2   B01.B07.B09
  152.                     TPOPHDR;
  153.  
  154. /*****************************************************************************/
  155. /* Open (SSCP) opnpad1 values                                                */
  156. /*****************************************************************************/
  157.  
  158. #define OPEN_TEST       0               /* DON'T FORCE A CONNECTION ACTIVE   */
  159. #define OPEN_FORCE      1               /* FORCE A CONNECTION ACTIVE         */
  160.  
  161. /*****************************************************************************/
  162. /* Constants for operr2 field in Open(SSCP) Error Responses                  */
  163. /*****************************************************************************/
  164.  
  165. #define CSRENOSR 0                      /* NO SERVERS FOUND                  */
  166. #define CSRESERV 1                      /* SERVICE NOT PRESENT AT LOCALITY   */
  167. #define CSRECNFG 2                      /* CONFIGURATION MISMATCH            */
  168. #define CSRECBSH 3                      /* CONTROL BLOCK/RESOURCE SHORTAGE   */
  169. #define CSREFORM 4                      /* FORMAT/PROTOCOL ERROR             */
  170.  
  171. /*****************************************************************************/
  172. /* LINK TYPE DEFINITIONS FOR OPEN (SSCP) RESPONSE IN DATARU[38]              */
  173. /*****************************************************************************/
  174.  
  175. #define CESLINK          3              /* SDLC LINK                         */
  176. #define CESX25           4              /* X.25 LINK                         */
  177. #define CESDFT          10              /* DFT LINK                          */
  178. #define CESTR           11              /* TOKEN RING LINK                   */
  179. #define CESTCPIP        30              /* TCP/IP LINK                       */
  180. #define CESRELAY        31              /* FRAME RELAY LINK                  */
  181. #define CESCHANL        32              /* CHANNEL LINK                      */
  182. #define CESISDN         33              /* ISDN LINK                         */
  183. #define CESETHER        34              /* ETHERNET 802.2 LINK               */
  184.  
  185. /*****************************************************************************/
  186. /* BIND Table Index Values for the Open PLU response (in element)            */
  187. /*****************************************************************************/
  188.  
  189. #define BIND_TABLE_INDEX_PRT    1
  190. #define BIND_TABLE_INDEX_CRT    2
  191.  
  192. /*****************************************************************************/
  193. /* CLOSE MESSAGE TYPE DECLARATIONS                                           */
  194. /*****************************************************************************/
  195.  
  196.      typedef struct tpclhdr{                         /* CLOSE MESSAGE HEADER */
  197.                       CHAR     closqual;    /* Same values as openqual       */
  198.                       CHAR     clstype;     /* Same values as opentype       */
  199.                       CHAR     clsctl;      /* For Close(PLU) only           */
  200. #define CLNORMAL 1
  201. #define CLBIND   2
  202. #define CLCFAERR 3
  203. #define CLPUINAC 4
  204. #define CLLUINAC 5
  205. #define CLLNKERR 6
  206. #define CLBFSHRT 7
  207. #define CLRCVCHK 8
  208. #define CLSLUTRM 9
  209.                       CHAR     clspad1;
  210.                       INTEGER  clspad2;
  211.                       INTEGER  clserr1;
  212.                       INTEGER  clserr2;
  213.                     }TPCLHDR;
  214.  
  215. /*****************************************************************************/
  216. /* STATUS-ACKNOWLEDGE MESSAGE TYPE DECLARATION                               */
  217. /*****************************************************************************/
  218.  
  219.      typedef struct tpstahdr{                   /* STATUS ACK MESSAGE HEADER */
  220.                       CHAR     akstat;
  221. #define ACK      1
  222.                       CHAR     akqual;
  223. #define ACKPOS   2
  224. #define ACKNEG1  3
  225. #define ACKNEG2  4
  226.                       INTEGER  akmsgkey;
  227.                       union {
  228.                               INTEGER XXXXX01;
  229.                               struct {
  230.                                  CHAR     XXXXX02;
  231.                                  CHAR     XXXXX03;
  232.                                      } XXXXX04;
  233.                             } XXXXX05;
  234.                       INTEGER  aknumb1;
  235.                       INTEGER  aknumb2;
  236.                       INTEGER  akseqno;
  237.  
  238. #define akmsgtim XXXXX05.XXXXX01
  239. #define akflags1 XXXXX05.XXXXX04.XXXXX02    /* Same values as fhflags1 below */
  240.                                             /* Reserved for ACKNEG2          */
  241. #define akflags2 XXXXX05.XXXXX04.XXXXX03    /* Same values as fhflags2 below */
  242.                                             /* Crit/Non-Crit fail for ACKNEG2*/
  243.  
  244.                     }TPSTAHDR;
  245.  
  246. /*****************************************************************************/
  247. /* STATUS-ERROR MESSAGE TYPE DECLARATION                                     */
  248. /*****************************************************************************/
  249.  
  250.      typedef struct tpstehdr{                 /* STATUS ERROR MESSAGE HEADER */
  251.                       CHAR     errstat;
  252. #define STERROR  3
  253.                       CHAR     errpad1;
  254.                       INTEGER  errpad2;
  255.                       INTEGER  errpad3;
  256.                       INTEGER  errcode1;
  257.                       INTEGER  errcode2;
  258.                     }TPSTEHDR;
  259.  
  260. /*****************************************************************************/
  261. /* STATUS-CONTROL MESSAGE TYPE DECLARATION                                   */
  262. /*****************************************************************************/
  263.  
  264.      typedef struct tpstchdr{               /* STATUS CONTROL MESSAGE HEADER */
  265.                      CHAR     ctlstat;
  266. #define STCNTRL  2
  267.                      CHAR     ctlqual;
  268. #define CTLREQU  1
  269. /* #define ACKPOS   2 */
  270. /* #define ACKNEG1  3 */
  271. /* #define ACKNEG2  4 */
  272.                      CHAR     ctltype;
  273. #define CCLEAR   1
  274. #define CSDT     2
  275. #define CRQR     3
  276. #define CSTSN    4
  277. #define CCANCEL  16
  278. #define CLUSTAT  17
  279. #define CSIGNAL  18
  280. #define CRSHUTD  19
  281. #define CBID     20
  282. #define CCHASE   21
  283. #define CSHUTC   22
  284. #define CSHUTD   23
  285. #define CRTR     24
  286. #define CQC      32
  287. #define CQEC     33
  288. #define CRELQ    34
  289.                      CHAR     ctlack;       /* Same values as fhackrqd below */
  290.                      CHAR     ctlflag1;     /* Same values as fhflags1 below */
  291.                      CHAR     ctlflag2;     /* Same values as fhflags2 below */
  292.                      INTEGER  ctlnumb1;
  293.                      INTEGER  ctlnumb2;
  294.                      INTEGER  ctlmsgk;
  295.                    }TPSTCHDR;
  296.  
  297. /*****************************************************************************/
  298. /* STATUS-RESOURCE MESSAGE TYPE DECLARATION                                  */
  299. /*****************************************************************************/
  300.  
  301.      typedef struct tpstrhdr{              /* STATUS RESOURCE MESSAGE HEADER */
  302.                       CHAR     resstat;
  303. #define STRESRCE 4
  304.                       CHAR     respad;
  305.                       INTEGER  rescred;
  306.                     }TPSTRHDR;
  307.  
  308. /*****************************************************************************/
  309. /* STATUS-SESSION MESSAGE TYPE DECLARATION                                   */
  310. /*****************************************************************************/
  311.  
  312.      typedef struct tpstshdr{               /* STATUS SESSION MESSAGE HEADER */
  313.                       CHAR     sessstat;
  314. #define STSESSN  5
  315.                       CHAR     sesspad;
  316.                       INTEGER  sesscode;
  317. #define STNOSESS 1                               /* X'01' (NO SESSION)       */
  318. #define STLINERR 2                               /* X'02' (LINK ERROR)       */
  319. #define STPUACT  3                               /* X'03' (PU ACTIVE)        */
  320. #define STPUREAC 4                               /* X'04' (PU RE-ACTIVATED)  */
  321. #define STLUACT  5                               /* X'05' (LU ACTIVE)        */
  322. #define STLUREAC 6                               /* X'06' (LU RE-ACTIVATED)  */
  323. #define STBETB   7                               /* BETB STATUS-SESSION CODE */
  324.                       INTEGER  sessqual;
  325. /* #define STPUACT  3                               X'03' (PU ACTIVE)        */
  326. /* #define STPUREAC 4                               X'04' (PU RE-ACTIVATED)  */
  327. #define STPUINAC 16                              /* X'10' (PU INACTIVE)      */
  328. #define STLUINAC 17                              /* X'11' (LU INACTIVE)      */
  329.                     }TPSTSHDR;
  330.  
  331. /*****************************************************************************/
  332. /* STATUS-RTM     MESSAGE TYPE DECLARATION                                   */
  333. /*****************************************************************************/
  334.  
  335.      typedef struct tpstmhdr{               /* STATUS RTM     MESSAGE HEADER */
  336.                       CHAR     rtmstat;
  337. #define STRTM    6
  338.                       CHAR     strbndry;   /* set boundaries flag */
  339.                       CHAR     strcount;   /* set counters flag */
  340.                       CHAR     strtmdef;   /* rtm definition */
  341.                       CHAR     strtmact;   /* rtm active flag */
  342.                       CHAR     strtmdsp;   /* local display active flag */
  343.                     }TPSTMHDR;
  344.  
  345. /*****************************************************************************/
  346. /* STATUS VARIANT TYPES                                                      */
  347. /*****************************************************************************/
  348.  
  349.      typedef struct tpashdr{                    /* APPLSTATUS MESSAGE HEADER */
  350.                       union {
  351.                         struct {TPSTAHDR B0G;}B0F; /* Status-Ack variant     */
  352.                         struct {TPSTCHDR B0I;}B0H; /* Status-Control variant */
  353.                         struct {TPSTEHDR B0K;}B0J; /* Status-Error variant   */
  354.                         struct {TPSTRHDR B0M;}B0L; /* Status-Resource variant*/
  355.                         struct {TPSTSHDR B0O;}B0N; /* Status-Session variant */
  356.                         struct {TPSTMHDR X1E;}X1D; /* Status-RTM variant     */
  357.                     }B0E;}
  358. #define stackhdr B0E.B0F.B0G
  359. #define stctlhdr B0E.B0H.B0I
  360. #define sterrhdr B0E.B0J.B0K
  361. #define streshdr B0E.B0L.B0M
  362. #define stseshdr B0E.B0N.B0O
  363. #define strtmhdr B0E.X1D.X1E
  364.                     TPASHDR;
  365.  
  366. /*****************************************************************************/
  367. /* FMI APPLDATA HERE                                                         */
  368. /*****************************************************************************/
  369.  
  370.      typedef struct tpfmihdr{                     /* FMI DATA MESSAGE HEADER */
  371.                      CHAR     fhackrqd;
  372. #define NOACKREQ 0
  373. #define ACKREQ   1
  374.                      CHAR     fhpad1;
  375.                      INTEGER  fhmsgkey;
  376.                      CHAR     fhflags1;           /* BIT SIGNIFICANT */
  377. #define AF_FMH  0x80
  378. #define AF_BC   0x40
  379. #define AF_EC   0x20
  380. #define AF_COMM 0x10
  381. #define AF_BB   0x08
  382. #define AF_EB   0x04
  383. #define AF_CD   0x02
  384. #define AF_SD   0x01
  385.                      CHAR     fhflags2;           /* BIT SIGNIFICANT */
  386. #define AF_CODE 0x80
  387. #define AF_ENCR 0x40
  388. #define AF_ENPD 0x20
  389. #define AF_QRI  0x10
  390. #define AF_CEI  0x08
  391. #define AF_BBIU 0x04
  392. #define AF_EBIU 0x02
  393. #define AF_RBI  0x01
  394.                      INTEGER  fhpad2;
  395.                      INTEGER  fhpad3;
  396.                      INTEGER  fhseqno;
  397.                    }TPFMIHDR;
  398.  
  399. /*****************************************************************************/
  400. /* MAIN DEFINITION OF MESSAGE HEADER                                         */
  401. /*****************************************************************************/
  402.  
  403. #ifdef WIN32_SUPPORT
  404.  #define PTRBFHDR struct bufhdr *
  405. #else
  406.  #define PTRBFHDR struct bufhdr far *
  407. #endif
  408.  
  409.      typedef struct bufhdr{
  410.                      PTRBFHDR nxtqptr;
  411.                      PTRBFELT hdreptr;
  412.                      CHAR     numelts;
  413.                      CHAR     msgtype;
  414. #define OPENMSG  1
  415. #define CLOSEMSG 2
  416. #define DATAFMI  32
  417. #define STATFMI  33
  418.                      CHAR     srcl;
  419.                      CHAR     srcp;
  420. #define S3PROD   18                               /* 3270 Partner number     */
  421.                      INTEGER  srci;
  422.                      CHAR     destl;
  423.                      CHAR     destp;
  424.                      INTEGER  desti;
  425.                      union {
  426.                        struct {TPOPHDR  B1C;}B1B;
  427.                        struct {TPCLHDR  B1E;}B1D;
  428.                        struct {TPFMIHDR B1K;}B1J;
  429.                        struct {TPASHDR  B1M;}B1L;
  430.                      }B0Y;}
  431. #define ophdr    B0Y.B1B.B1C
  432. #define clhdr    B0Y.B1D.B1E
  433. #define dfhdr    B0Y.B1J.B1K
  434. #define sfhdr    B0Y.B1L.B1M
  435.                      BUFHDR;
  436.  
  437. /*****************************************************************************/
  438. /* RETURN CONSTANTS FOR SBPURCV                                              */
  439. /*****************************************************************************/
  440.  
  441. #define CSUNORES 0 /* NO RESULT                                              */
  442. #define CSUMSGRT 1 /* MESSAGE RETURNED                                       */
  443. #define CSUPTHER 2 /* PATH ERROR                                             */
  444. #define CSUTERM  3 /* TERMINATE                                              */
  445. #define CSUBUFSH 4 /* BUFFER SHORTAGE                                        */
  446.  
  447. /*****************************************************************************/
  448. /* PROCTYPE AND SERVTYPE PARAMETERS FOR SBPUINIT                             */
  449. /*****************************************************************************/
  450.  
  451. #define CLIENT           2      /* client entry                              */
  452. #define CES3270          2      /* SNAP-3270                                 */
  453.  
  454. /*****************************************************************************/
  455. /* DL-Base return Values                                                     */
  456. /*****************************************************************************/
  457.  
  458. #ifndef NO_ERROR
  459.  #define NO_ERROR         0
  460. #endif
  461.  
  462. #define CEDINNOMSG       0          /* status = no message or status         */
  463. #define CEDINMSG         1          /* status = got message                  */
  464. #define CEDINLLN         2          /* status = lost locality                */
  465.  
  466. /* values for SBPUINIT only */
  467.  
  468. #define DMBASE          550            /* Base level for Com Manager errors  */
  469. #define DMLTABF         (DMBASE + 5)   /* L-table full                       */
  470. #define DMMNWGI         (DMBASE + 12)  /* NetWkstaGetInfo call failed        */
  471. #define DMDSTFL         (DMBASE + 13)  /* Service table full                 */
  472. #define DMMPIPF         (DMBASE + 17)  /* Make pipe call failed              */
  473. #define DMCOMNM         (DMBASE + 32)  /* No name found for this service     */
  474. #define DMCOMDUP        (DMBASE + 46)  /* Duplicate COMNAME for service      */
  475. #define DMNOTLOG        (DMBASE + 48)  /* User not logged on                 */
  476. #define DMCFGOPN        (DMBASE + 66)  /* Failed to open the config file     */
  477. #define DMCFREAD        (DMBASE + 68)  /* Error reading config file          */
  478. #define DMNONAP         (DMBASE + 75)  /* NAP not up when starting service   */
  479. #define WINBASE          950           /* Base level for Windows-only errors */
  480. #define DMMAXAPP        (WINBASE+3)    /* Exceeded max # of concurrent apps  */
  481.  
  482. /*****************************************************************************/
  483. /* Dmod/DL-Base entry points                                                 */
  484. /*****************************************************************************/
  485.  
  486. #ifdef MSWIN_SUPPORT
  487.  #ifndef APIENTRY
  488.   #define APIENTRY WINAPI
  489.  #endif
  490. #endif
  491.  
  492. #ifdef OS2_SUPPORT
  493. extern USHORT   APIENTRY  sbpuinit (HSEM FAR *, USHORT, USHORT, UCHAR FAR *);
  494. extern USHORT   APIENTRY  sbpurcv (PTRBFHDR FAR *, INTEGER FAR*);
  495. #endif
  496.  
  497. #ifdef WIN32_SUPPORT
  498. extern USHORT WINAPI sbpuinit (HANDLE *, USHORT, USHORT, UCHAR *);
  499. extern USHORT WINAPI sbpurcv (PTRBFHDR *, INTEGER *);
  500. #endif
  501.  
  502. #ifdef MSWIN_SUPPORT
  503. extern USHORT   WINAPI  sbpuinit (USHORT, USHORT, UCHAR FAR *);
  504. #endif
  505.  
  506. #ifdef DOS_SUPPORT
  507. extern USHORT   APIENTRY  sbpuinit (HSEM FAR *, USHORT, USHORT);
  508. #endif
  509.  
  510. #ifndef WIN32_SUPPORT
  511. extern USHORT   APIENTRY  sbpurcvx (BUFHDR FAR * FAR *, INTEGER, INTEGER);
  512. extern VOID     APIENTRY  sbpusend (PTRBFHDR);
  513. extern VOID     APIENTRY  sbputerm (VOID);
  514. #else
  515. extern USHORT WINAPI sbpurcvx (BUFHDR * *, INTEGER, INTEGER);
  516. extern VOID   WINAPI sbpusend (PTRBFHDR);
  517. extern VOID   WINAPI sbputerm (VOID);
  518. #endif
  519.  
  520. #ifdef OS2_SUPPORT
  521. extern USHORT APIENTRY sepdrout(USHORT (APIENTRY *) (BUFHDR far *, USHORT, USHORT));
  522. #endif
  523.  
  524. #ifdef WIN32_SUPPORT
  525. extern ULONG WINAPI sepdrout(ULONG (WINAPI *) (BUFHDR *, USHORT, USHORT));
  526. #endif
  527.  
  528. #ifdef MSWIN_SUPPORT
  529. extern USHORT WINAPI sepwrout(USHORT (WINAPI *) (BUFHDR far *, USHORT, USHORT));
  530. #endif
  531.  
  532. #ifdef DOS_SUPPORT
  533. extern USHORT APIENTRY sepdrout(USHORT (APIENTRY *) (BUFHDR far *, USHORT, USHORT));
  534. #endif
  535.  
  536. /*****************************************************************************/
  537. /* Buffer pool access routines                                               */
  538. /*****************************************************************************/
  539.  
  540. #ifndef WIN32_SUPPORT
  541. extern PTRBFHDR APIENTRY  sepdbubl (USHORT);
  542. extern VOID     APIENTRY  sepdburl (PTRBFHDR);
  543.  
  544. extern VOID     APIENTRY  sbpibegt (PTRBFELT FAR *);
  545. extern VOID     APIENTRY  sbpiberl (PTRBFELT FAR *);
  546.  
  547. extern VOID     APIENTRY  sepdchnk (USHORT FAR *, USHORT FAR *);
  548. #else
  549. extern PTRBFHDR WINAPI sepdbubl (USHORT);
  550. extern VOID     WINAPI sepdburl (PTRBFHDR);
  551.  
  552. extern VOID     WINAPI sbpibegt (PTRBFELT *);
  553. extern VOID     WINAPI sbpiberl (PTRBFELT *);
  554.  
  555. extern VOID     WINAPI sepdchnk (USHORT *, USHORT *);
  556. #endif
  557.  
  558. /*****************************************************************************/
  559. /* Structures for the 3270 user record.                                      */
  560. /*****************************************************************************/
  561.  
  562. #define CERT3270  0x0002           /* 3270 user record type                  */
  563. #define CECWKHAC  8                /* Length of Host Access Name             */
  564. #define CECWKUNM  20               /* Length of 3270 user name               */
  565. #define CECWKREM  25               /* Length of record remark                */
  566. #define CE3MASMX  10               /* Max number of 3270 sessions            */
  567.  
  568. typedef struct tecwrksd
  569. {
  570.   UCHAR   cwshost[CECWKHAC + 1];   /* LU/Pool name accessed                  */
  571.   USHORT  cwsestyp;                /* Session type (M2, M3, M4, M5, printer) */
  572. #define CERTMOD2 0                 /* 24x80                                  */
  573. #define CERTMOD3 1                 /* 32x80                                  */
  574. #define CERTMOD4 2                 /* 43x80                                  */
  575. #define CERTMOD5 3                 /* 27x132                                 */
  576. #define CERTPRNT 4                 /* Host printer                           */
  577.   USHORT  cwsmodov;                /* Has the user got override permission?  */
  578.   USHORT  cwspad;                  /* 2 bytes of padding                     */
  579. } TECWRKSD;
  580.  
  581. typedef struct tecwrkus
  582. {
  583.   USHORT   cwlen;                  /* Length of record                       */
  584.   USHORT   cwtype;                 /* Type of record                         */
  585.   UCHAR    cwname[CECWKUNM + 1];   /* User name                              */
  586.   UCHAR    cwremark[CECWKREM + 1]; /* Comment field                          */
  587.   UCHAR    cwstylef[9];            /* Initial style file name - no extnsn    */
  588.   USHORT   cwvewrtm;               /* Can user view RTM info ?               */
  589.   USHORT   cwalert;                /* Has user got ALERT permission ?        */
  590.   USHORT   cwchghan;               /* Can change LU/Pool name accessed ?     */
  591.   USHORT   cwmaxses;               /* Maximum number of active sessions 1-10 */
  592.   USHORT   cwnumrec;               /* Number of sessions for user            */
  593.   TECWRKSD cwsesdat[CE3MASMX];     /* Session information records            */
  594.   USHORT   cwmodisf;               /* Permission to modify initial style     */
  595.   USHORT   cwpad;                  /* 2 bytes of padding                     */
  596.   USHORT   cwnumrmp;               /* Number of LUs/Pools in remap list      */
  597.   TECWRKSD cwremap[1];             /* LU/Pool Remap list                     */
  598. } TECWRKUS;
  599.  
  600. /*****************************************************************************/
  601. /* Structures for the diagnostics record.                                    */
  602. /*****************************************************************************/
  603.  
  604. #define CERTDIAG  0x0001           /* Diagnostics record type                */
  605. #define CECNUMAL  20               /* Max number of ALERTs configurable      */
  606. #define CECALRNM  52               /* Length of ALERT description 52 (arr sz)*/
  607. #define CECALRNA  34               /* Actual length of ALERT desc is 34      */
  608. #define CECALRPR  32               /* Length of parameter description        */
  609. #define CECONAME  8                /* Length of connection name              */
  610. #define CESTRLEN  128              /* Length of a string + 1                 */
  611. #define CECCNLEN  15               /* Length of a computer name              */
  612.  
  613. typedef struct tedalert
  614. {
  615.   UCHAR    dalrtnam[CECALRNM + 1]; /* Description of the ALERT number        */
  616.   UCHAR    daparam1[CECALRPR + 1]; /* Description of parameter 1             */
  617.   UCHAR    daparam2[CECALRPR + 1]; /* Description of parameter 2             */
  618.   UCHAR    daparam3[CECALRPR + 1]; /* Description of parameter 3             */
  619. } TEDALERT;
  620.  
  621. typedef struct tediagns
  622. {
  623.   USHORT   dilen;                  /* Length of record                       */
  624.   USHORT   ditype;                 /* Type of record                         */
  625.   UCHAR    dinetmgt[CECONAME + 1]; /* Network Management Connection name     */
  626.   USHORT   disrtmco;               /* Send RTM data at counter overflow      */
  627.   USHORT   disrtmub;               /* Send RTM data at UNBIND                */
  628.   USHORT   diwruldr;               /* RTM timers run until:                  */
  629. #define CERTWRIT 0                 /*  0 - first data reaches screen         */
  630. #define CERTUNLK 1                 /*  1 - host unlocks keyboard             */
  631. #define CERTDIRE 2                 /*  2 - host lets user send               */
  632.   USHORT   dirtmth1;               /* RTM threshold #1                       */
  633.   USHORT   dirtmth2;               /* RTM threshold #2                       */
  634.   USHORT   dirtmth3;               /* RTM threshold #3                       */
  635.   USHORT   dirtmth4;               /* RTM threshold #4                       */
  636.   TEDALERT dialerts[CECNUMAL];     /* ALERT description records              */
  637.   UCHAR    diaudit[CESTRLEN];      /* Audit log filename                     */
  638.   UCHAR    dierror[CESTRLEN];      /* Error log filename                     */
  639.   USHORT   diaudlev;               /* Default audit level                    */
  640.                                    /*   0   -   level 6                      */
  641.                                    /*   1   -   level 8                      */
  642.                                    /*   2   -   level 10                     */
  643.   UCHAR    dipad[CECCNLEN + 1];    /* 16 bytes of padding                    */
  644. } TEDIAGNS;
  645.  
  646. /*****************************************************************************/
  647. /* Routine to access config information                                      */
  648. /*****************************************************************************/
  649. #ifndef WIN32_SUPPORT
  650. USHORT APIENTRY sepdcrec(UCHAR FAR *, USHORT, USHORT FAR * );
  651. #else
  652. USHORT WINAPI sepdcrec(UCHAR *, USHORT, USHORT * );
  653. #endif
  654.  
  655. /*****************************************************************************/
  656. /* Return codes from sepdcrec                                                */
  657. /*****************************************************************************/
  658.  
  659. #define NOCSSRVR 1                   /* No config server available           */
  660. #define NODGNREC 2                   /* Diagnostics record not found         */
  661. #define NOUSRREC 3                   /* No user record found for this user   */
  662. #define BUF2SMAL 4                   /* Buffer too small                     */
  663. #define NONOS    5                   /* Network not started                  */
  664. #define NOTLOGON 6                   /* User not logged on to network        */
  665. #define READERR  7                   /* File read error                      */
  666. #define NONAP    8                   /* NAP not started                      */
  667. #define MAXAPP   9                   /* Max # of client apps reached         */
  668. #define ERROR_SERVER 14              /* Error on the server end of the RPC   */
  669. #define ERROR_LOCAL_FAILURE 15       /* Error on the local end of the RPC    */
  670.  
  671. /*****************************************************************************/
  672. /* Structure of version information block                                    */
  673. /*****************************************************************************/
  674.  
  675. typedef struct cs_info {
  676.   unsigned short    length;            /* length of this struct (bytes)      */
  677.                                        /* (supplied parameter)               */
  678.   unsigned char     major_ver;         /* CS major ver CS1.1->1, CS2.0->2    */
  679.   unsigned char     minor_ver;         /* CS minor ver CS1.1->10 (dec)       */
  680.   unsigned char     config_share[80];  /* name of share point of current     */
  681.                                        /* config file = default location for */
  682.                                        /* style file \\box\share\ (null      */
  683.                                        /* terminated)                        */
  684.   unsigned short    nos;               /* NOS that the LAN is running        */
  685. #define Workstation 0
  686. #define LANMan      1      /* Also LAN Server, unless we can differentiate   */
  687. #define NetWare     2
  688. } CS_INFO;
  689.  
  690. /*****************************************************************************/
  691. /* Routine to get version information                                        */
  692. /*****************************************************************************/
  693. #ifndef WIN32_SUPPORT
  694. USHORT APIENTRY sepdgetinfo(struct cs_info far * );
  695. #else
  696. USHORT WINAPI sepdgetinfo(struct cs_info * );
  697. #endif
  698.  
  699. /*****************************************************************************/
  700. /* Additional return code from sepdgetinfo.                                  */
  701. /*****************************************************************************/
  702. #define BADLNGTH 2
  703.  
  704.  
  705. /*****************************************************************************/
  706. /* Function definition for fmistrings dll entry point                        */
  707. /*****************************************************************************/
  708. int WINAPI GetFmiReturnCode (UINT,UINT,UINT,unsigned char FAR * );
  709.  
  710. /*****************************************************************************/
  711. /* typedef for casting proc address return from GetProcAddress               */
  712. /*****************************************************************************/
  713. typedef int (FAR WINAPI * PGETFMISTR)(UINT, UINT, UINT, char FAR *);
  714.  
  715. /*****************************************************************************/
  716. /* Macro for creating the first parameter for the GetFmiReturnCode call when */
  717. /* using the error code and qualifier off a FMI status message.              */
  718. /*****************************************************************************/
  719. #define FMISTAT_TO_INT(code, qual)  ((INTEGER) (((code >> 8) << 8) | (qual >> 8)))
  720.  
  721. #ifdef WIN32_SUPPORT
  722.   #pragma pack()
  723. #endif
  724.  
  725. #ifdef __cplusplus
  726. }
  727. #endif
  728.  
  729. #pragma option pop /*P_O_Pop*/
  730. #endif
  731. /* End of file fmi.h */
  732.  
  733.