mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
esx: Gather some XML generation macros in esx_vi.h
This commit is contained in:
parent
7a056d0648
commit
3f52921d43
@ -38,38 +38,13 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
||||
|
||||
#define ESX_VI__SOAP__REQUEST_HEADER \
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
|
||||
"<soapenv:Envelope " \
|
||||
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " \
|
||||
"xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" " \
|
||||
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " \
|
||||
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" \
|
||||
"<soapenv:Body>"
|
||||
|
||||
#define ESX_VI__SOAP__REQUEST_FOOTER \
|
||||
"</soapenv:Body>" \
|
||||
"</soapenv:Envelope>"
|
||||
|
||||
#define ESX_VI__SOAP__RESPONSE_XPATH(_type) \
|
||||
((char *)"/soapenv:Envelope/soapenv:Body/" \
|
||||
"vim:"_type"Response/vim:returnval")
|
||||
|
||||
#define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \
|
||||
do { \
|
||||
virBufferAddLit(_buffer, "<"); \
|
||||
virBufferAdd(_buffer, _element, -1); \
|
||||
virBufferAddLit(_buffer, " xmlns=\"urn:vim25\" xsi:type=\""); \
|
||||
virBufferAdd(_buffer, _type, -1); \
|
||||
virBufferAddLit(_buffer, "\">"); \
|
||||
} while (0)
|
||||
|
||||
#define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \
|
||||
do { \
|
||||
virBufferAddLit(_buffer, "</"); \
|
||||
virBufferAdd(_buffer, _element, -1); \
|
||||
virBufferAddLit(_buffer, ">"); \
|
||||
} while (0)
|
||||
|
||||
#define ESX_VI__TEMPLATE__ALLOC(_type) \
|
||||
int \
|
||||
@ -78,6 +53,8 @@
|
||||
return esxVI_Alloc((void **)ptrptr, sizeof(esxVI_##_type)); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__FREE(_type, _body) \
|
||||
void \
|
||||
esxVI_##_type##_Free(esxVI_##_type **ptrptr) \
|
||||
|
@ -40,6 +40,43 @@
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__SOAP__REQUEST_HEADER \
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
|
||||
"<soapenv:Envelope\n" \
|
||||
" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" \
|
||||
" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n" \
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" \
|
||||
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" \
|
||||
"<soapenv:Body>\n"
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__SOAP__REQUEST_FOOTER \
|
||||
"</soapenv:Body>\n" \
|
||||
"</soapenv:Envelope>"
|
||||
|
||||
|
||||
|
||||
#define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \
|
||||
do { \
|
||||
virBufferAddLit(_buffer, "<"); \
|
||||
virBufferAdd(_buffer, _element, -1); \
|
||||
virBufferAddLit(_buffer, " xmlns=\"urn:vim25\" xsi:type=\""); \
|
||||
virBufferAdd(_buffer, _type, -1); \
|
||||
virBufferAddLit(_buffer, "\">"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
#define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \
|
||||
do { \
|
||||
virBufferAddLit(_buffer, "</"); \
|
||||
virBufferAdd(_buffer, _element, -1); \
|
||||
virBufferAddLit(_buffer, ">"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
typedef enum _esxVI_APIVersion esxVI_APIVersion;
|
||||
typedef enum _esxVI_ProductVersion esxVI_ProductVersion;
|
||||
typedef enum _esxVI_Occurrence esxVI_Occurrence;
|
||||
|
@ -34,23 +34,6 @@
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__SOAP__REQUEST_HEADER \
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
|
||||
"<soapenv:Envelope " \
|
||||
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " \
|
||||
"xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" " \
|
||||
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " \
|
||||
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" \
|
||||
"<soapenv:Body>"
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__SOAP__REQUEST_FOOTER \
|
||||
"</soapenv:Body>" \
|
||||
"</soapenv:Envelope>"
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__METHOD__CHECK_OUTPUT__None \
|
||||
/* nothing */
|
||||
|
||||
|
@ -39,26 +39,6 @@
|
||||
|
||||
|
||||
|
||||
#define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \
|
||||
do { \
|
||||
virBufferAddLit(_buffer, "<"); \
|
||||
virBufferAdd(_buffer, _element, -1); \
|
||||
virBufferAddLit(_buffer, " xmlns=\"urn:vim25\" xsi:type=\""); \
|
||||
virBufferAdd(_buffer, _type, -1); \
|
||||
virBufferAddLit(_buffer, "\">"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
#define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \
|
||||
do { \
|
||||
virBufferAddLit(_buffer, "</"); \
|
||||
virBufferAdd(_buffer, _element, -1); \
|
||||
virBufferAddLit(_buffer, ">"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__ALLOC(__type) \
|
||||
int \
|
||||
esxVI_##__type##_Alloc(esxVI_##__type **ptrptr) \
|
||||
|
Loading…
Reference in New Issue
Block a user