[Opendnssec-commits] [svn.opendnssec.org/svn/dnssec] r5435 - branches/OpenDNSSEC-adapters/signer/src/adapter

Matthijs Mekking matthijs at nlnetlabs.nl
Mon Aug 22 15:28:08 CEST 2011


Author: matthijs
Date: 2011-08-22 15:28:08 +0200 (Mon, 22 Aug 2011)
New Revision: 5435

Modified:
   branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.c
   branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.h
   branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.c
   branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.h
Log:
small file adapter init adjustments



Modified: branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.c
===================================================================
--- branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.c	2011-08-22 13:21:21 UTC (rev 5434)
+++ branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.c	2011-08-22 13:28:08 UTC (rev 5435)
@@ -51,22 +51,16 @@
 ods_status
 adapter_init(adapter_type* adapter)
 {
-    ods_log_assert(adapter);
-    ods_log_assert(adapter->type);
-    ods_log_assert(adapter->configstr);
-
-    switch(adapter->type) {
-        case ADAPTER_FILE:
-            return adfile_init();
-            break;
-        default:
-            ods_log_error("[%s] unable to initialize adapter: "
-                "unknown adapter", adapter_str);
-            return ODS_STATUS_ERR;
-            break;
+    if (adapter) {
+        switch(adapter->type) {
+            case ADAPTER_FILE:
+                return adfile_init(adapter->configstr);
+            default:
+                ods_log_error("[%s] unable to initialize adapter: "
+                    "unknown adapter", adapter_str);
+                return ODS_STATUS_ERR;
+        }
     }
-
-    /* not reached */
     return ODS_STATUS_ERR;
 }
 

Modified: branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.h
===================================================================
--- branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.h	2011-08-22 13:21:21 UTC (rev 5434)
+++ branches/OpenDNSSEC-adapters/signer/src/adapter/adapter.h	2011-08-22 13:28:08 UTC (rev 5435)
@@ -89,25 +89,25 @@
 
 /**
  * Compare adapters.
- * /param[in] a1 adapter 1
- * /param[in] a2 adapter 2
- * /return int 0 on equal, -1 if a1 < a2, 1 if a1 > a2
+ * \param[in] a1 adapter 1
+ * \param[in] a2 adapter 2
+ * \return int 0 on equal, -1 if a1 < a2, 1 if a1 > a2
  *
  */
 int adapter_compare(adapter_type* a1, adapter_type* a2);
 
 /**
  * Read zone from input adapter.
- * /param[in] zone zone
- * /return ods_status stats
+ * \param[in] zone zone
+ * \return ods_status stats
  *
  */
 ods_status adapter_read(struct zone_struct* zone);
 
 /**
  * Write zone to output adapter.
- * /param[in] zone zone
- * /return ods_status stats
+ * \param[in] zone zone
+ * \return ods_status stats
  *
  */
 ods_status adapter_write(struct zone_struct* zone);

Modified: branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.c
===================================================================
--- branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.c	2011-08-22 13:21:21 UTC (rev 5434)
+++ branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.c	2011-08-22 13:28:08 UTC (rev 5435)
@@ -55,9 +55,12 @@
  *
  */
 ods_status
-adfile_init(void)
+adfile_init(const char* configstr)
 {
-    /* nothing to initialize */
+    if (configstr) {
+        ods_log_warning("[%s] File Adapter init not implemented %s",
+            adapter_str);
+    }
     return ODS_STATUS_OK;
 }
 

Modified: branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.h
===================================================================
--- branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.h	2011-08-22 13:21:21 UTC (rev 5434)
+++ branches/OpenDNSSEC-adapters/signer/src/adapter/adfile.h	2011-08-22 13:28:08 UTC (rev 5435)
@@ -50,10 +50,11 @@
 
 /**
  * Initialize file adapters.
+ * \param[in] configstr init configuration file location
  * \return ods_status status
  *
  */
-ods_status adfile_init(void);
+ods_status adfile_init(const char* configstr);
 
 /**
  * Read zone from input file adapter.




More information about the Opendnssec-commits mailing list