[gcr] Revert changes to libtool version and removed API
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] Revert changes to libtool version and removed API
- Date: Fri, 9 Dec 2011 12:51:11 +0000 (UTC)
commit 358a4d29c50e09525591a929c4b86b168f05e31e
Author: Stef Walter <stefw collabora co uk>
Date: Fri Dec 9 07:16:18 2011 +0100
Revert changes to libtool version and removed API
* There were problems with applications that didn't use libgck but
linked to the old version with the old libtool number: empathy
* So stub out the removed functions, revert the libtool version changes
instead of removing those functions.
This reverts commit ef7e91d66839d4104ee6ba9681e49506f5dd5fa3.
configure.ac | 2 +-
docs/reference/gck/gck-sections.txt | 26 +++-
docs/reference/gcr/gcr-sections.txt | 1 -
gck/gck-attributes.c | 375 ++++++++++++++++++++++++++++++++++-
gck/gck-deprecated.h | 73 +++++++-
gck/gck-misc.c | 7 +
gck/gck-module.c | 8 +-
gck/gck-modules.c | 2 +-
gck/gck-slot.c | 19 ++-
gck/gck-uri.c | 17 ++-
gck/gck.h | 10 +-
gck/gck.symbols | 21 ++
gck/tests/test-gck-attributes.c | 15 ++-
gck/tests/test-gck-module.c | 4 +-
gck/tests/test-gck-modules.c | 4 +-
gck/tests/test-gck-slot.c | 2 +-
gck/tests/test-gck-uri.c | 2 +-
gcr/gcr-importer.c | 2 +-
gcr/gcr-key-mechanisms.c | 2 +-
19 files changed, 565 insertions(+), 27 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e5b586f..e21581e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@ GCK_MINOR=0
GCK_MICRO=0
# GCK libtool versioning
-GCK_CURRENT=1
+GCK_CURRENT=0
GCK_REVISION=0
GCK_AGE=0
diff --git a/docs/reference/gck/gck-sections.txt b/docs/reference/gck/gck-sections.txt
index 936da1a..523591a 100644
--- a/docs/reference/gck/gck-sections.txt
+++ b/docs/reference/gck/gck-sections.txt
@@ -89,11 +89,29 @@ gck_builder_find_boolean
gck_builder_find_date
gck_builder_find_string
gck_builder_find_ulong
+gck_attributes_add
+gck_attributes_add_all
+gck_attributes_add_boolean
+gck_attributes_add_data
+gck_attributes_add_date
+gck_attributes_add_empty
+gck_attributes_add_invalid
+gck_attributes_add_string
+gck_attributes_add_ulong
+gck_attributes_dup
+gck_attributes_new_full
+gck_attributes_set
+gck_attributes_set_all
+gck_attributes_set_boolean
+gck_attributes_set_date
+gck_attributes_set_string
+gck_attributes_set_ulong
<SUBSECTION Standard>
GCK_TYPE_BUILDER
GCK_TYPE_BUILDER_FLAGS
GCK_TYPE_ATTRIBUTES
gck_attributes_get_type
+gck_attributes_get_boxed_type
gck_builder_flags_get_type
gck_builder_get_type
GckAllocator
@@ -191,6 +209,8 @@ GckSlotPrivate
GCK_TYPE_MECHANISM_INFO
GCK_TYPE_SLOT_INFO
GCK_TYPE_TOKEN_INFO
+GckMechanisms
+gck_mechanisms_free
gck_mechanism_info_get_type
gck_slot_info_get_type
gck_token_info_get_type
@@ -373,6 +393,7 @@ gck_uri_data_copy
gck_uri_data_free
GCK_URI_ERROR
<SUBSECTION Private>
+gck_uri_get_error_quark
GCK_URI_DATA_TYPE
gck_uri_data_get_type
gck_uri_error_get_quark
@@ -436,6 +457,7 @@ gck_value_to_boolean
gck_value_to_ulong
GCK_INVALID
<SUBSECTION Private>
+gck_get_error_quark
gck_error_get_quark
GCK_TYPE_LIST
gck_list_get_boxed_type
@@ -446,4 +468,6 @@ gck_error_get_type
<SECTION>
<FILE>gck-private</FILE>
<SUBSECTION Private>
-</SECTION>
+GCK_URI_BAD_PREFIX
+CKR_GCK_MODULE_PROBLEM
+</SECTION>
\ No newline at end of file
diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt
index f7c916e..29432bc 100644
--- a/docs/reference/gcr/gcr-sections.txt
+++ b/docs/reference/gcr/gcr-sections.txt
@@ -376,7 +376,6 @@ gcr_collection_model_new
gcr_collection_model_new_full
gcr_collection_model_set_columns
gcr_collection_model_get_collection
-gcr_collection_model_set_collection
gcr_collection_model_iter_for_object
gcr_collection_model_object_for_iter
gcr_collection_model_is_selected
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index a8e5839..b8d8530 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -2096,10 +2096,21 @@ gck_attributes_get_type (void)
return type;
}
+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
+ * @...: the other empty attribute types
*
- * Creates an GckAttributes array with no attributes.
+ * Creates an GckAttributes array with empty attributes
+ *
+ * Terminate the argument list with %GCK_INVALID.
*
* The returned set of attributes is floating, and should either be passed to
* another gck library function which consumes this floating reference, or if
@@ -2109,9 +2120,20 @@ gck_attributes_get_type (void)
* Returns: (transfer none): a floating reference to an empty set of attributes
**/
GckAttributes *
-gck_attributes_new_empty (void)
+gck_attributes_new_empty (gulong first_type,
+ ...)
{
GckBuilder builder = GCK_BUILDER_INIT;
+ va_list va;
+
+ va_start (va, first_type);
+
+ while (first_type != GCK_INVALID) {
+ gck_builder_add_empty (&builder, first_type);
+ first_type = va_arg (va, gulong);
+ }
+
+ va_end (va);
return gck_builder_end (&builder);
}
@@ -2845,3 +2867,352 @@ gck_attributes_to_string (GckAttributes *attrs)
_gck_format_attributes (output, attrs);
return g_string_free (output, FALSE);
}
+
+/**
+ * gck_attributes_new:
+ * @reserved: Should be set to always be GCK_INVALID
+ *
+ * Create a new empty GckAttributes array.
+ *
+ * The returned set of attributes is floating, and should either be passed to
+ * another gck library function which consumes this floating reference, or if
+ * you wish to keep these attributes around you should ref them with
+ * gck_attributes_ref_sink() and unref them later with gck_attributes_unref().
+ *
+ * Returns: (transfer none): a floating reference to the new attributes array;
+ * when done with the array release it with gck_attributes_unref().
+ **/
+GckAttributes *
+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 gtk_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 gtk_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 gtk_builder_set() instead.
+ *
+ * Returns: (transfer none): returns %NULL
+ **/
+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 gtk_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 gtk_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 gtk_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 gtk_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 gtk_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 gtk_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 gtk_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 gtk_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 gtk_builder_set_date() instead.
+ *
+ * Returns: (transfer none): returns %NULL
+ */
+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 gtk_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 gtk_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 gtk_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 gtk_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 gtk_attributes_ref() or gck_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-deprecated.h b/gck/gck-deprecated.h
index fb5ab33..0e3b67a 100644
--- a/gck/gck-deprecated.h
+++ b/gck/gck-deprecated.h
@@ -30,7 +30,78 @@ G_BEGIN_DECLS
#ifndef GCK_DISABLE_DEPRECATED
-/* No deprecated functions at this time */
+typedef GArray GckMechanisms;
+
+#define gck_mechanisms_free(a) (g_array_free (a, TRUE))
+
+#define CKR_GCK_MODULE_PROBLEM GCK_ERROR_MODULE_PROBLEM
+
+GQuark gck_get_error_quark (void);
+
+GQuark gck_uri_get_error_quark (void);
+
+#define GCK_URI_BAD_PREFIX GCK_URI_BAD_SCHEME
+
+GType gck_attributes_get_boxed_type (void) G_GNUC_CONST;
+
+GckAttributes * gck_attributes_new_full (GckAllocator allocator);
+
+GckAttribute * gck_attributes_add (GckAttributes *attrs,
+ GckAttribute *attr);
+
+void gck_attributes_add_all (GckAttributes *attrs,
+ GckAttributes *from);
+
+GckAttribute * gck_attributes_add_data (GckAttributes *attrs,
+ gulong attr_type,
+ const guchar *value,
+ gsize length);
+
+GckAttribute * gck_attributes_add_invalid (GckAttributes *attrs,
+ gulong attr_type);
+
+GckAttribute * gck_attributes_add_empty (GckAttributes *attrs,
+ gulong attr_type);
+
+GckAttribute* gck_attributes_add_boolean (GckAttributes *attrs,
+ gulong attr_type,
+ gboolean value);
+
+GckAttribute* gck_attributes_add_string (GckAttributes *attrs,
+ gulong attr_type,
+ const gchar *value);
+
+GckAttribute* gck_attributes_add_date (GckAttributes *attrs,
+ gulong attr_type,
+ const GDate *value);
+
+GckAttribute* gck_attributes_add_ulong (GckAttributes *attrs,
+ gulong attr_type,
+ gulong value);
+
+void gck_attributes_set (GckAttributes *attrs,
+ GckAttribute *attr);
+
+void gck_attributes_set_boolean (GckAttributes *attrs,
+ gulong attr_type,
+ gboolean value);
+
+void gck_attributes_set_ulong (GckAttributes *attrs,
+ gulong attr_type,
+ gulong value);
+
+void gck_attributes_set_string (GckAttributes *attrs,
+ gulong attr_type,
+ const gchar *value);
+
+void gck_attributes_set_date (GckAttributes *attrs,
+ gulong attr_type,
+ const GDate *value);
+
+void gck_attributes_set_all (GckAttributes *attrs,
+ GckAttributes *from);
+
+GckAttributes * gck_attributes_dup (GckAttributes *attrs);
#endif /* GCK_DISABLE_DEPRECATED */
diff --git a/gck/gck-misc.c b/gck/gck-misc.c
index 6ecdf43..42780ff 100644
--- a/gck/gck-misc.c
+++ b/gck/gck-misc.c
@@ -80,6 +80,13 @@ EGG_SECURE_DEFINE_GLIB_GLOBALS ();
*/
GQuark
+gck_get_error_quark (void)
+{
+ /* This is the deprecated version */
+ return gck_error_get_quark ();
+}
+
+GQuark
gck_error_get_quark (void)
{
static GQuark domain = 0;
diff --git a/gck/gck-module.c b/gck/gck-module.c
index ec44e7c..e5503fa 100644
--- a/gck/gck-module.c
+++ b/gck/gck-module.c
@@ -348,17 +348,17 @@ perform_initialize (Initialize *args)
/* Load the actual module */
module = g_module_open (args->path, 0);
if (!module) {
- g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
_("Error loading PKCS#11 module: %s"), g_module_error ());
- return GCK_ERROR_MODULE_PROBLEM;
+ return CKR_GCK_MODULE_PROBLEM;
}
/* Get the entry point */
if (!g_module_symbol (module, "C_GetFunctionList", (void**)&get_function_list)) {
- g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
_("Invalid PKCS#11 module: %s"), g_module_error ());
g_module_close (module);
- return GCK_ERROR_MODULE_PROBLEM;
+ return CKR_GCK_MODULE_PROBLEM;
}
/* Get the function list */
diff --git a/gck/gck-modules.c b/gck/gck-modules.c
index e4cbe96..06301e1 100644
--- a/gck/gck-modules.c
+++ b/gck/gck-modules.c
@@ -63,7 +63,7 @@ perform_initialize_registered (InitializeRegistered *args)
message = p11_kit_message ();
if (message == NULL)
message = gck_message_from_rv (rv);
- g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
_("Couldn't initialize registered PKCS#11 modules: %s"), message);
return rv;
}
diff --git a/gck/gck-slot.c b/gck/gck-slot.c
index fe25352..7dd3c2a 100644
--- a/gck/gck-slot.c
+++ b/gck/gck-slot.c
@@ -371,8 +371,14 @@ gck_mechanism_info_free (GckMechanismInfo *mech_info)
}
/**
+ * GckMechanisms:
+ *
+ * A set of GckMechanismInfo structures.
+ */
+
+/**
* gck_mechanisms_length:
- * @a: an array of unsigned long mechanism types set
+ * @a: A GckMechanisms set.
*
* Get the number of GckMechanismInfo in the set.
*
@@ -381,8 +387,8 @@ gck_mechanism_info_free (GckMechanismInfo *mech_info)
/**
* gck_mechanisms_at:
- * @a: an array of unsigned long mechanism types set
- * @i: the index of a mechanism type
+ * @a: A GckMechanisms set.
+ * @i: The index of a mechanism
*
* Get a specific mechanism in a the set.
*
@@ -390,6 +396,13 @@ gck_mechanism_info_free (GckMechanismInfo *mech_info)
*/
/**
+ * gck_mechanisms_free:
+ * @a: A GckMechanism set.
+ *
+ * Free a GckMechanisms set.
+ */
+
+/**
* gck_mechanisms_check:
* @mechanisms: A list of mechanisms, perhaps retrieved from gck_slot_get_mechanisms().
* @...: A list of mechanism types followed by GCK_INVALID.
diff --git a/gck/gck-uri.c b/gck/gck-uri.c
index 6a19bc5..d8665fa 100644
--- a/gck/gck-uri.c
+++ b/gck/gck-uri.c
@@ -119,7 +119,15 @@
*/
/**
- * GCK_ERROR_MODULE_PROBLEM:
+ * GCK_URI_BAD_PREFIX:
+ *
+ * Use %GCK_URI_BAD_SCHEME instead.
+ *
+ * Deprecated: Since 3.2
+ */
+
+/**
+ * CKR_GCK_MODULE_PROBLEM:
*
* Use %GCK_ERROR_MODULE_PROBLEM instead.
*
@@ -137,6 +145,13 @@ struct _GckUri {
};
GQuark
+gck_uri_get_error_quark (void)
+{
+ /* This is deprecated version */
+ return gck_uri_get_error_quark ();
+}
+
+GQuark
gck_uri_error_get_quark (void)
{
static GQuark domain = 0;
diff --git a/gck/gck.h b/gck/gck.h
index 5500d37..da3814f 100644
--- a/gck/gck.h
+++ b/gck/gck.h
@@ -32,7 +32,6 @@
#define __GCK_INSIDE_HEADER__
-#include "gck-deprecated.h"
#include "gck-enum-types.h"
G_BEGIN_DECLS
@@ -336,11 +335,14 @@ GckBuilder * gck_builder_copy (GckBuilder *builder
void gck_builder_clear (GckBuilder *builder);
-#define GCK_TYPE_ATTRIBUTES (gck_attributes_get_type ())
+#define GCK_TYPE_ATTRIBUTES (gck_attributes_get_boxed_type ())
GType gck_attributes_get_type (void) G_GNUC_CONST;
-GckAttributes * gck_attributes_new_empty (void);
+GckAttributes * gck_attributes_new (gulong reserved);
+
+GckAttributes * gck_attributes_new_empty (gulong first_type,
+ ...);
const GckAttribute * gck_attributes_at (GckAttributes *attrs,
guint index);
@@ -1554,6 +1556,8 @@ void gck_uri_data_free (GckUriData *uri_dat
G_END_DECLS
+#include "gck-deprecated.h"
+
#undef __GCK_INSIDE_HEADER__
#endif /* GCK_H */
diff --git a/gck/gck.symbols b/gck/gck.symbols
index f402d3f..1664f94 100644
--- a/gck/gck.symbols
+++ b/gck/gck.symbols
@@ -29,19 +29,38 @@ gck_attribute_new_empty
gck_attribute_new_invalid
gck_attribute_new_string
gck_attribute_new_ulong
+gck_attributes_add
+gck_attributes_add_all
+gck_attributes_add_boolean
+gck_attributes_add_data
+gck_attributes_add_date
+gck_attributes_add_empty
+gck_attributes_add_invalid
+gck_attributes_add_string
+gck_attributes_add_ulong
gck_attributes_at
gck_attributes_contains
gck_attributes_count
gck_attributes_dump
+gck_attributes_dup
gck_attributes_find
gck_attributes_find_boolean
gck_attributes_find_date
gck_attributes_find_string
gck_attributes_find_ulong
+gck_attributes_get_boxed_type
gck_attributes_get_type
+gck_attributes_new
gck_attributes_new_empty
+gck_attributes_new_full
gck_attributes_ref
gck_attributes_ref_sink
+gck_attributes_set
+gck_attributes_set_all
+gck_attributes_set_boolean
+gck_attributes_set_date
+gck_attributes_set_string
+gck_attributes_set_ulong
gck_attributes_to_string
gck_attributes_unref
gck_builder_add_all
@@ -96,6 +115,7 @@ gck_enumerator_set_interaction
gck_enumerator_set_object_type
gck_error_get_quark
gck_error_get_type
+gck_get_error_quark
gck_list_ref_copy
gck_list_unref_free
gck_list_get_boxed_type
@@ -280,6 +300,7 @@ gck_uri_data_new
gck_uri_error_get_quark
gck_uri_error_get_type
gck_uri_flags_get_type
+gck_uri_get_error_quark
gck_uri_parse
gck_value_to_boolean
gck_value_to_ulong
diff --git a/gck/tests/test-gck-attributes.c b/gck/tests/test-gck-attributes.c
index 7c287dc..a825435 100644
--- a/gck/tests/test-gck-attributes.c
+++ b/gck/tests/test-gck-attributes.c
@@ -1040,10 +1040,23 @@ static void
test_attributes_new_empty (void)
{
GckAttributes *attrs;
+ const GckAttribute *attr;
- attrs = gck_attributes_new_empty ();
+ attrs = gck_attributes_new_empty (GCK_INVALID);
g_assert_cmpuint (gck_attributes_count (attrs), ==, 0);
gck_attributes_unref (attrs);
+
+ attrs = gck_attributes_new_empty (CKA_ID, CKA_LABEL, GCK_INVALID);
+ g_assert_cmpuint (gck_attributes_count (attrs), ==, 2);
+ attr = gck_attributes_at (attrs, 0);
+ g_assert (attr->type == CKA_ID);
+ g_assert (attr->length == 0);
+ g_assert (attr->value == NULL);
+ attr = gck_attributes_at (attrs, 1);
+ g_assert (attr->type == CKA_LABEL);
+ g_assert (attr->length == 0);
+ g_assert (attr->value == NULL);
+ gck_attributes_unref (attrs);
}
static void
diff --git a/gck/tests/test-gck-module.c b/gck/tests/test-gck-module.c
index 9c6f56a..2a1d3a1 100644
--- a/gck/tests/test-gck-module.c
+++ b/gck/tests/test-gck-module.c
@@ -94,14 +94,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)GCK_ERROR_MODULE_PROBLEM);
+ g_assert_error (error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM);
g_assert (invalid == NULL);
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)GCK_ERROR_MODULE_PROBLEM);
+ g_assert_error (error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM);
g_assert (invalid == NULL);
g_clear_error (&error);
diff --git a/gck/tests/test-gck-modules.c b/gck/tests/test-gck-modules.c
index a83e45f..e212d1c 100644
--- a/gck/tests/test-gck-modules.c
+++ b/gck/tests/test-gck-modules.c
@@ -116,7 +116,7 @@ test_token_for_uri_error (Test *test, gconstpointer unused)
slot = gck_modules_token_for_uri (test->modules, "http://invalid.uri", &error);
g_assert (slot == NULL);
g_assert (error != NULL);
- g_assert (g_error_matches (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME));
+ g_assert (g_error_matches (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX));
g_error_free (error);
}
@@ -151,7 +151,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 (object == NULL);
g_assert (error != NULL);
- g_assert (g_error_matches (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME));
+ g_assert (g_error_matches (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX));
g_error_free (error);
}
diff --git a/gck/tests/test-gck-slot.c b/gck/tests/test-gck-slot.c
index 8abcd6d..3048026 100644
--- a/gck/tests/test-gck-slot.c
+++ b/gck/tests/test-gck-slot.c
@@ -178,7 +178,7 @@ test_slot_mechanisms (Test *test, gconstpointer unused)
gck_mechanism_info_free (info);
}
- g_array_free (mechs, TRUE);
+ gck_mechanisms_free (mechs);
}
static void
diff --git a/gck/tests/test-gck-uri.c b/gck/tests/test-gck-uri.c
index 51f65bf..8370133 100644
--- a/gck/tests/test-gck-uri.c
+++ b/gck/tests/test-gck-uri.c
@@ -60,7 +60,7 @@ test_parse_bad_scheme (void)
uri_data = gck_uri_parse ("http:\\example.com\test", GCK_URI_FOR_ANY, &error);
g_assert (uri_data == NULL);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
g_error_free (error);
}
diff --git a/gcr/gcr-importer.c b/gcr/gcr-importer.c
index 9ddaa64..0e4a784 100644
--- a/gcr/gcr-importer.c
+++ b/gcr/gcr-importer.c
@@ -218,7 +218,7 @@ gcr_importer_create_for_parsed (GcrParsed *parsed)
if (attrs != NULL)
gck_attributes_ref (attrs);
else
- attrs = gck_attributes_new_empty ();
+ attrs = gck_attributes_new_empty (GCK_INVALID);
seen = g_hash_table_new (g_direct_hash, g_direct_equal);
diff --git a/gcr/gcr-key-mechanisms.c b/gcr/gcr-key-mechanisms.c
index b0afbb9..b21ccbb 100644
--- a/gcr/gcr-key-mechanisms.c
+++ b/gcr/gcr-key-mechanisms.c
@@ -74,7 +74,7 @@ find_first_usable_mechanism (GckObject *key,
break;
}
- g_array_free (mechs, TRUE);
+ gck_mechanisms_free (mechs);
if (i < n_mechanisms)
return mechanisms[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]