---
name: "globus_extension_lookup"
section: "3"
platform: "linux"
package: "libglobus-common-doc"
version: "18.14-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_extension.h"
---

# globus\_extension\_lookup(3)

Globus Extension Modules.

Part of [globus\_extension.h(3)](/globus_extension.h/3.md).

## NAME

globus\_extension.h - Globus Extension Modules.

## SYNOPSIS

`#include 'globus_common_include.h'`\
 `#include 'globus_module.h'`\
 `#include 'globus_hashtable.h'`\

### Macros

\#define **GlobusExtensionDefineModule**(name)       **globus\_module\_descriptor\_t** name##\_module\

### Functions

int **globus\_extension\_activate** (const char \*extension\_name)\
 void \* **globus\_extension\_lookup** (globus\_extension\_handle\_t \*handle, globus\_extension\_registry\_t \*registry, void \*symbol)\
 int **globus\_extension\_register\_builtin** (const char \*extension\_name, **globus\_module\_descriptor\_t** \*module\_descriptor)\

## Detailed Description

Globus Extension Modules.

## Macro Definition Documentation

### #define GlobusExtensionDefineModule(name) globus\_module\_descriptor\_t name##\_module

Declare your module with the following.

Ex: **GlobusExtensionDefineModule(my\_module)** = { 'my\_module', globus\_l\_my\_module\_activate, globus\_l\_my\_module\_deactivate, NULL, NULL, &local\_version };

## Function Documentation

### int globus\_extension\_activate (const char \* extension\_name)

loads the shared library 'lib**extension\_name**\_**flavor**.so' from $GLOBUS\_LOCATION/lib (or other location in LD\_LIBRARY\_PATH and activates the module defined within.

In the future, a configuration file will be supported allowing arbitrary extension names to be mapped to a specific library name.

Also, when builtin (compiled in) extensions are supported, this will activate those directly without needing to load the library.

Search order:

- •

  **extension\_name** in mappings hash XXX not implemented

- •

  mapped name in builtin hash XXX not implemented

- •

  mapped name in dll hash XXX not implemented

- •

  load mapped name XXX not implemented

- •

  **extension\_name** in builtin hash

- •

  **extension\_name** in dll hash

- •

  load library if(strchr(**extension\_name**, '/'))

- •

  concatenate / + dirname(**extension\_name**) + /lib + basename(**extension\_name**) + \_\<flavor\>.so to $GLOBUS\_LOCATION/lib and each search path in mappings file XXX not implemented (eg, for **extension\_name** == wsrf/services/CounterService, load $GLOBUS\_LOCATION/lib/wsrf/services/libCounterService\_gcc32dbg.so)

- •

  lib + basename(**entension\_name**) + \_**flavor**.so subject to LD\_LIBRARY\_PATH else

- •

  load lib**extension\_name**\_**build\_flavor** subject to LD\_LIBRARY\_PATH

### void \* globus\_extension\_lookup (globus\_extension\_handle\_t \* handle, globus\_extension\_registry\_t \* registry, void \* symbol)

Get the datum associated with symbol in this registry.

You MUST call globus\_extension\_release() when you are done using the data. the lookup() and release() calls handle the reference counting that prevents an extension from being unloaded while things it provides are being used. Do NOT call release() until you are done accessing the data from \* the lookup() call.

release() could potentially block as a result of module deactivation and unloading. ensuring that globus\_extension\_deactivate() is not called with outstanding references will prevent that.

symbol is a char \* by default. the key can be changed by calling globus\_extension\_registry\_set\_hashing() before it is accessed.

### int globus\_extension\_register\_builtin (const char \* extension\_name, globus\_module\_descriptor\_t \* module\_descriptor)

hopefully in the future, these functions will only be needed by generated code

## Author

Generated automatically by Doxygen for globus\_common from the source code.
