r14879: Fix bug unpacking ldb_messages.
authorTim Potter <tpot@samba.org>
Mon, 3 Apr 2006 08:25:03 +0000 (08:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:00:11 +0000 (14:00 -0500)
Start decoding more of ldb_message and ldb_message_result.
(This used to be commit 60f7f14baa7ff212138ac2349b94d56918566f73)

source4/scripting/swig/ldb.i

index f7c3b5d70972b926fbaba01a91f432870fb73d50..12053d6ac997fe7a73a75276894285a66e25b19e 100644 (file)
@@ -113,12 +113,23 @@ enum ldb_scope {LDB_SCOPE_DEFAULT=-1,
        resultobj = PyList_New((*$1)->count);
 
        for (i = 0; i < (*$1)->count; i++) {
-               PyList_SetItem(resultobj, i, SWIG_NewPointerObj(*$1, SWIGTYPE_p_ldb_message, 0));
+               PyList_SetItem(resultobj, i, SWIG_NewPointerObj((*$1)->msgs[i], SWIGTYPE_p_ldb_message, 0));
        }
 }      
 
 %types(struct ldb_result *);
 
+%typemap(out) struct ldb_dn * {
+       $result = PyString_FromString(ldb_dn_linearize($1, $1));
+}
+
+struct ldb_message_element {
+       unsigned int flags;
+       const char *name;
+       unsigned int num_values;
+       struct ldb_val *values;
+};
+
 struct ldb_message {
        struct ldb_dn *dn;
        unsigned int num_elements;