Explicitly Linking to Server Libraries

LINKLIBRARY Function

Because of the possibilities for fatal errors in linking client libraries to server libraries, you might want to consider using the LINKLIBRARY function to make the linkage. This function, which is available only in ALGOL, NEWP, and Pascal, makes a conditional attempt to establish linkage with the server library. If the attempt fails, the function returns a value indicating the reason for the failure, but no error messages are displayed. If the attempt succeeds, the function returns a value indicating whether all the import objects defined in the client program for the client library were really present in the server library.

LINKLIBRARY Parameters

The LINKLIBRARY function can include the following parameters:

  • Substitute values for any of the following library attributes: FUNCTIONNAME, INTERFACENAME, and TITLE. These values temporarily override any values previously assigned to these attributes of the client library.

  • An option indicating the action to take if the library is not available. The following are the possible values of this option and their effects:

    • DONTWAIT

      The linkage attempt proceeds only if a library instance is immediately available (that is, already frozen or readied by the READYCL function). Otherwise, LINKLIBRARY returns an error result.

    • DONTWAITFORFILE

      If a library instance is not available, the system initiates a new instance of the library code file. If the library code file is also not available, LINKLIBRARY returns an error result.

    • WAITFORFILE

      The linkage attempt continues regardless of whether a library instance or library code file is available. If a library instance is not available, the system initiates a new instance of the library code file. If the library code file is also not available, the linking process is suspended with an RSVP message and waits for an operator response.

LINKLIBRARY Result

LINKLIBRARY returns a result indicating whether the linkage attempt was successful or not. The possible LINKLIBRARY results are documented in the ALGOL Programming Reference Manual, Volume 1: Basic Implementation.