From 686ee56fc5e4b8a3573dbad3a0e997fe89ba71a7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Tue, 18 May 2010 18:25:41 +0200 Subject: now stuck in dlsym/dereferencing type-punned pointer will break strict-aliasing rules beautiness :-) --- src/library/loader.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/library/loader.c b/src/library/loader.c index ad83bda..cf5f0e3 100644 --- a/src/library/loader.c +++ b/src/library/loader.c @@ -85,12 +85,22 @@ wolf_error_t wolf_library_unload( wolf_library_p l ) { return WOLF_OK; } -char *wolf_library_errmsg( const wolf_error_t error, const wolf_library_p l, char *buf, size_t buflen ) { +char *wolf_library_errmsg( const wolf_error_t error, const wolf_library_p library, char *buf, size_t buflen ) { (void)wolf_error_msg( error, buf, buflen ); strncat( buf, " - ", buflen - strlen( buf ) ); if( error == WOLF_ERR_INTERNAL ) { - strncat( buf, l->errbuf, buflen - strlen( buf ) ); + strncat( buf, library->errbuf, buflen - strlen( buf ) ); } return buf; } + +void *wolf_library_get( const wolf_library_p l, const char *name, wolf_error_t *error ) { + void *ret; + + ret = dlsym( l->handle, name ); + + *error = WOLF_OK; + return ret; +} + -- cgit v1.2.3-54-g00ecf