2007-03-15 17:30:04 +00:00
|
|
|
/*
|
2007-06-26 22:21:22 +00:00
|
|
|
* buf.h: buffers for libvirt
|
2007-03-15 17:30:04 +00:00
|
|
|
*
|
Eliminate all uses of virBufferAdd with string literals.
* Makefile.maint (sc_prohibit_virBufferAdd_with_string_literal):
New rule.
* src/buf.h (virBufferAddLit): Define.
* src/conf.c (virConfSaveValue): Use virBufferAddLit, in place
of virBufferAdd everywhere possible.
(virConfSaveEntry): Likewise.
* src/qemu_conf.c (qemudGenerateXML, qemudGenerateNetworkXML): Likewise.
* src/qemu_driver.c (qemudGetFeatures, qemudGetCapabilities): Likewise.
* src/test.c (testDomainDumpXML, testNetworkDumpXML): Likewise.
* src/xen_internal.c (xenHypervisorMakeCapabilitiesXML): Likewise.
* src/xend_internal.c (xend_parse_sexp_desc_os): Likewise.
(xend_parse_sexp_desc, sexpr_to_xend_topology_xml): Likewise.
* src/xm_internal.c (xenXMDomainFormatXML, xenXMDomainPinVcpu): Likewise.
* src/xml.c (virSaveCpuSet, virParseXenCpuTopology): Likewise.
(virDomainParseXMLGraphicsDescImage): Likewise.
(virDomainParseXMLGraphicsDescVFB, virDomainParseXMLOSDescHVM): Likewise.
(virDomainParseXMLOSDescPV, virDomainParseXMLDiskDesc): Likewise.
(virDomainParseXMLIfDesc, virDomainParseXMLDesc): Likewise.
2008-02-05 14:22:28 +00:00
|
|
|
* Copyright (C) 2005-2008 Red Hat, Inc.
|
2007-03-15 17:30:04 +00:00
|
|
|
*
|
|
|
|
* See COPYING.LIB for the License of this software
|
|
|
|
*
|
|
|
|
* Daniel Veillard <veillard@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2007-06-26 22:21:22 +00:00
|
|
|
#ifndef __VIR_BUFFER_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __VIR_BUFFER_H__
|
2007-03-15 17:30:04 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
2007-03-15 17:30:04 +00:00
|
|
|
|
|
|
|
/**
|
2007-06-26 22:21:22 +00:00
|
|
|
* virBuffer:
|
2007-03-15 17:30:04 +00:00
|
|
|
*
|
|
|
|
* A buffer structure.
|
|
|
|
*/
|
2007-06-26 22:21:22 +00:00
|
|
|
typedef struct _virBuffer virBuffer;
|
|
|
|
typedef virBuffer *virBufferPtr;
|
2008-04-28 15:14:59 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# ifndef __VIR_BUFFER_C__
|
|
|
|
# define VIR_BUFFER_INITIALIZER { 0, 0, 0, NULL }
|
2008-04-28 15:14:59 +00:00
|
|
|
|
|
|
|
/* This struct must be kept in syn with the real struct
|
|
|
|
in the buf.c impl file */
|
2007-06-26 22:21:22 +00:00
|
|
|
struct _virBuffer {
|
2008-04-28 15:14:59 +00:00
|
|
|
unsigned int a;
|
|
|
|
unsigned int b;
|
|
|
|
unsigned int c;
|
|
|
|
char *d;
|
2007-03-15 17:30:04 +00:00
|
|
|
};
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
2007-03-15 17:30:04 +00:00
|
|
|
|
2008-11-17 11:03:25 +00:00
|
|
|
char *virBufferContentAndReset(const virBufferPtr buf);
|
2009-12-09 23:00:50 +00:00
|
|
|
void virBufferFreeAndReset(const virBufferPtr buf);
|
2008-11-17 11:03:25 +00:00
|
|
|
int virBufferError(const virBufferPtr buf);
|
2008-04-28 15:14:59 +00:00
|
|
|
unsigned int virBufferUse(const virBufferPtr buf);
|
2008-11-17 11:03:25 +00:00
|
|
|
void virBufferAdd(const virBufferPtr buf, const char *str, int len);
|
|
|
|
void virBufferAddChar(const virBufferPtr buf, char c);
|
|
|
|
void virBufferVSprintf(const virBufferPtr buf, const char *format, ...)
|
Fix misc Win32 compile warnings
GCC >= 4.4 assumes the 'printf' attribute refers to the native
runtime libraries format specifiers. Thanks to gnulib, libvirt
has GNU format specifiers everywhere. This means we need to
use 'gnu_printf' with GCC >= 4.4 to get correct compiler
checking of printf format specifiers.
* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
driver on mingw32 builds
* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
src/logging.h, src/security.h, src/sexpr.h, src/util.h,
src/virterror_internal.h, src/xend_internal.c: Change
over to ATTRIBUTE_FMT_PRINTF.
* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
since they don't compile
* src/threads-win32.c: Add missing return value check
2009-07-23 15:07:32 +00:00
|
|
|
ATTRIBUTE_FMT_PRINTF(2, 3);
|
2009-11-06 09:39:13 +00:00
|
|
|
void virBufferStrcat(const virBufferPtr buf, ...)
|
|
|
|
ATTRIBUTE_SENTINEL;
|
2008-04-28 15:14:59 +00:00
|
|
|
void virBufferEscapeString(const virBufferPtr buf, const char *format, const char *str);
|
2010-11-19 15:51:57 +00:00
|
|
|
void virBufferEscapeSexpr(const virBufferPtr buf, const char *format, const char *str);
|
2008-04-28 15:14:59 +00:00
|
|
|
void virBufferURIEncodeString (const virBufferPtr buf, const char *str);
|
2007-03-15 17:30:04 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# define virBufferAddLit(buf_, literal_string_) \
|
2008-11-17 11:03:25 +00:00
|
|
|
virBufferAdd (buf_, "" literal_string_ "", sizeof literal_string_ - 1)
|
2008-04-28 15:14:59 +00:00
|
|
|
|
2007-06-26 22:21:22 +00:00
|
|
|
#endif /* __VIR_BUFFER_H__ */
|