]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2379] Add separate initializer for NameComparisonResult type
authorJelte Jansen <jelte@isc.org>
Mon, 17 Dec 2012 13:57:52 +0000 (14:57 +0100)
committerJelte Jansen <jelte@isc.org>
Mon, 17 Dec 2012 13:57:52 +0000 (14:57 +0100)
src/lib/dns/python/pydnspp.cc

index a58b9d276c5722a41436e487c96f0f81b0feede4..443a21a818304d37889f7938290e99e924923d6d 100644 (file)
@@ -187,11 +187,7 @@ initModulePart_MessageRenderer(PyObject* mod) {
 }
 
 bool
-initModulePart_Name(PyObject* mod) {
-
-    //
-    // NameComparisonResult
-    //
+initModulePart_NameComparisonResult(PyObject* mod) {
     if (!initClass(name_comparison_result_type,
                    "NameComparisonResult", mod)) {
         return (false);
@@ -215,10 +211,11 @@ initModulePart_Name(PyObject* mod) {
     addClassVariable(name_comparison_result_type, "COMMONANCESTOR",
                      Py_BuildValue("I", NameComparisonResult::COMMONANCESTOR));
 
+    return (true);
+}
 
-    //
-    // Name
-    //
+bool
+initModulePart_Name(PyObject* mod) {
     if (!initClass(name_type, "Name", mod)) {
         return (false);
     }
@@ -240,8 +237,6 @@ initModulePart_Name(PyObject* mod) {
     addClassVariable(name_type, "ROOT_NAME",
                      createNameObject(Name::ROOT_NAME()));
 
-
-
     // Add the exceptions to the module
     try {
         po_EmptyLabel = PyErr_NewException("pydnspp.EmptyLabel", NULL, NULL);
@@ -785,6 +780,10 @@ PyInit_pydnspp(void) {
 
     // for each part included above, we call its specific initializer
 
+    if (!initModulePart_NameComparisonResult(mod)) {
+        return (NULL);
+    }
+
     if (!initModulePart_Name(mod)) {
         return (NULL);
     }