diff options
author | Guannan Ren <gren@redhat.com> | 2012-03-27 14:06:10 +0800 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-03-28 08:42:40 -0600 |
commit | db3debebf058b47328df47137b505e80b4adca08 (patch) | |
tree | 4056379c4d58623d0da013c45429c301eaa853f8 /typewrappers.h | |
parent | a8e031a749d4e67a27cb2004b7c50f0456ecc401 (diff) | |
download | libvirt-python-v6-db3debebf058b47328df47137b505e80b4adca08.tar.gz libvirt-python-v6-db3debebf058b47328df47137b505e80b4adca08.tar.xz libvirt-python-v6-db3debebf058b47328df47137b505e80b4adca08.zip |
python: Add new helper functions for python to C integral conversion
int libvirt_intUnwrap(PyObject *obj, int *val);
int libvirt_uintUnwrap(PyObject *obj, unsigned int *val);
int libvirt_longUnwrap(PyObject *obj, long *val);
int libvirt_ulongUnwrap(PyObject *obj, unsigned long *val);
int libvirt_longlongUnwrap(PyObject *obj, long long *val);
int libvirt_ulonglongUnwrap(PyObject *obj, unsigned long long *val);
int libvirt_doubleUnwrap(PyObject *obj, double *val);
int libvirt_boolUnwrap(PyObject *obj, bool *val);
Diffstat (limited to 'typewrappers.h')
-rw-r--r-- | typewrappers.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/typewrappers.h b/typewrappers.h index 1e34dfa..af68bce 100644 --- a/typewrappers.h +++ b/typewrappers.h @@ -7,6 +7,7 @@ */ #include <Python.h> +#include <stdbool.h> #include "libvirt/libvirt.h" #include "libvirt/virterror.h" @@ -163,6 +164,14 @@ PyObject * libvirt_ulonglongWrap(unsigned long long val); PyObject * libvirt_charPtrWrap(char *str); PyObject * libvirt_charPtrSizeWrap(char *str, Py_ssize_t size); PyObject * libvirt_constcharPtrWrap(const char *str); +int libvirt_intUnwrap(PyObject *obj, int *val); +int libvirt_uintUnwrap(PyObject *obj, unsigned int *val); +int libvirt_longUnwrap(PyObject *obj, long *val); +int libvirt_ulongUnwrap(PyObject *obj, unsigned long *val); +int libvirt_longlongUnwrap(PyObject *obj, long long *val); +int libvirt_ulonglongUnwrap(PyObject *obj, unsigned long long *val); +int libvirt_doubleUnwrap(PyObject *obj, double *val); +int libvirt_boolUnwrap(PyObject *obj, bool *val); PyObject * libvirt_virConnectPtrWrap(virConnectPtr node); PyObject * libvirt_virDomainPtrWrap(virDomainPtr node); PyObject * libvirt_virNetworkPtrWrap(virNetworkPtr node); |