summary refs log tree commit diff
path: root/libnm-glib
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-10-28 23:04:16 +0200
committerMichael Biebl <biebl@debian.org>2011-10-28 23:04:16 +0200
commit485d149fe80915d94ed49ea6c2c0552cf7a3e79a (patch)
tree6a48492b46b8c1e3df1c58626c28f05a978c61f7 /libnm-glib
parent263bf4c0c89bb88dc995acd9a6a2de9095fbd461 (diff)
Imported Upstream version 0.9.1.95 upstream/0.9.1.95
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/Makefile.in8
-rw-r--r--libnm-glib/nm-device.c5
-rw-r--r--libnm-glib/nm-object.c25
-rw-r--r--libnm-glib/nm-remote-connection.c15
-rw-r--r--libnm-glib/nm-remote-settings.c10
-rw-r--r--libnm-glib/nm-secret-agent.c18
-rw-r--r--libnm-glib/nm-secret-agent.h18
-rw-r--r--libnm-glib/tests/Makefile.in8
8 files changed, 65 insertions, 42 deletions
diff --git a/libnm-glib/Makefile.in b/libnm-glib/Makefile.in
index 9728f7d9..513c607f 100644
--- a/libnm-glib/Makefile.in
+++ b/libnm-glib/Makefile.in
@@ -348,8 +348,16 @@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM = @LIBM@
+LIBNL1_CFLAGS = @LIBNL1_CFLAGS@
+LIBNL1_LIBS = @LIBNL1_LIBS@
+LIBNL2_CFLAGS = @LIBNL2_CFLAGS@
+LIBNL2_LIBS = @LIBNL2_LIBS@
+LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
+LIBNL3_LIBS = @LIBNL3_LIBS@
 LIBNL_CFLAGS = @LIBNL_CFLAGS@
 LIBNL_LIBS = @LIBNL_LIBS@
+LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
+LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index f06c1e4a..1f9f3671 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -1475,8 +1475,9 @@ deactivate_cb (DBusGProxy *proxy,
 /**
  * nm_device_disconnect:
  * @device: a #NMDevice
- * @callback: (scope async): callback to be called when disconnect operation completes
- * @user_data: caller-specific data passed to @callback
+ * @callback: (scope async) (allow-none): callback to be called when disconnect
+ * operation completes
+ * @user_data: (closure): caller-specific data passed to @callback
  *
  * Disconnects the device if currently connected, and prevents the device from
  * automatically connecting to networks until the next manual network connection
diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c
index cbcf2919..9a8a60f7 100644
--- a/libnm-glib/nm-object.c
+++ b/libnm-glib/nm-object.c
@@ -28,6 +28,7 @@
 #include "nm-object-cache.h"
 #include "nm-object-private.h"
 #include "nm-dbus-glib-types.h"
+#include "nm-glib-compat.h"
 
 #define DEBUG 0
 
@@ -438,11 +439,11 @@ _nm_object_handle_properties_changed (NMObject *object,
 	}
 }
 
-#define HANDLE_TYPE(ucase, lcase) \
+#define HANDLE_TYPE(ucase, lcase, getter) \
 	} else if (pspec->value_type == G_TYPE_##ucase) { \
 		if (G_VALUE_HOLDS_##ucase (value)) { \
 			g##lcase *param = (g##lcase *) field; \
-			*param = g_value_get_##lcase (value); \
+			*param = g_value_get_##getter (value); \
 		} else { \
 			success = FALSE; \
 			goto done; \
@@ -474,16 +475,16 @@ _nm_object_demarshal_generic (NMObject *object,
 			success = FALSE;
 			goto done;
 		}
-	HANDLE_TYPE(BOOLEAN, boolean)
-	HANDLE_TYPE(CHAR, char)
-	HANDLE_TYPE(UCHAR, uchar)
-	HANDLE_TYPE(DOUBLE, double)
-	HANDLE_TYPE(INT, int)
-	HANDLE_TYPE(UINT, uint)
-	HANDLE_TYPE(INT64, int)
-	HANDLE_TYPE(UINT64, uint)
-	HANDLE_TYPE(LONG, long)
-	HANDLE_TYPE(ULONG, ulong)
+	HANDLE_TYPE(BOOLEAN, boolean, boolean)
+	HANDLE_TYPE(CHAR, char, schar)
+	HANDLE_TYPE(UCHAR, uchar, uchar)
+	HANDLE_TYPE(DOUBLE, double, double)
+	HANDLE_TYPE(INT, int, int)
+	HANDLE_TYPE(UINT, uint, uint)
+	HANDLE_TYPE(INT64, int, int)
+	HANDLE_TYPE(UINT64, uint, uint)
+	HANDLE_TYPE(LONG, long, long)
+	HANDLE_TYPE(ULONG, ulong, ulong)
 	} else {
 		g_warning ("%s: %s/%s unhandled type %s.",
 		           __func__, G_OBJECT_TYPE_NAME (object), pspec->name,
diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c
index 57870c62..9e190d9e 100644
--- a/libnm-glib/nm-remote-connection.c
+++ b/libnm-glib/nm-remote-connection.c
@@ -94,15 +94,17 @@ update_cb (DBusGProxy *proxy, GError *error, gpointer user_data)
 	RemoteCall *call = user_data;
 	NMRemoteConnectionCommitFunc func = (NMRemoteConnectionCommitFunc) call->callback;
 
-	(*func)(call->self, error, call->user_data);
+	if (func != NULL)
+		(*func)(call->self, error, call->user_data);
 	remote_call_complete (call->self, call);
 }
 
 /**
  * nm_remote_connection_commit_changes:
  * @connection: the #NMRemoteConnection
- * @callback: (scope async): a function to be called when the commit completes
- * @user_data: caller-specific data to be passed to @callback
+ * @callback: (scope async) (allow-none): a function to be called when the
+ * commit completes
+ * @user_data: (closure): caller-specific data to be passed to @callback
  *
  * Save any local changes to the settings and properties of this connection and
  * save them in the settings service.
@@ -154,7 +156,7 @@ delete_cb (DBusGProxy *proxy, GError *error, gpointer user_data)
  * nm_remote_connection_delete:
  * @connection: the #NMRemoteConnection
  * @callback: (scope async) (allow-none): a function to be called when the delete completes
- * @user_data: caller-specific data to be passed to @callback
+ * @user_data: (closure): caller-specific data to be passed to @callback
  *
  * Delete the connection.
  **/
@@ -197,8 +199,9 @@ get_secrets_cb (DBusGProxy *proxy, GHashTable *secrets, GError *error, gpointer
  * nm_remote_connection_get_secrets:
  * @connection: the #NMRemoteConnection
  * @setting_name: the #NMSetting object name to get secrets for
- * @callback: (scope async): a function to be called when the update completes
- * @user_data: caller-specific data to be passed to @callback
+ * @callback: (scope async): a function to be called when the update completes;
+ * must not be NULL
+ * @user_data: (closure): caller-specific data to be passed to @callback
  *
  * Request the connection's secrets.
  **/
diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c
index b6aaabb0..7658623f 100644
--- a/libnm-glib/nm-remote-settings.c
+++ b/libnm-glib/nm-remote-settings.c
@@ -501,7 +501,7 @@ add_connection_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data
  * @connection: the connection to add. Note that this object's settings will be
  *   added, not the object itself
  * @callback: (scope async): callback to be called when the add operation completes
- * @user_data: caller-specific data passed to @callback
+ * @user_data: (closure): caller-specific data passed to @callback
  *
  * Requests that the remote settings service add the given settings to a new
  * connection.
@@ -594,7 +594,8 @@ save_hostname_cb (DBusGProxy *proxy,
 	GError *error = NULL;
 
 	dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
-	info->callback (info->settings, error, info->callback_data);
+	if (info->callback != NULL)
+		info->callback (info->settings, error, info->callback_data);
 	g_clear_error (&error);
 }
 
@@ -603,8 +604,9 @@ save_hostname_cb (DBusGProxy *proxy,
  * @settings: the %NMRemoteSettings
  * @hostname: the new persistent hostname to set, or NULL to clear any existing
  *  persistent hostname
- * @callback: (scope async): callback to be called when the hostname operation completes
- * @user_data: caller-specific data passed to @callback
+ * @callback: (scope async) (allow-none): callback to be called when the
+ * hostname operation completes
+ * @user_data: (closure): caller-specific data passed to @callback
  *
  * Requests that the machine's persistent hostname be set to the specified value
  * or cleared.
diff --git a/libnm-glib/nm-secret-agent.c b/libnm-glib/nm-secret-agent.c
index 90bdfbe7..1b413171 100644
--- a/libnm-glib/nm-secret-agent.c
+++ b/libnm-glib/nm-secret-agent.c
@@ -656,7 +656,7 @@ auto_register_cb (gpointer user_data)
  * @hints: (array zero-terminated=1): hints to the agent
  * @flags: flags that modify the behavior of the request
  * @callback: (scope async): a callback, invoked when the operation is done
- * @callback_data: (closure):
+ * @user_data: (closure): caller-specific data to be passed to @callback
  *
  * Asyncronously retrieve secrets belonging to @connection for the
  * setting @setting_name.  @flags indicate specific behavior that the secret
@@ -673,7 +673,7 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
                              const char **hints,
                              NMSecretAgentGetSecretsFlags flags,
                              NMSecretAgentGetSecretsFunc callback,
-                             gpointer callback_data)
+                             gpointer user_data)
 {
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (NM_IS_SECRET_AGENT (self));
@@ -691,7 +691,7 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
 	                                               hints,
 	                                               flags,
 	                                               callback,
-	                                               callback_data);
+	                                               user_data);
 }
 
 /**
@@ -699,7 +699,7 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
  * @self: a #NMSecretAgent
  * @connection: a #NMConnection
  * @callback: (scope async): a callback, invoked when the operation is done
- * @callback_data: (closure):
+ * @user_data: (closure): caller-specific data to be passed to @callback
  *
  * Asyncronously ensure that all secrets inside @connection
  * are stored to disk.
@@ -710,7 +710,7 @@ void
 nm_secret_agent_save_secrets (NMSecretAgent *self,
                               NMConnection *connection,
                               NMSecretAgentSaveSecretsFunc callback,
-                              gpointer callback_data)
+                              gpointer user_data)
 {
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (NM_IS_SECRET_AGENT (self));
@@ -722,7 +722,7 @@ nm_secret_agent_save_secrets (NMSecretAgent *self,
 	                                                connection,
 	                                                nm_connection_get_path (connection),
 	                                                callback,
-	                                                callback_data);
+	                                                user_data);
 }
 
 /**
@@ -730,7 +730,7 @@ nm_secret_agent_save_secrets (NMSecretAgent *self,
  * @self: a #NMSecretAgent
  * @connection: a #NMConnection
  * @callback: (scope async): a callback, invoked when the operation is done
- * @callback_data: (closure):
+ * @user_data: (closure): caller-specific data to be passed to @callback
  *
  * Asynchronously ask the agent to delete all saved secrets belonging to
  * @connection.
@@ -741,7 +741,7 @@ void
 nm_secret_agent_delete_secrets (NMSecretAgent *self,
                                 NMConnection *connection,
                                 NMSecretAgentDeleteSecretsFunc callback,
-                                gpointer callback_data)
+                                gpointer user_data)
 {
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (NM_IS_SECRET_AGENT (self));
@@ -753,7 +753,7 @@ nm_secret_agent_delete_secrets (NMSecretAgent *self,
 	                                                  connection,
 	                                                  nm_connection_get_path (connection),
 	                                                  callback,
-	                                                  callback_data);
+	                                                  user_data);
 }
 
 /**************************************************************/
diff --git a/libnm-glib/nm-secret-agent.h b/libnm-glib/nm-secret-agent.h
index 6b209c44..2e0cce40 100644
--- a/libnm-glib/nm-secret-agent.h
+++ b/libnm-glib/nm-secret-agent.h
@@ -101,7 +101,7 @@ typedef struct {
 	/* Called when the subclass should retrieve and return secrets.  Subclass
 	 * must copy or reference any arguments it may require after returning from
 	 * this method, as the arguments will freed (except for 'agent', 'callback',
-	 * and 'callback_data' of course).  If the request is canceled, the callback
+	 * and 'user_data' of course).  If the request is canceled, the callback
 	 * should still be called, but with the NM_SECRET_AGENT_ERROR_AGENT_CANCELED
 	 * error.
 	 */
@@ -112,7 +112,7 @@ typedef struct {
 	                     const char **hints,
 	                     NMSecretAgentGetSecretsFlags flags,
 	                     NMSecretAgentGetSecretsFunc callback,
-	                     gpointer callback_data);
+	                     gpointer user_data);
 
 	/* Called when the subclass should cancel an outstanding request to
 	 * get secrets for a given connection.  Canceling the request MUST
@@ -127,26 +127,26 @@ typedef struct {
 	/* Called when the subclass should save the secrets contained in the
 	 * connection to backing storage.  Subclass must copy or reference any
 	 * arguments it may require after returning from this method, as the
-	 * arguments will freed (except for 'agent', 'callback', and 'callback_data'
+	 * arguments will freed (except for 'agent', 'callback', and 'user_data'
 	 * of course).
 	 */
 	void (*save_secrets) (NMSecretAgent *agent,
 	                      NMConnection *connection,
 	                      const char *connection_path,
 	                      NMSecretAgentSaveSecretsFunc callback,
-	                      gpointer callback_data);
+	                      gpointer user_data);
 
 	/* Called when the subclass should delete the secrets contained in the
 	 * connection from backing storage.  Subclass must copy or reference any
 	 * arguments it may require after returning from this method, as the
-	 * arguments will freed (except for 'agent', 'callback', and 'callback_data'
+	 * arguments will freed (except for 'agent', 'callback', and 'user_data'
 	 * of course).
 	 */
 	void (*delete_secrets) (NMSecretAgent *agent,
 	                        NMConnection *connection,
 	                        const char *connection_path,
 	                        NMSecretAgentDeleteSecretsFunc callback,
-	                        gpointer callback_data);
+	                        gpointer user_data);
 
 	/* Signals */
 	void (*registration_result) (NMSecretAgent *agent, GError *error);
@@ -172,17 +172,17 @@ void nm_secret_agent_get_secrets (NMSecretAgent *self,
                                   const char **hints,
                                   NMSecretAgentGetSecretsFlags flags,
                                   NMSecretAgentGetSecretsFunc callback,
-                                  gpointer callback_data);
+                                  gpointer user_data);
 
 void nm_secret_agent_save_secrets (NMSecretAgent *self,
                                    NMConnection *connection,
                                    NMSecretAgentSaveSecretsFunc callback,
-                                   gpointer callback_data);
+                                   gpointer user_data);
 
 void nm_secret_agent_delete_secrets (NMSecretAgent *self,
                                      NMConnection *connection,
                                      NMSecretAgentDeleteSecretsFunc callback,
-                                     gpointer callback_data);
+                                     gpointer user_data);
 
 G_END_DECLS
 
diff --git a/libnm-glib/tests/Makefile.in b/libnm-glib/tests/Makefile.in
index d4d5e6b5..d3c3ecaa 100644
--- a/libnm-glib/tests/Makefile.in
+++ b/libnm-glib/tests/Makefile.in
@@ -188,8 +188,16 @@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM = @LIBM@
+LIBNL1_CFLAGS = @LIBNL1_CFLAGS@
+LIBNL1_LIBS = @LIBNL1_LIBS@
+LIBNL2_CFLAGS = @LIBNL2_CFLAGS@
+LIBNL2_LIBS = @LIBNL2_LIBS@
+LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
+LIBNL3_LIBS = @LIBNL3_LIBS@
 LIBNL_CFLAGS = @LIBNL_CFLAGS@
 LIBNL_LIBS = @LIBNL_LIBS@
+LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
+LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@