From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 28-JAN-1993 17:58:23.22 To: info-vax@kl.sri.com CC: Subj: Re: Activating a sharable image 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 --------------------------------------------------------------------------------