summaryrefslogtreecommitdiffstats
path: root/libvir_wrap.h
blob: 31771d7826608bf9f0fe7a855141696bf189633d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * libvir_wrap.h: type wrappers for libvir python bindings
 *
 * Copyright (C) 2005 Red Hat, Inc.
 *
 * Daniel Veillard <veillard@redhat.com>
 */

#include <Python.h>
#include <libvir.h>

#ifdef __GNUC__
#ifdef ATTRIBUTE_UNUSED
#undef ATTRIBUTE_UNUSED
#endif
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif /* ATTRIBUTE_UNUSED */
#else
#define ATTRIBUTE_UNUSED
#endif

#define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \
	(((PyvirConnect_Object *)(v))->obj))

typedef struct {
    PyObject_HEAD
    virConnectPtr obj;
} PyvirConnect_Object;


#define PyvirDomain_Get(v) (((v) == Py_None) ? NULL : \
	(((PyvirDomain_Object *)(v))->obj))

typedef struct {
    PyObject_HEAD
    virDomainPtr obj;
} PyvirDomain_Object;


PyObject * libvir_intWrap(int val);
PyObject * libvir_longWrap(long val);
PyObject * libvir_charPtrWrap(char *str);
PyObject * libvir_constcharPtrWrap(const char *str);
PyObject * libvir_charPtrConstWrap(const char *str);
PyObject * libvir_virConnectPtrWrap(virConnectPtr node);
PyObject * libvir_virDomainPtrWrap(virDomainPtr node);