* python/libvir.c: fixed a bug in the new wrapper
[libvirt-python/ericb.git] / libvirt_wrap.h
blob29b27eeed884a4c532fe30597bdbc88c44a4b259
1 /*
2 * libvirt_wrap.h: type wrappers for libvir python bindings
4 * Copyright (C) 2005 Red Hat, Inc.
6 * Daniel Veillard <veillard@redhat.com>
7 */
9 #include <Python.h>
10 #include <libvirt.h>
11 #include <virterror.h>
13 #ifdef __GNUC__
14 #ifdef ATTRIBUTE_UNUSED
15 #undef ATTRIBUTE_UNUSED
16 #endif
17 #ifndef ATTRIBUTE_UNUSED
18 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
19 #endif /* ATTRIBUTE_UNUSED */
20 #else
21 #define ATTRIBUTE_UNUSED
22 #endif
24 #define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \
25 (((PyvirConnect_Object *)(v))->obj))
27 typedef struct {
28 PyObject_HEAD
29 virConnectPtr obj;
30 } PyvirConnect_Object;
33 #define PyvirDomain_Get(v) (((v) == Py_None) ? NULL : \
34 (((PyvirDomain_Object *)(v))->obj))
36 typedef struct {
37 PyObject_HEAD
38 virDomainPtr obj;
39 } PyvirDomain_Object;
42 PyObject * libvirt_intWrap(int val);
43 PyObject * libvirt_longWrap(long val);
44 PyObject * libvirt_longlongWrap(long long val);
45 PyObject * libvirt_charPtrWrap(char *str);
46 PyObject * libvirt_constcharPtrWrap(const char *str);
47 PyObject * libvirt_charPtrConstWrap(const char *str);
48 PyObject * libvirt_virConnectPtrWrap(virConnectPtr node);
49 PyObject * libvirt_virDomainPtrWrap(virDomainPtr node);