1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-28 11:42:03 +03:00

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 acecee6f2b)
This commit is contained in:
Tim Potter
2002-11-06 23:34:12 +00:00
parent 6ae9de8f39
commit f4766f4900
2 changed files with 26 additions and 26 deletions

View File

@ -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;
}