home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / top2src.zip / OS2.ZIP / MCP.H < prev    next >
C/C++ Source or Header  |  1996-01-17  |  4KB  |  92 lines

  1. #ifdef __WATCOMC__
  2.   #ifdef __FLAT__
  3.     #pragma library("..\lib\mcp32.lib");
  4.   #else
  5.     #pragma library("..\lib\mcp.lib");
  6.   #endif
  7. #endif
  8.  
  9. #define MCP                           /* Make sure that MCP is defined */
  10. #define PIPE_MSG_SIZE         16384   /* Up to 16k IPC messages */
  11. #define MCP_OUT_BUF_MAX       512     /* Send 512 bytes at a time */
  12.  
  13. #ifndef CALLBACK
  14.   #define CALLBACK __syscall
  15. #endif
  16.  
  17. /* Table of handler functions */
  18.  
  19. typedef struct
  20. {
  21.   USHORT dispatch_code;
  22.   int (CALLBACK *f)(PVOID);
  23. } DISPATCH;
  24.  
  25.  
  26. typedef struct
  27. {
  28.   BYTE bHeight;
  29.   BYTE bWidth;
  30.   BYTE bCurRow;
  31.   BYTE bCurCol;
  32.   BYTE bCurAttr;
  33. } VIO_DUMP_HDR;
  34.  
  35.  
  36.  
  37. /* Messages sent to MCP by Maximus: */
  38.  
  39. #define PMSG_HELLO              0x00    /* Task on-line */
  40. #define PMSG_EOT                0x01    /* End of session */
  41. #define PMSG_SET_STATUS         0x02    /* Set IPC status of this node */
  42. #define PMSG_MAX_SEND_MSG       0x03    /* Send inter-node message */
  43. #define PMSG_QUERY_ACTIVE       0x04    /* Query status of task number x */
  44. #define PMSG_QUERY_TASKINFO     0x04    /* Query status of task number x */
  45. #define PMSG_QUERY_ACTIVE_NUM   0x05    /* Query total no. of active tasks */
  46. #define PMSG_QUERY_TASKLIST     0x05    /* Query total no. of active tasks */
  47. #define PMSG_PING               0x06    /* We are alive */
  48. #define PMSG_VIO                0x07    /* Video I/O */
  49. #define PMSG_VIO_DUMP           0x08    /* Video screen buffer dump */
  50. #define PMSG_LOG                0x09    /* Logging information */
  51.  
  52. /* Messages sent to Maximus by MCP: */
  53.  
  54. #define RPMSG_GOT_MSG           0x00    /* Msg for you from other Max node */
  55. #define RPMSG_MONITOR           0x01    /* Begin/end monitoring */
  56. #define RPMSG_HAPPY_DAGGER      0x02    /* Terminate session */
  57. #define RPMSG_CTRLC             0x03    /* Got ^c from client */
  58. #define RPMSG_BREAK             0x04    /* Got ^brk from client */
  59. #define RPMSG_KEY               0x05    /* Keyboard I/O */
  60.  
  61. /* Messages sent by client to MCP */
  62.  
  63. #define CLMSG_BEGINMONITOR      0x00    /* Start monitoring a Max task */
  64. #define CLMSG_ENDMONITOR        0x01    /* End monitoring a Max task */
  65. #define CLMSG_BEGINOVR          0x02    /* Start sending overview info */
  66. #define CLMSG_ENDOVR            0x03    /* Stop sending overview info */
  67. #define CLMSG_BYEBYE            0x04    /* Disconnect from client */
  68. #define CLMSG_KEY               0x05    /* Keyboard input */
  69. #define CLMSG_START             0x06    /* Tell Max task to begin */
  70. #define CLMSG_HAPPY_DAGGER      0x07    /* Tell Max task to end */
  71. #define CLMSG_MAX_SEND_MSG      0x08    /* Send a msg to a Max task */
  72.  
  73. /* Messages send by MCP to client */
  74.  
  75. #define RCMSG_ACK               0x00    /* Okay */
  76. #define RCMSG_BADNODE           0x01    /* Unknown node */
  77. #define RCMSG_NORESOURCES       0x02    /* Not enough resources for req */
  78. #define RCMSG_IO_MONITOR        0x03    /* I/O from monitored session */
  79. #define RCMSG_CIAO_BABY         0x04    /* MCP terminating connection */
  80. #define RCMSG_IO_MONITOR_DUMP   0x05    /* Incoming screen dump */
  81. #define RCMSG_OVERVIEW          0x06    /* Overview information */
  82. #define RCMSG_PING              0x07    /* Got ping from node */
  83. #define RCMSG_LOG               0x08    /* Got logging info from node */
  84.  
  85. int APIENTRY McpGetMsg(HPIPE hp, PVOID pv, USHORT *pusSize, USHORT usMaxSize);
  86. int APIENTRY McpPeekMsg(HPIPE hp, PVOID pv, USHORT *pusSize, USHORT usMaxSize);
  87. int APIENTRY McpDispatchMsg(PVOID pv, USHORT usSize, DISPATCH *dt, PVOID pvParm);
  88. int APIENTRY McpSendMsg(HPIPE hp, USHORT usType, BYTE *pbMsg, USHORT cbMsg);
  89. int APIENTRY McpOpenPipe(char *pszPipeName, HPIPE *php);
  90. void APIENTRY McpClosePipe(HPIPE hp);
  91.  
  92.