diff options
Diffstat (limited to 'typewrappers.c')
-rw-r--r-- | typewrappers.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/typewrappers.c b/typewrappers.c index e39d3cd..b5758b4 100644 --- a/typewrappers.c +++ b/typewrappers.c @@ -77,6 +77,20 @@ libvirt_ulonglongWrap(unsigned long long val) } PyObject * +libvirt_charPtrSizeWrap(char *str, Py_ssize_t size) +{ + PyObject *ret; + + if (str == NULL) { + Py_INCREF(Py_None); + return (Py_None); + } + ret = PyString_FromStringAndSize(str, size); + free(str); + return (ret); +} + +PyObject * libvirt_charPtrWrap(char *str) { PyObject *ret; |