The libraryMgr is a tiny make facility (analogous to Linux make and MSWindows nmake).
LibraryMgr arbitrarily groups source files into libraries.
In libraryMgr, source libraries are stored in two different types of library file cabinets.
Function Libraries are stored in a central Object Repository with a source archive file as backup.
Source Libraries are stored in a central Host OS folder (Directory) with a source archive file as backup.
The libraryMgr manages all source code stored in the Libraries.
This includes checking source in and out of the library file cabinets, importing, exporting, and deleting source from each Library.
Note: Libraries are compiled (made) in the order they were registered.
The libraryMgr function initializes the libraryMgr make facility,
and also initializes the libraryMgr static storage facility _libraryMgr.
Type: Function
Syntax: | (libraryMgr) |
Returns | true |
The addFunctionLibrary function registers a new Library file cabinet to the libraryMgr.
This function library will be stored in a repository and will have an archive source file for backup.
Type: Function
Syntax: | (libraryMgr.addFunctionLibrary libraryName repositoryName folderName archiveFileName autoSearchFlag compileFlag fileSuffix) |
---|---|
libraryName | The name of the library |
repositoryName | The name of the library repository (must be "" for source libraries) |
folderName | The name of the library folder (must be present even for function libraries) |
archiveFileName | The name of the library archive source file (must be "" for function libraries) |
autoSearchFlag | If true, the library is included in all checkout searches |
compileFlag | If true, the library is automatically compiled upon registration |
fileSuffix | The file suffix for all source files in the library (must be present for ALL libraries) |
Returns | true |
Excerpted from the Tutorial_OnlineDoc project, the following example demonstrates how a project make setup is registered to libraryMgr.
Notice that some of the Libraries are stored in repositories (addFunctionLibrary) and others are stored as folders (addSourceLibrary).
;; *****************
;; RegisterLibraries
;; *****************
;; Register Lambda cabinets for use in ARC
(writeln "Compiling Function Libraries used in AisRefGuide Tutorial")
;; RadIde
;; Arguments are ==> libraryName repositoryName folderName archiveFileName autoSearchFlag compileFlag fileSuffix)
(libraryMgr.addFunctionLibrary precompiler: (append _path "/Binary/Precompiler.db") (append _path "/Source/Precompiler") (append _path "/Source/Precompiler.sl") true false "sl" )
(libraryMgr.addFunctionLibrary libraryMgr: (append _path "/Binary/LibraryMgr.db") (append _path "/Source/LibraryMgr") (append _path "/Source/LibraryMgr.sl") true false "sl" )
(libraryMgr.addFunctionLibrary ideMgr: (append _path "/Binary/IdeMgr.db") (append _path "/Source/IdeMgr") (append _path "/Source/IdeMgr.sl") true false "sl" )
;; AisRadIde
(libraryMgr.addFunctionLibrary aisRefGuide: (append _path "/Binary/AisRefGuide.db") (append _path "/Source/AisRefGuide") (append _path "/Source/AisRefGuide.sl") true true "sl" )
(libraryMgr.addFunctionLibrary porter: (append _path "/Binary/Porter.db") (append _path "/Source/Porter") (append _path "/Source/Porter.sl") true true "sl" )
(libraryMgr.addFunctionLibrary xml: (append _path "/Binary/Xml.db") (append _path "/Source/Xml") (append _path "/Source/Xml.sl") true true "sl" )
;; Core
(libraryMgr.addSourceLibrary CoreContent: "" (append _path "/CoreContent") "" false false "xml" )
(libraryMgr.addSourceLibrary Foundry: "" (append _path "/Foundry") "" false false "xml" )
(libraryMgr.addSourceLibrary Templates: "" (append _path "/Templates") "" false false "html" )
(libraryMgr.addSourceLibrary HtmlOutput: "" (append _path "/wwwroot") "" false false "html" )
;; Working Views
(libraryMgr.addSourceLibrary ImageContent: "" (append _path "/Foundry") "" false false "gif" )
(libraryMgr.addSourceLibrary ImageOutput: "" (append _path "/wwwroot") "" false false "gif" )
(libraryMgr.addSourceLibrary HtmlTemplates: "" (append _path "/Foundry") "" false false "html" )
The addSourceLibrary function registers a new Library file cabinet to the libraryMgr.
This source library will be stored as individual source files in a host OS folder (Directory) and will have an archive source file for backup.
Type: Function
Syntax: | (libraryMgr.addSourceLibrary libraryName repositoryName folderName archiveFileName autoSearchFlag compileFlag fileSuffix) |
---|---|
libraryName | The name of the library |
repositoryName | The name of the library repository (must be "" for source libraries) |
folderName | The name of the library folder (must be present even for function libraries) |
archiveFileName | The name of the library archive source file (must be "" for function libraries) |
autoSearchFlag | If true, the library is included in all checkout searches |
compileFlag | If true, the library is automatically compiled upon registration |
fileSuffix | The file suffix for all source files in the library (must be present for ALL libraries) |
Returns | true |
Excerpted from the Tutorial_OnlineDoc project, the following example demonstrates how a project make setup is registered to libraryMgr.
Notice that some of the Libraries are stored in repositories (addFunctionLibrary) and others are stored as folders (addSourceLibrary).
;; *****************
;; RegisterLibraries
;; *****************
;; Register Lambda cabinets for use in ARC
(writeln "Compiling Function Libraries used in AisRefGuide Tutorial")
;; RadIde
;; Arguments are ==> libraryName repositoryName folderName archiveFileName autoSearchFlag compileFlag fileSuffix)
(libraryMgr.addFunctionLibrary precompiler: (append _path "/Binary/Precompiler.db") (append _path "/Source/Precompiler") (append _path "/Source/Precompiler.sl") true false "sl" )
(libraryMgr.addFunctionLibrary libraryMgr: (append _path "/Binary/LibraryMgr.db") (append _path "/Source/LibraryMgr") (append _path "/Source/LibraryMgr.sl") true false "sl" )
(libraryMgr.addFunctionLibrary ideMgr: (append _path "/Binary/IdeMgr.db") (append _path "/Source/IdeMgr") (append _path "/Source/IdeMgr.sl") true false "sl" )
;; AisRadIde
(libraryMgr.addFunctionLibrary aisRefGuide: (append _path "/Binary/AisRefGuide.db") (append _path "/Source/AisRefGuide") (append _path "/Source/AisRefGuide.sl") true true "sl" )
(libraryMgr.addFunctionLibrary porter: (append _path "/Binary/Porter.db") (append _path "/Source/Porter") (append _path "/Source/Porter.sl") true true "sl" )
(libraryMgr.addFunctionLibrary xml: (append _path "/Binary/Xml.db") (append _path "/Source/Xml") (append _path "/Source/Xml.sl") true true "sl" )
;; Core
(libraryMgr.addSourceLibrary CoreContent: "" (append _path "/CoreContent") "" false false "xml" )
(libraryMgr.addSourceLibrary Foundry: "" (append _path "/Foundry") "" false false "xml" )
(libraryMgr.addSourceLibrary Templates: "" (append _path "/Templates") "" false false "html" )
(libraryMgr.addSourceLibrary HtmlOutput: "" (append _path "/wwwroot") "" false false "html" )
;; Working Views
(libraryMgr.addSourceLibrary ImageContent: "" (append _path "/Foundry") "" false false "gif" )
(libraryMgr.addSourceLibrary ImageOutput: "" (append _path "/wwwroot") "" false false "gif" )
(libraryMgr.addSourceLibrary HtmlTemplates: "" (append _path "/Foundry") "" false false "html" )
The checkin function stores the specified Lambda source into the file cabinet
under the specified Lambda name.
Type: Function
Syntax: | (libraryMgr.checkin LambdaName LambdaSource) |
LambdaName | The name of the Lambda in the file cabinet currently in focus. |
LambdaScript | The source string for the Lambda. |
Returns | true |
Syntax: | (libraryMgr.checkin cabinetName LambdaName LambdaSource) |
cabinetName | The name of the file cabinet the Lambda is to be checked into. |
LambdaName | The name of the Lambda in the specified file cabinet. |
LambdaScript | The source string for the Lambda. |
Returns | true |
The checkout function returns the Lambda source stored, in the file cabinet, under the specified Lambda name.
Type: Function
Syntax: | (libraryMgr.checkout LambdaName) |
LambdaName | The name of the Lambda in the file cabinet. |
Returns | The source string for the Lambda. |
Syntax: | (libraryMgr.checkout cabinetName LambdaName) |
cabinetName | The name of the extent in the file cabinet. |
LambdaName | The name of the Lambda in the file cabinet. |
Returns | The source string for the Lambda. |
Cabinet Search:
For all File Cabinets, during checkout operations without a cabinet name argument, the libraryMgr will not search file cabinet extents whose names begin with the "~" character. This prevents the needless automatic searching of unwarrented file cabinets during checkout.
The checkStatus function returns the current import/export synchronization status for a cabinet.
Type: Function
Syntax: | (libraryMgr.checkStatus cabinetName) |
cabinetName | The name of the cabinet. |
Returns | Tab delimited string of the cabinet's current import/export synchronization status. |
The checkoutStrip function returns the Lambda source stored, in the file cabinet, under the specified Lambda name,
with any ;#text headers stripped away, and
with the the first and last lines, which must be #if 0 and #endif, stripped away.
Type: Function
Syntax: | (libraryMgr.checkoutStrip LambdaName) |
LambdaName | The name of the Lambda in the file cabinet. |
Returns | The source string for the Lambda. |
Syntax: | (libraryMgr.checkoutStrip cabinetName LambdaName) |
cabinetName | The name of the extent in the file cabinet. |
LambdaName | The name of the Lambda in the file cabinet. |
Returns | The source string for the Lambda. |
Cabinet Search:
For all File Cabinets, during checkoutStrip operations without a cabinet name argument, the libraryMgr will not search file cabinet extents whose names begin with the "~" character. This prevents the needless automatic searching of unwarrented file cabinets during checkout.
The compileAll function compiles and loads every Lambda in the currently focused file cabinet. The compiled Lambdas are loaded into RAM memory.
Type: Function
Syntax: | (libraryMgr.compileAll loadSwitch) |
loadSwitchs | Always recompile (true), load only do not recompile (false) |
Returns | true |
The compileFocusedLibrary function compiles the source in the currently focused library.
Type: Function
Syntax: | (libraryMgr.compileFocusedLibrary alwaysCompileSW) |
alwaysCompileSW | If true, the source library is always compiled even if its autoCompileFlag is false. |
Returns | true (if there is no error) |
The dropLibrary function unregisters a file cabinet extent from the libraryMgr.
Type: Function
Syntax: | (libraryMgr.dropLibrary libraryName) |
extentName | The name of the library file cabinet extent. |
Returns | true |
The eraseSource function deletes the specified Lambda from the file cabinet.
Type: Function
Syntax: | (libraryMgr.eraseSource LambdaName) |
LambdaName | The name of the Lambda to be erased from the file cabinet. |
Returns | The source code for the Lambda which has been erased. |
The exportDirectory function exports all cabinet Lambdas into the specified directory.
Type: Function
Syntax: | (libraryMgr.exportDirectory directory LambdaName |
directory | The new directory that would contain all source files for the exported cabinet. |
LambdaName | Specific Lambda to be exported as a source file on the given directory(currently not used). |
saveInfoFlag | (Optional) If set to "true", it will save the exported cabinet information to the object repository. |
Returns | true |
The exportArchive function exports the specified Library from its file cabinet to the specified ASCII archive source file.
Type: Function
Syntax: | (libraryMgr.exportArchive libraryName) |
LambdaName | The name of the Library whose source code is to be exported. |
Returns | true |
The getChildNames function returns a vector of all Lambda's names stored in the file cabinet.
Type: Function
Syntax: | (libraryMgr.getChildNames) |
Returns | A tab delimited string of all the Lambda's names stored in the file cabinet |
The getLibraryCount function returns the number of file cabinet extents currently registered to the Lambda.
Type: Function
Syntax: | (libraryMgr.getLibraryCount) |
Returns | The number of file cabinet extents currently registered to the Lambda. |
The getLibraryNames function returns a vector containing file cabinet extent.
Type: Function
Syntax: | (libraryMgr.getLibraryNames) |
Returns | A vector containing file cabinet extent names. |
The getFocus function returns the name of the file cabinet extent which is currently in focus.
Type: Function
Syntax: | (libraryMgr.getFocus) |
Returns | The name of the extent now in focus. |
The getFocusIndex function returns the index of the file cabinet extent which is currently in focus.
Type: Function
Syntax: | (libraryMgr.getFocusIndex) |
Returns | The index of the extent now in focus. |
The getKeys function returns a vector of all Library source names stored in the file cabinet.
Type: Function
Syntax: | (libraryMgr.getKeys) |
Returns | A tab delimited string of all the Library source file names stored in the file cabinet |
The htmlPageServer function routes a message, from an html page, to an html server Lambda (see the htmlPageRegistry property).
Type: Function
Syntax: | (libraryMgr.htmlPageServer pageName pageParms) |
pageName | The name of the page where the message originated. |
Returns | The parameter structure associated with this message. |
Returns | The URL name of the html page created as a response. |
The importArchive function imports the specified Lambda library archive source file into the file cabinet.
The specified Lambda library file should have been created by a previous exportArchive command.
Type: Function
Syntax: | (libraryMgr.importSource fileName) |
fileName | The path and file name of the Lambda library text file to be imported into the file cabinet. |
Returns | true |
The inspect function returns a tab delimited string of statistics from the workspace. The single argument specifies the type of workspace inspection desired.
Type: Function
Syntax: | (parseLib.apply theType) |
theType | The type of workspace inspection desired. A value of Lambdas: returns a tab delimited string of Lambda names in the file cabinet. A value of globals: returns a tab delimited string of global variables and their current values. A value of stats: returns a tab delimited string showing the current workspace memory and object usage. |
Returns | A tab delimited string of workspace statistics. |
The prettyGlobals function returns a tab delimited string containing global variables and their current contents. The prettyGlobals function allows the client to browse the current workspace using the libraryMgr.
Type: Function
Syntax: | (libraryMgr.prettyGlobals showCFuncs showLocked) |
showCFuncs | A value of 1 if C functions are to be displayed, 0 if they are not. |
showLocked | A value of 1 if locked globals are to be displayed, 0 if they are not. |
Returns | A tab delimited string of global variable names along with their current contents. Each entry has the following format: globalName = value |
The prettyString converts the specified object into a delimited string using the specified delimiters.
Type: Function
Syntax: | (libraryMgr.prettyString anObj midDel endDel lineNoSW) |
anObj | An object to be converted into a delimited string. |
midDel | The delimited to place between the key and the value when converting a Structure or Dictionary object. |
endDel | The delimited to place at the end of every entry (usually carriage return line feed). |
lineNoSw | (Optional) If the line number switch is present and true then line numbers will prefix each vector element. |
Returns | A delimited string representing the contents of the input object. |
The removeDelimiters function removes all carriage returns, line feeds, and tabs from the string.
Type: Function
Syntax: | (libraryMgr.removeDelimiters aString) |
aString | The string whose delimiters are to be removed. |
Returns | A sting with the delimiters removed. |
The showGlobals function produces a report that shows globals accessed by a specified agency.
Type: Function
Syntax: | (libraryMgr.showGlobals rootLambda) |
rootLambda | The name of a Lambda in memory. |
Returns | true |
This function shows globals except the following:
Use this function to check your Lambdas for unwanted global references.
The setFocus function sets the specified extent to be the current file cabinet.
Type: Function
Syntax: | (libraryMgr.setFocus extentName) |
extentName | The name of the file cabinet extent to be made the focused file cabinet. |
Returns | The repository extent now in focus. |
The setLambdaBindings function binds all of the unbound Lambdas assigned to global symbols
with the global symbol name in the Lambda.In.Bindings element of the Lambda. All unbound child Lambdas
are also bound in their childLambda.In.Bindings elements.
Type: Function
Syntax: | (libraryMgr.setLambdaBindings) |
Returns | true |
The tabbedNameList function returns a tab delimited string containing the names of all child Lambdas stored in the file cabinet.
Type: Function
Syntax: | (libraryMgr.tabbedNameList) |
Returns | A tab delimited string of all child Lambdas stored in the file cabinet. |