[network-manager-openconnect/th/vpn-service-info-bgo767197] fixup! change multiprotocol support to use a new "protocol" option



commit b3d7b55bcc0b39b443ac257ba08c652eda74f269
Author: Thomas Haller <thaller redhat com>
Date:   Sun Jun 12 17:56:21 2016 +0200

    fixup! change multiprotocol support to use a new "protocol" option

 shared/nm-vpn-editor-plugin-call.h |  107 ++++++++++++++++++++---------------
 1 files changed, 61 insertions(+), 46 deletions(-)
---
diff --git a/shared/nm-vpn-editor-plugin-call.h b/shared/nm-vpn-editor-plugin-call.h
index fa847fe..eecd3f1 100644
--- a/shared/nm-vpn-editor-plugin-call.h
+++ b/shared/nm-vpn-editor-plugin-call.h
@@ -30,10 +30,27 @@
 #include "gsystem-local-alloc.h"
 #include "nm-macros-internal.h"
 
+/*****************************************************************************/
+
 #ifndef NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_INFO
 #define NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_INFO "get-service-info"
 #endif
 
+#ifndef NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAILS
+#define NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAILS "get-service-add-details"
+#endif
+
+#ifndef NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAIL
+#define NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAIL "get-service-add-detail"
+#endif
+
+/*****************************************************************************
+ * Call
+ *
+ * The following wrap the calling of generic functions for a VPN plugin.
+ * They are used by callers (for example nm-connection-editor).
+ *****************************************************************************/
+
 static inline gboolean
 nm_vpn_editor_plugin_get_service_info (NMVpnEditorPlugin *plugin,
                                        const char *service_type,
@@ -67,10 +84,6 @@ nm_vpn_editor_plugin_get_service_info (NMVpnEditorPlugin *plugin,
        return TRUE;
 }
 
-#ifndef NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAILS
-#define NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAILS "get-service-add-details"
-#endif
-
 static inline char **
 nm_vpn_editor_plugin_get_service_add_details (NMVpnEditorPlugin *plugin,
                                               const char *service_name)
@@ -93,10 +106,6 @@ nm_vpn_editor_plugin_get_service_add_details (NMVpnEditorPlugin *plugin,
        return details;
 }
 
-#ifndef NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAIL
-#define NM_VPN_EDITOR_PLUGIN_CALL_GET_SERVICE_ADD_DETAIL "get-service-add-detail"
-#endif
-
 static inline gboolean
 nm_vpn_editor_plugin_get_service_add_detail (NMVpnEditorPlugin *plugin,
                                              const char *service_type,
@@ -133,55 +142,61 @@ nm_vpn_editor_plugin_get_service_add_detail (NMVpnEditorPlugin *plugin,
        return TRUE;
 }
 
-/*****************************************************************************/
-
-static gboolean (*_nm_vpn_editor_plugin_call_impl_get_service_info) (NMVpnEditorPlugin *plugin,
-                                                                     const char *service_type,
-                                                                     char **out_short_name,
-                                                                     char **out_pretty_name,
-                                                                     char **out_description,
-                                                                     guint *flags,
-                                                                     GError **error);
-
-#define NM_VPN_EDITOR_PLUGIN_CALL_SET_GET_SERVICE_INFO(fcn) \
-static gboolean (*_nm_vpn_editor_plugin_call_impl_get_service_info) (NMVpnEditorPlugin *plugin, \
-                                                                     const char *service_type, \
-                                                                     char **out_short_name, \
-                                                                     char **out_pretty_name, \
-                                                                     char **out_description, \
-                                                                     guint *flags, \
-                                                                     GError **error) = (fcn)
-
-static gboolean (*_nm_vpn_editor_plugin_call_impl_get_service_add_details) (NMVpnEditorPlugin *plugin,
-                                                                            const char *service_type,
-                                                                            char ***out_add_details,
-                                                                            GError **error);
-
-#define NM_VPN_EDITOR_PLUGIN_CALL_SET_GET_SERVICE_ADD_DETAILS(fcn) \
-static gboolean (*_nm_vpn_editor_plugin_call_impl_get_service_add_details) (NMVpnEditorPlugin *plugin, \
-                                                                            const char *service_type, \
-                                                                            char ***out_add_details, \
-                                                                            GError **error) = (fcn)
+/*****************************************************************************
+ * Implementation
+ *
+ * The following glue code can be used to implement calls in a VPN plugin.
+ * Register your hocks via NM_VPN_EDITOR_PLUGIN_CALL_SET_*() and
+ * NM_VPN_EDITOR_PLUGIN_CALL_SETUP().
+ *****************************************************************************/
 
-static gboolean (*_nm_vpn_editor_plugin_call_impl_get_service_add_detail) (NMVpnEditorPlugin *plugin,
+static gboolean (*const _nm_vpn_editor_plugin_call_impl_get_service_info) (NMVpnEditorPlugin *plugin,
                                                                            const char *service_type,
-                                                                           const char *add_detail,
+                                                                           char **out_short_name,
                                                                            char **out_pretty_name,
                                                                            char **out_description,
-                                                                           char **out_add_detail_key,
-                                                                           guint *out_flags,
+                                                                           guint *flags,
                                                                            GError **error);
 
-#define NM_VPN_EDITOR_PLUGIN_CALL_SET_GET_SERVICE_ADD_DETAIL(fcn) \
-static gboolean (*_nm_vpn_editor_plugin_call_impl_get_service_add_detail) (NMVpnEditorPlugin *plugin, \
+#define NM_VPN_EDITOR_PLUGIN_CALL_SET_GET_SERVICE_INFO(fcn) \
+static gboolean (*const _nm_vpn_editor_plugin_call_impl_get_service_info) (NMVpnEditorPlugin *plugin, \
                                                                            const char *service_type, \
-                                                                           const char *add_detail, \
+                                                                           char **out_short_name, \
                                                                            char **out_pretty_name, \
                                                                            char **out_description, \
-                                                                           char **out_add_detail_key, \
-                                                                           guint *out_flags, \
+                                                                           guint *flags, \
                                                                            GError **error) = (fcn)
 
+static gboolean (*const _nm_vpn_editor_plugin_call_impl_get_service_add_details) (NMVpnEditorPlugin *plugin,
+                                                                                  const char *service_type,
+                                                                                  char ***out_add_details,
+                                                                                  GError **error);
+
+#define NM_VPN_EDITOR_PLUGIN_CALL_SET_GET_SERVICE_ADD_DETAILS(fcn) \
+static gboolean (*const _nm_vpn_editor_plugin_call_impl_get_service_add_details) (NMVpnEditorPlugin *plugin, 
\
+                                                                                  const char *service_type, \
+                                                                                  char ***out_add_details, \
+                                                                                  GError **error) = (fcn)
+
+static gboolean (*const _nm_vpn_editor_plugin_call_impl_get_service_add_detail) (NMVpnEditorPlugin *plugin,
+                                                                                 const char *service_type,
+                                                                                 const char *add_detail,
+                                                                                 char **out_pretty_name,
+                                                                                 char **out_description,
+                                                                                 char **out_add_detail_key,
+                                                                                 guint *out_flags,
+                                                                                 GError **error);
+
+#define NM_VPN_EDITOR_PLUGIN_CALL_SET_GET_SERVICE_ADD_DETAIL(fcn) \
+static gboolean (*const _nm_vpn_editor_plugin_call_impl_get_service_add_detail) (NMVpnEditorPlugin *plugin, \
+                                                                                 const char *service_type, \
+                                                                                 const char *add_detail, \
+                                                                                 char **out_pretty_name, \
+                                                                                 char **out_description, \
+                                                                                 char **out_add_detail_key, \
+                                                                                 guint *out_flags, \
+                                                                                 GError **error) = (fcn)
+
 static inline gboolean
 _nm_vpn_editor_plugin_call_get_signature (NMVpnEditorPlugin *plugin,
                                           const char *request,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]