31 #ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_SYSTEM_H_
32 #define ELEMENTSKERNEL_ELEMENTSKERNEL_SYSTEM_H_
55 #if defined(__APPLE__)
92 #if defined(__OPTIMIZE__) && defined(__clang__)
102 #if defined(__linux__) || defined(__APPLE__)
103 #define TEMPLATE_SPECIALIZATION
106 #ifndef HOST_NAME_MAX
108 #ifdef _POSIX_HOST_NAME_MAX
109 #define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
111 #define HOST_NAME_MAX 255
122 using EntryPoint =
unsigned long (*)(
const unsigned long iid,
void** ppvObject);
168 bool overwrite =
true);
184 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_SYSTEM_H_
ELEMENTS_API bool getStackLevel(ELEMENTS_UNUSED void *addresses, ELEMENTS_UNUSED void *&addr, ELEMENTS_UNUSED std::string &fnc, ELEMENTS_UNUSED std::string &lib)
ELEMENTS_API unsigned long getLastError()
Get last system known error.
const std::string LIB_EXTENSION
constant that represent the common extension of the libraries
Macro to silence unused variables warnings from the compiler.
ELEMENTS_API unsigned long unloadDynamicLib(ImageHandle handle)
unload dynamic link library
ELEMENTS_API const std::string getLastErrorString()
Get last system error as string.
void *(*)( Creator)
Definition of the "generic" DLL entry point function.
ELEMENTS_API int setEnv(const std::string &name, const std::string &value, bool overwrite=true)
set an environment variables.
const std::string LIB_SUFFIX
constant that represents the standard suffix of the libraries: usually "."+LIB_EXTENSION ...
ELEMENTS_API bool isEnvSet(const std::string &var)
Check if an environment variable is set or not.
defines the macros to be used for explicit export of the symbols
void * ImageHandle
Definition of an image handle.
ELEMENTS_API std::string getEnv(const std::string &var)
get a particular environment variable
ELEMENTS_API const std::string & osVersion()
OS version.
ELEMENTS_API int unSetEnv(const std::string &name)
Simple wrap around unsetenv for strings.
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
ELEMENTS_API const std::string getErrorString(unsigned long error)
Retrieve error code as string for a given error.
ELEMENTS_API int backTrace(ELEMENTS_UNUSED std::shared_ptr< void * > addresses, ELEMENTS_UNUSED const int depth)
const std::string SHLIB_VAR_NAME
name of the shared dynamic library path
ELEMENTS_API unsigned long getProcedureByName(ImageHandle handle, const std::string &name, EntryPoint *pFunction)
Get a specific function defined in the DLL.
ELEMENTS_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
void * ProcessHandle
Definition of the process handle.
const std::string LIB_PREFIX
constant that represent the common prefix of the libraries
const std::string DEFAULT_INSTALL_PREFIX
constant for the canonical installation prefix (on Linux and MacOSX at least)
ELEMENTS_API const std::string & hostName()
Host name.
ELEMENTS_API const std::string & osName()
OS name.
unsigned long(*)(const unsigned long iid, void **ppvObject) EntryPoint
Definition of the "generic" DLL entry point function.
ELEMENTS_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
const std::string SHLIB_SUFFIX
alias for LIB_SUFFIX
ELEMENTS_API const std::string & machineType()
Machine type.