CORELIB.INC 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. (* Release 3.00 *)
  2. (* Copyright (C) 1989..1991 Jensen and Partners. All Rights Reserved *)
  3. (********************************* Model Flags *****************************)
  4. (* *)
  5. (* These flags are generated by the make system to reflect the current *)
  6. (* memory model. *)
  7. (* *)
  8. (***************************************************************************)
  9. NearCall = 1 - _fcall
  10. SameDS = 1 - _fdata
  11. NearPtr = 1 - _fptr
  12. MThread = _mthread
  13. RegParam = _jpicall
  14. near_init_code = NearCall
  15. near_init_data = SameDS
  16. StackChecks = 1
  17. _DLLOVL = (~_OS2) & (_DLL | _OVL)
  18. _NRM = ~(_DLL | _OVL)
  19. ProtMode = _WINDOWS | _OS2 (* You must be using a valid Library
  20. or add the following line to your project:
  21. override *.a /d_DLL? /d_OS2? /d_WINDOWS?
  22. where ? is either + or - depending on the
  23. target environment. *)
  24. (*%T _WINDLL *)
  25. _DLL = 0
  26. (*%E *)
  27. (***************************** Stack Frame Constants ***********************)
  28. (* *)
  29. (* These constants specify the model and calling convention parameter *)
  30. (* offset on the stack. *)
  31. (* *)
  32. (***************************************************************************)
  33. (*%F NearCall *)
  34. frame = 6 (* standard stack frame, far call *)
  35. bxframe = 4 (* bx stack frame, far call *)
  36. (*%E *)
  37. (*%T NearCall *)
  38. frame = 4 (* standard stack frame, near call *)
  39. bxframe = 2 (* bx stack frame, near call *)
  40. (*%E *)
  41. lframe = 6 (* standard stack frame, near_call=>off *)
  42. lbxframe = 4 (* bx stack frame, near_call=>off *)
  43. sframe = 4 (* standard stack frame, near_call=>on *)
  44. sbxframe = 2 (* bx stack frame, near_call=>on *)
  45. PopParam = 0 (* Dummy value for changing real return convention *)
  46. (***************************** Data Type Sizes *****************************)
  47. (* *)
  48. (* These constants specify the data type sizes according to memory *)
  49. (* model. *)
  50. (* *)
  51. (***************************************************************************)
  52. (*%F NearCall *)
  53. CodePtrSize = 4 (* Code pointer, far calls *)
  54. (*%E *)
  55. (*%T NearCall *)
  56. CodePtrSize = 2 (* Code pointer, near calls *)
  57. (*%E *)
  58. FarCodePtrSize = 4 (* Code pointer, near_call=>off *)
  59. NearCodePtrSize = 2 (* Code pointer, near_call=>on *)
  60. (*%F NearPtr *)
  61. DataPtrSize = 4 (* Data pointer, 32 bit data pointer models *)
  62. (*%E *)
  63. (*%T NearPtr *)
  64. DataPtrSize = 2 (* Data pointer, 16 bit data pointer models *)
  65. (*%E *)
  66. FarDataPtrSize = 4 (* Data pointer, near_ptr=>off *)
  67. NearDataPtrSize = 2 (* Data pointer, near_ptr=>on *)
  68. (*%F NearPtr *)
  69. _ptr = 0 (* _iob structure *)
  70. _cnt = 4
  71. _size = 6
  72. _base = 8
  73. _flag = 12
  74. _file = 14
  75. _pback = 16
  76. _iobSize = 24 (* size of _iob structure *)
  77. (*%E *)
  78. (*%T NearPtr *)
  79. _ptr = 0 (* _iob structure *)
  80. _cnt = 2
  81. _size = 4
  82. _base = 6
  83. _flag = 8
  84. _file = 10
  85. _pback = 12
  86. _iobSize = 20 (* size of _iob structure *)
  87. (*%E *)
  88. (***************************** OS Error Codes ******************************)
  89. (* *)
  90. (* These constants specify the error codes handled or set by the library. *)
  91. (* *)
  92. (***************************************************************************)
  93. ENOENT = 2
  94. ENOPATH = 3
  95. EACCESS = 5
  96. EBADF = 6
  97. E2BIG = 7
  98. ENOMEM = 8
  99. ENOSPC = 14
  100. EINVAL = 19
  101. EDOM = 33
  102. ERANGE = 34
  103. (***************************** IO Constants*********************************)
  104. (* *)
  105. (* These global constants are used by the IO functions. *)
  106. (* *)
  107. (***************************************************************************)
  108. BUFSIZ = 512 (* IO Buffer size *)
  109. _IOFBF = 0 (* setvbuf - full buffering *)
  110. _IOLBF = 1 (* setvbuf - line buffering *)
  111. _IONBF = 2 (* setvbuf - no buffering *)
  112. _F_RDWR = 0003H (* Read/write *)
  113. _F_READ = 0001H (* Read only file *)
  114. _F_WRIT = 0002H (* Write only file *)
  115. _F_UBUF = 0004H (* User allocated buffer *)
  116. _F_APP = 0008H (* Append data *)
  117. _F_ERR = 0010H (* Error *)
  118. _F_EOF = 0020H (* EOF *)
  119. _F_BIN = 0040H (* Binary file *)
  120. _F_IN = 0080H (* Data is incoming *)
  121. _F_OUT = 0100H (* Data is outgoing *)
  122. _F_DEV = 0200H (* File is terminal *)
  123. _F_RST = 0400H (* Newly opened stream *)
  124. _F_LBUF = 0800H (* line buffered stream *)
  125. _F_CTZ = 1000H
  126. SEEK_SET = 0 (* lseek - origin beginning of file *)
  127. SEEK_CUR = 1 (* lseek - origin current position *)
  128. SEEK_END = 2 (* lseek - origin end of file *)
  129. CTLZ = 1AH (* Text mode EOF character *)
  130. EOF = -1 (* end of file return value *)
  131. O_RDONLY = 0
  132. O_WRONLY = 1
  133. O_RDWR = 2
  134. O_CREAT = 0100H (* create and open file *)
  135. O_TRUNC = 0200H (* open with truncation *)
  136. O_EXCL = 0400H (* exclusive open *)
  137. _O_EOF = 0200H (* set when text file hits ^Z *)
  138. O_APPEND = 0800H (* write to end of file *)
  139. O_CHANGED = 1000H (* File has been written *)
  140. O_DEVICE = 2000H (* user read only flag *)
  141. O_TEXT = 4000H (* CR-LF translation *)
  142. O_BINARY = 8000H (* no translation *)
  143. SH_NOINHERIT = 80H (* File sharing modes *)
  144. SH_COMPAT = 00H
  145. SH_DENYRW = 10H
  146. SH_DENYWR = 20H
  147. SH_DENYRD = 30H
  148. SH_DENYNO = 40H
  149. SH_DENYNONE = SH_DENYNO (* MS documentation uses both *)
  150. S_IFDIR = 4000H (* directory *)
  151. S_IFCHR = 2000H (* character device *)
  152. S_IFREG = 8000H (* regular file *)
  153. S_IREAD = 0100H (* owner may read *)
  154. S_IWRITE = 0080H (* owner may write *)
  155. S_IEXEC = 0040H (* owner may execute directory search *)
  156. (************************ OS2 structures and constants ********************)
  157. (* *)
  158. (* *)
  159. (***************************************************************************)
  160. fdateCreation = 0
  161. ftimeCreation = 2
  162. fdateLastAccess = 4
  163. ftimeLastAccess = 6
  164. fdateLastWrite = 8
  165. ftimeLastWrite = 10
  166. cbFile = 12
  167. cbFileAlloc = 16
  168. attrFile = 20
  169. FileInfoSize = 22
  170. IO_WAIT = 0
  171. IO_NOWAIT = 1
  172. (* KBDKEYINFO structure, for KbdCharIn and KbdPeek *)
  173. chChar = 0
  174. chScan = 1
  175. fbStatus = 2
  176. bNlsShift = 3
  177. fsState = 4
  178. time = 6
  179. KbdInfoSize = 10
  180. hours = 0
  181. minutes = 1
  182. seconds = 2
  183. hundredths = 3
  184. day = 4
  185. month = 5
  186. year = 6
  187. timezone = 8
  188. weekday = 10
  189. DateTimeSize = 11
  190. EXIT_THREAD = 0
  191. EXIT_PROCESS = 1
  192. EXLST_ADD = 1
  193. EXLST_REMOVE = 2
  194. EXLST_EXIT = 3
  195. (* Signal Numbers for DosSetSigHandler *)
  196. SIG_CTRLC = 1 (* Control C *)
  197. SIG_BROKENPIPE = 2 (* Broken Pipe *)
  198. SIG_KILLPROCESS = 3 (* Program Termination *)
  199. SIG_CTRLBREAK = 4 (* Control Break *)
  200. SIG_PFLG_A = 5 (* Process Flag A *)
  201. SIG_PFLG_B = 6 (* Process Flag B *)
  202. SIG_PFLG_C = 7 (* Process Flag C *)
  203. SIG_CSIGNALS = 8 (* number of signals plus one *)
  204. (* Flag Numbers for DosFlagProcess *)
  205. PFLG_A = 0 (* Process Flag A *)
  206. PFLG_B = 1 (* Process Flag B *)
  207. PFLG_C = 2 (* Process Flag C *)
  208. (* Signal actions *)
  209. SIGA_KILL = 0
  210. SIGA_IGNORE = 1
  211. SIGA_ACCEPT = 2
  212. SIGA_ERROR = 3
  213. SIGA_ACKNOWLEDGE = 4
  214. SIG_DFL = 0
  215. SIG_IGN = 1
  216. SIG_SGE = 3
  217. SIG_ACK = 4
  218. (************************ Library Internal Constants ***********************)
  219. (* *)
  220. (* These constants are internal to the run-time library and may NOT *)
  221. (* changed. *)
  222. (* *)
  223. (***************************************************************************)
  224. TRUE = 1
  225. FALSE = 0
  226. math_saved_regs = 8
  227. THREADTABLESIZE = 52 (* Thread Table Size *)
  228. MAXTHREAD = 32
  229. _ERRNO = 0
  230. ExpNeg = 80H
  231. magic = 01234H (* value to flag exception handler *)
  232. f_st5 = 10H (* arg1 is in st5 *)
  233. f_two = 20H (* two arguments *)
  234. _DOMAIN = 1 (* parameter not in valid domain *)
  235. _SING = 2 (* function is incalculable at this place *)
  236. _OVERFLOW = 3 (* result exceeds representable range *)
  237. _UNDERFLOW = 4 (* result too close to zero to be represented *)
  238. _TLOSS = 5 (* total loss of precision (eg. Sine (2**65)) *)
  239. _PLOSS = 6 (* partial precision loss *)
  240. VideoConfigSize = 22
  241. RCcoordSize = 4
  242. XYcoordSize = 4
  243. graph_xcoord = 0
  244. graph_ycoord = 2
  245. (* Process descriptor offsets *)
  246. NextProcess = 0 (* Next in chain (-1 = end) *)
  247. (* of waiting processes *)
  248. LongCall = 2 (* Long call used to point interrupts *)
  249. LongCallIP = 4 (* at interrupt handler *)
  250. LongCallCS = 6
  251. ProcessSP = 8
  252. ProcessSS = 10
  253. ProcessPriority = 12
  254. ProcessFloat = 14
  255. ProcessRecordSize = 94 + ProcessFloat
  256. ProcessRecSize = 1 (* paragraphs *)
  257. ProcessRecSizeFloat = 7 (* paragraphs *)
  258. ColorStatusReg = 03DAH
  259. ColorRetrace = 1
  260. ColorVertRetrace = 8
  261. BWseg = 0B000H
  262. ColorSeg = 0B800H
  263. ZFLAG = 80H (* Zero pad flag from printf *)
  264. (*%F NearPtr *) (* vprinter control structure *)
  265. stream = 0
  266. flush = 4
  267. (*%F _DLL *)
  268. count = 6
  269. args = 8
  270. handler = 10
  271. (*%E *)
  272. (*%T _DLL *)
  273. count = 8
  274. args = 10
  275. handler = 12
  276. (*%E *)
  277. (*%E *)
  278. (*%T NearPtr *)
  279. stream = 0
  280. flush = 2
  281. count = 4
  282. args = 6
  283. handler = 8
  284. (*%E *)
  285. CurrentThread = 0
  286. (*%F _WINDOWS *)
  287. InMathLib = 1
  288. (*%E *)
  289. (*%T _WINDOWS *)
  290. InMathLib = 17
  291. (*%E *)
  292. ThreadID = 6 (* Thread table offsets *)
  293. _ERRNO = 0
  294. nearFreeSize = 0 (* near heap header offsets *)
  295. nearNextBlock = 2
  296. farFreeSize = 14 (* MSDOS far heap header offsets *)
  297. farNextBlock = 16
  298. OS2FreeSize = 0 (* OS2 far heap header offsets *)
  299. OS2NextBlock = 2
  300. prevHeap = 0 (* OS2 far heap segment header offsets *)
  301. nextHeap = 2
  302. firstFree = 4
  303. statHeap = 6
  304. heapStart = 8
  305. HEAP_ALLOCATED = 1 (* OS2 far heap segment header constants *)
  306. HEAP_FREE = 0
  307. OS2MAXSIZE = 0FFF6H
  308. OS2HEAPTOP = OS2MAXSIZE + heapStart
  309. OS2MINHEAP = 10
  310. OS2MAXSEGS = 10
  311. MINGAP = 1024
  312. MINBLOCK = 16
  313. MINHEAP = 16
  314. STACK_SIZE = 1000H
  315. ENVNUM = 64 (* Max environment pointers *)
  316. DTA_SIZE = 128
  317. InitRecSize = 3+CodePtrSize
  318. Magic = 0
  319. Priority = 2
  320. ProcVar = 3
  321. MAGIC_NUM = 1234H
  322. PR0 = 30
  323. PR1 = 29
  324. PR2 = 28
  325. PR3 = 27
  326. PR4 = 26
  327. PR5 = 25
  328. PRL = 20
  329. PRMAX = 32
  330. InitRecNext = 0
  331. InitRecTotal = 4
  332. InitRecSeg = 6
  333. Timer=40H (* 8253-5 Programmable Interval Timer *)
  334. PPIport=60H (* 8255A-5 Programmable Peripheral Interface *)
  335. KBCtrl=61H
  336. ARG_BUF_SIZE = 1024 (* Max Size for child's environment *)
  337. emu_fraction = 0
  338. emu_exponent = 8
  339. emu_sign = 10
  340. emu_spare = 11
  341. emu_temp_size = 12
  342. by0 = 0
  343. by1 = 1
  344. w0 = 0
  345. w1 = 2
  346. w2 = 4
  347. w3 = 6
  348. dd0 = 0
  349. dd1 = 4
  350. STACK_GUARD = 1234H
  351. GETSTATE_START = 0
  352. GETSTATE_END = 2
  353. GETSTATE_FIRST = 4
  354. LOADER_ERROR_INVALID_ENTRY = 1
  355. LOADER_ERROR_TOO_MANY_MODULES = 2
  356. LOADER_ERROR_WRONG_MODULE_VERSION = 3
  357. LOADER_ERROR_MODULE_CORRUPT = 4
  358. LOADER_ERROR_STACK_CORRUPT = 5
  359. LOADER_ERROR_MODULE_NOT_FOUND = 6
  360. LOADER_ERROR_FIXUP_INCORRECT = 7
  361. LOADER_ERROR_EMS_ERROR = 8
  362. LOADER_ERROR_NOT_DLL = 9
  363. LOADER_ERROR_INVALID_FUNC = 10
  364. LOADER_ERROR_MODULE_INIT_FAILED = 11
  365. LOADER_ERROR_FILE_NOT_FOUND = 12
  366. LOADER_ERROR_OUT_OF_MEMORY = 13
  367. LOADER_ERROR_FILE_READ = 14
  368. LOADER_ERROR_FILE_SEEK = 15
  369. LOADER_ERROR_STACK_OVERFLOW = 16
  370. LOADER_ERROR_CODE_FIXUP = 17
  371. LOADER_ERROR_TOO_MANY_SEGMENTS = 18
  372. LOADER_ERROR_INVALID_LOAD = 19
  373. LOADER_ERROR_CMEM_ERROR = 20
  374. LOADER_ERROR_INVALID_IMPORT = 21
  375. LOADER_ERROR_NO_ENTRYPOINTS = 22
  376. LOADER_ERROR_INVALID_TRANSFORM = 23
  377.