home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sniff16.zip / TESTAPP / WORMS.H < prev    next >
C/C++ Source or Header  |  1993-03-12  |  6KB  |  169 lines

  1. /*=========================================================================\
  2.  *                                                                         *
  3.  *       FILE:worms.h                                                      *
  4.  *                                                                         *
  5.  *       DESCRIPTION: This is the header file for the c module worms.c     *
  6.  *                                                                         *
  7.  *                                                                         *
  8.  *                                                                         *
  9.  *      Created 1991  IBM Corp.                                            *
  10.  *                                                                         *
  11.  *      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is        *
  12.  *      sample code created by IBM Corporation and/or Microsoft            *
  13.  *      Corporation. This sample code is not part of any standard          *
  14.  *      Microsoft or IBM product and is provided to you solely for         *
  15.  *      the purpose of assisting you in the development of your            *
  16.  *      applications.  The code is provided "AS IS", without               *
  17.  *      warranty of any kind.  Neither IBM or Microsoft  shall be          *
  18.  *      liable for any damages arising out of your use of the sample       *
  19.  *      code, even if they have been advised of the possibility of         *
  20.  *      such damages.                                                      *
  21.  *                                                                         *
  22.  *-------------------------------------------------------------------------*
  23.  *
  24.  *
  25.  *
  26.  *
  27.  *
  28.  *
  29.  *
  30.  *
  31.  *
  32.  *
  33.  *
  34.  *--------------------------------------------------------------
  35.  *
  36.  *  This header file  is for the source  module: worms.c
  37.  *
  38.  *
  39.  *
  40.  *
  41.  *
  42. \*==============================================================*/
  43.  
  44. /*--------------------------------------------------------------*\
  45.  *  Global macros, defined constants, and externs
  46. \*--------------------------------------------------------------*/
  47.  
  48.  
  49. typedef struct threaddata
  50. {
  51.      LONG     tidWorm;
  52.      BOOL     fActive;
  53.      USHORT   usCurrentRow;
  54.      USHORT   usCurrentCol;
  55.      BYTE     bAttribute;
  56.      SHORT    sCurrentDirection;
  57. }THREAD_DATA,*PTHREAD_DATA;
  58.  
  59.  
  60. /*--------------------------------------------------------------*\
  61.  *  Global variables  and definitions for this file
  62. \*--------------------------------------------------------------*/
  63.  
  64. extern SHORT         sStartWorms;
  65. extern THREAD_DATA   ThreadData[];
  66. extern BOOL          fThreadsContinue;
  67. extern SHORT         sCurrentThread;
  68. extern CHAR          *pszWormMessages [];
  69. extern SHORT         sStartWorms;
  70. extern BOOL          fSilent;
  71. extern VIOCURSORINFO viociCursor;
  72. extern BOOL          fQuit;
  73. extern BOOL          fDraw;
  74. extern MOUEVENTINFO mouev;
  75. extern VIOMODEINFO   VioModeInfo;
  76. extern HMOU hmou;
  77. extern HVIO  hvio;
  78. extern BOOL  bHelpEnabled;
  79. #ifndef __HEV__
  80. #include <bsedos.h>
  81. #endif
  82.   extern HEV   hevWormSem;
  83.   extern HEV   hevDrawSem;
  84.   extern HEV   hevDrawOk;
  85. #define WAIT_THREAD_EXIT     500L
  86. #define SLEEP_TIME_THREADS   100L
  87. #define PAUSE_TIME         ( 75L)
  88.  
  89. #define UP                   1
  90. #define LEFT                 2
  91. #define DOWN                 3
  92. #define RIGHT                4
  93. #define GOBBLE               5
  94. #define ZIG_UP               6
  95. #define BOX                  7
  96. #define ZIG_DOWN             8
  97.  
  98. #define WM_BLACK             0x00
  99. #define WM_BLUE              0x01
  100. #define WM_GREEN             0x02
  101. #define WM_CYAN              0x03
  102. #define WM_RED               0x04
  103. #define WM_MAGENTA           0x05
  104. #define WM_BROWN             0x06
  105. #define WM_PALEGRAY          0x07
  106. #define WM_DKGREY            0x08
  107. #define WM_LBLUE             0x09
  108. #define WM_LGREEN            0x0A
  109. #define WM_LCYAN             0x0B
  110. #define WM_LRED              0x0C
  111. #define WM_LMAGENTA          0x0D
  112. #define WM_YELLOW            0x0E
  113. #define WM_WHITE             0x0F
  114. #define WM_MAX_COLOR         0X0F
  115. #define TOP_ROW          0                   //Window Frame
  116. #define LEFT_COL         0
  117. #define BOT_ROW          25
  118. #define RGT_COL          80
  119.  
  120. #define FIRST_ROW        TOP_ROW + 3   //   Drawable Window Coordinates
  121. #define LAST_ROW         VioModeInfo.row
  122. #define FIRST_COL        1
  123. #define LAST_COL         VioModeInfo.col -1
  124. #define WIDTH            2
  125. #define MAX_DIRECTIONS   8
  126. #define HOR_WIDTH        (RGT_COL - LEFT_COL)
  127. #define HEIGHT           (BOT_ROW - TOP_ROW)
  128.  
  129.  
  130. #define F1                   0x3B            //Function keys
  131.  
  132. #define WM_BACKGROUND     (WM_BLUE << 4 ) + WM_WHITE
  133. #define MKATRB(a,b )     ((BYTE) (a << 4 ) + b )
  134.  
  135. /*
  136.  *global  message/error  numbers
  137.  */
  138.  
  139.  #define   WRM_NORMAL_EXIT          0
  140.  #define   ERROR                    1
  141.  #define   INIT_FAILURE             2
  142.  #define   MAX_THREADS_EXCEEDED     3
  143.  #define   ERROR_CREATING_THREAD    4
  144.  #define   ERROR_DISP_HELP          5
  145.  #define   ERROR_CREATING_WREADTHRD 6
  146.  #define   ENTER_TO_EXIT            7
  147.  #define   WAITING_THREADS_EXIT     8
  148.  #define   ANY_KEY_TO_CONTINUE      9
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. /*--------------------------------------------------------------*\
  157.  *  Global Entry point declarations
  158. \*--------------------------------------------------------------*/
  159. extern VOID   ErrorMessage(SHORT sExitStatus,BOOL fBeep);
  160. extern VOID   WormDelete(VOID );
  161. extern BOOL   WormCreate(VOID );
  162. extern VOID   Message(SHORT sErrorMessage,BOOL fBeep,
  163.                       BOOL fKeyBoardWait,BOOL fClsConsole,
  164.                       BOOL fSuspendThreads);
  165.  
  166. /*--------------------------------------------------------------*\
  167.  *  End of file : worms.h
  168. \*--------------------------------------------------------------*/
  169.