:orphan:

.. index:: pair: group; TAPI for remote calls of dynamic linking loader
.. _doxid-group__te__lib__rpc__dlfcn:

TAPI for remote calls of dynamic linking loader
===============================================

.. toctree::
	:hidden:

Overview
~~~~~~~~




.. ref-code-block:: cpp
	:class: doxyrest-overview-code-block

	
	// typedefs

	typedef int64_t :target:`rpc_dlhandle<doxid-group__te__lib__rpc__dlfcn_1gabf80900c2f350e07d5ecbd6fca75cf03>`;
	typedef int64_t :target:`rpc_dlsymaddr<doxid-group__te__lib__rpc__dlfcn_1ga8df34841616e793aca38c7e16cce9fad>`;

	// global functions

	rpc_dlhandle :ref:`rpc_dlopen<doxid-group__te__lib__rpc__dlfcn_1gaf586bc2ceb52e84e5c0ca386a2289f01>`(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, const char* filename, int flags);
	char* :ref:`rpc_dlerror<doxid-group__te__lib__rpc__dlfcn_1ga92432991ce16c29286518cbb2c5cd0dc>`(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs);
	rpc_dlsymaddr :ref:`rpc_dlsym<doxid-group__te__lib__rpc__dlfcn_1gad2ed3b6c9ab0528dd40d33eabe12d014>`(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, rpc_dlhandle handle, const char* symbol);
	int :ref:`rpc_dlsym_call<doxid-group__te__lib__rpc__dlfcn_1gac29ccbdf2c44a129072b2f521cbf5277>`(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, rpc_dlhandle handle, const char* symbol);
	int :ref:`rpc_dlclose<doxid-group__te__lib__rpc__dlfcn_1ga5cc9b93dbb43bee3cff53b0b1cf99537>`(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, rpc_dlhandle handle);

	// macros

	#define :target:`RPC_DLHANDLE_NULL<doxid-group__te__lib__rpc__dlfcn_1ga775fe0ec032c149eb48158687f016a1b>`
	#define :target:`RPC_DLSYM_NULL<doxid-group__te__lib__rpc__dlfcn_1gaf163e5cb4313e5edb41b13cafe0ab3f6>`

.. _details-group__te__lib__rpc__dlfcn:

Detailed Documentation
~~~~~~~~~~~~~~~~~~~~~~



Global Functions
----------------

.. index:: pair: function; rpc_dlopen
.. _doxid-group__te__lib__rpc__dlfcn_1gaf586bc2ceb52e84e5c0ca386a2289f01:

.. ref-code-block:: cpp
	:class: doxyrest-title-code-block

	rpc_dlhandle rpc_dlopen(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, const char* filename, int flags)

Loads the dynamic labrary file.



.. rubric:: Parameters:

.. list-table::
	:widths: 20 80

	*
		- rpcs

		- RPC server handle

	*
		- filename

		- the name of the file to load

	*
		- flags

		- dlopen flags



.. rubric:: Returns:

dynamic library handle on success or NULL in the case of failure

.. index:: pair: function; rpc_dlerror
.. _doxid-group__te__lib__rpc__dlfcn_1ga92432991ce16c29286518cbb2c5cd0dc:

.. ref-code-block:: cpp
	:class: doxyrest-title-code-block

	char* rpc_dlerror(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs)

Returns a human readable string describing the most recent error that occurred from dlopen(), dlsym() or dlclose().



.. rubric:: Parameters:

.. list-table::
	:widths: 20 80

	*
		- rpcs

		- RPC server handle



.. rubric:: Returns:

a pointer to string or NULL if no errors occurred.

.. index:: pair: function; rpc_dlsym
.. _doxid-group__te__lib__rpc__dlfcn_1gad2ed3b6c9ab0528dd40d33eabe12d014:

.. ref-code-block:: cpp
	:class: doxyrest-title-code-block

	rpc_dlsymaddr rpc_dlsym(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, rpc_dlhandle handle, const char* symbol)

Returns the address where a certain symbol from dynamic library is loaded into memory.



.. rubric:: Parameters:

.. list-table::
	:widths: 20 80

	*
		- rpcs

		- RPC server handle

	*
		- handle

		- handle of a dynamic library returned by dlopen()

	*
		- symbol

		- null-terminated symbol name



.. rubric:: Returns:

address of the symbol or NULL if symbol is not found.

.. index:: pair: function; rpc_dlsym_call
.. _doxid-group__te__lib__rpc__dlfcn_1gac29ccbdf2c44a129072b2f521cbf5277:

.. ref-code-block:: cpp
	:class: doxyrest-title-code-block

	int rpc_dlsym_call(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, rpc_dlhandle handle, const char* symbol)

Calls a certain function without arguments from dynamic labrary.



.. rubric:: Parameters:

.. list-table::
	:widths: 20 80

	*
		- rpcs

		- RPC server handle

	*
		- handle

		- handle of a dynamic library returned by dlopen()

	*
		- symbol

		- null-terminated symbol name



.. rubric:: Returns:

return code of function.

.. index:: pair: function; rpc_dlclose
.. _doxid-group__te__lib__rpc__dlfcn_1ga5cc9b93dbb43bee3cff53b0b1cf99537:

.. ref-code-block:: cpp
	:class: doxyrest-title-code-block

	int rpc_dlclose(:ref:`rcf_rpc_server<doxid-structrcf__rpc__server>`* rpcs, rpc_dlhandle handle)

Decrements the reference count on the dynamic library handle. If the reference count drops to zero and no other loaded libraries use symbols in it, then the dynamic library is unloaded.



.. rubric:: Parameters:

.. list-table::
	:widths: 20 80

	*
		- rpcs

		- RPC server handle

	*
		- handle

		- handle of a dynamic library returned by dlopen()



.. rubric:: Returns:

0 on success, and non-zero on error.