summaryrefslogtreecommitdiffstats
path: root/eurephiadb.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-08-10 21:36:35 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-08-10 21:36:35 +0200
commite17bbcdefb188500b23be259c0f9259a49bbd6cb (patch)
tree4ba01cc06985e439d6a7800f986d4d7fb5b0e33d /eurephiadb.c
parent6cdb4cef3fc8ad268e63081ce817605cc7a38549 (diff)
downloadeurephia-e17bbcdefb188500b23be259c0f9259a49bbd6cb.tar.gz
eurephia-e17bbcdefb188500b23be259c0f9259a49bbd6cb.tar.xz
eurephia-e17bbcdefb188500b23be259c0f9259a49bbd6cb.zip
Moved eDBlink_getsym(...) out of eurephiadb.c and into eurephia_getsym.c. Renamed to eGetSym(...)
Diffstat (limited to 'eurephiadb.c')
-rw-r--r--eurephiadb.c57
1 files changed, 21 insertions, 36 deletions
diff --git a/eurephiadb.c b/eurephiadb.c
index e243c3a..99c5b91 100644
--- a/eurephiadb.c
+++ b/eurephiadb.c
@@ -28,30 +28,13 @@
#include "eurephiadb_driver.h"
#include "eurephia_log.h"
#include "eurephiadb_session.h"
+#include "eurephia_getsym.h"
#ifdef MEMWATCH
#include <memwatch.h>
#endif
-void *eDBlink_getsym(eurephiaCTX *ctx, const char *symnam)
-{
- void *func = NULL;
-
- if( ctx->fatal_error > 0 ) {
- return NULL;
- }
-
- eurephia_log(ctx, LOG_DEBUG, 13, "Locating eDBlink function '%s'", symnam);
- func = dlsym(ctx->eurephia_driver, symnam);
- if( func == NULL ) {
- eurephia_log(ctx, LOG_ERROR, 1, "Could not find needed '%s' function in eDBlink driver", symnam);
- ctx->fatal_error = 1;
- }
- return func;
-}
-
-
int eDBlink_close(eurephiaCTX *ctx)
{
if( ctx == NULL ) {
@@ -88,8 +71,8 @@ int eDBlink_init(eurephiaCTX *ctx, const char *dbl)
}
// Find mandatory functions containing driver information
- eDB_DriverVersion = eDBlink_getsym(ctx, "eDB_DriverVersion");
- eDB_DriverAPIVersion = eDBlink_getsym(ctx, "eDB_DriverAPIVersion");
+ eDB_DriverVersion = eGetSym(ctx, ctx->eurephia_driver, "eDB_DriverVersion");
+ eDB_DriverAPIVersion = eGetSym(ctx, ctx->eurephia_driver, "eDB_DriverAPIVersion");
eurephia_log(ctx, LOG_INFO, 1, "Driver loaded: %s (API version %i)",
eDB_DriverVersion(), eDB_DriverAPIVersion());
@@ -103,27 +86,29 @@ int eDBlink_init(eurephiaCTX *ctx, const char *dbl)
case 1:
// Setup eDBlink functions
- eDBconnect = eDBlink_getsym(ctx, "eDBconnect");
- eDBdisconnect = eDBlink_getsym(ctx, "eDBdisconnect");
+ eDBconnect = eGetSym(ctx, ctx->eurephia_driver, "eDBconnect");
+ eDBdisconnect = eGetSym(ctx, ctx->eurephia_driver, "eDBdisconnect");
- eDBauth_TLS = eDBlink_getsym(ctx, "eDBauth_TLS");
+ eDBauth_TLS = eGetSym(ctx, ctx->eurephia_driver, "eDBauth_TLS");
- eDBauth_user = eDBlink_getsym(ctx, "eDBauth_user");
- eDBget_uid = eDBlink_getsym(ctx, "eDBget_uid");
+ eDBauth_user = eGetSym(ctx, ctx->eurephia_driver, "eDBauth_user");
+ eDBget_uid = eGetSym(ctx, ctx->eurephia_driver, "eDBget_uid");
- eDBblacklist_check = eDBlink_getsym(ctx, "eDBblacklist_check");
- eDBregister_attempt = eDBlink_getsym(ctx, "eDBregister_attempt");
+ eDBblacklist_check = eGetSym(ctx, ctx->eurephia_driver, "eDBblacklist_check");
+ eDBregister_attempt = eGetSym(ctx, ctx->eurephia_driver, "eDBregister_attempt");
- eDBregister_login = eDBlink_getsym(ctx, "eDBregister_login");
- eDBregister_vpnmacaddr = eDBlink_getsym(ctx, "eDBregister_vpnmacaddr");
- eDBregister_logout = eDBlink_getsym(ctx, "eDBregister_logout");
+ eDBregister_login = eGetSym(ctx, ctx->eurephia_driver, "eDBregister_login");
+ eDBregister_vpnmacaddr = eGetSym(ctx, ctx->eurephia_driver, "eDBregister_vpnmacaddr");
+ eDBregister_logout = eGetSym(ctx, ctx->eurephia_driver, "eDBregister_logout");
- eDBget_sessionkey = eDBlink_getsym(ctx, "eDBget_sessionkey");
- eDBcheck_sessionkey_uniqueness = eDBlink_getsym(ctx, "eDBcheck_sessionkey_uniqueness");
- eDBregister_sessionkey = eDBlink_getsym(ctx, "eDBregister_sessionkey");
- eDBload_sessiondata = eDBlink_getsym(ctx, "eDBload_sessiondata");
- eDBstore_session_value = eDBlink_getsym(ctx, "eDBstore_session_value");
- eDBdestroy_session = eDBlink_getsym(ctx, "eDBdestroy_session");
+ eDBget_sessionkey = eGetSym(ctx, ctx->eurephia_driver, "eDBget_sessionkey");
+ eDBcheck_sessionkey_uniqueness = eGetSym(ctx, ctx->eurephia_driver,
+ "eDBcheck_sessionkey_uniqueness");
+
+ eDBregister_sessionkey = eGetSym(ctx, ctx->eurephia_driver, "eDBregister_sessionkey");
+ eDBload_sessiondata = eGetSym(ctx, ctx->eurephia_driver, "eDBload_sessiondata");
+ eDBstore_session_value = eGetSym(ctx, ctx->eurephia_driver, "eDBstore_session_value");
+ eDBdestroy_session = eGetSym(ctx, ctx->eurephia_driver, "eDBdestroy_session");
break;
}
if( ctx->fatal_error > 0 ) {