# Class: com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryService

The type library service \(TLS\) is responsible for managing \(loading and unloading\) native code type libraries \(`typelibs`\). There is one TLS per JEB engines context. It can be retrieved via [IEnginesContext#getTypeLibraryService()](IEnginesContext#getTypeLibraryService()). 

 This class is thread\-safe. 

 Positive UUIDs \(range \[0, 0x80000000\[\) is reserved for internal use. External users may use negative UUIDs.

## Constructor: TypeLibraryService

Description: Create a new TLS. At least one folder must be added using [#addFolder(File, boolean)](#addFolder(File, boolean)).

## Constructor: TypeLibraryService
- parameter: `folder`, type: `java.io.File`

Description: Create a new TLS with an initial folder. The folder will be scanned.
parameter: folder: 

## Static Field: GROUPID_TYPELIB_EFI
Type: `int`

Constant value: `30`

## Static Field: GROUPID_TYPELIB_LINUX
Type: `int`

Constant value: `2`

## Static Field: GROUPID_TYPELIB_LINUX_ANDROID
Type: `int`

Constant value: `3`

## Static Field: GROUPID_TYPELIB_POSIX
Type: `int`

Constant value: `1`

## Static Field: GROUPID_TYPELIB_TEST
Type: `int`

Constant value: `100`
Description: reserved for internal use

## Static Field: GROUPID_TYPELIB_TEST1
Type: `int`

Constant value: `101`
Description: reserved for internal use

## Static Field: GROUPID_TYPELIB_TEST2
Type: `int`

Constant value: `102`
Description: reserved for internal use

## Static Field: GROUPID_TYPELIB_TEST3
Type: `int`

Constant value: `103`
Description: reserved for internal use

## Static Field: GROUPID_TYPELIB_TEST4
Type: `int`

Constant value: `104`
Description: reserved for internal use

## Static Field: GROUPID_TYPELIB_UNKNOWN
Type: `int`

Constant value: `0`

## Static Field: GROUPID_TYPELIB_WIN32
Type: `int`

Constant value: `10`

## Static Field: GROUPID_TYPELIB_WINDDK
Type: `int`

Constant value: `20`

## Static Field: GROUPID_TYPELIB_WINDOWS
Type: `int`

Constant value: `9`

## Static Field: TYPELIB_FILE_EXTENSION
Type: `java.lang.String`

Constant value: `.typelib`

## Method: addFolder
- parameter: `folder`, type: `java.io.File`
- parameter: `doRescan`, type: `boolean`

Description: Add a typelib folder to this TLS.
parameter: folder: 
parameter: doRescan: if true, [#rescan()](#rescan()) will be invoked after the folder addition

## Method: findConstantsByName
- parameter: `name`, type: `java.lang.String`
- parameter: `procType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- parameter: `groupId`, type: `int`
- return type: `java.util.Set<java.lang.Object>`

Description: Find constants by name in the currently loaded typelibs. Convenience routine.
parameter: name: constant name
parameter: procType: optional
parameter: groupId: optional \(0 if none/unknown\)
return: 

## Method: findFirstIntegerConstantByName
- parameter: `name`, type: `java.lang.String`
- return type: `java.lang.Long`

Description: Find the first integer constant by name in the currently loaded typelibs. Convenience routine.
parameter: name: constant name
return: a constant, null if none

## Method: findRoutineByName
- parameter: `name`, type: `java.lang.String`
- parameter: `procType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`

Description: Convenience method.
parameter: name: routine name
parameter: procType: optional
return: 

## Method: findRoutineByName
- parameter: `name`, type: `java.lang.String`
- parameter: `procType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- parameter: `groupId`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`

Description: Find a routine by simple name in the currently loaded typelibs. Convenience routine.
parameter: name: routine name
parameter: procType: optional
parameter: groupId: optional \(0 if none/unknown\)
return: 

## Method: findTypeBySignature
- parameter: `signature`, type: `java.lang.String`
- parameter: `procType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`

Description: Find a type by signature in the currently loaded typelibs. Convenience routine.
parameter: signature: 
parameter: procType: optional
return: 

## Method: findTypeBySignature
- parameter: `signature`, type: `java.lang.String`
- parameter: `procType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- parameter: `groupId`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`

Description: Find a type by signature in the currently loaded typelibs. Convenience routine.
parameter: signature: 
parameter: procType: optional
parameter: groupId: optional \(0 if none/unknown\)
return: 

## Method: getAvailables
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryEntry>`

Description: Get the list of available type library entries. An available typelib is not necessarily loaded. Refer to [TypeLibraryEntry](TypeLibraryEntry) for additional details about the state of a given typelib.
return: 

## Method: getLoadedTypeLibraries
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.type.ITypeLibrary>`

Description: Get the list of loaded type libraries. More type libraries may be available, eg non\-loaded ones.
return: 

## Method: getLoadedTypeLibraryEntries
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryEntry>`

Description: Get the list of entries that specify a loaded typelib.
return: 

## Method: getNotLoadedTypeLibraryEntries
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryEntry>`

Description: Get the list of entries that specify an unloaded typelib.
return: 

## Method: load
- parameter: `entry`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryEntry`
- return type: `boolean`

Description: Load the provided type library into this TLS.
parameter: entry: 
return: 

## Method: load
- parameter: `processorType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- parameter: `groupId`, type: `int`
- return type: `boolean`

Description: Load all type libraries matching the given processor and group.
parameter: processorType: 
parameter: groupId: 
return: success indicator if one or more typelib was loaded

## Method: load
- parameter: `processorType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- parameter: `groupId`, type: `int`
- parameter: `maxCount`, type: `int`
- return type: `boolean`

Description: Load type libraries matching the given processor and group.
parameter: processorType: mandatory
parameter: groupId: mandatory
parameter: maxCount: 
return: success indicator if one or more typelib was loaded

## Method: loadExternal
- parameter: `typelib`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.ITypeLibrary`
- return type: `boolean`

Description: Load the provided external \(not backed by a file managed by this TLS\) typelib object.
parameter: typelib: 
return: 

## Method: loadSingle
- parameter: `processorType`, type: `com.pnfsoftware.jeb.core.units.codeobject.ProcessorType`
- parameter: `groupId`, type: `int`
- return type: `boolean`

Description: Load the highest priority type library matching the given processor type and group.
parameter: processorType: 
parameter: groupId: 
return: success indicator

## Method: rescan


## Method: rescan
- parameter: `deleteOldEntries`, type: `boolean`

Description: Rescan the type library folders to register/unregister additional/removed typelib binary files.
parameter: deleteOldEntries: 

## Method: unload
- parameter: `typelib`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.ITypeLibrary`
- return type: `boolean`

Description: Unload a type library.
parameter: typelib: a type library
return: true if the typelib was previously loaded and is now unloaded; false otherwise

## Method: unload
- parameter: `e`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryEntry`
- return type: `boolean`

Description: Unload a type library.
parameter: e: a typelib entry
return: true if the typelib was previously loaded and is now unloaded; false otherwise

## Method: unloadAll
- return type: `int`

Description: Unload all type libraries.
return: the number of typelibs that were unloaded

## Static Method: groupIdToName
- parameter: `id`, type: `int`
- return type: `java.lang.String`


