From f4766f4900c87a82d49f39dadac56e74debef920 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 6 Nov 2002 23:34:12 +0000 Subject: Moved function to parse a list of unicode strings into util file. It's now used in parsing printer driver structures and the response from the enumprinterkey rpc. (This used to be commit acecee6f2bb92c4992078f4fe2dfae4414f43482) --- source3/python/py_conv.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/python/py_conv.c') 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; +} -- cgit