home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22129 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.2 KB

  1. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!sgiblab!darwin.sura.net!haven.umd.edu!umd5!bill.ab.umd.edu!bill
  2. From: bill@bill.ab.umd.edu (Bill Bame)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Activating a sharable image
  5. Message-ID: <18191@umd5.umd.edu>
  6. Date: 27 Jan 93 20:04:34 GMT
  7. References: <1993Jan27.165530.4660@das.harvard.edu>
  8. Sender: news@umd5.umd.edu
  9. Reply-To: bill@office.ab.umd.edu
  10. Followup-To: comp.os.vms
  11. Organization: M.I.E.M.S.S.
  12. Lines: 43
  13.  
  14. In article <1993Jan27.165530.4660@das.harvard.edu>, chen@speed.uucp (Lilei Chen) writes:
  15.  
  16. >Does someone on the net know how to call subroutines in a sharable image
  17. >after a lib$find_image_symbol call?  What can one do with the the symbol
  18. >value returned by that call?  An example in FORTRAN and/or C would be
  19. >greatly appreciated.
  20.  
  21. Warning: the code fragment I am about to post is off the top of my head,
  22. and therefore has never been tested!  It may not be exactly correct, but
  23. the idea should be sound...
  24.  
  25.     program call_my_shareable_routine
  26.     implicit none
  27.     parameter shareable_image = 'MYSHR'    ! assumes sys$share
  28.     parameter gizmo_to_call   = 'MYROUTINE'
  29.     integer*4 status,gizmo_addr,vector(0:2),arg1,arg2
  30.     integer*4 lib$find_image_symbol,lib$callg
  31.     status=lib$find_image_symbol(shareable_image,gizmo_to_call,gizmo_addr)
  32.     if (.not. status) call lib$stop(%val(status))
  33.     vector(0)=2        ! This assumes that MYROUTINE takes two
  34.     vector(1)=%loc(arg1)    ! integer args.
  35.     vector(2)=%loc(arg2)
  36.     status=lib$callg(vec,proc) ! or should that be %val(proc)?
  37.     if (.not. status) call lib$stop(%val(status))
  38.     end
  39.  
  40. This is easier in C since you don't have to use LIB$CALLG.  For further
  41. reference consult "A Guide to Writing Modular Library Procedures", "Linker
  42. Reference Manual", and the LIB$ section of the RTL manual.
  43.  
  44. >Jim (xue@cfaft5.harvard.edu)
  45. >
  46.  
  47. -Bill
  48.  
  49. --
  50. --------------------------------------------------------------------------------
  51. William P. Bame                    | sneakernet: William P. Bame
  52. internet: bill@office.ab.umd.edu   |             M.I.E.M.S.S.
  53.           bbame@achi1.ab.umd.edu   |             22 South Greene Street
  54. AT&T    : [Work] (410) 328-3062    |             Baltimore, MD 21201
  55. CIS     : 71620,425                |             Room: T1R55
  56. --------------------------------------------------------------------------------
  57.