Use #pragma once in driver headers

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>
This commit is contained in:
Jonathon Jongsma 2019-06-07 15:20:12 -05:00 committed by Ján Tomko
parent e6635c626a
commit e97f8228b9
10 changed files with 53 additions and 92 deletions

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_HYPERVISOR_H #pragma once
# define LIBVIRT_DRIVER_HYPERVISOR_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvConnectURIProbe)(char **uri); (*virDrvConnectURIProbe)(char **uri);
@ -1581,6 +1580,3 @@ struct _virHypervisorDriver {
virDrvNodeGetSEVInfo nodeGetSEVInfo; virDrvNodeGetSEVInfo nodeGetSEVInfo;
virDrvDomainGetLaunchSecurityInfo domainGetLaunchSecurityInfo; virDrvDomainGetLaunchSecurityInfo domainGetLaunchSecurityInfo;
}; };
#endif /* LIBVIRT_DRIVER_HYPERVISOR_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_INTERFACE_H #pragma once
# define LIBVIRT_DRIVER_INTERFACE_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvConnectNumOfInterfaces)(virConnectPtr conn); (*virDrvConnectNumOfInterfaces)(virConnectPtr conn);
@ -117,6 +116,3 @@ struct _virInterfaceDriver {
virDrvInterfaceChangeCommit interfaceChangeCommit; virDrvInterfaceChangeCommit interfaceChangeCommit;
virDrvInterfaceChangeRollback interfaceChangeRollback; virDrvInterfaceChangeRollback interfaceChangeRollback;
}; };
#endif /* LIBVIRT_DRIVER_INTERFACE_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_NETWORK_H #pragma once
# define LIBVIRT_DRIVER_NETWORK_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvConnectNumOfNetworks)(virConnectPtr conn); (*virDrvConnectNumOfNetworks)(virConnectPtr conn);
@ -152,6 +151,3 @@ struct _virNetworkDriver {
virDrvNetworkIsPersistent networkIsPersistent; virDrvNetworkIsPersistent networkIsPersistent;
virDrvNetworkGetDHCPLeases networkGetDHCPLeases; virDrvNetworkGetDHCPLeases networkGetDHCPLeases;
}; };
#endif /* LIBVIRT_DRIVER_NETWORK_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_NODEDEV_H #pragma once
# define LIBVIRT_DRIVER_NODEDEV_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvNodeNumOfDevices)(virConnectPtr conn, (*virDrvNodeNumOfDevices)(virConnectPtr conn,
@ -115,6 +114,3 @@ struct _virNodeDeviceDriver {
virDrvNodeDeviceCreateXML nodeDeviceCreateXML; virDrvNodeDeviceCreateXML nodeDeviceCreateXML;
virDrvNodeDeviceDestroy nodeDeviceDestroy; virDrvNodeDeviceDestroy nodeDeviceDestroy;
}; };
#endif /* LIBVIRT_DRIVER_NODEDEV_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_NWFILTER_H #pragma once
# define LIBVIRT_DRIVER_NWFILTER_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvConnectNumOfNWFilters)(virConnectPtr conn); (*virDrvConnectNumOfNWFilters)(virConnectPtr conn);
@ -108,6 +107,3 @@ struct _virNWFilterDriver {
virDrvNWFilterBindingDelete nwfilterBindingDelete; virDrvNWFilterBindingDelete nwfilterBindingDelete;
virDrvNWFilterBindingGetXMLDesc nwfilterBindingGetXMLDesc; virDrvNWFilterBindingGetXMLDesc nwfilterBindingGetXMLDesc;
}; };
#endif /* LIBVIRT_DRIVER_NWFILTER_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_SECRET_H #pragma once
# define LIBVIRT_DRIVER_SECRET_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
enum { enum {
/* This getValue call is inside libvirt, override the "private" flag. /* This getValue call is inside libvirt, override the "private" flag.
@ -113,6 +112,3 @@ struct _virSecretDriver {
virDrvConnectSecretEventRegisterAny connectSecretEventRegisterAny; virDrvConnectSecretEventRegisterAny connectSecretEventRegisterAny;
virDrvConnectSecretEventDeregisterAny connectSecretEventDeregisterAny; virDrvConnectSecretEventDeregisterAny connectSecretEventDeregisterAny;
}; };
#endif /* LIBVIRT_DRIVER_SECRET_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_STATE_H #pragma once
# define LIBVIRT_DRIVER_STATE_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvStateInitialize)(bool privileged, (*virDrvStateInitialize)(bool privileged,
@ -49,6 +48,3 @@ struct _virStateDriver {
virDrvStateReload stateReload; virDrvStateReload stateReload;
virDrvStateStop stateStop; virDrvStateStop stateStop;
}; };
#endif /* LIBVIRT_DRIVER_STATE_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_STORAGE_H #pragma once
# define LIBVIRT_DRIVER_STORAGE_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvConnectNumOfStoragePools)(virConnectPtr conn); (*virDrvConnectNumOfStoragePools)(virConnectPtr conn);
@ -279,6 +278,3 @@ struct _virStorageDriver {
virDrvStoragePoolIsActive storagePoolIsActive; virDrvStoragePoolIsActive storagePoolIsActive;
virDrvStoragePoolIsPersistent storagePoolIsPersistent; virDrvStoragePoolIsPersistent storagePoolIsPersistent;
}; };
#endif /* LIBVIRT_DRIVER_STORAGE_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_STREAM_H #pragma once
# define LIBVIRT_DRIVER_STREAM_H
# ifndef __VIR_DRIVER_H_INCLUDES___ #ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h" # error "Don't include this file directly, only use driver.h"
# endif #endif
typedef int typedef int
(*virDrvStreamSend)(virStreamPtr st, (*virDrvStreamSend)(virStreamPtr st,
@ -92,6 +91,3 @@ struct _virStreamDriver {
virDrvStreamFinish streamFinish; virDrvStreamFinish streamFinish;
virDrvStreamAbort streamAbort; virDrvStreamAbort streamAbort;
}; };
#endif /* LIBVIRT_DRIVER_STREAM_H */

View File

@ -19,14 +19,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_DRIVER_H #pragma once
# define LIBVIRT_DRIVER_H
# include <unistd.h> #include <unistd.h>
# include "internal.h" #include "internal.h"
# include "libvirt_internal.h" #include "libvirt_internal.h"
# include "viruri.h" #include "viruri.h"
/* Status codes returned from driver open call. */ /* Status codes returned from driver open call. */
@ -56,24 +55,24 @@ typedef enum {
* != 0 Feature is supported. * != 0 Feature is supported.
* 0 Feature is not supported. * 0 Feature is not supported.
*/ */
# define VIR_DRV_SUPPORTS_FEATURE(drv, conn, feature) \ #define VIR_DRV_SUPPORTS_FEATURE(drv, conn, feature) \
((drv)->connectSupportsFeature ? \ ((drv)->connectSupportsFeature ? \
(drv)->connectSupportsFeature((conn), (feature)) > 0 : 0) (drv)->connectSupportsFeature((conn), (feature)) > 0 : 0)
# define __VIR_DRIVER_H_INCLUDES___ #define __VIR_DRIVER_H_INCLUDES___
# include "driver-hypervisor.h" #include "driver-hypervisor.h"
# include "driver-interface.h" #include "driver-interface.h"
# include "driver-network.h" #include "driver-network.h"
# include "driver-nodedev.h" #include "driver-nodedev.h"
# include "driver-nwfilter.h" #include "driver-nwfilter.h"
# include "driver-secret.h" #include "driver-secret.h"
# include "driver-state.h" #include "driver-state.h"
# include "driver-stream.h" #include "driver-stream.h"
# include "driver-storage.h" #include "driver-storage.h"
# undef __VIR_DRIVER_H_INCLUDES___ #undef __VIR_DRIVER_H_INCLUDES___
typedef struct _virConnectDriver virConnectDriver; typedef struct _virConnectDriver virConnectDriver;
typedef virConnectDriver *virConnectDriverPtr; typedef virConnectDriver *virConnectDriverPtr;
@ -126,5 +125,3 @@ int virSetConnectNWFilter(virConnectPtr conn);
int virSetConnectNodeDev(virConnectPtr conn); int virSetConnectNodeDev(virConnectPtr conn);
int virSetConnectSecret(virConnectPtr conn); int virSetConnectSecret(virConnectPtr conn);
int virSetConnectStorage(virConnectPtr conn); int virSetConnectStorage(virConnectPtr conn);
#endif /* LIBVIRT_DRIVER_H */