SRC_M2.DOC 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. Modula-2 Library SourceKit Documentation version 3.10
  2. ========================== ==========================
  3. Introduction
  4. ------------
  5. Why a read-me file?
  6. There are two major reasons why printed documentation was
  7. not produced for the TopSpeed SourceKits:
  8. * Internal revision. Only the public interface of the
  9. run-time libraries can remain fixed. TopSpeed's policy
  10. of continual improvement means that the actual
  11. implementation of products may be changed between
  12. minor releases.
  13. * User feedback. This documentation will be augmented
  14. in response to user requests for information where
  15. possible.
  16. Modula-2 library naming
  17. -----------------------
  18. In normal use, the correct Modula-2 libraries are linked
  19. automatically by the project system. However, if manual
  20. selection is required, the following naming convention
  21. must be used:
  22. %O%%M%%C%M2.LIB
  23. %O%%M%%C%MLIB.LIB
  24. Where the macros %O%, %M% and %C% are expanded as follows:
  25. %O% Operating system:
  26. R Real mode (MSDOS).
  27. W Windows.
  28. P Protected mode (OS2).
  29. %M% Memory model:
  30. S Small model.
  31. C Compact model.
  32. M Medium model.
  33. L Large model.
  34. X XLarge model.
  35. T Mthread model.
  36. O Overlay model (MSDOS only).
  37. D Dynalink model.
  38. %C% Calling convention:
  39. _ JPI.
  40. F Stack frame.
  41. For example, the large model, MSDOS, JPI calling
  42. convention Modula-2 libraries are named:
  43. RL_MLIB.LIB, RL_M2.LIB
  44. In a multi-language program, the MLIB library is not
  45. used, MLIBC being substituted.
  46. Conditional compilation
  47. -----------------------
  48. The assembly language files produce code for all TopSpeed
  49. memory models, operating systems and calling conventions.
  50. This is achieved by conditional compilation.
  51. The following boolean flags are used to reflect the
  52. various possibilities:
  53. NearPtr When true, data pointers are 16 bit. When
  54. false, data pointers are 32 bit.
  55. Small and Medium models use NearPtr = true.
  56. All other models use NearPtr = false.
  57. NearCall When true, calls and return are near, and
  58. procedure variables are 16 bit. When false,
  59. calls and return are far, and procedure
  60. variables are 32 bit.
  61. Small and Compact models use NearCall = true.
  62. All other models use NearCall = false.
  63. SameDS When true, DS is not assumed to be fixed, i.e.
  64. pointing to DGROUP, the default data segment.
  65. XLarge, Mthread, Overlay and Dynalink models
  66. use SameDS = false. All other models use
  67. SameDS = true.
  68. RegParam When using the jpi calling convention, passing
  69. parameters in registers, RegParam is true.
  70. When using the standard stack frame calling
  71. convention, RegParam is false.
  72. MThread In memory models that support multi-thread
  73. operation, MThread is true.
  74. Mthread, overlay and dynalink models support
  75. multiple threads. Code to support this mode of
  76. operation is include in these models.
  77. _OS2 When true, OS2 specific code is generated. When
  78. false MSDOS and some Windows code is generated
  79. _WINDOWS When true, Windows specific code is generated.
  80. _DLLOVL When true, code required for the TopSpeed
  81. overlay manager is generated. This required
  82. for Overlay model and the Dynalink model under
  83. MSDOS.
  84. _DLL When true, code specific to DLLs is generated.
  85. ProtMode When true, protected mode features are enabled
  86. for either OS2 or Windows.
  87. _WINDLL When true, code specific to Windows DLLs is
  88. generated.
  89. The Modula-2 files use the following conditional
  90. compilation flags:
  91. _mthread In memory models that support multithread
  92. operation, _mthread is true.
  93. Mthread, overlay and dynalink models support
  94. multiple threads. Code to support this mode of
  95. operation is include in these models.
  96. _OS2 When true OS2 specific code is generated. When
  97. false MSDOS and some Windows code is generated
  98. _WINDOWS When true, Windows specific code is generated.
  99. _DLL When true, code specific to DLLs is generated.
  100. MKLIB.PI
  101. --------
  102. MKLIB.PI is included by the project file mklib.pr. It
  103. defines all the TopSpeed libraries, and the commands
  104. necessary to make them. The macro settings necessary to
  105. make a specific group of libraries are described in the
  106. relevant language library reference. The Modula-2 library
  107. is re-made automatically when any language library is re-
  108. made.
  109. Library structure
  110. -----------------
  111. The Modula-2 library comprises the following modules.
  112. modcore.a Intermediate core library interface file.
  113. spawn.a Process spawning module.
  114. storage.mod Default memory management module.
  115. wstorage.mod Windows memory management module.
  116. mstorage.mod Multi language memory management module.
  117. fior.mod File redirection module.
  118. shtheap.mod Short heap memory management module.
  119. formio.mod Formatted output module.
  120. window.mod Text window module.
  121. fio.mod File I/O module.
  122. asmlib.a Assembly language implementation module.
  123. mathlib.mod Math library module.
  124. system.mod System module. System definitions and
  125. process primitives.
  126. str.mod String module.
  127. lib.mod Miscellaneous library functions and
  128. procedures.
  129. io.mod Console I/O module.
  130. floatexc.mod Floating point exception handling module.
  131. process.mod Multi thread process module.
  132. winfio.mod Windows file I/O module.
  133. winstr.mod Windows string handling module.
  134. biosio.mod BIOS I/O module.
  135. lim.mod Expanded memory module.
  136. msmouse.mod Microsoft mouse interface.
  137. graph.mod Graphics module.
  138. graphi.mod IOPL OS2 graphics server module.
  139. The Modula-2 library EXP file
  140. ------------------------------
  141. The MSDOS and OS2 DLL versions of the core library have
  142. corresponding EXP files, declaring the exported identifiers:
  143. RD_M2.EXP RD_MLIB.EXP Real mode.
  144. PD_M2.EXP PD_MLIB.EXP Protected mode.
  145. If a public definition is added or removed from a module,
  146. EXP must be altered to reflect the change, if the DLL
  147. version is to be made.
  148. Similarly, a cut-down version of the core library DLL may
  149. be made by commenting out any unused identifiers. Smart
  150. linking will take care of removing the unwanted code from
  151. the DLL when it is remade.
  152. EXP files also exist for the multi-language DLL, MLIBC.
  153. Modula-2 Library modules
  154. ------------------------
  155. The public interface to the library modules is described
  156. in the Modula-2 documentation. Only internal procedures and
  157. implementation details are described here.
  158. MODCORE.A
  159. ---------
  160. Modcore is an intermediate interface file to the core
  161. library. It function is performed by other libraries in a
  162. multi-language program.
  163. Procedures and functions
  164. __rreal_out, __rreal_in, __init_dummy, __initwin,
  165. __setvideomode, __exit1, __initmt, __initgraphpublic,
  166. __clock_time, _time, __flsbuf, __filbuf, __flusher
  167. These are all dummy procedures for resolving uncalled
  168. references.
  169. __exec
  170. Procedure for executing command shell.
  171. __get_retcode
  172. Returns exit status of spawned process.
  173. _AdjustMem
  174. Adjusts far heap size.
  175. __write
  176. Low level OS2 file write function.
  177. __read
  178. Low level OS2 file read function.
  179. __os2_open
  180. Low level OS2 file open function.
  181. __close
  182. Low level OS2 file close function.
  183. _chdir, _mkdir, _rmdir, _getcurdir
  184. Low level OS2 directory manipulation functions.
  185. _rename
  186. Low level OS2 file rename function.
  187. _unlink
  188. Low level OS2 file delete function.
  189. __getfmode
  190. Low level OS2 file status function.
  191. _strlen, _strrchr, _strnicmp, _strcpy
  192. Functions for manipulating zero terminated strings.
  193. SPAWN.A
  194. -------
  195. Spawn provides low level functions for spawning and chaining to
  196. new processes.
  197. Procedures and functions
  198. __execve
  199. Execve processes the command line by calling __CatArgV,
  200. the program name by calling FindProg, and environment
  201. strings by calling CatEnvV, and than uses the executor to
  202. chain to a new process.
  203. Executor
  204. The Executor is a special subroutine which is copied up
  205. to a memory area beyond the overlay image. When execve
  206. has completed all preparations it puts a modified exeHead
  207. structure in a stack area at ES:BX (above the Executor)
  208. and jumps to the Executor. The Executor is then
  209. responsible for the final stages of calling MSDOS to load
  210. the overlay, and then initializing registers and
  211. jumping to the start of the overlayed program.
  212. __FindProg
  213. The given file name *nameP is to be interpreted as the
  214. name of an executable file, given the usual MSDOS rules
  215. for program names:
  216. - if the name ends in ".*" or "." then no endings are
  217. substituted, otherwise the endings ".COM" and ".EXE"
  218. will be the trial endings.
  219. - if the name begins with "/" or "\" or "?:", or if the
  220. usePath argument is false, then there are no trial
  221. prefixes, else the trial prefixes are those in the
  222. PATH variable in the environment.
  223. - with each prefix, beginning with a null prefix, the
  224. name is searched for using each of its trial endings,
  225. continuing until the first match or until all
  226. prefixes and endings have been tried.
  227. A buffer is allocated for the trial paths. If a trial
  228. match succeeds, the result of the function is a pointer
  229. to the buffer which holds the complete path. The file is
  230. not open (the CHMOD function is used to test if the file
  231. exists, not FIND). The caller is responsible to free()
  232. the buffer when it is no longer needed.
  233. The function result is a pointer to the buffer. If the
  234. search fails then the buffer is de-allocated and the
  235. function result is NULL.
  236. The function also returns the size of the path in CX,
  237. with a value of zero if the search failed.
  238. In the case where a path is found the caller is
  239. responsible for deallocating the buffer, using free().
  240. __CatArgV
  241. Takes the vector of arguments and concatenate them into
  242. an MSDOS-style command line. Use a space to separate
  243. each argument, with a maximum of 126 characters, plus a
  244. preceding length byte and a following CR ('0x0D').
  245. Also, check the assumption that *argV[1] and *argV[2] may
  246. be MSDOS 1.xx style (CPM-era) file names. If so,
  247. construct FCBs from them.
  248. A NULL entry in the argV vector is taken as a terminator.
  249. The entry argV[0] by Unix convention is a command name
  250. which should not appear in the MSDOS command line, so it
  251. is entirely ignored here.
  252. Allocate a structure to hold the two FCBs and the command
  253. line. If the command line does not overflow, then the
  254. return value is the pointer to the structure:
  255. argComposite
  256. FCB1 char [16];
  257. FCB2 char [16];
  258. length char;
  259. text char [127]; /* includes trailing 0x0D */
  260. The size of the arguments is calculated. If it will
  261. total more than 126 bytes, including spaces, then the
  262. function quits without allocating an argComposite. If
  263. the total is OK, then the size of argComposite is trimmed
  264. to hold just the necessary number of characters.
  265. The return value is a pointer to the argComposite, in
  266. DX:AX, with the total length of the argComposite in CX.
  267. If an error occurs, then DX:AX == NULL and CX == 0.
  268. __CatEnvV
  269. Take the environment vector and concatenate the
  270. environment strings into an MSDOS-style contiguous
  271. environment. Each string remains terminated by a zero,
  272. with a null string as an overall terminator and a maximum
  273. length of 32k bytes.
  274. If a NULL envV value is supplied, then replace it with
  275. the global _environ variable.
  276. The size of the environment is totalled, and if it does
  277. not exceed 32k bytes then a space is allocated, including
  278. 15 byte extra for paragraph alignment. The environment is
  279. adjusted to begin on a paragraph boundary since MSDOS
  280. uses segment values alone to locate environment strings.
  281. A NULL entry in the envV vector or a pointer to an empty
  282. string are taken as terminators.
  283. The return value in DX:AX is the pointer to the
  284. allocated memory (NULL if none allocated). The register
  285. ES contains the paragraph number at which the environment
  286. string actually begins (zero if none allocated). Note
  287. that while MSDOS needs only the ES value, the DX:AX
  288. pointer will in general be required in order to free()
  289. the allocation.
  290. The register CX returns the length of the environment
  291. string, including the terminating zero. CX == 0 in cases
  292. of error.
  293. __beget
  294. A child process, with program identified by *pathP, is
  295. found, validated, and executed. The current process
  296. continues to exist but is asleep until the child process
  297. is finished.
  298. A return value of -1 indicates that the child process
  299. could not be created. Otherwise, the return value will
  300. be the exit code of the child process, which by
  301. convention is zero if the child executed without fault.
  302. The exact meaning and severity of non-zero exit codes are
  303. not standardized.
  304. If usePath is true then the PATH environment variable
  305. will be used to help find the program name, otherwise
  306. *pathP is assumed to include directory names and the PATH
  307. is not used. However, in either case the suffixes ".COM"
  308. and ".EXE" will automatically be tried unless the
  309. supplied name already ends with an extension.
  310. The basis for the begetting of a child process is the
  311. MSDOS Exec command, function 4Bh request kind 0.
  312. However, there are several preliminary actions required.
  313. Firstly the exact and complete program name must be
  314. found, which involves tracing the PATH= environment
  315. variable. This is done by the _FindProg function.
  316. Next the arguments must be scanned and concatenated into
  317. a single command string of up to 126 bytes, plus a length
  318. byte and a trailing carriage return.
  319. Arguments [1] and [2] may be file names, and so the MSDOS
  320. Parse Filename function (29h) is used to build matching
  321. FCB's if possible. This is done with the _CatArgV
  322. function.
  323. Note that argument [0] is by convention the same as
  324. pathP. It is not used and not checked. The end of the
  325. argV vector must be set by placing a NULL pointer in the
  326. final element of the vector.
  327. The envV vector points to a collection of environment
  328. strings. These must also be concatenated into a
  329. contiguous region of up to 32k bytes, terminated with a
  330. double zero, which is the form expected by Exec. This is
  331. done by the _CatEnvV function. The envV vector is
  332. terminated either by a NULL pointer or by a pointer to a
  333. null string. If envV == NULL then the current program's
  334. environment is used.
  335. When all these things have been done the child program
  336. may be executed using function 4Bh, with the environment,
  337. command line, and dummy FCBs supplied as parameters to
  338. function 4Bh. After the child has terminated, function
  339. 4Dh is used to pick up the exit code.
  340. STORAGE.MOD
  341. -----------
  342. Storage.mod provides default memory management for all
  343. non-windows Modula-2 only programs.
  344. The Near Heap
  345. A memory model with 16 bit data pointers (Small or
  346. Medium) has data residing in one segment in order to be
  347. able to address and data object using the short pointer.
  348. Therefore the heap must reside in this default data segment.
  349. In these models the functions ALLOCATE, DEALLOCATE and
  350. AVAILABLE operate on this near heap and return short
  351. pointers to object within the default data segment.
  352. The size of this near heap may be limited by the
  353. data(heap_size=>) pragma. It normally occupies all of the
  354. space from the top of the stack to the end of the
  355. segment.
  356. |-------------------------| 64K
  357. | Heap |
  358. |-------------------------|
  359. | Stack |
  360. |-------------------------|
  361. | Static Data |
  362. |-------------------------| 0
  363. The Far Heap
  364. A memory model with 32 bit data pointers (Compact, Large,
  365. Xlarge, Mthread) has data residing in many segments.
  366. Therefore the heap may reside in a far segment and be
  367. much larger in size The heap_size pragma has no effect.
  368. In these models the functions ALLOCATE, DEALLOCATE and
  369. AVAILABLE operate on this far heap and return long
  370. pointers to object within this huge segment.
  371. |-------------------------| Top of Memory
  372. | Heap |
  373. |-------------------------|
  374. | Stack |
  375. |-------------------------|
  376. | Far Static Data |
  377. |-------------------------|
  378. |-------------------------| up to 64K
  379. | Static Data |
  380. |-------------------------| 0
  381. Under MSDOS this far heap is a contiguous block of memory
  382. growing from the top of the stack to the top of memory.
  383. The entire available memory at program startup is
  384. allocated to the far heap.
  385. Under OS2 the far heap is a linked list of separate
  386. segments. The size of the far heap is limited by
  387. available physical memory and maximum swap file size.
  388. Constants and variables
  389. CONST EndMarker = 0FFFFH;
  390. Used to mark last block in far heap.
  391. CONST Align = 4;
  392. Used to align size of near heap block request.
  393. VAR NearHeapSetup, FarHeapSetup: BOOLEAN;
  394. Flags indicating near and far heaps have been
  395. initialized.
  396. VAR LastBlock: FarHeapRecPtr;
  397. Storage for last block in heap when shrinking and
  398. restoring DOS far heap.
  399. Procedures and functions
  400. PROCEDURE FarHeapShrink(): CARDINAL;
  401. Shrinks far heap to minimum size and returns surplus
  402. memory to DOS. Used when spawning process.
  403. PROCEDURE FarHeapRestore;
  404. Restores heap to previous size before process spawn.
  405. PROCEDURE FarHeapFix(Space: CARDINAL);
  406. Fixes far heap when exiting TSR program.
  407. PROCEDURE InitFarHeap;
  408. Initializes far heap.
  409. PROCEDURE InitNearHeap;
  410. Initializes near heap.
  411. PROCEDURE Merge(LowRec, HighRec: NearHeapRecPtr);
  412. Merges two adjacent near heap blocks, when freeing or
  413. reallocating.
  414. WSTORAGE.MOD
  415. ------------
  416. Wstorage provides memory management module for a Windows
  417. process. All memory management requests are vectored to
  418. Windows API calls.
  419. MSTORAGE.MOD
  420. ------------
  421. Multi language memory management module. When linking
  422. with C, C++ or Pascal, the core memory manager must be
  423. used. mstorage provides an interface to coremem. See Core
  424. library documentation.
  425. FIOR.MOD
  426. --------
  427. FIOR provides a file redirection capability. The actual
  428. I/O is executed by FIO, only the file location is done by
  429. this module.
  430. Constants and variables
  431. CONST StrTabSize = 1024
  432. Size of string table. Used to store redirection paths.
  433. VAR StrTab : ARRAY [0..StrTabMax] OF CHAR
  434. String table. Used to store redirection paths.
  435. VAR StrTabPtr : CARDINAL
  436. Pointer into string table.
  437. CONST MaxNoOfConversions = 50
  438. Maximum number of paths that can be stored in string table.
  439. VAR NoOfConversions : CARDINAL ;
  440. Actual number of paths stored in string table.
  441. VAR Conversion : ARRAY[1..MaxNoOfConversions] OF CARDINAL
  442. Indexes into string table.
  443. CONST FileBuffSize = 4096
  444. File buffer size.
  445. VAR FileBuff : FileBuffPtr
  446. Current pointer into file buffer.
  447. VAR FileBuffBase : FileBuffPtr
  448. Pointer to base of file buffer.
  449. Procedures and functions
  450. PROCEDURE SetIOR(Num: CARDINAL);
  451. Sets IO result variable.
  452. PROCEDURE AddText ( s : ARRAY OF CHAR ) : CARDINAL ;
  453. Copies text into string table.
  454. PROCEDURE OpenTextFile ( name : ARRAY OF CHAR ) : BOOLEAN;
  455. Locates and opens redirection file.
  456. PROCEDURE ReadTextLn ( VAR l : ARRAY OF CHAR ) ;
  457. Reads a line of text from redirection file.
  458. PROCEDURE CloseTextFile ;
  459. Closes text file.
  460. PROCEDURE DosCall ( VAR R : SYSTEM.Registers ) : BOOLEAN;
  461. DOS procedure for generating software interrupt.
  462. PROCEDURE GetDosVersion (): CARDINAL;
  463. Checks for DOS version 3+. The module needs to know if
  464. the program name is available.
  465. PROCEDURE AbsolutePath ( name : ARRAY OF CHAR ) : BOOLEAN
  466. Check if a supplied path is a complete file path.
  467. PROCEDURE ExtensionPos ( VAR s : ARRAY OF CHAR ) : CARDINAL;
  468. Returns index of file extension in a path string.
  469. PROCEDURE OpenOrCreateFile ( name: ARRAY OF CHAR ;
  470. om : OpenMode): CARDINAL;
  471. Locates file then opens or creates file depending on
  472. setting of om.
  473. WINDOW.MOD
  474. ----------
  475. The JPI text window module uses CoreWind as a low-level
  476. server module for actual screen access.
  477. A stack of open windows is maintained, with the current
  478. window on top. A cursor chain to control the active
  479. cursor is also maintained.
  480. Constants and variables
  481. VAR Lock,Unlock : LockProc
  482. multi thread lock and unlock procedure variables.
  483. CONST GuardConst = 4A4EH
  484. Guard constant used to validate window handle.
  485. procedures and variables
  486. Procedures and functions
  487. PROCEDURE CheckWindow ( W : WinType );
  488. Validates window handle using check guard. If handle is
  489. invalid, process is terminated with error.
  490. PROCEDURE ClipFrame ( W : WinType );
  491. Clips window pane depending on existence of frame.
  492. PROCEDURE ClipXY ( W : WinType; VAR X,Y : RelCoord );
  493. Clips X Y coordinates.
  494. PROCEDURE BufferSpaceFill ( W : WinType; pos : CARDINAL;
  495. len : CARDINAL );
  496. Fill an area of window buffer with attribute and
  497. character values.
  498. PROCEDURE CurWin () : WinType;
  499. Returns the current window being used for output for this
  500. thread. If no window has been assigned by Use then it
  501. returns Top. This function locks the window system and
  502. leaves it locked if CoreWind._multip set.
  503. PROCEDURE ResetCursor;
  504. Restores cursor position and size if not obscured.
  505. PROCEDURE UnlinkCursor ( W : WinType );
  506. Removes window from cursor chain.
  507. PROCEDURE MakeWindow ( VAR WD : WinDef ) : WinType;
  508. Creates a new Window descriptor. The size is Inclusive of
  509. any frame if specified. The window buffer is not
  510. allocated at this point.
  511. PROCEDURE TakeOffStack ( W : WinType );
  512. Removes window from stack.
  513. PROCEDURE UpdateScreen ( W : WinType; X,Y : AbsCoord;
  514. Updates the screen from the window buffer.
  515. PROCEDURE RedrawSection ( W: WinType; X1,Y1,X2,Y2: AbsCoord );
  516. Redraws rectangular portion of the window from the buffer.
  517. PROCEDURE DisposeTitle ( W : WinType );
  518. Disposes of window title.
  519. PROCEDURE WindowWrite (W : WinType;
  520. x,y : RelCoord;
  521. Len : CARDINAL;
  522. str : ADDRESS;frame :
  523. BOOLEAN );
  524. Writes a string of characters and attributes to the
  525. window buffer.
  526. PROCEDURE DrawFrame ( W : WinType );
  527. Draws window frame.
  528. PROCEDURE MergeWindows ( s,d : WinType);
  529. Merges two windows. s is a new hidden window, while d is
  530. the old window to be merged into.
  531. PROCEDURE IGotoXY ( W : WinType; X,Y : RelCoord );
  532. Sets the current X Y position of the pane currently being
  533. used
  534. PROCEDURE NullProc;
  535. Null procedure. Its address is the default value of the
  536. Lock and Unlock procedure variables.
  537. PROCEDURE WriteC ( W : WinType; C : CHAR);
  538. Writes a character to the window, and updates cursor
  539. position.
  540. PROCEDURE WriteOut (S : ARRAY OF CHAR);
  541. Writes string to window. This procedure vectors IO output
  542. procedures.
  543. PROCEDURE ReadString ( VAR string : ARRAY OF CHAR );
  544. Reads string from keyboard, echoing to window. This
  545. procedure vectors IO input procedures.
  546. FIO.MOD
  547. -------
  548. File I/O module.
  549. Variables
  550. The OK, IOR and EOF variables are implemented as arrays
  551. of BOOLEAN in multi thread models, with an array member
  552. corresponding to a thread.
  553. Procedures and functions
  554. PROCEDURE SetIOR(Num: CARDINAL);
  555. Set IOR variable.
  556. PROCEDURE SetThreadOK( b : BOOLEAN);
  557. Set OK variable.
  558. PROCEDURE SetThreadEOF( b : BOOLEAN);
  559. Set EOF variable.
  560. PROCEDURE ErrorCheck(Code: CARDINAL; ErrNum: CARDINAL;
  561. Checks error return of OS call.
  562. PROCEDURE StreamLock(F: FileInf);
  563. PROCEDURE StreamUnlock(F: FileInf);
  564. Stream lock and unlock procedures for OS2. Under OS2
  565. there is no need to lock the entire process when
  566. accessing a stream, so each stream has an associated
  567. semaphore.
  568. PROCEDURE FlsBuf(F: FileInf): INTEGER;
  569. Empties file buffer on buffered file.
  570. PROCEDURE FilBuf(F: FileInf): INTEGER;
  571. Fills file buffer on buffered file.
  572. PROCEDURE RdItem( F : File; VAR S : ARRAY OF CHAR );
  573. Reads an item from input file. An item is defined as all
  574. characters not in the set SEPARATORS.
  575. PROCEDURE FindFreeStream(): FileInf;
  576. When allocating a buffer to a file, this functions finds
  577. an unused file descriptor.
  578. ASMLIB.A
  579. --------
  580. Procedures and functions
  581. PROCEDURE STANDARD.NULLPROC;
  582. Null procedure variables should point to this procedure.
  583. If called, process is terminated with an error.
  584. PROCEDURE HALT;
  585. Terminates process by calling CoreMain.exit.
  586. PROCEDURE @LoadRegisters
  587. Loads 80X87 registers from REGISTERS record.
  588. PROCEDURE @SaveRegisters
  589. Saves 80X87 registers to REGISTERS record.
  590. PROCEDURE - $NormPtr
  591. Normalizes far pointer. MSDOS only.
  592. PROCESS.MOD
  593. -----------
  594. The DOS multi thread process module implements a time
  595. slicing scheduler to control threads. The OS2 module uses
  596. the OS2 multi thread facility, via CoreProc._beginthread.
  597. DOS procedures and variables
  598. PROCEDURE QInsert(T: CoreProc.Task; VAR Q: CoreProc.Task);
  599. Inserts task after last task in Q with greater or equal
  600. priority.
  601. PROCEDURE AddReadyProcess(T: CoreProc.Task);
  602. Adds a new process, created by NEWPROCESS, to the ready
  603. list. It gets added ahead of current process if at the
  604. same or higher priority.
  605. PROCEDURE CheckTimeQ;
  606. Checks for ready process in queue.
  607. PROCEDURE Slice;
  608. Clears waiting queue, then schedules next ready process
  609. if it is of equal or higher priority.
  610. MODULE SS[1]
  611. This local module implements the scheduler using IRQ 1,
  612. timer interrupt.
  613. PROCEDURE Idler;
  614. This procedure is always on the CoreProc._cp chain.
  615. OS2 procedures and variables
  616. PROCEDURE ErrorNamed ( IOR : CARDINAL; Code: CARDINAL );
  617. Checks error return value of OS calls.
  618. GRAPHI.MOD
  619. ----------
  620. This module is the IOPL OS2 graphics server module.
  621. Because a process must be executing in ring 2 to access
  622. I/O ports, all graphics functions must be in an IO
  623. privilege segment.
  624. Swapping sessions. The graphics screen is saved and
  625. restored when sessions are swapped by the following
  626. procedures. A background thread monitors using
  627. SavRedrawWait.
  628. Procedures and functions
  629. PROCEDURE SaveScreen;
  630. PROCEDURE RestoreScreen(); Modula-2 Library Documentation
  631.