home *** CD-ROM | disk | FTP | other *** search
/ WordPerfect for Linux Bible / WP4LinuxBible.iso / sdk / wpx / code / wt / wtcomm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-25  |  2.2 KB  |  81 lines

  1.  
  2. /* HEADER FILE *****************************************************
  3.  * WTCOMM.H  -  Writing Tools API Communication Header File.
  4.  *******************************************************************
  5.  * Copyright (C) 1993 WordPerfect Corp., All Rights Reserved
  6.  *******************************************************************/
  7. #ifndef WTCOMM_H
  8. #define WTCOMM_H
  9.  
  10. #include <wtapi.h>
  11.  
  12. #define MAXBLOCKSIZE    1024
  13. #define MAXBLOCKCNT     50
  14.  
  15. typedef int    (*FUNCP)();        /* pointer to function which returns an int */
  16.  
  17. typedef enum {
  18.     PIPE_OK = 0,    /* pipe read/write was successful */
  19.     PIPE_DOWN,        /* pipe read/write failed, pipe has gone down */
  20.     PIPE_NOMEM,        /* pipe read/write failed, not enough memory */
  21.     PIPE_ERROR        /* pipe read/write failed, unknown error */
  22. } PIPE_ERRS;
  23.  
  24. typedef enum {
  25.     WTAPI_CLIENT_COMMAND,    /* Command sent by a client */
  26.     WTAPI_CLIENT_QUERY,        /* Query sent by a client */
  27.     WTAPI_TOOL_COMMAND,        /* Command sent by a tool */
  28.     WTAPI_TOOL_QUERY,        /* Query sent by a tool */
  29.     QUIT,                    /* Quit */
  30.     REPLY,                    /* Reply to a sent message */
  31.     INVOKE_DIALOG,            /* Bring up a dialog */
  32.     QUERY,                    /* Get info about product */
  33.     END_MSG_TYPES            /* End of message types */
  34. } MSG_TYPE;
  35.  
  36. typedef enum {
  37.     MSG_SEND,
  38.     MSG_SEND_MODAL,
  39.     MSG_SEND_REQUEST
  40. } SEND_TYPE;
  41.  
  42. typedef enum {
  43.     MSG_OK,
  44.     MSG_CANT_DELIVER,
  45.     MSG_CANT_RECEIVE,
  46.     MSG_NOMEM,
  47.     MSG_ERROR
  48. } MSG_ERRS;
  49.  
  50. typedef struct {
  51.     WTMSGID    inmsgid;
  52.     WTSIZE    inmsgsize;
  53.     WTSIZE    inbufsize;
  54.     WTMSGID    rtmsgid;
  55.     WTSIZE    rtmsgsize;
  56.     WTSIZE    rtbufsize;
  57. } WTMSGHEADER, *WTMSGHEADERP;
  58.  
  59. typedef struct {                /* TEXTBLOCK query structure */
  60.     unsigned    offset;            /* offset of text */
  61.     unsigned    len;            /* len of text */
  62. } TQCONTEXT,  *TQPTR;
  63.  
  64. typedef struct {
  65.     WTCOMM        commid;            /* communication id (platform-specific) */
  66.     WTTOOL        toolType;        /* type of writing tool */
  67.     WTTEXT        textmode;        /* text transmission mode */
  68.     unsigned    version;        /* version of API communication */
  69.     unsigned    service;        /* writing tool service number */
  70.     char          rtText[MAXBLOCKSIZE];    /* block for returning data */
  71.     TQCONTEXT    textInfo[MAXBLOCKCNT];
  72.     int            lastBlock;
  73.     int            currBlock;
  74.     unsigned    absPos;
  75.     WTUNIT        tounit;
  76.     WTPOS        topos;
  77.     WTCOUNT        toloc;
  78. } WTCONTEXT, *WTPTR;
  79.  
  80. #endif    /* WTCOMM_H */
  81.