Add enum names for database drivers
authorMartin Willi <martin@revosec.ch>
Thu, 19 May 2011 15:21:31 +0000 (17:21 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 14 Oct 2011 08:04:45 +0000 (10:04 +0200)
src/libstrongswan/Android.mk
src/libstrongswan/Makefile.am
src/libstrongswan/database/database.c [new file with mode: 0644]
src/libstrongswan/database/database.h

index 4788c48..dbaa1cb 100644 (file)
@@ -47,8 +47,8 @@ credentials/sets/cert_cache.c credentials/sets/cert_cache.h \
 credentials/sets/mem_cred.c credentials/sets/mem_cred.h \
 credentials/sets/callback_cred.c credentials/sets/callback_cred.h \
 credentials/auth_cfg.c credentials/auth_cfg.h credentials/credential_set.h \
-credentials/cert_validator.h \
-database/database.h database/database_factory.h database/database_factory.c \
+credentials/cert_validator.h database/database.h database/database.c \
+database/database_factory.h database/database_factory.c \
 fetcher/fetcher.h fetcher/fetcher.c fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
 eap/eap.h eap/eap.c \
 pen/pen.h pen/pen.c \
index 3f75fbe..5739d15 100644 (file)
@@ -45,8 +45,8 @@ credentials/sets/cert_cache.c credentials/sets/cert_cache.h \
 credentials/sets/mem_cred.c credentials/sets/mem_cred.h \
 credentials/sets/callback_cred.c credentials/sets/callback_cred.h \
 credentials/auth_cfg.c credentials/auth_cfg.h credentials/credential_set.h \
-credentials/cert_validator.h \
-database/database.h database/database_factory.h database/database_factory.c \
+credentials/cert_validator.h database/database.h database/database.c \
+database/database_factory.h database/database_factory.c \
 fetcher/fetcher.h fetcher/fetcher.c fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
 eap/eap.h eap/eap.c \
 pen/pen.h pen/pen.c \
diff --git a/src/libstrongswan/database/database.c b/src/libstrongswan/database/database.c
new file mode 100644 (file)
index 0000000..60ef6cd
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2011 Martin Willi
+ * Copyright (C) 2011 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+#include "database.h"
+
+ENUM(db_driver_names, DB_ANY, DB_MYSQL,
+       "any",
+       "SQLite",
+       "MySQL",
+);
index 8df1c6f..dda29b5 100644 (file)
@@ -49,6 +49,8 @@ enum db_type_t {
  * Database implementation type.
  */
 enum db_driver_t {
+       /** matches to other databases */
+       DB_ANY = 0,
        /** SQLite database */
        DB_SQLITE,
        /** MySQL database */
@@ -56,6 +58,11 @@ enum db_driver_t {
 };
 
 /**
+ * Names for db_driver_t
+ */
+extern enum_name_t *db_driver_names;
+
+/**
  * Interface for a database implementation.
  *
  * @code