home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / os2 / npipe / namepipe.h < prev    next >
C/C++ Source or Header  |  1999-05-11  |  3KB  |  74 lines

  1. /*
  2.  *   Namepipe.h - variables and defines used by both
  3.  *                server and client pipe routines.
  4.  *
  5.  *   Copyright 1991 IBM Corp.
  6.  *
  7.  */
  8.  
  9. struct _PIPE_MSG
  10. {
  11.    USHORT  usMsgType;
  12.    USHORT  usMsgData;
  13. };
  14.  
  15. typedef struct _PIPE_MSG  PIPE_MSG;
  16.  
  17. #define START_PIPE_NAME  "\\pipe\\BUYAPS2"
  18. #define GAME_PIPE_NAME   "\\pipe\\NOWINDOZ"
  19.  
  20. #define FS_SVR_STARTPIPE_OPEN_MODE  NP_ACCESS_DUPLEX | NP_NOINHERIT | NP_WRITEBEHIND
  21. #define FS_SVR_STARTPIPE_PIPE_MODE  NP_WAIT | NP_READMODE_MESSAGE | NP_TYPE_MESSAGE | 1
  22.  
  23. #define FS_CLI_STARTPIPE_OPEN_MODE  OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYREADWRITE | OPEN_FLAGS_WRITE_THROUGH
  24.  
  25. #define FS_SVR_GAMEPIPE_OPEN_MODE   NP_ACCESS_DUPLEX | NP_NOINHERIT | NP_WRITEBEHIND
  26. #define FS_SVR_GAMEPIPE_PIPE_MODE   NP_WAIT | NP_READMODE_MESSAGE | NP_TYPE_MESSAGE | MAX_PLAYERS
  27.  
  28. #define FS_CLI_GAMEPIPE_OPEN_MODE   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE | OPEN_FLAGS_WRITE_THROUGH
  29.  
  30. #define DIVISIONS     3                      /* number of squares per side */
  31. #define SERVER        TRUE
  32. #define CLIENT        FALSE
  33. #define PIPE_TIMEOUT  1000                   /* milliseconds till pipe times out */
  34. #define MAX_PLAYERS   NP_UNLIMITED_INSTANCES
  35. #define MAXSERVERNAME 9                      /* maximum length of server name */
  36. #define MAXPIPENAME   (MAXSERVERNAME+16)     /* maximum length of pipe name */
  37.  
  38. /*
  39.  *  1 = server, DIVISIONS+1 = client
  40.  */
  41.  
  42. #define SERVER_NUM  (USHORT)1
  43. #define CLIENT_NUM  (DIVISIONS+(USHORT)1)
  44.  
  45. #define CLIENT_MOVE       (USHORT)10
  46. #define YOU_FIRST         (USHORT)12
  47. #define ERROR_MSG         (USHORT)13
  48. #define CLIENT_QUIT       (USHORT)14
  49. #define WIN_CLIENT        (USHORT)15
  50. #define WIN_SERVER        (USHORT)16
  51. #define SERVER_MOVE       (USHORT)17
  52. #define START_MSG         (USHORT)18
  53. #define WIN_DRAW          (USHORT)20
  54.  
  55. #define WM_CLIENT_MOVE    (WM_USER+CLIENT_MOVE)
  56. #define WM_YOU_FIRST      (WM_USER+YOU_FIRST)
  57. #define WM_ERROR_MSG      (WM_USER+ERROR_MSG)
  58. #define WM_CLIENT_QUIT    (WM_USER+CLIENT_QUIT)
  59. #define WM_WIN_CLIENT     (WM_USER+WIN_CLIENT)
  60. #define WM_WIN_SERVER     (WM_USER+WIN_SERVER)
  61. #define WM_SERVER_MOVE    (WM_USER+SERVER_MOVE)
  62. #define WM_START          (WM_USER+START_MSG)
  63. #define WM_DRAW           (WM_USER+WIN_DRAW)
  64.  
  65. #define CLIENT_MOVE_TEXT    "CLIENT_MOVE"
  66. #define YOU_FIRST_TEXT      "YOU_FIRST"
  67. #define ERROR_MSG_TEXT      "ERROR_MSG"
  68. #define CLIENT_QUIT_TEXT    "CLIENT_QUIT"
  69. #define WIN_CLIENT_TEXT     "WIN_CLIENT"
  70. #define WIN_SERVER_TEXT     "WIN_SERVER"
  71. #define SERVER_MOVE_TEXT    "SERVER_MOVE"
  72. #define START_MSG_TEXT      "START_MSG"
  73. #define WIN_DRAW_TEXT       "WIN_DRAW"
  74.