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