summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-01-28 11:19:39 +0100
committerThomas Haller <thaller@redhat.com>2018-02-12 13:29:03 +0100
commit4e5bef395129ff5e8d416dacf25a0270d41f18fa (patch)
tree25491a4cf574c9d93a4bf45d6db40a6ed65e867f
parent7a956644d4971a523cd9eead52516966360fc309 (diff)
downloadNetworkManager-4e5bef395129ff5e8d416dacf25a0270d41f18fa.tar.gz
shared: add macros to define GDBus registration info
-rw-r--r--shared/nm-utils/nm-shared-utils.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-shared-utils.h b/shared/nm-utils/nm-shared-utils.h
index e52b419b0c..50daa91221 100644
--- a/shared/nm-utils/nm-shared-utils.h
+++ b/shared/nm-utils/nm-shared-utils.h
@@ -469,4 +469,39 @@ int nm_utils_fd_read_loop_exact (int fd, void *buf, size_t nbytes, bool do_poll)
/*****************************************************************************/
+#define NM_DEFINE_GDBUS_ARG_INFO(a_name, ...) \
+ ((GDBusArgInfo *) (&((const GDBusArgInfo) { \
+ .ref_count = -1, \
+ .name = a_name, \
+ __VA_ARGS__ \
+ })))
+
+#define NM_DEFINE_GDBUS_ARG_INFOS(...) \
+ ((GDBusArgInfo **) ((const GDBusArgInfo *[]) { \
+ __VA_ARGS__ \
+ NULL, \
+ }))
+
+#define NM_DEFINE_GDBUS_METHOD_INFO(m_name, ...) \
+ ((GDBusMethodInfo *) (&((const GDBusMethodInfo) { \
+ .ref_count = -1, \
+ .name = m_name, \
+ __VA_ARGS__ \
+ })))
+
+#define NM_DEFINE_GDBUS_METHOD_INFOS(...) \
+ ((GDBusMethodInfo **) ((const GDBusMethodInfo *[]) { \
+ __VA_ARGS__ \
+ NULL, \
+ }))
+
+#define NM_DEFINE_GDBUS_INTERFACE_INFO(variable, i_name, ...) \
+ static GDBusInterfaceInfo *const variable = ((GDBusInterfaceInfo *) (&((const GDBusInterfaceInfo) { \
+ .ref_count = -1, \
+ .name = i_name, \
+ __VA_ARGS__ \
+ })))
+
+/*****************************************************************************/
+
#endif /* __NM_SHARED_UTILS_H__ */