[gcr/main: 4/24] gck: Remove deprecated header
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr/main: 4/24] gck: Remove deprecated header
- Date: Mon, 7 Feb 2022 11:10:49 +0000 (UTC)
commit d0907c3c0a8ce67ca99d181966176ac6f5245ff4
Author: Corentin Noël <corentin noel collabora com>
Date: Tue Nov 23 15:32:22 2021 +0100
gck: Remove deprecated header
gck/gck-attributes.c | 331 -----------------------------------------------
gck/gck-deprecated.h | 130 -------------------
gck/gck-misc.c | 7 -
gck/gck-module.c | 4 +-
gck/gck-modules.c | 4 +-
gck/gck-uri.c | 23 ----
gck/gck.h | 2 -
gck/meson.build | 1 -
gck/test-gck-module.c | 4 +-
gck/test-gck-modules.c | 4 +-
gck/test-gck-slot.c | 2 +-
gck/test-gck-uri.c | 2 +-
gcr/gcr-key-mechanisms.c | 2 +-
13 files changed, 11 insertions(+), 505 deletions(-)
---
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index 33044a7..25e794d 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -2032,13 +2032,6 @@ gck_attribute_hash (gconstpointer attr)
G_DEFINE_BOXED_TYPE (GckAttributes, gck_attributes,
gck_attributes_ref, gck_attributes_unref)
-GType
-gck_attributes_get_boxed_type (void)
-{
- /* Deprecated version */
- return gck_attributes_get_type ();
-}
-
/**
* gck_attributes_new_empty:
* @first_type: the first empty attribute type
@@ -2828,327 +2821,3 @@ gck_attributes_new (gulong reserved)
GckBuilder builder = GCK_BUILDER_INIT;
return gck_builder_end (&builder);
}
-
-/**
- * gck_attributes_new_full: (skip)
- * @allocator: memory allocator for attribute data, or %NULL for default
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_all] instead.
- *
- * Returns: returns %NULL
- **/
-GckAttributes *
-gck_attributes_new_full (GckAllocator allocator)
-{
- g_warning ("gck_attributes_new_full() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add:
- * @attrs: the attributes array to add to
- * @attr: the attribute to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_all] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add (GckAttributes *attrs,
- GckAttribute *attr)
-{
- g_warning ("gck_attributes_add() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set:
- * @attrs: attributes array to add to
- * @attr: attribute to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_data] instead.
- **/
-void
-gck_attributes_set (GckAttributes *attrs,
- GckAttribute *attr)
-{
- g_warning ("gck_attributes_set() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_data:
- * @attrs: The attributes array to add to.
- * @attr_type: The type of attribute to add.
- * @value: (array length=length): the raw memory of the attribute value
- * @length: The length of the attribute value.
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_data] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_data (GckAttributes *attrs,
- gulong attr_type,
- const guchar *value,
- gsize length)
-{
- g_warning ("gck_attributes_add_data() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add_invalid:
- * @attrs: The attributes array to add to.
- * @attr_type: The type of attribute to add.
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_invalid] instead
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_invalid (GckAttributes *attrs,
- gulong attr_type)
-{
- g_warning ("gck_attributes_add_invalid() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add_empty:
- * @attrs: The attributes array to add.
- * @attr_type: The type of attribute to add.
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_empty] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_empty (GckAttributes *attrs,
- gulong attr_type)
-{
- g_warning ("gck_attributes_add_empty() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add_boolean:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the boolean value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_boolean] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_boolean (GckAttributes *attrs,
- gulong attr_type,
- gboolean value)
-{
- g_warning ("gck_attributes_add_boolean() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_boolean:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: boolean value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_boolean] instead.
- */
-void
-gck_attributes_set_boolean (GckAttributes *attrs,
- gulong attr_type,
- gboolean value)
-{
- g_warning ("gck_attributes_set_boolean() is no no longer supported");
-
-}
-
-/**
- * gck_attributes_add_string:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the null terminated string value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_string] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_string (GckAttributes *attrs,
- gulong attr_type,
- const gchar *value)
-{
- g_warning ("gck_attributes_add_string() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_string:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: null terminated string value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_string] instead.
- */
-void
-gck_attributes_set_string (GckAttributes *attrs,
- gulong attr_type,
- const gchar *value)
-{
- g_warning ("gck_attributes_set_string() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_date:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the GDate value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_date] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_date (GckAttributes *attrs,
- gulong attr_type,
- const GDate *value)
-{
- g_warning ("gck_attributes_add_date() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_date:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: date value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_date] instead.
- */
-void
-gck_attributes_set_date (GckAttributes *attrs,
- gulong attr_type,
- const GDate *value)
-{
- g_warning ("gck_attributes_set_date() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_ulong:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the gulong value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_ulong] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_ulong (GckAttributes *attrs,
- gulong attr_type,
- gulong value)
-{
- g_warning ("gck_attributes_add_ulong() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_ulong:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: gulong value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_ulong] instead.
- */
-void
-gck_attributes_set_ulong (GckAttributes *attrs,
- gulong attr_type,
- gulong value)
-{
- g_warning ("gck_attributes_set_ulong() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_all:
- * @attrs: a set of attributes
- * @from: attributes to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_all] instead.
- */
-void
-gck_attributes_add_all (GckAttributes *attrs,
- GckAttributes *from)
-{
- g_warning ("gck_attributes_add_all() is no no longer supported");
-}
-
-/**
- * gck_attributes_set_all:
- * @attrs: set of attributes
- * @from: attributes to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_all] instead.
- */
-void
-gck_attributes_set_all (GckAttributes *attrs,
- GckAttributes *from)
-{
- g_warning ("gck_attributes_set_all() is no no longer supported");
-}
-
-/**
- * gck_attributes_dup:
- * @attrs: set of attributes to copy
- *
- * #GckAttributes are now immutable, and can be used in mulitple places.
- *
- * Deprecated: 3.4: Use gck_attributes_ref() or [method@Builder.add_all] instead.
- *
- * Returns: (transfer none): a new floating #GckAttributes
- */
-GckAttributes *
-gck_attributes_dup (GckAttributes *attrs)
-{
- GckBuilder builder = GCK_BUILDER_INIT;
-
- if (attrs == NULL)
- return NULL;
-
- gck_builder_add_all (&builder, attrs);
- return gck_builder_end (&builder);
-}
diff --git a/gck/gck-misc.c b/gck/gck-misc.c
index e2fbbf8..2c864a1 100644
--- a/gck/gck-misc.c
+++ b/gck/gck-misc.c
@@ -102,13 +102,6 @@ EGG_SECURE_DEFINE_GLIB_GLOBALS ();
* The error domain for gck library errors.
*/
-GQuark
-gck_get_error_quark (void)
-{
- /* This is the deprecated version */
- return gck_error_get_quark ();
-}
-
GQuark
gck_error_get_quark (void)
{
diff --git a/gck/gck-module.c b/gck/gck-module.c
index a50f78d..935bbeb 100644
--- a/gck/gck-module.c
+++ b/gck/gck-module.c
@@ -321,9 +321,9 @@ perform_initialize (Initialize *args)
funcs = p11_kit_module_load (args->path, P11_KIT_MODULE_CRITICAL);
if (funcs == NULL) {
- g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
_("Error loading PKCS#11 module: %s"), p11_kit_message ());
- return CKR_GCK_MODULE_PROBLEM;
+ return GCK_ERROR_MODULE_PROBLEM;
}
result = g_object_new (GCK_TYPE_MODULE,
diff --git a/gck/gck-modules.c b/gck/gck-modules.c
index 97d7f01..fb9b93e 100644
--- a/gck/gck-modules.c
+++ b/gck/gck-modules.c
@@ -56,9 +56,9 @@ perform_initialize_registered (InitializeRegistered *args)
modules = p11_kit_modules_load_and_initialize (0);
if (modules == NULL) {
- g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
_("Couldn’t initialize registered PKCS#11 modules: %s"), p11_kit_message ());
- return CKR_GCK_MODULE_PROBLEM;
+ return GCK_ERROR_MODULE_PROBLEM;
}
for (funcs = modules; *funcs; ++funcs) {
diff --git a/gck/gck-uri.c b/gck/gck-uri.c
index ba92715..e0c3faf 100644
--- a/gck/gck-uri.c
+++ b/gck/gck-uri.c
@@ -96,22 +96,6 @@
* Error domain for URI errors.
*/
-/**
- * GCK_URI_BAD_PREFIX:
- *
- * Use %GCK_URI_BAD_SCHEME instead.
- *
- * Deprecated: Since 3.2
- */
-
-/**
- * CKR_GCK_MODULE_PROBLEM:
- *
- * Use %GCK_ERROR_MODULE_PROBLEM instead.
- *
- * Deprecated: Since 3.4
- */
-
#define URI_PREFIX "pkcs11:"
#define N_URI_PREFIX 7
@@ -122,13 +106,6 @@ struct _GckUri {
GckAttributes *attributes;
};
-GQuark
-gck_uri_get_error_quark (void)
-{
- /* This is deprecated version */
- return gck_uri_error_get_quark ();
-}
-
GQuark
gck_uri_error_get_quark (void)
{
diff --git a/gck/gck.h b/gck/gck.h
index bb52c01..1b60308 100644
--- a/gck/gck.h
+++ b/gck/gck.h
@@ -1595,8 +1595,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (GckUriData, gck_uri_data_free);
G_END_DECLS
-#include "gck-deprecated.h"
-
#undef __GCK_INSIDE_HEADER__
#endif /* GCK_H */
diff --git a/gck/meson.build b/gck/meson.build
index a21a1e9..ee217a9 100644
--- a/gck/meson.build
+++ b/gck/meson.build
@@ -56,7 +56,6 @@ gck_sources = [
gck_exported_headers = [
gck_headers,
gck_version_h,
- 'gck-deprecated.h',
'pkcs11.h',
'pkcs11n.h',
'pkcs11x.h',
diff --git a/gck/test-gck-module.c b/gck/test-gck-module.c
index 91e7e4d..0cd8c1c 100644
--- a/gck/test-gck-module.c
+++ b/gck/test-gck-module.c
@@ -95,14 +95,14 @@ test_invalid_modules (Test *test, gconstpointer unused)
/* Shouldn't be able to load modules */
invalid = gck_module_initialize ("blah-blah-non-existant", NULL, &error);
- g_assert_error (error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM);
+ g_assert_error (error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM);
g_assert_null (invalid);
g_clear_error (&error);
/* Shouldn't be able to load any file successfully */
invalid = gck_module_initialize ("/usr/lib/libm.so", NULL, &error);
- g_assert_error (error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM);
+ g_assert_error (error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM);
g_assert_null (invalid);
g_clear_error (&error);
diff --git a/gck/test-gck-modules.c b/gck/test-gck-modules.c
index 1468b9b..6ef994e 100644
--- a/gck/test-gck-modules.c
+++ b/gck/test-gck-modules.c
@@ -114,7 +114,7 @@ test_token_for_uri_error (Test *test, gconstpointer unused)
slot = gck_modules_token_for_uri (test->modules, "http://invalid.uri", &error);
g_assert_null (slot);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
g_error_free (error);
}
@@ -148,7 +148,7 @@ test_object_for_uri_error (Test *test, gconstpointer unused)
object = gck_modules_object_for_uri (test->modules, "http://invalid.uri", 0, &error);
g_assert_null (object);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
g_error_free (error);
}
diff --git a/gck/test-gck-slot.c b/gck/test-gck-slot.c
index c314233..4cfddbe 100644
--- a/gck/test-gck-slot.c
+++ b/gck/test-gck-slot.c
@@ -182,7 +182,7 @@ test_slot_mechanisms (Test *test, gconstpointer unused)
gck_mechanism_info_free (info);
}
- gck_mechanisms_free (mechs);
+ g_array_unref (mechs);
}
static void
diff --git a/gck/test-gck-uri.c b/gck/test-gck-uri.c
index bbfddda..57adee9 100644
--- a/gck/test-gck-uri.c
+++ b/gck/test-gck-uri.c
@@ -59,7 +59,7 @@ test_parse_bad_scheme (void)
uri_data = gck_uri_parse ("http:\\example.com\test", GCK_URI_FOR_ANY, &error);
g_assert_null (uri_data);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
g_error_free (error);
}
diff --git a/gcr/gcr-key-mechanisms.c b/gcr/gcr-key-mechanisms.c
index 7d82908..89f968a 100644
--- a/gcr/gcr-key-mechanisms.c
+++ b/gcr/gcr-key-mechanisms.c
@@ -70,7 +70,7 @@ find_first_usable_mechanism (GckObject *key,
break;
}
- gck_mechanisms_free (mechs);
+ g_array_unref (mechs);
if (i < n_mechanisms)
return mechanisms[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]