home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12963 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  2.4 KB

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