home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 545b.lha / RexxHS / sas / README < prev    next >
Encoding:
Text File  |  1991-09-07  |  2.3 KB  |  57 lines

  1.  
  2. Info on RexxHS support library and SAS 5.1 users
  3. ------------------------------------------------
  4.  
  5. To build:
  6.  
  7.     Type "rx smake" to copy the required .c and .h files from
  8.     the parent directory.  It will run "lmk" automatically to
  9.     build the library.
  10.  
  11.  
  12. How it works:
  13.  
  14.     The only file you should really be interested in is the
  15.     file rexxhs.c, since all the other files are just there to
  16.     do the shared library gunk and their use is documented in
  17.     the Amiga Programmer's Guide to ARexx.
  18.  
  19.     Basically the function library has exactly one entry point,
  20.     called the dispatch function.  ARexx calls this entry point
  21.     and passes a pointer to a RexxMsg structure (the same one that
  22.     gets sent to function hosts) in one of the registers.  The
  23.     gunk files stuff this pointer on the stack and call the "real"
  24.     dispatch function in rexxhs.c.  This function takes the packet,
  25.     gets the function name and the number of arguments, and then
  26.     compares those against a list of functions it supports.  If
  27.     it supports the desired function, it calls the appropriate internal
  28.     code.  Otherwise it sets the primary result field to 5 and
  29.     the secondary result field to 1 and returns back to ARexx.  ARexx
  30.     now continues with the search through the Library List...
  31.  
  32.     The function implementations in rexxhs.c are pretty straightforward.
  33.     The only toughie is ReplyToCall... as it turns out, ARexx keeps a
  34.     list of packets that you retrieve using GetPkt().  When you call
  35.     Reply(), ARexx removes the appropriate packet from its internal list.
  36.     This is so that when the ARexx program exits, any unreplied packets
  37.     can be replied to... so ReplyToCall() has to also remove a packet
  38.     from the list.  Luckily, the structure is documented in the ARexx
  39.     header files so it's not too obscure... the FindPacket() function
  40.     in rexxhs.c does all the dirty work, making sure the pointer you
  41.     pass to it is really a packet in the "waiting for reply" list.
  42.  
  43.  
  44. Things to do:
  45.  
  46.     -- Better error checking and number conversion.
  47.     -- Add a PktAction() function which would return a string representing
  48.        the actual action in a packet (RXCOMM, RXFUNC, etc.).  Right
  49.        now all you can do is assume that if IsFunctionCall() returns
  50.        false then a packet is an RXCOMM packet.
  51.  
  52.  
  53. Enjoy....
  54.  
  55. Eric Giguere
  56. BIX     : giguere
  57. Internet: giguere@csg.uwaterloo.ca