Source:NetHack 3.3.0/def os2.h
Revision as of 10:20, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 3.3.0/def os2.h moved to Source:NetHack 3.3.0/def os2.h: Robot: moved page)
Below is the full text to def_os2.h from the source code of NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/def_os2.h#line123]], for example.
Warning! This is the source code from an old release. For the latest release, see Source code
The NetHack General Public License applies to screenshots, source code and other content from NetHack.
This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.
1. /* SCCS Id: @(#)def_os2.h 3.3 93/01/19 */ 2. /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. /* 6. * Only a small portion of all OS/2 defines are needed, so the 7. * actual include files often need not be used. In fact, 8. * including the full headers may stall the compile in DOS. 9. */ 10. 11. #ifdef OS2_USESYSHEADERS 12. 13. # define INCL_NOPMAPI 14. # define INCL_DOSFILEMGR 15. # define INCL_DOS 16. # define INCL_SUB 17. 18. #include <os2.h> 19. 20. #else 21. 22. typedef char CHAR; 23. typedef void VOID; 24. 25. typedef unsigned char UCHAR; 26. typedef unsigned short USHORT; 27. typedef unsigned int UINT; 28. typedef unsigned long ULONG; 29. typedef unsigned char BYTE; 30. 31. # ifdef OS2_32BITAPI 32. 33. typedef unsigned long SHANDLE; 34. typedef USHORT HKBD; 35. typedef USHORT HVIO; 36. 37. # define CCHMAXPATHCOMP 256 38. 39. # ifdef OS2_CSET2 40. # define API16 _Far16 _Pascal 41. # define DAT16 42. # define API32 _System 43. # define KbdGetStatus KBD16GETSTATUS 44. # define KbdSetStatus KBD16SETSTATUS 45. # define KbdCharIn KBD16CHARIN 46. # define KbdPeek KBD16PEEK 47. # define VioGetMode VIO16GETMODE 48. # define VioSetCurPos VIO16SETCURPOS 49. # else 50. # define API16 51. # define DAT16 52. # define API32 53. # endif 54. 55. # define DAT 56. 57. # else /* OS2_32BITAPI */ 58. 59. typedef unsigned short SHANDLE; 60. typedef SHANDLE HKBD; 61. typedef SHANDLE HVIO; 62. 63. # define CCHMAXPATHCOMP 13 64. 65. # ifdef OS2_MSC 66. # define API16 pascal far 67. # define DAT16 68. # endif 69. 70. # define DAT DAT16 71. 72. # endif /* OS2_32BITAPI */ 73. 74. typedef USHORT * DAT16 PUSHORT; 75. typedef BYTE * DAT16 PBYTE; 76. typedef ULONG * DAT PULONG; 77. typedef VOID * DAT PVOID; 78. 79. typedef SHANDLE HDIR; 80. typedef HDIR * DAT PHDIR; 81. 82. typedef char * DAT16 PCH; 83. typedef char * DAT PSZ; 84. 85. /* all supported compilers understand this */ 86. 87. # pragma pack(2) 88. 89. typedef struct { 90. UCHAR chChar; 91. UCHAR chScan; 92. UCHAR fbStatus; 93. UCHAR bNlsShift; 94. USHORT fsState; 95. ULONG time; 96. } KBDKEYINFO; 97. 98. typedef KBDKEYINFO * DAT16 PKBDKEYINFO; 99. 100. /* File time and date types */ 101. 102. typedef struct { 103. UINT twosecs : 5; 104. UINT minutes : 6; 105. UINT hours : 5; 106. } FTIME; 107. 108. typedef struct { 109. UINT day : 5; 110. UINT month : 4; 111. UINT year : 7; 112. } FDATE; 113. 114. # ifdef OS2_32BITAPI 115. 116. typedef struct { 117. ULONG oNextEntryOffset; 118. FDATE fdateCreation; 119. FTIME ftimeCreation; 120. FDATE fdateLastAccess; 121. FTIME ftimeLastAccess; 122. FDATE fdateLastWrite; 123. FTIME ftimeLastWrite; 124. ULONG cbFile; 125. ULONG cbFileAlloc; 126. ULONG attrFile; 127. UCHAR cchName; 128. CHAR achName[CCHMAXPATHCOMP]; 129. } FILEFINDBUF3; 130. 131. # else 132. 133. typedef struct { 134. FDATE fdateCreation; 135. FTIME ftimeCreation; 136. FDATE fdateLastAccess; 137. FTIME ftimeLastAccess; 138. FDATE fdateLastWrite; 139. FTIME ftimeLastWrite; 140. ULONG cbFile; 141. ULONG cbFileAlloc; 142. USHORT attrFile; 143. UCHAR cchName; 144. CHAR achName[CCHMAXPATHCOMP]; 145. } FILEFINDBUF; 146. 147. typedef FILEFINDBUF * DAT16 PFILEFINDBUF; 148. 149. # endif /* OS2_32BITAPI */ 150. 151. typedef struct { 152. ULONG idFileSystem; 153. ULONG cSectorUnit; 154. ULONG cUnit; 155. ULONG cUnitAvail; 156. USHORT cbSector; 157. } FSALLOCATE; 158. 159. typedef struct { 160. USHORT cb; 161. USHORT fsMask; 162. USHORT chTurnAround; 163. USHORT fsInterim; 164. USHORT fsState; 165. } KBDINFO; 166. 167. typedef KBDINFO * DAT16 PKBDINFO; 168. 169. typedef struct { 170. USHORT cb; 171. UCHAR fbType; 172. UCHAR color; 173. USHORT col; 174. USHORT row; 175. USHORT hres; 176. USHORT vres; 177. UCHAR fmt_ID; 178. UCHAR attrib; 179. ULONG buf_addr; 180. ULONG buf_length; 181. ULONG full_length; 182. ULONG partial_length; 183. PCH ext_data_addr; 184. } VIOMODEINFO; 185. 186. typedef VIOMODEINFO * DAT16 PVIOMODEINFO; 187. 188. # pragma pack() 189. 190. /* OS2 API functions */ 191. 192. USHORT API16 KbdGetStatus(PKBDINFO, HKBD); 193. USHORT API16 KbdSetStatus(PKBDINFO, HKBD); 194. USHORT API16 KbdCharIn(PKBDKEYINFO, USHORT, HKBD); 195. USHORT API16 KbdPeek(PKBDKEYINFO, HKBD); 196. 197. USHORT API16 VioGetMode(PVIOMODEINFO, HVIO); 198. USHORT API16 VioSetCurPos(USHORT, USHORT, HVIO); 199. 200. # ifdef OS2_32BITAPI 201. ULONG API32 DosQueryFSInfo(ULONG, ULONG, PVOID, ULONG); 202. ULONG API32 DosFindFirst(PSZ, PHDIR, ULONG, PVOID, ULONG, PULONG, ULONG); 203. ULONG API32 DosFindNext(HDIR, PVOID, ULONG, PULONG); 204. ULONG API32 DosSetDefaultDisk(ULONG); 205. # else 206. USHORT API16 DosQFSInfo(USHORT, USHORT, PBYTE, USHORT); 207. USHORT API16 DosFindFirst(PSZ, PHDIR, USHORT, PFILEFINDBUF, USHORT, PUSHORT, ULONG); 208. USHORT API16 DosFindNext(HDIR, PFILEFINDBUF, USHORT, PUSHORT); 209. USHORT API16 DosSelectDisk(USHORT); 210. # endif /* OS2_32BITAPI */ 211. 212. #endif /* OS2_USESYSHEADERS */