A Library Template is built by a Compiler for a program that declares Entrypoints which are in an external Library to which it will Link.
A Library Directory is built by a Compiler for a program which Exports Entrypoints and will Freeze to become a Library.
This is the general structure of a LibraryTemplate and a Library Directory. The structure of a Library Template and a Library Directory are almost the same, and any differences are noted in the text.
Header Area |
Stack Reference Area |
Objects Area |
Types Area |
Names Area |
Attributes Area |
UseInfo Area |
Free Area |
This description is for a Level 6 Library Template on MCP 5.0. It only discusses the fields used by a Compiler.
The Header Area contains Level information and indexes to the other Areas. Many of the fields are only used by the MCP when the Template is touched.
L_HeaderAreaSizeInWordsV = 15.
Library Template Header Area | ||||
---|---|---|---|---|
Word | Field | Name | Values | Description |
0 | L_StatusV | |||
[23:8] | L_LevelF | L_Template3V = 3 L_Template6V = 6 |
A Level 4 Template has the same
layout as a Level 3 Template, but contains Imported or Exported Data
(42.1).
A Level 5 Template allows a WAIT on an imported Event (47). |
|
[6:1] | L_OneWayF | |||
[5:2] | L_TypeF | L_ServerV = 0 L_Single_CLEV = 1 L_Multi_CLEV = 2 L_Win32_DLLV = 3 |
||
[3:4] | L_LinkClassF | L_UserV = 0 L_SupportV = 1 |
||
1 | [31:16] | L3_FreeIndexF | This is the index of the Free Area in Level 3 Templates, which has been moved to Word 8 for Level 6 Templates. | |
[15:16] | L_UseInfoIndexF | Word Index of the MCP UseInfo Area | ||
2 | [47:16] | L_StackRefIndexF | Word Index of the Stack Reference Area for APPROVAL and CHANGE procedures. | |
[31:16] | L_ImportsIndexF | Word Index of Imported Objects Area. These are the Objects declared to belong to a Library, and for which the Compiler generates a Library Template. | ||
[15:16] | L_ExportsIndexF | Word Index of Exported Objects Area. These are the Objects which are Exported from the program, and for which the Compiler generates a Library DirectoryTemplate. | ||
3 | [47:16] | L_TypesIndexF | Word Index of the Types Area. It contains the Type descriptions of the Objects and their Parameters. | |
[31:16] | L_NamesIndexF | Word Index of the Names Area, which contains the names of the Objects. | ||
[15:16] | L_AttributesIndexF | Word Index of the Attributes Area, which contains the Attributes for a Library, such as TITLE and LIBACCESS. | ||
4 | 0 | |||
5 | 0 | |||
6 | 0 | |||
7 | 0 | |||
8 | [19:20] | L_FreeIndexF | Word Index of the Free Area used by the MCP. | |
9 | 0 | |||
10 | 0 | |||
11 | 0 | Only Level 6 and later Templates have Words 11..14 | ||
12 | 0 | |||
13 | 0 | |||
14 | 0 |
The Stack Reference Area is located at the Word given by Template[1].L_StackRefIndexF.
This area maintains stack references (Lex Level and Displacement) to any CHANGE or APPROVAL procedures for a Library.
L_StackRefAreaSizeInWordsV = 6.
Library Template Stack Reference Area | ||||
---|---|---|---|---|
Word | Field | Name | Values | Description |
0 | [15:16] | L_SizeF | 6 | L_StackRefAreaSizeInWordsV |
1 | [11:12] | L_TemplateOffsetF | The Stack Displacement of the Library Template. | |
2 | 0 | |||
3 | L_LinkEventV | |||
[47:24] | L_ApprovalF | Composite Field | ||
[47:4] | L_Approval_LexLevelF | |||
[43:4] | 0 | |||
[39:16] | L_Approval_OffsetF | |||
[23:24] | L_ChangeF | Composite Field | ||
[23:4] | L_Change_LexLevelF | |||
[19:4] | 0 | |||
[15:16] | L_Change_OffsetF | |||
4 | ||||
5 |
The Objects Area definition is used for both Imported Objects and Exported Objects.
The Imported Objects are located at the Word given by Template[2].L_ImportsIndexF.
The Exported Objects are located at the Word given by Template[2].L_ExportsIndexF.
The size of the area depends on the number of objects, and is stored in Word 0. The size of the area includes the Size Word.
Library Template Objects Area | ||||
---|---|---|---|---|
Word | Field | Name | Values | Description |
0 | ||||
[15:16] | L_SizeF | The total number of words in the area, including this word. | ||
1..(L_SizeF-1) | 2 Word Object Descriptions |
The Objects are sorted in ascending order by Name.
Library Template Object | ||||
---|---|---|---|---|
Word | Field | Name | Values | Description |
0 | [47:4] | L_ProvisionF | L_DirectV = 0 L_IndirectV = 1 L_ByCallingV = 2 L_DynamicV = 3 |
|
[43:8] | L_NameLengthF | Length of Object Name in Bytes | ||
[35:20] | L_NameIndexF | Byte Index of Object Name from the start of the Library Template Names Area | ||
[15:16] | L_TypeIndexF | Index of the Type Tree | ||
1 | [47:16] | L_IndirObjF | Frame offset in Indirect Library | |
[25:2] | L_AccessModeF | L_NoAccessV = 0 L_ReadOnlyV = 1, L_ReadWriteV = 2 |
||
[19:4] | L_ObjectLinkClassF | |||
[15:16] | L_DisplacementF |
The Exported Objects described in a Library Directory have a sentinel Object with the name 4"FF". A Library Template does not have a sentinel Object.
The Types Area is located at the Word given by Template[3].L_TypesIndexF. It contains entries which describe the types and parameters of the library objects.
Library Template Types Area | ||||
---|---|---|---|---|
Word | Field | Name | Values | Description |
0 | ||||
[15:16] | L_SizeF | The total number of words in the area, including this word. | ||
1..(L_SizeF-1) | Type Definitions |
See BuildTypeDescription in Algol at 82050000.
The Names Area is located at the Word given by Template[3].L_NamesIndexF. It contains the Ebcdic names of the Objects.
Library Template Names Area | ||||
---|---|---|---|---|
Word | Field | Name | Values | Description |
0 | ||||
[15:16] | L_SizeF | The total number of words in the area, including this word. | ||
1..(L_SizeF-1) | Ebcdic Names. The Sentinel name for Exported Objects is 4"FF". |
The Names Area is located at the Word given by Template[3].L_NamesIndexF. It contains the Ebcdic names of the Objects.
Library Template Attributes Area | ||||
Word | Field | Name | Values | Description |
---|---|---|---|---|
0 | ||||
[15:16] | L_SizeF | The total number of words in the area, including this word. | ||
1 | 0 | This word is referred to as the VALUE Word, and is 0. | ||
2..(L_SizeF-2) | A list of Library Attribute
entries, terminated by a NULL Byte. The Last Word is filled with NULLs to
the Word Boundary.
An extra, Lib_Template_Attributes_Extra = 5, null Words are allocated at the end of the Attributes Area. |
There are several different formats for attribute definitions,
Name | Attribute No. | Format | Comments |
---|---|---|---|
INTNAME | 48"00" | 48"0200"<standard form name> | The <standard form name> has only 1 name, and no usercode or familyname. |
TITLE | 48"01" | 48"0201"<standard form name> | |
LIBPARAMETER | 48"02" | 48"0202"<2 byte length><text> | |
FUNCTIONNAME | 48"03" | 48"0203"<standard form name> | |
LIBACCESS | 48"04" | 48"0304"<libaccess code> | A <libaccess code> is
returned by the VALUE Function using one of these Mnemonics, BYTITLE (1) BYFUNCTION (2) BYINITIATOR (3) |
TRUSTED | 48"05" | ||
LINKCLASS | 48"06" | A <linkclass code> is
retuned by the VALUE Function using one of these Mnemonics, MCPLIB (1) MCSLIB (2) ENVLIB (3) PPLIB (4) COMPILERLIB (5) MAXCLASS (15) |
|
LIBRARYDEF | 48"08" | Not yet implemented. |
The UseInfo Area is located at the Word given by Template[1].L_UseInfoIndexF.
L_UseInfoAreaSizeInWordsV = 3.
This area is used by the MCP and is set to 0 by the Compilers.
The Free Area is located at the Word given by Template[8].L_FreeIndexF.
L_FreeAreaSizeInWordsV = 10.
This area is used by the MCP and is set to 0 by the Compilers.