]> xenbits.xensource.com Git - libvirt.git/commitdiff
tools: use #pragma once in headers
authorJonathon Jongsma <jjongsma@redhat.com>
Tue, 18 Jun 2019 16:13:15 +0000 (11:13 -0500)
committerJán Tomko <jtomko@redhat.com>
Wed, 19 Jun 2019 15:12:34 +0000 (17:12 +0200)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
25 files changed:
tools/nss/libvirt_nss.h
tools/virsh-completer.h
tools/virsh-console.h
tools/virsh-domain-monitor.h
tools/virsh-domain.h
tools/virsh-host.h
tools/virsh-interface.h
tools/virsh-network.h
tools/virsh-nodedev.h
tools/virsh-nwfilter.h
tools/virsh-pool.h
tools/virsh-secret.h
tools/virsh-snapshot.h
tools/virsh-util.h
tools/virsh-volume.h
tools/virsh.h
tools/virt-admin-completer.h
tools/virt-admin.h
tools/virt-host-validate-bhyve.h
tools/virt-host-validate-common.h
tools/virt-host-validate-lxc.h
tools/virt-host-validate-qemu.h
tools/vsh-table.h
tools/vsh.h
tools/wireshark/src/packet-libvirt.h

index 4c7525a0d034285554594efa72d7764744880e0e..75a2e4fd93e893cdd700ff4fbff6158a204e0b73 100644 (file)
  * <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,
@@ -48,17 +47,15 @@ enum nss_status
 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 */
index cd3cc9ecae227d133020be93b4a7f57d8fde8864..9b3951f4fdbe1a43d50b3829922c236d78b51774 100644 (file)
  * <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,
@@ -118,4 +117,3 @@ char ** virshCellnoCompleter(vshControl *ctl,
 char ** virshDomainShutdownModeCompleter(vshControl *ctl,
                                          const vshCmd *cmd,
                                          unsigned int flags);
-#endif /* LIBVIRT_VIRSH_COMPLETER_H */
index bc1a70b5180823118a28038905dd2aa10564bf1e..e89484d24bf4cbd9f54a56cb53ab2eaad7695213 100644 (file)
  * <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 */
index d24e0bbd40e7d85319b18dce622dd139fc1da529..77e83502db49a1f46e21b1cdef26c05caa8c8b21 100644 (file)
  * <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 */
index 119d4422a12a4a9f1473b93b07ff32adcf6f004d..02996d51b1d54c9f5339460ffa4238a4235afddb 100644 (file)
  * <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;
@@ -32,5 +31,3 @@ typedef struct virshDomainEventCallback virshDomainEventCallback;
 extern virshDomainEventCallback virshDomainEventCallbacks[];
 
 extern const vshCmdDef domManagementCmds[];
-
-#endif /* LIBVIRT_VIRSH_DOMAIN_H */
index 395e39cd577ff9475651b3d3f87d8e6830f58a94..f4c2aa316da6f15f7c3316cda24443a4f749c220 100644 (file)
  * <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 */
index e110e3a8e2f35cac39e9fed23ae8db8ad3c3c995..ad7bf36ab4fc37d8e3ec47c5d47d3be4f78531a1 100644 (file)
  * <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 */
index 18b8e4365f8cc07e0d2a6f6b505e84db0f281d94..3c786dd7a194a07301eaab22fbdab93744d0caad 100644 (file)
  * <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,
@@ -33,7 +32,7 @@ virshCommandOptNetworkPort(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)
 
@@ -46,5 +45,3 @@ typedef struct virshNetworkEventCallback virshNetworkEventCallback;
 extern virshNetworkEventCallback virshNetworkEventCallbacks[];
 
 extern const vshCmdDef networkCmds[];
-
-#endif /* LIBVIRT_VIRSH_NETWORK_H */
index e58eedf6ea0551d0d43d0c4cd985fe3ca66d1d40..9691b0db4d422fc8ddcb297a1a43d51a6f370437 100644 (file)
  * <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;
@@ -32,5 +31,3 @@ typedef struct virshNodedevEventCallback virshNodedevEventCallback;
 extern virshNodedevEventCallback virshNodedevEventCallbacks[];
 
 extern const vshCmdDef nodedevCmds[];
-
-#endif /* LIBVIRT_VIRSH_NODEDEV_H */
index 2ac9bdff7f4ec55b401ac70be9f01ed61b02cb8f..e29a8903e5f5083f7606f5b140108ad2b6bb80d9 100644 (file)
  * <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,
@@ -32,14 +31,12 @@ virshCommandOptNWFilterBindingBy(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 */
index 458e843d3c388000c380442161e544a8864105d7..219f0eea42044f6714eb86a2ef548fe13daae082 100644 (file)
  * <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)
 
@@ -41,5 +40,3 @@ typedef struct virshPoolEventCallback virshPoolEventCallback;
 extern virshPoolEventCallback virshPoolEventCallbacks[];
 
 extern const vshCmdDef storagePoolCmds[];
-
-#endif /* LIBVIRT_VIRSH_POOL_H */
index 71271f7c8021e09e730674827620775061112795..6ebe573f8726e6a7f7374995a1024f2089a3c380 100644 (file)
  * <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;
@@ -32,5 +31,3 @@ typedef struct virshSecretEventCallback virshSecretEventCallback;
 extern virshSecretEventCallback virshSecretEventCallbacks[];
 
 extern const vshCmdDef secretCmds[];
-
-#endif /* LIBVIRT_VIRSH_SECRET_H */
index c9e706ded62a59a50bf510b93dff0aea17ba73fd..49517a423595299e9637892533726e2fde8ae2cc 100644 (file)
  * <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 */
index fb2ed277aff3e35caf439ceecb6914e25994a323..55520302ff5be8bb08f005f55bc1bd46be569d95 100644 (file)
  * <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,
@@ -103,5 +102,3 @@ virshDomainGetXML(vshControl *ctl,
                   xmlXPathContextPtr *ctxt)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
     ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRSH_UTIL_H */
index 66cf9cfa548912c36be1c2f0607dc6709bcd41bb..15cab0fd8c611bbea1e8f9ec80cac833fbd77ff5 100644 (file)
  * <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,
@@ -29,10 +28,8 @@ virStorageVolPtr virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
                                       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 */
index 254ce3289e51b7d637c5956cf66cde1417bf4280..847ed251512253dceb7213033c1e505036ec3350 100644 (file)
  * <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, \
@@ -66,7 +65,7 @@
      .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;
@@ -171,5 +170,3 @@ typedef enum {
 } virshLookupByFlags;
 
 virConnectPtr virshConnect(vshControl *ctl, const char *uri, bool readonly);
-
-#endif /* LIBVIRT_VIRSH_H */
index a0b09f1ec90e74648d8f8f6cce87294443e08a1e..b6f68ce205890acfb6901344aa6fad4fb1f8444b 100644 (file)
  * <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 */
index a58bb7bef2b2dd0fe7626d7f8277906e4c281d4f..9f9fdc503d58702a62885c9137de5a6869229d7f 100644 (file)
  * <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
@@ -40,5 +39,3 @@ struct _vshAdmControl {
     virAdmConnectPtr conn;      /* connection to a daemon's admin server */
     bool wantReconnect;
 };
-
-#endif /* LIBVIRT_VIRT_ADMIN_H */
index c9a3f2b5b4690aa9ed72dc88d756e5016ac4cd5a..a5fd22c8717012b72e2813f435d91821237b2796 100644 (file)
@@ -19,9 +19,6 @@
  *
  */
 
-#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 */
index 94a5005d5de360a99f599fc1e42bf3e269dbb002..c4e4fa2175886760c0d167bdbf41d2d9d97f8835 100644 (file)
  *
  */
 
-#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,
@@ -84,5 +83,3 @@ int virHostValidateCGroupControllers(const char *hvname,
 
 int virHostValidateIOMMU(const char *hvname,
                          virHostValidateLevel level);
-
-#endif /* LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H */
index b8d3dd8eb04ef69d2a1f81b9b1f13301052b75a0..fefab175527f35c27b40be2e0612df4fd1f2da55 100644 (file)
@@ -19,9 +19,6 @@
  *
  */
 
-#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 */
index 031029dd61c32fdb404778cccdb0f5787a1833ea..ddb86aa52c320e8ed1443c2b56eaea740ef9fbfb 100644 (file)
@@ -19,9 +19,6 @@
  *
  */
 
-#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 */
index e5b8a9f48030e39c5040a1f890ca1ca4533ff7f3..ef0042ffcc55ab4490e73b8dc3ef4bae16a35a95 100644 (file)
  * <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;
@@ -33,5 +32,3 @@ vshTablePtr vshTableNew(const char *format, ...);
 int vshTableRowAppend(vshTablePtr table, const char *arg, ...);
 void vshTablePrintToStdout(vshTablePtr table, vshControl *ctl);
 char *vshTablePrintToString(vshTablePtr table, bool header);
-
-#endif /* LIBVIRT_VSH_TABLE_H */
index 68fbe0a1f20391d274ec1a95d40ea2a2955651d9..4e02bb177dffbb363a2817f5367be8de321aba85 100644 (file)
  * <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:
@@ -62,7 +61,7 @@ typedef enum {
     VSH_ERR_ERROR
 } vshErrorLevel;
 
-# define VSH_DEBUG_DEFAULT VSH_ERR_ERROR
+#define VSH_DEBUG_DEFAULT VSH_ERR_ERROR
 
 /*
  * virsh command line grammar:
@@ -218,9 +217,9 @@ struct _vshControl {
     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 */
@@ -313,7 +312,7 @@ void vshDebug(vshControl *ctl, int level, const char *format, ...)
     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,
@@ -386,7 +385,7 @@ bool cmdQuit(vshControl *ctl, const vshCmd *cmd);
 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, \
@@ -395,7 +394,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .flags = VSH_CMD_FLAG_NOCONNECT \
     }
 
-# define VSH_CMD_ECHO \
+#define VSH_CMD_ECHO \
     { \
         .name = "echo", \
         .handler = cmdEcho, \
@@ -404,7 +403,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .flags = VSH_CMD_FLAG_NOCONNECT \
     }
 
-# define VSH_CMD_EXIT \
+#define VSH_CMD_EXIT \
     { \
         .name = "exit", \
         .handler = cmdQuit, \
@@ -413,7 +412,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .flags = VSH_CMD_FLAG_NOCONNECT \
     }
 
-# define VSH_CMD_HELP \
+#define VSH_CMD_HELP \
     { \
         .name = "help", \
         .handler = cmdHelp, \
@@ -422,7 +421,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .flags = VSH_CMD_FLAG_NOCONNECT \
     }
 
-# define VSH_CMD_PWD \
+#define VSH_CMD_PWD \
     { \
         .name = "pwd", \
         .handler = cmdPwd, \
@@ -431,7 +430,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .flags = VSH_CMD_FLAG_NOCONNECT \
     }
 
-# define VSH_CMD_QUIT \
+#define VSH_CMD_QUIT \
     { \
         .name = "quit", \
         .handler = cmdQuit, \
@@ -440,7 +439,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .flags = VSH_CMD_FLAG_NOCONNECT \
     }
 
-# define VSH_CMD_SELF_TEST \
+#define VSH_CMD_SELF_TEST \
     { \
         .name = "self-test", \
         .handler = cmdSelfTest, \
@@ -450,7 +449,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
         .alias = "self-test" \
     }
 
-# define VSH_CMD_COMPLETE \
+#define VSH_CMD_COMPLETE \
     { \
         .name = "complete", \
         .handler = cmdComplete, \
@@ -467,16 +466,16 @@ char * vshReadline(vshControl *ctl, const char *prompt);
 
 /* 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. */
 
@@ -493,7 +492,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
  * 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); \
@@ -511,7 +510,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
  * 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))
 
@@ -526,7 +525,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
  * 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. */
@@ -544,7 +543,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
  * 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"), \
@@ -564,7 +563,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
  * 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))
 
@@ -580,7 +579,5 @@ char *_vshStrdup(vshControl *ctl, const char *s, const char *filename,
  * 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 */
index 3b7a0f054d63642f2eb03e069a030ab27f26706a..14e6e13696f22e73ad7ecca0ab9f0232f2b61368 100644 (file)
  * <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 */