plibsys 0.0.5
|
Library initialization. More...
Go to the source code of this file.
Functions | |
P_LIB_API void | p_libsys_init (void) |
Initializes library resources. | |
P_LIB_API void | p_libsys_init_full (const PMemVTable *vtable) |
Initializes library resources along with the memory table. | |
P_LIB_API void | p_libsys_shutdown (void) |
Frees library resources. | |
P_LIB_API const pchar * | p_libsys_version (void) |
Gets the library version against which it was compiled at run-time. | |
Library initialization.
Before using the library you must to initialize it properly. Use p_libsys_init() to initialize the library. Please note that you need to call it only once, not in every thread. This call is not MT-safe (because it also initializes the threading subsystem itself), so it is best to place it in the program's main thread, when the program starts.
The only difference between p_libsys_init() and p_libsys_init_full() is that the latter one allows to setup memory management routines before doing any internal library call. This way you can ensure to use provided memory management everywhere (even for library initialization).
When you do not need the library anymore release used resourses with the p_libsys_shutdown() routine. You should only call it once, too. This call is not MT-safe (because it also deinitializes the threading subsystem itself), so it is best to place it in the program's main thread, when the program finishes.
It is not recommended to call the initialization and deinitialization routines on Windows in the DllMain() call because it may require libraries other than kernel32.dll.
Definition in file pmain.h.
P_LIB_API void p_libsys_init | ( | void | ) |
Initializes library resources.
P_LIB_API void p_libsys_init_full | ( | const PMemVTable * | vtable | ) |
Initializes library resources along with the memory table.
vtable | Memory management table. |
P_LIB_API void p_libsys_shutdown | ( | void | ) |
Frees library resources.
You should stop using any of the library routines after calling this one.
Gets the library version against which it was compiled at run-time.