* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSTRING_H
-# define LIBVIRT_VIRSTRING_H
+#pragma once
-# include <stdarg.h>
+#include <stdarg.h>
-# include "internal.h"
+#include "internal.h"
char **virStringSplitCount(const char *string,
const char *delim,
ATTRIBUTE_RETURN_CHECK;
int virStrcpy(char *dest, const char *src, size_t destbytes)
ATTRIBUTE_RETURN_CHECK;
-# define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest))
+#define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest))
/* Don't call these directly - use the macros below */
int virStrdup(char **dest, const char *src, bool report, int domcode,
* Returns -1 on failure (with OOM error reported), 0 if @src was NULL,
* 1 if @src was copied
*/
-# define VIR_STRDUP(dst, src) virStrdup(&(dst), src, true, VIR_FROM_THIS, \
- __FILE__, __FUNCTION__, __LINE__)
+#define VIR_STRDUP(dst, src) virStrdup(&(dst), src, true, VIR_FROM_THIS, \
+ __FILE__, __FUNCTION__, __LINE__)
/**
* VIR_STRDUP_QUIET:
*
* Returns -1 on failure, 0 if @src was NULL, 1 if @src was copied
*/
-# define VIR_STRDUP_QUIET(dst, src) virStrdup(&(dst), src, false, 0, NULL, NULL, 0)
+#define VIR_STRDUP_QUIET(dst, src) virStrdup(&(dst), src, false, 0, NULL, NULL, 0)
/**
* VIR_STRNDUP:
* Returns -1 on failure (with OOM error reported), 0 if @src was NULL,
* 1 if @src was copied
*/
-# define VIR_STRNDUP(dst, src, n) virStrndup(&(dst), src, n, true, \
- VIR_FROM_THIS, __FILE__, \
- __FUNCTION__, __LINE__)
+#define VIR_STRNDUP(dst, src, n) virStrndup(&(dst), src, n, true, \
+ VIR_FROM_THIS, __FILE__, \
+ __FUNCTION__, __LINE__)
/**
* VIR_STRNDUP_QUIET:
*
* Returns -1 on failure, 0 if @src was NULL, 1 if @src was copied
*/
-# define VIR_STRNDUP_QUIET(dst, src, n) virStrndup(&(dst), src, n, false, \
- 0, NULL, NULL, 0)
+#define VIR_STRNDUP_QUIET(dst, src, n) virStrndup(&(dst), src, n, false, \
+ 0, NULL, NULL, 0)
size_t virStringListLength(const char * const *strings);
* Returns -1 on failure (with OOM error reported), number of bytes printed
* on success.
*/
-# define virVasprintf(strp, fmt, list) \
+#define virVasprintf(strp, fmt, list) \
virVasprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, \
__LINE__, strp, fmt, list)
*
* Returns -1 on failure, number of bytes printed on success.
*/
-# define virVasprintfQuiet(strp, fmt, list) \
+#define virVasprintfQuiet(strp, fmt, list) \
virVasprintfInternal(false, 0, NULL, NULL, 0, strp, fmt, list)
/**
* on success.
*/
-# define virAsprintf(strp, ...) \
+#define virAsprintf(strp, ...) \
virAsprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__, \
strp, __VA_ARGS__)
* Returns -1 on failure, number of bytes printed on success.
*/
-# define virAsprintfQuiet(strp, ...) \
+#define virAsprintfQuiet(strp, ...) \
virAsprintfInternal(false, 0, NULL, NULL, 0, \
strp, __VA_ARGS__)
* Declares a NULL-terminated list of strings which will be automatically freed
* when the pointer goes out of scope.
*/
-# define VIR_AUTOSTRINGLIST \
+#define VIR_AUTOSTRINGLIST \
__attribute__((cleanup(virStringListAutoFree))) char **
-
-#endif /* LIBVIRT_VIRSTRING_H */