Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
dynamic_link.h File Reference
#include "tbb/tbb_stddef.h"
#include <stddef.h>
Include dependency graph for dynamic_link.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dynamic_link_descriptor
 Association between a handler name and location of pointer to it. More...
 

Macros

#define LIBRARY_ASSERT(x, y)   __TBB_ASSERT_EX(x,y)
 
#define OPEN_INTERNAL_NAMESPACE   namespace tbb { namespace internal {
 
#define CLOSE_INTERNAL_NAMESPACE   }}
 
#define DLD(s, h)   {#s, (pointer_to_handler*)(void*)(&h)}
 The helper to construct dynamic_link_descriptor structure. More...
 
#define DLD_NOWEAK(s, h)   DLD(s,h)
 

Typedefs

typedef voiddynamic_link_handle
 

Enumerations

enum  dynamic_link_error_t {
  dl_success = 0, dl_lib_not_found, dl_sym_not_found, dl_sys_fail,
  dl_buff_too_small
}
 

Functions

bool dynamic_link (const char *library, const dynamic_link_descriptor descriptors[], size_t required, dynamic_link_handle *handle=0, int flags=DYNAMIC_LINK_ALL)
 Fill in dynamically linked handlers. More...
 
void dynamic_unlink (dynamic_link_handle handle)
 
void dynamic_unlink_all ()
 

Variables

OPEN_INTERNAL_NAMESPACE typedef void(* pointer_to_handler )()
 Type definition for a pointer to a void somefunc(void) More...
 
const int DYNAMIC_LINK_GLOBAL = 0x01
 
const int DYNAMIC_LINK_LOAD = 0x02
 
const int DYNAMIC_LINK_WEAK = 0x04
 
const int DYNAMIC_LINK_ALL = DYNAMIC_LINK_GLOBAL | DYNAMIC_LINK_LOAD | DYNAMIC_LINK_WEAK
 

Macro Definition Documentation

◆ CLOSE_INTERNAL_NAMESPACE

#define CLOSE_INTERNAL_NAMESPACE   }}

Definition at line 36 of file dynamic_link.h.

◆ DLD

#define DLD (   s,
  h 
)    {#s, (pointer_to_handler*)(void*)(&h)}

The helper to construct dynamic_link_descriptor structure.

Definition at line 56 of file dynamic_link.h.

◆ DLD_NOWEAK

#define DLD_NOWEAK (   s,
  h 
)    DLD(s,h)

Definition at line 57 of file dynamic_link.h.

◆ LIBRARY_ASSERT

#define LIBRARY_ASSERT (   x,
 
)    __TBB_ASSERT_EX(x,y)

Definition at line 28 of file dynamic_link.h.

◆ OPEN_INTERNAL_NAMESPACE

#define OPEN_INTERNAL_NAMESPACE   namespace tbb { namespace internal {

By default, symbols declared and defined here go into namespace tbb::internal. To put them in other namespace, define macros OPEN_INTERNAL_NAMESPACE and CLOSE_INTERNAL_NAMESPACE to override the following default definitions.

Definition at line 35 of file dynamic_link.h.

Typedef Documentation

◆ dynamic_link_handle

Definition at line 74 of file dynamic_link.h.

Enumeration Type Documentation

◆ dynamic_link_error_t

Enumerator
dl_success 
dl_lib_not_found 
dl_sym_not_found 
dl_sys_fail 
dl_buff_too_small 

Definition at line 108 of file dynamic_link.h.

108  {
109  dl_success = 0,
110  dl_lib_not_found, // char const * lib, dlerr_t err
111  dl_sym_not_found, // char const * sym, dlerr_t err
112  // Note: dlerr_t depends on OS: it is char const * on Linux* and macOS*, int on Windows*.
113  dl_sys_fail, // char const * func, int err
114  dl_buff_too_small // none
115 }; // dynamic_link_error_t

Function Documentation

◆ dynamic_link()

bool dynamic_link ( const char *  library,
const dynamic_link_descriptor  descriptors[],
size_t  required,
dynamic_link_handle handle = 0,
int  flags = DYNAMIC_LINK_ALL 
)

Fill in dynamically linked handlers.

'library' is the name of the requested library. It should not contain a full path since dynamic_link adds the full path (from which the runtime itself was loaded) to the library name. 'required' is the number of the initial entries in the array descriptors[] that have to be found in order for the call to succeed. If the library and all the required handlers are found, then the corresponding handler pointers are set, and the return value is true. Otherwise the original array of descriptors is left untouched and the return value is false. 'required' is limited by 20 (exceeding of this value will result in failure to load the symbols and the return value will be false). 'handle' is the handle of the library if it is loaded. Otherwise it is left untouched. 'flags' is the set of DYNAMIC_LINK_* flags. Each of the DYNAMIC_LINK_* flags allows its corresponding linking stage.

◆ dynamic_unlink()

void dynamic_unlink ( dynamic_link_handle  handle)

Definition at line 569 of file dynamic_link.cpp.

569 {}

◆ dynamic_unlink_all()

void dynamic_unlink_all ( )

Definition at line 570 of file dynamic_link.cpp.

570 {}

Referenced by tbb::internal::governor::release_resources().

Here is the caller graph for this function:

Variable Documentation

◆ DYNAMIC_LINK_ALL

Definition at line 80 of file dynamic_link.h.

◆ DYNAMIC_LINK_GLOBAL

const int DYNAMIC_LINK_GLOBAL = 0x01

Definition at line 77 of file dynamic_link.h.

◆ DYNAMIC_LINK_LOAD

const int DYNAMIC_LINK_LOAD = 0x02

Definition at line 78 of file dynamic_link.h.

◆ DYNAMIC_LINK_WEAK

const int DYNAMIC_LINK_WEAK = 0x04

Definition at line 79 of file dynamic_link.h.

◆ pointer_to_handler

OPEN_INTERNAL_NAMESPACE typedef void(* pointer_to_handler) ()

Type definition for a pointer to a void somefunc(void)

Definition at line 47 of file dynamic_link.h.


Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.