diff options
| author | Thomas Haller <thaller@redhat.com> | 2018-01-02 13:37:06 +0100 |
|---|---|---|
| committer | Thomas Haller <thaller@redhat.com> | 2018-01-08 12:38:53 +0100 |
| commit | 22ef6a507a308f2fe495b60bef78ac2ca00fb6d2 (patch) | |
| tree | 3bd2f287df3db9c5254f9b27607b4f0735b938d7 /libnm/nm-manager.h | |
| parent | 31b6abd4b533c56c91c616498ee2080d56d0fd48 (diff) | |
| download | NetworkManager-22ef6a507a308f2fe495b60bef78ac2ca00fb6d2.tar.gz | |
build: refine the NETWORKMANAGER_COMPILATION define
Note that:
- we compile some source files multiple times. Most notably those
under "shared/".
- we include a default header "shared/nm-default.h" in every source
file. This header is supposed to setup a common environment by defining
and including parts that are commonly used. As we always include the
same header, the header must behave differently depending
one whether the compilation is for libnm-core, NetworkManager or
libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h>
depending on whether we compile a library or an application.
For that, the source files need the NETWORKMANAGER_COMPILATION #define
to behave accordingly.
Extend the define to be composed of flags. These flags are all named
NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the
build are available. E.g. when building libnm-core.la itself, then
WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE
are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE
is not available but the internal parts are still accessible. When
building nmcli, only WITH_LIBNM_CORE (the public part) is available.
This granularily controls the build.
Diffstat (limited to 'libnm/nm-manager.h')
| -rw-r--r-- | libnm/nm-manager.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libnm/nm-manager.h b/libnm/nm-manager.h index 852a088972..ac0630ccf4 100644 --- a/libnm/nm-manager.h +++ b/libnm/nm-manager.h @@ -22,11 +22,13 @@ #ifndef __NM_MANAGER_H__ #define __NM_MANAGER_H__ +#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) +#error Cannot use this header. +#endif + #include "nm-object.h" #include "nm-client.h" -G_BEGIN_DECLS - #define NM_TYPE_MANAGER (nm_manager_get_type ()) #define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager)) #define NM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MANAGER, NMManagerClass)) @@ -75,8 +77,6 @@ typedef struct { void (*permission_changed) (NMManager *manager, NMClientPermission permission, NMClientPermissionResult result); - - /* nm-manager.h is internal API. We can add more slots without breaking ABI. */ } NMManagerClass; GType nm_manager_get_type (void); @@ -102,13 +102,10 @@ gboolean nm_manager_wimax_get_enabled (NMManager *manager); void nm_manager_wimax_set_enabled (NMManager *manager, gboolean enabled); gboolean nm_manager_wimax_hardware_get_enabled (NMManager *manager); -NM_AVAILABLE_IN_1_10 gboolean nm_manager_connectivity_check_get_available (NMManager *manager); -NM_AVAILABLE_IN_1_10 gboolean nm_manager_connectivity_check_get_enabled (NMManager *manager); -NM_AVAILABLE_IN_1_10 void nm_manager_connectivity_check_set_enabled (NMManager *manager, gboolean enabled); @@ -140,7 +137,6 @@ NMConnectivityState nm_manager_check_connectivity_finish (NMManager *manager, /* Devices */ const GPtrArray *nm_manager_get_devices (NMManager *manager); -NM_AVAILABLE_IN_1_2 const GPtrArray *nm_manager_get_all_devices(NMManager *manager); NMDevice *nm_manager_get_device_by_path (NMManager *manager, const char *object_path); NMDevice *nm_manager_get_device_by_iface (NMManager *manager, const char *iface); @@ -215,6 +211,4 @@ GHashTable *nm_manager_checkpoint_rollback_finish (NMManager *manager, GAsyncResult *result, GError **error); -G_END_DECLS - #endif /* __NM_MANAGER_H__ */ |
