opentracing-c
OpenTracing C API
Data Structures | Typedefs | Enumerations | Functions
dynamic_load.h File Reference
#include <opentracing-c/config.h>
#include <opentracing-c/tracer_factory.h>
Include dependency graph for dynamic_load.h:

Go to the source code of this file.

Data Structures

struct  opentracing_library_handle
 Handle for maintaining ownership of dynamically loaded shared library. More...
 

Typedefs

typedef enum opentracing_dynamic_load_error_code opentracing_dynamic_load_error_code
 Error codes for dynamic loading. More...
 
typedef struct opentracing_library_handle opentracing_library_handle
 Handle for maintaining ownership of dynamically loaded shared library.
 

Enumerations

enum  opentracing_dynamic_load_error_code { opentracing_dynamic_load_error_code_success = 0, opentracing_dynamic_load_error_code_failure = -1, opentracing_dynamic_load_error_code_not_supported = -2, opentracing_dynamic_load_error_code_incompatible_library_versions = -3 }
 Error codes for dynamic loading. More...
 

Functions

void opentracing_library_handle_destroy (opentracing_library_handle *handle)
 Destroy handle to stop using this library. More...
 
opentracing_dynamic_load_error_code opentracing_dynamically_load_tracing_library (const char *lib, opentracing_library_handle *handle, char *error_buffer, int error_buffer_length) OPENTRACINGC_NONNULL(1
 Dynamically loads a tracing library and returns a handle that can be used to create tracers. More...
 

Typedef Documentation

◆ opentracing_dynamic_load_error_code

Error codes for dynamic loading.

Enumeration Type Documentation

◆ opentracing_dynamic_load_error_code

Error codes for dynamic loading.

Enumerator
opentracing_dynamic_load_error_code_success 

Success value.

opentracing_dynamic_load_error_code_failure 

Occurs when dynamically loading a tracer library fails.

Possible reasons could be the library doesn't exist or it is missing the required symbols.

opentracing_dynamic_load_error_code_not_supported 

Means dynamic loading of tracing libraries is not supported for the platform used.

opentracing_dynamic_load_error_code_incompatible_library_versions 

Occurs if the tracing dynamically loaded library uses an incompatible version of opentracing.

Function Documentation

◆ opentracing_dynamically_load_tracing_library()

opentracing_dynamic_load_error_code opentracing_dynamically_load_tracing_library ( const char *  lib,
opentracing_library_handle handle,
char *  error_buffer,
int  error_buffer_length 
)

Dynamically loads a tracing library and returns a handle that can be used to create tracers.

Parameters
libShared library name.
[out]handleLibrary handle that should be closed once symbol is no longer needed.
[out]error_bufferBuffer for potential error message.
error_buffer_lengthLength of error_buffer. If error_buffer is NULL, must be zero.
Returns
opentracing_dynamic_load_error_code indicating success or failure.
See also
opentracing_library_handle_destroy

◆ opentracing_library_handle_destroy()

void opentracing_library_handle_destroy ( opentracing_library_handle handle)

Destroy handle to stop using this library.

To avoid undefined behavior, the caller must avoid doing this until all tracers loaded from this library are also destroyed.

Parameters
handleLibrary handle to destroy.