summaryrefslogtreecommitdiff
path: root/source3/python/py_conv.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-11-07 01:12:24 +0000
committerTim Potter <tpot@samba.org>2002-11-07 01:12:24 +0000
commit3955716f90c317684093b43065c73167382137d4 (patch)
tree268de5b76a46687ab8e1549d0be185fde30475cb /source3/python/py_conv.c
parentab1cf8d1cf447e85063b43b65fa05c8b4bfde2a9 (diff)
downloadsamba-3955716f90c317684093b43065c73167382137d4.tar.gz
samba-3955716f90c317684093b43065c73167382137d4.tar.bz2
samba-3955716f90c317684093b43065c73167382137d4.zip
Sync up python stuff from HEAD.
(This used to be commit 92c76e16fa40adc6148b9c11b3e377f35c464975)
Diffstat (limited to 'source3/python/py_conv.c')
-rw-r--r--source3/python/py_conv.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/python/py_conv.c b/source3/python/py_conv.c
index 20302c83e8..04b4194824 100644
--- a/source3/python/py_conv.c
+++ b/source3/python/py_conv.c
@@ -182,3 +182,27 @@ done:
return result;
}
+
+/* Convert a NULL terminated list of NULL terminated unicode strings
+ to a list of (char *) strings */
+
+PyObject *from_unistr_list(uint16 *dependentfiles)
+{
+ PyObject *list;
+ int offset = 0;
+
+ list = PyList_New(0);
+
+ while (*(dependentfiles + offset) != 0) {
+ fstring name;
+ int len;
+
+ len = rpcstr_pull(name, dependentfiles + offset,
+ sizeof(fstring), -1, STR_TERMINATE);
+
+ offset += len / 2;
+ PyList_Append(list, PyString_FromString(name));
+ }
+
+ return list;
+}