Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Name = POINTER TO ARRAY 1024 OF CHAR; TYPE CommandList = POINTER TO CommandRec; TYPE CommandRec = RECORD next: CommandList; name: Name; proc: PROCEDURE; END; TYPE ModuleList = POINTER TO ModuleRec; TYPE ModuleRec = RECORD next: ModuleList; name: Name; init: PROCEDURE; commands: CommandList; END;
VAR modules: ModuleList;
Because the modules where the commands belong to are not necessarily initialized it is important to call the init procedure of ModuleRec prior to calls of any commands. Only the first call of an initialization part is effective, all further calls are no-operations.
The order of modules is topological and in linkage order in case of unrelated modules. Command lists are in order of appearance (in source code).
It is important to note that the components of CommandRec are read-only because they are part of the UNIX text segment. The pointer components of the records CommandRec and ModuleRec are protected against tracing of garbage collectors.
Oberon || Library || Module Index || Search Engine || Definition || Module