diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/wolf/library/loader.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/include/wolf/library/loader.h b/include/wolf/library/loader.h index 85195a7..949d946 100644 --- a/include/wolf/library/loader.h +++ b/include/wolf/library/loader.h @@ -36,6 +36,7 @@ extern "C" { #include "port/sys.h" #include "errors.h" +#include <sys/types.h> /* for size_t */ /* @brief handle representing a shared library */ @@ -53,34 +54,25 @@ wolf_library_p wolf_library_load( const char *name, wolf_error_t *error ); /** * Free up resources used by the library object. * - * @param demon the library object to free + * @param library the library object to free * * @return WOLF_OK if library has been unloaded, * WOLF_ERR_INTERNAL_STATE if the library handle is in an illegal state * (like double freeing the same library) */ - wolf_error_t wolf_library_unload( wolf_library_p library ); -#if 0 - -#if !defined _WIN32 - -#include <dlfcn.h> /* for dlxxx functions */ - - -#else - -#define WIN32_MEAN_AND_LEAN -#include <windows.h> - -#endif /* !defined _WIN32 */ - -#endif - -#ifdef __cplusplus -} -#endif +/** + * Converts the last error and state of the library object in a human readable message. + * + * @param error the error which happened after calling a library loader function + * @param library the library object for which we want a error message + * @param buf the buffer which will hold the error message + * @param buflen the size of the buffer + * + * @returns a pointer to buf for convenience + */ +char *wolf_libary_errmsg( const wolf_error_t error, const wolf_library_p library, char *buf, size_t buflen ); /** @} */ /* @addtogroup wolf_library */ |