A server library program can also contain one or more connection libraries. Hereafter, we shall refer to such a library program as a composite library. A process that initiates linkage to such a library program, either through the LINKLIBRARY function or by accessing an imported object, is referred to as the linking process.
INTERFACENAME and Composite Libraries
The INTERFACENAME specified by the linking process determines whether the linkage is made to the server library or one of the connection libraries, as follows:
-
If the linking process specifies an INTERFACENAME that matches one of the eligible connection libraries in the composite program, then the system attempts to create the linkage to that connection library. For implicit or explicit linkage attempts, only connection libraries that have been readied by a READYCL statement are eligible. For direct linkage attempts, all connection libraries in the composite program are eligible.
-
If the linking process specifies an INTERFACENAME that does not match any of the eligible connection libraries in the composite program, then the system creates the linkage to the server library.
-
If the linking process does not specify an INTERFACENAME, the system applies the default value for INTERFACENAME and then makes one of the two determinations listed previously. The default value of INTERFACENAME is inherited from the INTNAME attribute; if INTNAME is not assigned, then INTERFACENAME inherits the library identifier as its value.
Composite Library Example
The following is an example of an ALGOL composite library program:
BEGIN
PROCEDURE DOSTUFF1;
BEGIN
% Procedure body statements
END;
TYPE CONNECTION BLOCK TEST1;
BEGIN
PROCEDURE DOSTUFF2;
BEGIN
% Procedure body statements
END;
EXPORT DOSTUFF2;
END;
TEST1 LIBRARY CL1 (INTERFACENAME=“CONLIB.”);
RSLT:= READYCL (CL1);
EXPORT DOSTUFF1;
FREEZE (PERMANENT);
END.In this library program, the server library exports procedure DOSTUFF1, and the connection library CL1 exports procedure DOSTUFF2. Suppose that this library program is titled OBJECT/TESTLIB, and that the following SL command has been used to define a function name mapping:
SL TESTLIB = OBJECT/TESTLIB
Examples of Linking to the Composite Library
The following are the results of various sorts of library declarations in the linking process, and the results of linkage attempts that use those declarations:
-
LIBRARY LIB1(LIBACCESS = BYFUNCTION, FUNCTIONNAME = “TESTLIB.”, INTERFACENAME = “WRONGNAME.”);
Because WRONGNAME does not match the INTERFACENAME of the connection library in OBJECT/TESTLIB, the linking process is linked to the server library.
-
LIBRARY LIB1(LIBACCESS = BYFUNCTION, FUNCTIONNAME = “CONLIB.”);
In this example, the FUNCTIONNAME attribute is wrongly assigned a value corresponding to the INTERFACENAME of the connection library instead of the SL function name of the library program. Because of this mistake, library linkage fails.
-
LIBRARY LIB1(LIBACCESS = BYTITLE, TITLE = “OBJECT/TESTLIB.”);
The system attempts to link the process to the library program OBJECT/TESTLIB. Because OBJECT/TESTLIB includes a connection library, the system inspects the INTERFACENAME specified by the linking process.
Because the linking process did not assign the INTERFACENAME or INTNAME attributes, INTERFACENAME inherits the library identifier, which is LIB1. Because there is no connection library with an INTERFACENAME of LIB1 in OBJECT/TESTLIB, the system links the process to the server library.
-
LIBRARY LIB1(LIBACCESS = BYTITLE, TITLE = “OBJECT/TESTLIB.”, INTERFACENAME = “CONLIB.”);
The system attempts to link the process to the library program OBJECT/TESTLIB. Because OBJECT/TESTLIB includes a connection library, the system inspects the INTERFACENAME specified by the linking process. Because the INTERFACENAME matches the connection library in OBJECT/TESTLIB, the system links the process to the connection library.

