CORELIB.INC 17 KB

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