HP 3000 Manuals

Searching Executable Libraries Specified at Load Time [ Resource Management Programmer's Guide ] MPE/iX 5.0 Documentation


Resource Management Programmer's Guide

Searching Executable Libraries Specified at Load Time 

You can use the optional firstfile parameter to specify which XL in the
binding sequence you want HPGETPROCPLABEL to begin searching for
procname.  If you do not specify firstfile, only the the System Libraries
are searched.

During a dynamic load, HPGETPROCPLABEL directs the loader to search
through each XL in the binding sequence, beginning with the XL specified
in firstfile, for the first instance of a procedure with the name
procname.  Each XL in the binding sequence after firstfile is searched in
turn if:

 *  The procedure specified in procname is not located in the XL.

 *  The procedure specified in procname contains unresolved external
    references that need to be satisfied in subsequent XLs.


NOTE The same procedure name might be repeated in different XLs. To ensure that the loader locates the correct procedure, you must be certain that any XLs searched prior to the XL containing the correct procedure do not contain a different procedure with the same name.
For example, let us assume that the binding sequence in Figure 3.1 is that of your process executing PROGRAM1. Let us further assume that there is a procedure named MYPROC located in the XL named LIBA and a different procedure with the same name (MYPROC) located in the XL named LIBC. The following HPGETPROCPLABEL call dynamically loads the MYPROC procedure located in LIBC: . . . PROCNAME := '%MYPROC%'; FIRSTFILE := '%LIBB%'; HPGETPROCPLABEL (PROCNAME,PLABEL,STATUS,FIRSTFILE); . . . In the above example, the intrinsic directs the loader to search the portion of the binding sequence beginning with LIBB for the first instance of a procedure named MYPROC. (LIBA is never searched.) When MYPROC is not found in LIBB, the loader continues the search in LIBC (the next XL in the binding sequence). Once MYPROC is found in LIBC it is dynamically loaded and its plabel returned in PLABEL. The same result is accomplished if you specify LIBC in FIRSTFILE. The following three intrinsics can return to your program the fully qualified file name of a particular XL in the binding sequence you want to specify in firstfile. Using HPFIRSTLIBRARY The HPFIRSTLIBRARY intrinsic returns the fully qualified file name of the first XL in the binding sequence (after the program file) determined at load time. If you did not specify additional XLs using one of the methods described, in "Determining the Binding Sequence" , then the name of the first file in the System Libraries is returned. You can pass this name to HPGETPROCPLABEL in the firstfile parameter. Using Figure 3.1 as your program's binding sequence, the following intrinsic call: HPFIRSTLIBRARY (XLNAME); returns the fully qualified file name of the first XL in the binding sequence (after the program file), LIBA.GROUP.ACCOUNT. Using HPMYPROGRAM The HPMYPROGRAM intrinsic returns the fully qualified file name of the program being executed by the calling process (the first file in the binding sequence). You can pass this name to HPGETPROCPLABEL in the firstfile parameter. Using Figure 3.1 as the binding sequence for your program, the following call: HPMYPROGRAM (PROGNAME); returns the fully qualified file name of your program file, PROGRAM1.GROUP.ACCOUNT. Using HPMYFILE The HPMYFILE intrinsic returns the fully qualified file name of the program or XL that called the intrinsic. If this intrinsic is called from your program, your program's file name is returned. If this intrinsic is called from a procedure located in an XL, the file name of the XL is returned. You can pass this name to HPGETPROCPLABEL in the firstfile parameter.


MPE/iX 5.0 Documentation