[gnome-keyring/with-p11-kit: 2/4] Remove extraneous argument from gck_module_new and gck_module_initialize



commit 73e662d6e70caa7506e24b78aed48754da609676
Author: Stef Walter <stefw collabora co uk>
Date:   Tue Apr 5 15:21:40 2011 +0200

    Remove extraneous argument from gck_module_new and gck_module_initialize
    
     * Since the signature of these functions changed anyway (API not yet
       stable, we are going to clean them up a bit more.
     * The xxx_full versions may be needed in the future if more options
       show up.

 daemon/dbus/gkd-dbus-secrets.c      |    2 +-
 daemon/gpg-agent/gkd-gpg-agent.c    |    2 +-
 daemon/login/gkd-login.c            |    2 +-
 daemon/ssh-agent/gkd-ssh-agent.c    |    2 +-
 gck/gck-module.c                    |    9 ++++-----
 gck/gck-modules.c                   |    5 ++---
 gck/gck-private.h                   |    3 +--
 gck/gck.h                           |    6 ++----
 gck/tests/test-gck-crypto.c         |    2 +-
 gck/tests/test-gck-module.c         |    2 +-
 gck/tests/test-gck-slot.c           |    2 +-
 gcr/gcr-library.c                   |    4 ++--
 gcr/tests/test-certificate-chain.c  |    2 +-
 gcr/tests/test-pkcs11-certificate.c |    2 +-
 gcr/tests/test-trust.c              |    2 +-
 15 files changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/daemon/dbus/gkd-dbus-secrets.c b/daemon/dbus/gkd-dbus-secrets.c
index 089d783..4963e90 100644
--- a/daemon/dbus/gkd-dbus-secrets.c
+++ b/daemon/dbus/gkd-dbus-secrets.c
@@ -46,7 +46,7 @@ calculate_secrets_slot (void)
 	GError *err = NULL;
 
 	/* TODO: Should we be handling just one module here? */
-	module = gck_module_new (gkd_pkcs11_get_functions (), 0);
+	module = gck_module_new (gkd_pkcs11_get_functions ());
 	g_return_val_if_fail (module, NULL);
 
 	modules = g_list_prepend (NULL, module);
diff --git a/daemon/gpg-agent/gkd-gpg-agent.c b/daemon/gpg-agent/gkd-gpg-agent.c
index e09b6fd..2ee7012 100644
--- a/daemon/gpg-agent/gkd-gpg-agent.c
+++ b/daemon/gpg-agent/gkd-gpg-agent.c
@@ -405,7 +405,7 @@ gkd_gpg_agent_initialize (CK_FUNCTION_LIST_PTR funcs)
 
 	g_return_val_if_fail (funcs, -1);
 
-	module = gck_module_new (funcs, 0);
+	module = gck_module_new (funcs);
 	ret = gkd_gpg_agent_initialize_with_module (module);
 	g_object_unref (module);
 	return ret;
diff --git a/daemon/login/gkd-login.c b/daemon/login/gkd-login.c
index 2fbbde8..8da57d9 100644
--- a/daemon/login/gkd-login.c
+++ b/daemon/login/gkd-login.c
@@ -38,7 +38,7 @@
 static GList*
 module_instances (void)
 {
-	GckModule *module = gck_module_new (gkd_pkcs11_get_base_functions (), 0);
+	GckModule *module = gck_module_new (gkd_pkcs11_get_base_functions ());
 	g_return_val_if_fail (module, NULL);
 	return g_list_append (NULL, module);
 }
diff --git a/daemon/ssh-agent/gkd-ssh-agent.c b/daemon/ssh-agent/gkd-ssh-agent.c
index eb8d21f..7a6fc01 100644
--- a/daemon/ssh-agent/gkd-ssh-agent.c
+++ b/daemon/ssh-agent/gkd-ssh-agent.c
@@ -353,7 +353,7 @@ gkd_ssh_agent_initialize (CK_FUNCTION_LIST_PTR funcs)
 
 	g_return_val_if_fail (funcs, -1);
 
-	module = gck_module_new (funcs, 0);
+	module = gck_module_new (funcs);
 	ret = gkd_ssh_agent_initialize_with_module (module);
 	g_object_unref (module);
 	return ret;
diff --git a/gck/gck-module.c b/gck/gck-module.c
index 2256951..4502300 100644
--- a/gck/gck-module.c
+++ b/gck/gck-module.c
@@ -373,7 +373,6 @@ gck_module_info_free (GckModuleInfo *module_info)
 /**
  * gck_module_initialize:
  * @path: The file system path to the PKCS#11 module to load.
- * @reserved_options: No options are currently available.
  * @err: A location to store an error resulting from a failed load.
  *
  * Load and initialize a PKCS#11 module represented by a GckModule object.
@@ -381,7 +380,7 @@ gck_module_info_free (GckModuleInfo *module_info)
  * Return value: The loaded PKCS#11 module or NULL if failed.
  **/
 GckModule*
-gck_module_initialize (const gchar *path, guint reserved_options, GError **err)
+gck_module_initialize (const gchar *path, GError **err)
 {
 	CK_C_GetFunctionList get_function_list;
 	CK_FUNCTION_LIST_PTR funcs;
@@ -444,16 +443,16 @@ gck_module_initialize (const gchar *path, guint reserved_options, GError **err)
  * Return value: The new PKCS#11 module.
  **/
 GckModule*
-gck_module_new (CK_FUNCTION_LIST_PTR funcs, guint reserved_options)
+gck_module_new (CK_FUNCTION_LIST_PTR funcs)
 {
 	g_return_val_if_fail (funcs, NULL);
 	return g_object_new (GCK_TYPE_MODULE, "functions", funcs, NULL);
 }
 
 GckModule*
-_gck_module_new_initialized (CK_FUNCTION_LIST_PTR funcs, guint reserved_options)
+_gck_module_new_initialized (CK_FUNCTION_LIST_PTR funcs)
 {
-	GckModule *module = gck_module_new (funcs, reserved_options);
+	GckModule *module = gck_module_new (funcs);
 	module->pv->initialized = TRUE; /* As if we initialized it */
 	return module;
 }
diff --git a/gck/gck-modules.c b/gck/gck-modules.c
index c039032..6e2e9d7 100644
--- a/gck/gck-modules.c
+++ b/gck/gck-modules.c
@@ -42,7 +42,6 @@
 
 /**
  * gck_modules_initialize_registered:
- * @reserved_options: reserved options set to zero.
  *
  * Load and initialize all the registered modules.
  *
@@ -50,7 +49,7 @@
  * be released with gck_list_unref_free().
  */
 GList*
-gck_modules_initialize_registered (guint reserved_options)
+gck_modules_initialize_registered (void)
 {
 	GckModule *module;
 	GList *results = NULL;
@@ -67,7 +66,7 @@ gck_modules_initialize_registered (guint reserved_options)
 	modules = p11_kit_registered_modules ();
 
 	for (funcs = modules; *funcs; ++funcs) {
-		module = _gck_module_new_initialized (*funcs, 0);
+		module = _gck_module_new_initialized (*funcs);
 		results = g_list_prepend (results, module);
 	}
 
diff --git a/gck/gck-private.h b/gck/gck-private.h
index 615a226..f822f3d 100644
--- a/gck/gck-private.h
+++ b/gck/gck-private.h
@@ -62,8 +62,7 @@ gboolean            _gck_ulong_equal                       (gconstpointer v1,
  * MODULE
  */
 
-GckModule*          _gck_module_new_initialized            (CK_FUNCTION_LIST_PTR funcs,
-                                                            guint reserved_options);
+GckModule*          _gck_module_new_initialized            (CK_FUNCTION_LIST_PTR funcs);
 
 gboolean            _gck_module_fire_authenticate_slot     (GckModule *module,
                                                              GckSlot *slot,
diff --git a/gck/gck.h b/gck/gck.h
index 934bc7c..2a4243a 100644
--- a/gck/gck.h
+++ b/gck/gck.h
@@ -293,11 +293,9 @@ struct _GckModuleClass {
 
 GType                 gck_module_get_type                     (void) G_GNUC_CONST;
 
-GckModule*            gck_module_new                          (CK_FUNCTION_LIST_PTR funcs,
-                                                               guint reserved_options);
+GckModule*            gck_module_new                          (CK_FUNCTION_LIST_PTR funcs);
 
 GckModule*            gck_module_initialize                   (const gchar *path,
-                                                               guint reserved_options,
                                                                GError **err);
 
 gboolean              gck_module_equal                        (gconstpointer module1,
@@ -314,7 +312,7 @@ GckModuleInfo*        gck_module_get_info                     (GckModule *self);
 GList*                gck_module_get_slots                    (GckModule *self,
                                                                gboolean token_present);
 
-GList*                gck_modules_initialize_registered       (guint reserved_options);
+GList*                gck_modules_initialize_registered       (void);
 
 GList*                gck_modules_get_slots                   (GList *modules,
                                                                gboolean token_present);
diff --git a/gck/tests/test-gck-crypto.c b/gck/tests/test-gck-crypto.c
index 7443ddf..5b43956 100644
--- a/gck/tests/test-gck-crypto.c
+++ b/gck/tests/test-gck-crypto.c
@@ -57,7 +57,7 @@ setup (Test *test, gconstpointer unused)
 	GckSlot *slot;
 
 	/* Successful load */
-	test->module = gck_module_initialize (".libs/libmock-test-module.so", 0, &err);
+	test->module = gck_module_initialize (".libs/libmock-test-module.so", &err);
 	g_assert_no_error (err);
 	g_assert (GCK_IS_MODULE (test->module));
 
diff --git a/gck/tests/test-gck-module.c b/gck/tests/test-gck-module.c
index 4708df3..75961cd 100644
--- a/gck/tests/test-gck-module.c
+++ b/gck/tests/test-gck-module.c
@@ -82,7 +82,7 @@ test_module_equals_hash (Test *test, gconstpointer unused)
 
 	g_assert (gck_module_equal (test->module, test->module));
 
-	other = gck_module_new (gck_module_get_functions (test->module), 0);
+	other = gck_module_new (gck_module_get_functions (test->module));
 	obj = g_object_new (G_TYPE_OBJECT, NULL);
 
 	g_assert (gck_module_equal (test->module, other));
diff --git a/gck/tests/test-gck-slot.c b/gck/tests/test-gck-slot.c
index 0b2af6e..7869218 100644
--- a/gck/tests/test-gck-slot.c
+++ b/gck/tests/test-gck-slot.c
@@ -145,7 +145,7 @@ test_slot_equals_hash (Test *test, gconstpointer unused)
 
 	g_assert (gck_slot_equal (test->slot, test->slot));
 
-	other_mod = gck_module_new (gck_module_get_functions (test->module), 0);
+	other_mod = gck_module_new (gck_module_get_functions (test->module));
 	other_slot = g_object_new (GCK_TYPE_SLOT, "module", other_mod, "handle", gck_slot_get_handle (test->slot), NULL);
 	g_assert (gck_slot_equal (test->slot, other_slot));
 	g_object_unref (other_mod);
diff --git a/gcr/gcr-library.c b/gcr/gcr-library.c
index 850c1ea..07651c7 100644
--- a/gcr/gcr-library.c
+++ b/gcr/gcr-library.c
@@ -164,7 +164,7 @@ _gcr_initialize (void)
 	egg_libgcrypt_initialize ();
 
 	if (g_once_init_enter (&gcr_initialized)) {
-		all_modules = gck_modules_initialize_registered (0);
+		all_modules = gck_modules_initialize_registered ();
 
 		/*
 		 * Soon we're going to have support for using a configuration of
@@ -273,7 +273,7 @@ gcr_pkcs11_add_module_from_file (const gchar *module_path, gpointer unused,
 	g_return_val_if_fail (module_path, FALSE);
 	g_return_val_if_fail (!error || !*error, FALSE);
 
-	module = gck_module_initialize (module_path, 0, error);
+	module = gck_module_initialize (module_path, error);
 	if (module == NULL)
 		return FALSE;
 
diff --git a/gcr/tests/test-certificate-chain.c b/gcr/tests/test-certificate-chain.c
index 92284ec..9deccdd 100644
--- a/gcr/tests/test-certificate-chain.c
+++ b/gcr/tests/test-certificate-chain.c
@@ -119,7 +119,7 @@ TESTING_SETUP (certificate_chain)
 	gck_assert_cmprv (rv, ==, CKR_OK);
 
 	g_assert (!modules);
-	module = gck_module_new (&funcs, 0);
+	module = gck_module_new (&funcs);
 	modules = g_list_prepend (modules, module);
 	gcr_pkcs11_set_modules (modules);
 	uris[0] = GCK_MOCK_SLOT_ONE_URI;
diff --git a/gcr/tests/test-pkcs11-certificate.c b/gcr/tests/test-pkcs11-certificate.c
index beb0bd4..35aca70 100644
--- a/gcr/tests/test-pkcs11-certificate.c
+++ b/gcr/tests/test-pkcs11-certificate.c
@@ -69,7 +69,7 @@ TESTING_SETUP (pkcs11_certificate)
 	gck_assert_cmprv (rv, ==, CKR_OK);
 
 	g_assert (!modules);
-	module = gck_module_new (&funcs, 0);
+	module = gck_module_new (&funcs);
 	modules = g_list_prepend (modules, module);
 	gcr_pkcs11_set_modules (modules);
 	gck_list_unref_free (modules);
diff --git a/gcr/tests/test-trust.c b/gcr/tests/test-trust.c
index 545fce0..d724d9a 100644
--- a/gcr/tests/test-trust.c
+++ b/gcr/tests/test-trust.c
@@ -64,7 +64,7 @@ TESTING_SETUP (trust_setup)
 	gck_assert_cmprv (rv, ==, CKR_OK);
 
 	g_assert (!modules);
-	module = gck_module_new (&funcs, 0);
+	module = gck_module_new (&funcs);
 	modules = g_list_prepend (modules, module);
 	gcr_pkcs11_set_modules (modules);
 	gck_list_unref_free (modules);



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