-
Notifications
You must be signed in to change notification settings - Fork 3
/
php_libvirt.h
118 lines (99 loc) · 3.43 KB
/
php_libvirt.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef PHP_LIBVIRT_H
#define PHP_LIBVIRT_H 1
#ifdef ZTS
#include "TSRM.h"
#endif
#include <libvirt/libvirt.h>
ZEND_BEGIN_MODULE_GLOBALS(libvirt)
char *last_error;
zend_bool longlong_to_string_ini;
ZEND_END_MODULE_GLOBALS(libvirt)
#ifdef ZTS
#define LIBVIRT_G(v) TSRMG(libvirt_globals_id, zend_libvirt_globals *, v)
#else
#define LIBVIRT_G(v) (libvirt_globals.v)
#endif
#define PHP_LIBVIRT_WORLD_VERSION "0.4"
#define PHP_LIBVIRT_WORLD_EXTNAME "libvirt"
typedef struct _php_libvirt_connection {
virConnectPtr conn;
long resource_id;
} php_libvirt_connection;
typedef struct _php_libvirt_domain {
virDomainPtr domain;
php_libvirt_connection* conn;
} php_libvirt_domain;
typedef struct _php_libvirt_storagepool {
virStoragePoolPtr pool;
} php_libvirt_storagepool;
typedef struct _php_libvirt_volume {
virStorageVolPtr volume;
} php_libvirt_volume;
typedef struct _php_libvirt_cred_value {
int count;
int type;
char *result;
unsigned int resultlen;
} php_libvirt_cred_value;
#define PHP_LIBVIRT_CONNECTION_RES_NAME "Libvirt connection"
#define PHP_LIBVIRT_DOMAIN_RES_NAME "Libvirt domain"
#define PHP_LIBVIRT_STORAGEPOOL_RES_NAME "Libvirt storagepool"
#define PHP_LIBVIRT_VOLUME_RES_NAME "Libvirt volume"
PHP_MINIT_FUNCTION(libvirt);
PHP_MSHUTDOWN_FUNCTION(libvirt);
PHP_RINIT_FUNCTION(libvirt);
PHP_RSHUTDOWN_FUNCTION(libvirt);
PHP_MINFO_FUNCTION(libvirt);
PHP_FUNCTION(libvirt_get_last_error);
PHP_FUNCTION(libvirt_connect);
PHP_FUNCTION(libvirt_get_hostname);
PHP_FUNCTION(libvirt_node_get_info);
PHP_FUNCTION(libvirt_get_active_domain_count);
PHP_FUNCTION(libvirt_get_inactive_domain_count);
PHP_FUNCTION(libvirt_get_domain_count);
PHP_FUNCTION(libvirt_domain_lookup_by_name);
PHP_FUNCTION(libvirt_domain_get_xml_desc);
PHP_FUNCTION(libvirt_domain_get_info);
PHP_FUNCTION(libvirt_list_domains);
PHP_FUNCTION(libvirt_domain_get_uuid);
PHP_FUNCTION(libvirt_domain_get_uuid_string);
PHP_FUNCTION(libvirt_domain_get_name);
PHP_FUNCTION(libvirt_list_active_domains);
PHP_FUNCTION(libvirt_list_defined_domains);
PHP_FUNCTION(libvirt_domain_get_id);
PHP_FUNCTION(libvirt_domain_lookup_by_id);
PHP_FUNCTION(libvirt_domain_lookup_by_uuid);
PHP_FUNCTION(libvirt_domain_lookup_by_uuid_string);
PHP_FUNCTION(libvirt_domain_destroy);
PHP_FUNCTION(libvirt_domain_create);
PHP_FUNCTION(libvirt_domain_resume);
PHP_FUNCTION(libvirt_domain_shutdown);
PHP_FUNCTION(libvirt_domain_suspend);
PHP_FUNCTION(libvirt_domain_undefine);
PHP_FUNCTION(libvirt_domain_reboot);
PHP_FUNCTION(libvirt_domain_define_xml);
PHP_FUNCTION(libvirt_domain_create_xml);
PHP_FUNCTION(libvirt_domain_memory_peek);
#if LIBVIR_VERSION_NUMBER>=7005
PHP_FUNCTION(libvirt_domain_memory_stats);
#endif
PHP_FUNCTION(libvirt_domain_block_stats);
PHP_FUNCTION(libvirt_domain_interface_stats);
PHP_FUNCTION(libvirt_version);
PHP_FUNCTION(libvirt_domain_get_connect);
PHP_FUNCTION(libvirt_domain_migrate);
#if LIBVIR_VERSION_NUMBER>=7007
PHP_FUNCTION(libvirt_domain_get_job_info);
#endif
PHP_FUNCTION(libvirt_domain_migrate_to_uri);
PHP_FUNCTION(libvirt_list_storagepools);
PHP_FUNCTION(libvirt_storagepool_lookup_by_name);
PHP_FUNCTION(libvirt_storagepool_list_volumes);
PHP_FUNCTION(libvirt_storagepool_get_info);
PHP_FUNCTION(libvirt_storagevolume_lookup_by_name);
PHP_FUNCTION(libvirt_storagevolume_get_info);
PHP_FUNCTION(libvirt_storagevolume_get_xml_desc);
PHP_FUNCTION(libvirt_storagevolume_create_xml);
extern zend_module_entry libvirt_module_entry;
#define phpext_libvirt_ptr &libvirt_module_entry
#endif