* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_NSS_H
-# define LIBVIRT_NSS_H
+#pragma once
-# include <nss.h>
-# include <netdb.h>
+#include <nss.h>
+#include <netdb.h>
-# if !defined(LIBVIRT_NSS_GUEST)
-# define NSS_NAME(s) _nss_libvirt_##s##_r
-# else
-# define NSS_NAME(s) _nss_libvirt_guest_##s##_r
-# endif
+#if !defined(LIBVIRT_NSS_GUEST)
+# define NSS_NAME(s) _nss_libvirt_##s##_r
+#else
+# define NSS_NAME(s) _nss_libvirt_guest_##s##_r
+#endif
enum nss_status
NSS_NAME(gethostbyname)(const char *name, struct hostent *result,
NSS_NAME(gethostbyname3)(const char *name, int af, struct hostent *result,
char *buffer, size_t buflen, int *errnop,
int *herrnop, int32_t *ttlp, char **canonp);
-# ifdef HAVE_STRUCT_GAIH_ADDRTUPLE
+#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE
enum nss_status
NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
char *buffer, size_t buflen, int *errnop,
int *herrnop, int32_t *ttlp);
-# endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
+#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
-# if defined(HAVE_BSD_NSS)
+#if defined(HAVE_BSD_NSS)
ns_mtab*
nss_module_register(const char *name, unsigned int *size,
nss_module_unregister_fn *unregister);
-# endif /* HAVE_BSD_NSS */
-
-#endif /* LIBVIRT_NSS_H */
+#endif /* HAVE_BSD_NSS */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_COMPLETER_H
-# define LIBVIRT_VIRSH_COMPLETER_H
+#pragma once
-# include "vsh.h"
+#include "vsh.h"
char ** virshDomainNameCompleter(vshControl *ctl,
const vshCmd *cmd,
char ** virshDomainShutdownModeCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
-#endif /* LIBVIRT_VIRSH_COMPLETER_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_CONSOLE_H
-# define LIBVIRT_VIRSH_CONSOLE_H
+#pragma once
-# ifndef WIN32
+#ifndef WIN32
-# include <virsh.h>
+# include <virsh.h>
int virshRunConsole(vshControl *ctl,
virDomainPtr dom,
const char *dev_name,
unsigned int flags);
-# endif /* !WIN32 */
-
-#endif /* LIBVIRT_VIRSH_CONSOLE_H */
+#endif /* !WIN32 */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_DOMAIN_MONITOR_H
-# define LIBVIRT_VIRSH_DOMAIN_MONITOR_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
char *virshGetDomainDescription(vshControl *ctl, virDomainPtr dom,
bool title, unsigned int flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
extern const vshCmdDef domMonitoringCmds[];
-
-#endif /* LIBVIRT_VIRSH_DOMAIN_MONITOR_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_DOMAIN_H
-# define LIBVIRT_VIRSH_DOMAIN_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
struct virshDomainEventCallback {
const char *name;
extern virshDomainEventCallback virshDomainEventCallbacks[];
extern const vshCmdDef domManagementCmds[];
-
-#endif /* LIBVIRT_VIRSH_DOMAIN_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_HOST_H
-# define LIBVIRT_VIRSH_HOST_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
extern const vshCmdDef hostAndHypervisorCmds[];
-
-#endif /* LIBVIRT_VIRSH_HOST_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_INTERFACE_H
-# define LIBVIRT_VIRSH_INTERFACE_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
virInterfacePtr virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd,
const char *optname,
const char **name, unsigned int flags);
/* default is lookup by Name and MAC */
-# define virshCommandOptInterface(_ctl, _cmd, _name) \
+#define virshCommandOptInterface(_ctl, _cmd, _name) \
virshCommandOptInterfaceBy(_ctl, _cmd, NULL, _name, \
VIRSH_BYMAC | VIRSH_BYNAME)
extern const vshCmdDef ifaceCmds[];
-
-#endif /* LIBVIRT_VIRSH_INTERFACE_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_NETWORK_H
-# define LIBVIRT_VIRSH_NETWORK_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
virNetworkPtr
virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd,
const char **name);
/* default is lookup by Name and UUID */
-# define virshCommandOptNetwork(_ctl, _cmd, _name) \
+#define virshCommandOptNetwork(_ctl, _cmd, _name) \
virshCommandOptNetworkBy(_ctl, _cmd, _name, \
VIRSH_BYUUID | VIRSH_BYNAME)
extern virshNetworkEventCallback virshNetworkEventCallbacks[];
extern const vshCmdDef networkCmds[];
-
-#endif /* LIBVIRT_VIRSH_NETWORK_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_NODEDEV_H
-# define LIBVIRT_VIRSH_NODEDEV_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
struct virshNodedevEventCallback {
const char *name;
extern virshNodedevEventCallback virshNodedevEventCallbacks[];
extern const vshCmdDef nodedevCmds[];
-
-#endif /* LIBVIRT_VIRSH_NODEDEV_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_NWFILTER_H
-# define LIBVIRT_VIRSH_NWFILTER_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
virNWFilterPtr
virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd,
const char **name, unsigned int flags);
/* default is lookup by Name and UUID */
-# define virshCommandOptNWFilter(_ctl, _cmd, _name) \
+#define virshCommandOptNWFilter(_ctl, _cmd, _name) \
virshCommandOptNWFilterBy(_ctl, _cmd, _name, \
VIRSH_BYUUID | VIRSH_BYNAME)
/* default is lookup by port dev */
-# define virshCommandOptNWFilterBinding(_ctl, _cmd, _name) \
+#define virshCommandOptNWFilterBinding(_ctl, _cmd, _name) \
virshCommandOptNWFilterBindingBy(_ctl, _cmd, _name, 0)
extern const vshCmdDef nwfilterCmds[];
-
-#endif /* LIBVIRT_VIRSH_NWFILTER_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_POOL_H
-# define LIBVIRT_VIRSH_POOL_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
virStoragePoolPtr
virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
const char **name, unsigned int flags);
/* default is lookup by Name and UUID */
-# define virshCommandOptPool(_ctl, _cmd, _optname, _name) \
+#define virshCommandOptPool(_ctl, _cmd, _optname, _name) \
virshCommandOptPoolBy(_ctl, _cmd, _optname, _name, \
VIRSH_BYUUID | VIRSH_BYNAME)
extern virshPoolEventCallback virshPoolEventCallbacks[];
extern const vshCmdDef storagePoolCmds[];
-
-#endif /* LIBVIRT_VIRSH_POOL_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_SECRET_H
-# define LIBVIRT_VIRSH_SECRET_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
struct virshSecretEventCallback {
const char *name;
extern virshSecretEventCallback virshSecretEventCallbacks[];
extern const vshCmdDef secretCmds[];
-
-#endif /* LIBVIRT_VIRSH_SECRET_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_SNAPSHOT_H
-# define LIBVIRT_VIRSH_SNAPSHOT_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
extern const vshCmdDef snapshotCmds[];
-
-#endif /* LIBVIRT_VIRSH_SNAPSHOT_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_UTIL_H
-# define LIBVIRT_VIRSH_UTIL_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
-# include <libxml/parser.h>
-# include <libxml/xpath.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
virDomainPtr
virshLookupDomainBy(vshControl *ctl,
xmlXPathContextPtr *ctxt)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRSH_UTIL_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_VOLUME_H
-# define LIBVIRT_VIRSH_VOLUME_H
+#pragma once
-# include "virsh.h"
+#include "virsh.h"
virStorageVolPtr virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
const char *optname,
const char **name, unsigned int flags);
/* default is lookup by Name and UUID */
-# define virshCommandOptVol(_ctl, _cmd, _optname, _pooloptname, _name) \
+#define virshCommandOptVol(_ctl, _cmd, _optname, _pooloptname, _name) \
virshCommandOptVolBy(_ctl, _cmd, _optname, _pooloptname, _name, \
VIRSH_BYUUID | VIRSH_BYNAME)
extern const vshCmdDef storageVolCmds[];
-
-#endif /* LIBVIRT_VIRSH_VOLUME_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRSH_H
-# define LIBVIRT_VIRSH_H
+#pragma once
-# include <stdarg.h>
-# include <unistd.h>
-# include <sys/stat.h>
-# include <termios.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <termios.h>
-# include "internal.h"
-# include "virerror.h"
-# include "virthread.h"
-# include "virpolkit.h"
-# include "vsh.h"
-# include "virsh-completer.h"
+#include "internal.h"
+#include "virerror.h"
+#include "virthread.h"
+#include "virpolkit.h"
+#include "vsh.h"
+#include "virsh-completer.h"
-# define VIRSH_PROMPT_RW "virsh # "
-# define VIRSH_PROMPT_RO "virsh > "
+#define VIRSH_PROMPT_RW "virsh # "
+#define VIRSH_PROMPT_RO "virsh > "
-# define VIR_FROM_THIS VIR_FROM_NONE
+#define VIR_FROM_THIS VIR_FROM_NONE
/*
* Command group types
*/
-# define VIRSH_CMD_GRP_DOM_MANAGEMENT "Domain Management"
-# define VIRSH_CMD_GRP_DOM_MONITORING "Domain Monitoring"
-# define VIRSH_CMD_GRP_STORAGE_POOL "Storage Pool"
-# define VIRSH_CMD_GRP_STORAGE_VOL "Storage Volume"
-# define VIRSH_CMD_GRP_NETWORK "Networking"
-# define VIRSH_CMD_GRP_NODEDEV "Node Device"
-# define VIRSH_CMD_GRP_IFACE "Interface"
-# define VIRSH_CMD_GRP_NWFILTER "Network Filter"
-# define VIRSH_CMD_GRP_SECRET "Secret"
-# define VIRSH_CMD_GRP_SNAPSHOT "Snapshot"
-# define VIRSH_CMD_GRP_HOST_AND_HV "Host and Hypervisor"
-# define VIRSH_CMD_GRP_VIRSH "Virsh itself"
+#define VIRSH_CMD_GRP_DOM_MANAGEMENT "Domain Management"
+#define VIRSH_CMD_GRP_DOM_MONITORING "Domain Monitoring"
+#define VIRSH_CMD_GRP_STORAGE_POOL "Storage Pool"
+#define VIRSH_CMD_GRP_STORAGE_VOL "Storage Volume"
+#define VIRSH_CMD_GRP_NETWORK "Networking"
+#define VIRSH_CMD_GRP_NODEDEV "Node Device"
+#define VIRSH_CMD_GRP_IFACE "Interface"
+#define VIRSH_CMD_GRP_NWFILTER "Network Filter"
+#define VIRSH_CMD_GRP_SECRET "Secret"
+#define VIRSH_CMD_GRP_SNAPSHOT "Snapshot"
+#define VIRSH_CMD_GRP_HOST_AND_HV "Host and Hypervisor"
+#define VIRSH_CMD_GRP_VIRSH "Virsh itself"
/*
* Common command options
*/
-# define VIRSH_COMMON_OPT_POOL(_helpstr, cflags) \
+#define VIRSH_COMMON_OPT_POOL(_helpstr, cflags) \
{.name = "pool", \
.type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \
.completer_flags = cflags, \
}
-# define VIRSH_COMMON_OPT_DOMAIN(_helpstr, cflags) \
+#define VIRSH_COMMON_OPT_DOMAIN(_helpstr, cflags) \
{.name = "domain", \
.type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \
.completer_flags = cflags, \
}
-# define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
+#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
-# define VIRSH_COMMON_OPT_CONFIG(_helpstr) \
+#define VIRSH_COMMON_OPT_CONFIG(_helpstr) \
{.name = "config", \
.type = VSH_OT_BOOL, \
.help = _helpstr \
}
-# define VIRSH_COMMON_OPT_LIVE(_helpstr) \
+#define VIRSH_COMMON_OPT_LIVE(_helpstr) \
{.name = "live", \
.type = VSH_OT_BOOL, \
.help = _helpstr \
}
-# define VIRSH_COMMON_OPT_CURRENT(_helpstr) \
+#define VIRSH_COMMON_OPT_CURRENT(_helpstr) \
{.name = "current", \
.type = VSH_OT_BOOL, \
.help = _helpstr \
}
-# define VIRSH_COMMON_OPT_FILE(_helpstr) \
+#define VIRSH_COMMON_OPT_FILE(_helpstr) \
{.name = "file", \
.type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \
.help = _helpstr \
}
-# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, oflags, cflags) \
+#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, oflags, cflags) \
{.name = "domain", \
.type = VSH_OT_STRING, \
.flags = oflags, \
.completer_flags = cflags, \
}
-# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(oflags, cflags) \
+#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(oflags, cflags) \
VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), \
oflags, cflags)
-# define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \
+#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \
{.name = "domain", \
.type = VSH_OT_ARGV, \
.flags = VSH_OFLAG_NONE, \
.completer_flags = cflags, \
}
-# define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
+#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)
typedef struct _virshControl virshControl;
} virshLookupByFlags;
virConnectPtr virshConnect(vshControl *ctl, const char *uri, bool readonly);
-
-#endif /* LIBVIRT_VIRSH_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRT_ADMIN_COMPLETER_H
-# define LIBVIRT_VIRT_ADMIN_COMPLETER_H
+#pragma once
-# include "vsh.h"
+#include "vsh.h"
char **
vshAdmServerCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
-#endif /* LIBVIRT_VIRT_ADMIN_COMPLETER_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRT_ADMIN_H
-# define LIBVIRT_VIRT_ADMIN_H
+#pragma once
-# include "internal.h"
-# include "vsh.h"
+#include "internal.h"
+#include "vsh.h"
-# define VIR_FROM_THIS VIR_FROM_NONE
+#define VIR_FROM_THIS VIR_FROM_NONE
/*
* Command group types
virAdmConnectPtr conn; /* connection to a daemon's admin server */
bool wantReconnect;
};
-
-#endif /* LIBVIRT_VIRT_ADMIN_H */
*
*/
-#ifndef LIBVIRT_VIRT_HOST_VALIDATE_BHYVE_H
-# define LIBVIRT_VIRT_HOST_VALIDATE_BHYVE_H
+#pragma once
int virHostValidateBhyve(void);
-
-#endif /* LIBVIRT_VIRT_HOST_VALIDATE_BHYVE_H */
*
*/
-#ifndef LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H
-# define LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H
+#pragma once
-# include "internal.h"
-# include "virutil.h"
-# include "virbitmap.h"
-# include "virenum.h"
+#include "internal.h"
+#include "virutil.h"
+#include "virbitmap.h"
+#include "virenum.h"
typedef enum {
VIR_HOST_VALIDATE_FAIL,
int virHostValidateIOMMU(const char *hvname,
virHostValidateLevel level);
-
-#endif /* LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H */
*
*/
-#ifndef LIBVIRT_VIRT_HOST_VALIDATE_LXC_H
-# define LIBVIRT_VIRT_HOST_VALIDATE_LXC_H
+#pragma once
int virHostValidateLXC(void);
-
-#endif /* LIBVIRT_VIRT_HOST_VALIDATE_LXC_H */
*
*/
-#ifndef LIBVIRT_VIRT_HOST_VALIDATE_QEMU_H
-# define LIBVIRT_VIRT_HOST_VALIDATE_QEMU_H
+#pragma once
int virHostValidateQEMU(void);
-
-#endif /* LIBVIRT_VIRT_HOST_VALIDATE_QEMU_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VSH_TABLE_H
-# define LIBVIRT_VSH_TABLE_H
+#pragma once
-# include "vsh.h"
+#include "vsh.h"
typedef struct _vshTable vshTable;
typedef struct _vshTableRow vshTableRow;
int vshTableRowAppend(vshTablePtr table, const char *arg, ...);
void vshTablePrintToStdout(vshTablePtr table, vshControl *ctl);
char *vshTablePrintToString(vshTablePtr table, bool header);
-
-#endif /* LIBVIRT_VSH_TABLE_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VSH_H
-# define LIBVIRT_VSH_H
+#pragma once
-# include <stdarg.h>
-# include <unistd.h>
-# include <sys/stat.h>
-# include <termios.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <termios.h>
-# include "internal.h"
-# include "virerror.h"
-# include "virthread.h"
+#include "internal.h"
+#include "virerror.h"
+#include "virthread.h"
-# define VIR_FROM_THIS VIR_FROM_NONE
+#define VIR_FROM_THIS VIR_FROM_NONE
-# define GETTIMEOFDAY(T) gettimeofday(T, NULL)
-# define VSH_MAX_XML_FILE (10*1024*1024)
-# define VSH_MATCH(FLAG) (flags & (FLAG))
+#define GETTIMEOFDAY(T) gettimeofday(T, NULL)
+#define VSH_MAX_XML_FILE (10*1024*1024)
+#define VSH_MATCH(FLAG) (flags & (FLAG))
/**
* The log configuration
*/
-# define MSG_BUFFER 4096
-# define DIR_MODE (S_IWUSR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) /* 0755 */
-# define FILE_MODE (S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) /* 0644 */
-# define LOCK_MODE (S_IWUSR | S_IRUSR) /* 0600 */
-# define LVL_DEBUG "DEBUG"
-# define LVL_INFO "INFO"
-# define LVL_NOTICE "NOTICE"
-# define LVL_WARNING "WARNING"
-# define LVL_ERROR "ERROR"
+#define MSG_BUFFER 4096
+#define DIR_MODE (S_IWUSR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) /* 0755 */
+#define FILE_MODE (S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) /* 0644 */
+#define LOCK_MODE (S_IWUSR | S_IRUSR) /* 0600 */
+#define LVL_DEBUG "DEBUG"
+#define LVL_INFO "INFO"
+#define LVL_NOTICE "NOTICE"
+#define LVL_WARNING "WARNING"
+#define LVL_ERROR "ERROR"
/**
* vshErrorLevel:
VSH_ERR_ERROR
} vshErrorLevel;
-# define VSH_DEBUG_DEFAULT VSH_ERR_ERROR
+#define VSH_DEBUG_DEFAULT VSH_ERR_ERROR
/*
* virsh command line grammar:
int keepalive_interval; /* Client keepalive interval */
int keepalive_count; /* Client keepalive count */
-# ifndef WIN32
+#ifndef WIN32
struct termios termattr; /* settings of the tty terminal */
-# endif
+#endif
bool istty; /* is the terminal a tty */
const vshClientHooks *hooks;/* mandatory client specific hooks */
ATTRIBUTE_FMT_PRINTF(3, 4);
/* User visible sort, so we want locale-specific case comparison. */
-# define vshStrcasecmp(S1, S2) strcasecmp(S1, S2)
+#define vshStrcasecmp(S1, S2) strcasecmp(S1, S2)
int vshNameSorter(const void *a, const void *b);
virTypedParameterPtr vshFindTypedParamByName(const char *name,
bool cmdSelfTest(vshControl *ctl, const vshCmd *cmd);
bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
-# define VSH_CMD_CD \
+#define VSH_CMD_CD \
{ \
.name = "cd", \
.handler = cmdCd, \
.flags = VSH_CMD_FLAG_NOCONNECT \
}
-# define VSH_CMD_ECHO \
+#define VSH_CMD_ECHO \
{ \
.name = "echo", \
.handler = cmdEcho, \
.flags = VSH_CMD_FLAG_NOCONNECT \
}
-# define VSH_CMD_EXIT \
+#define VSH_CMD_EXIT \
{ \
.name = "exit", \
.handler = cmdQuit, \
.flags = VSH_CMD_FLAG_NOCONNECT \
}
-# define VSH_CMD_HELP \
+#define VSH_CMD_HELP \
{ \
.name = "help", \
.handler = cmdHelp, \
.flags = VSH_CMD_FLAG_NOCONNECT \
}
-# define VSH_CMD_PWD \
+#define VSH_CMD_PWD \
{ \
.name = "pwd", \
.handler = cmdPwd, \
.flags = VSH_CMD_FLAG_NOCONNECT \
}
-# define VSH_CMD_QUIT \
+#define VSH_CMD_QUIT \
{ \
.name = "quit", \
.handler = cmdQuit, \
.flags = VSH_CMD_FLAG_NOCONNECT \
}
-# define VSH_CMD_SELF_TEST \
+#define VSH_CMD_SELF_TEST \
{ \
.name = "self-test", \
.handler = cmdSelfTest, \
.alias = "self-test" \
}
-# define VSH_CMD_COMPLETE \
+#define VSH_CMD_COMPLETE \
{ \
.name = "complete", \
.handler = cmdComplete, \
/* allocation wrappers */
void *_vshMalloc(vshControl *ctl, size_t sz, const char *filename, int line);
-# define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__)
+#define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__)
void *_vshCalloc(vshControl *ctl, size_t nmemb, size_t sz,
const char *filename, int line);
-# define vshCalloc(_ctl, _nmemb, _sz) \
+#define vshCalloc(_ctl, _nmemb, _sz) \
_vshCalloc(_ctl, _nmemb, _sz, __FILE__, __LINE__)
char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
int line);
-# define vshStrdup(_ctl, _s) _vshStrdup(_ctl, _s, __FILE__, __LINE__)
+#define vshStrdup(_ctl, _s) _vshStrdup(_ctl, _s, __FILE__, __LINE__)
/* Macros to help dealing with mutually exclusive options. */
* This helper does an early return and therefore it has to be called
* before anything that would require cleanup.
*/
-# define VSH_EXCLUSIVE_OPTIONS_EXPR(NAME1, EXPR1, NAME2, EXPR2) \
+#define VSH_EXCLUSIVE_OPTIONS_EXPR(NAME1, EXPR1, NAME2, EXPR2) \
if ((EXPR1) && (EXPR2)) { \
vshError(ctl, _("Options --%s and --%s are mutually exclusive"), \
NAME1, NAME2); \
* This helper does an early return and therefore it has to be called
* before anything that would require cleanup.
*/
-# define VSH_EXCLUSIVE_OPTIONS(NAME1, NAME2) \
+#define VSH_EXCLUSIVE_OPTIONS(NAME1, NAME2) \
VSH_EXCLUSIVE_OPTIONS_EXPR(NAME1, vshCommandOptBool(cmd, NAME1), \
NAME2, vshCommandOptBool(cmd, NAME2))
* This helper does an early return and therefore it has to be called
* before anything that would require cleanup.
*/
-# define VSH_EXCLUSIVE_OPTIONS_VAR(VARNAME1, VARNAME2) \
+#define VSH_EXCLUSIVE_OPTIONS_VAR(VARNAME1, VARNAME2) \
VSH_EXCLUSIVE_OPTIONS_EXPR(#VARNAME1, VARNAME1, #VARNAME2, VARNAME2)
/* Macros to help dealing with required options. */
* This helper does an early return and therefore it has to be called
* before anything that would require cleanup.
*/
-# define VSH_REQUIRE_OPTION_EXPR(NAME1, EXPR1, NAME2, EXPR2) \
+#define VSH_REQUIRE_OPTION_EXPR(NAME1, EXPR1, NAME2, EXPR2) \
do { \
if ((EXPR1) && !(EXPR2)) { \
vshError(ctl, _("Option --%s is required by option --%s"), \
* This helper does an early return and therefore it has to be called
* before anything that would require cleanup.
*/
-# define VSH_REQUIRE_OPTION(NAME1, NAME2) \
+#define VSH_REQUIRE_OPTION(NAME1, NAME2) \
VSH_REQUIRE_OPTION_EXPR(NAME1, vshCommandOptBool(cmd, NAME1), \
NAME2, vshCommandOptBool(cmd, NAME2))
* This helper does an early return and therefore it has to be called
* before anything that would require cleanup.
*/
-# define VSH_REQUIRE_OPTION_VAR(VARNAME1, VARNAME2) \
+#define VSH_REQUIRE_OPTION_VAR(VARNAME1, VARNAME2) \
VSH_REQUIRE_OPTION_EXPR(#VARNAME1, VARNAME1, #VARNAME2, VARNAME2)
-
-#endif /* LIBVIRT_VSH_H */
* <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_PACKET_LIBVIRT_H
-# define LIBVIRT_PACKET_LIBVIRT_H
+#pragma once
void proto_register_libvirt(void);
void proto_reg_handoff_libvirt(void);
-
-#endif /* LIBVIRT_PACKET_LIBVIRT_H */