home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!torn!cunews!revcan!sidus!atronx.OCUnix.On.Ca!qpoint!dej
- From: dej@qpoint.ocunix.on.ca (David Jones)
- Newsgroups: comp.sys.amiga.programmer
- Subject: ARexx function libraries and per-process data
- Distribution: world
- Message-ID: <dej.01e3@qpoint.ocunix.on.ca>
- Date: 31 Aug 92 18:09:19 EST
- Organization: Dejital Software
- Lines: 53
-
- I need to create an ARexx function library. Sounds simple, except:
-
- 1. The library cannot be expunged while ARexx scripts are using it.
- The library allocates memory from its own private pool, which becomes
- invalid if the library is expunged.
-
- 2. A while back, Michael Sinz indicated that one cannot close non-ROM
- libraries in your library Expunge function. I want to be able to
- expunge, and doing so correctly means closing rexxsyslib.library
- once all Rexx users have finished using by library.
-
- So, I need to know when a Rexx script has finished using my library.
- This is not easy, since a function library is opened/closed for each
- function call (too inefficient and awkward, IMHO). Two possibilities
- here:
-
- 1. Provide a close function that a Rexx script can call to indicate
- that it's finished using the library. Ugly.
-
- 2. Use the environment system to automatically clean up once the script
- terminates. I've yet to see instructions on how to do this (is it
- legal?) but here's my general plan:
-
- To install cleanup function in a Rexx script environment, given
- RexxMsg in rm:
-
- environment list is in rm->rm_TaskBlock->rt_Header1 (although you
- need to cast some of these)
- search for your environment node (your base/offset is unique among
- all nodes). If not found, add your node, setting base/offset to
- point to a cleanup function.
-
- When script terminates, do your cleanup, unlink node, and free it.
-
- Questions:
-
- 1. Is the above correct? In particular...
- 2. Must I allocate the resource node using (ugh. My friend's
- original Rexx manual has a function to do this, but the
- "official" CBM docs (Programmer's Guide to ARexx) doesn't
- document many of the functions in rexxsyslib so I can't
- recall what the function is)?
- 3. When deleting, must I unlink the resource node myself or is it
- done for me? What about freeing it?
-
-
-
-
- --
- David Jones, 6730 Tooney Drive, Orleans, Ontario K1C 6R4 CANADA
- email: dej@qpoint.ocunix.on.ca Fido: 1:163/109.8
- AMIGA: Advanced Multimedia with Interactive Graphics and Audio
-
-