diff options
author | Stef Walter <stefw@collabora.co.uk> | 2011-11-30 09:29:56 +0100 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2011-11-30 09:47:51 +0100 |
commit | b951143ba734e7b1664b5241434a96e0ce12a0fe (patch) | |
tree | 85d24a4e40e297c544c007c75f4e96598e55e792 /gck | |
parent | 42eab234b2257ac818988d64adb0781a2d62eddb (diff) | |
download | gcr-b951143ba734e7b1664b5241434a96e0ce12a0fe.tar.gz gcr-b951143ba734e7b1664b5241434a96e0ce12a0fe.tar.bz2 gcr-b951143ba734e7b1664b5241434a96e0ce12a0fe.zip |
gck: Make the gck_attributes_to_string() function public
* Used for debugging and logging
Diffstat (limited to 'gck')
-rw-r--r-- | gck/gck-attributes.c | 13 | ||||
-rw-r--r-- | gck/gck-enumerator.c | 6 | ||||
-rw-r--r-- | gck/gck-private.h | 2 | ||||
-rw-r--r-- | gck/gck-session.c | 4 | ||||
-rw-r--r-- | gck/gck.h | 2 | ||||
-rw-r--r-- | gck/gck.symbols | 1 |
6 files changed, 20 insertions, 8 deletions
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c index b0d2738..e3f244d 100644 --- a/gck/gck-attributes.c +++ b/gck/gck-attributes.c @@ -1975,8 +1975,19 @@ _gck_format_attributes (GString *output, g_string_append (output, " ]"); } +/** + * gck_attributes_to_string: + * attrs: the attributes + * + * Print out attributes to a string in aform that's useful for debugging + * or logging. + * + * The format of the string returned may change in the future. + * + * Returns: a newly allocated string + */ gchar * -_gck_attributes_format (GckAttributes *attrs) +gck_attributes_to_string (GckAttributes *attrs) { GString *output = g_string_sized_new (128); _gck_format_attributes (output, attrs); diff --git a/gck/gck-enumerator.c b/gck/gck-enumerator.c index dc3f2f2..5ebec47 100644 --- a/gck/gck-enumerator.c +++ b/gck/gck-enumerator.c @@ -436,7 +436,7 @@ state_find (GckEnumeratorState *args, if (args->match->attributes) { attrs = _gck_attributes_commit_out (args->match->attributes, &n_attrs); if (_gck_debugging) { - gchar *string = _gck_attributes_format (args->match->attributes); + gchar *string = gck_attributes_to_string (args->match->attributes); _gck_debug ("finding objects matching: %s", string); g_free (string); } @@ -539,7 +539,7 @@ state_results (GckEnumeratorState *args, if (GCK_IS_GET_ATTRIBUTE_RV_OK (rv)) { if (_gck_debugging) { - gchar *string = _gck_attributes_format (attrs); + gchar *string = gck_attributes_to_string (attrs); _gck_debug ("retrieved attributes for object %lu: %s", result->handle, string); g_free (string); @@ -699,7 +699,7 @@ created_enumerator (GckUriData *uri_data, { if (_gck_debugging) { gchar *attrs, *uri; - attrs = uri_data->attributes ? _gck_attributes_format (uri_data->attributes) : NULL; + attrs = uri_data->attributes ? gck_attributes_to_string (uri_data->attributes) : NULL; uri = uri_data ? gck_uri_build (uri_data, GCK_URI_FOR_TOKEN | GCK_URI_FOR_MODULE) : NULL; _gck_debug ("for = %s, tokens = %s, objects = %s", type, uri, attrs); g_free (attrs); diff --git a/gck/gck-private.h b/gck/gck-private.h index 5e265fe..3926fe1 100644 --- a/gck/gck-private.h +++ b/gck/gck-private.h @@ -52,8 +52,6 @@ CK_ATTRIBUTE_PTR _gck_attributes_commit_in (GckAttributes *attrs CK_ATTRIBUTE_PTR _gck_attributes_commit_out (GckAttributes *attrs, CK_ULONG_PTR n_attrs); -gchar * _gck_attributes_format (GckAttributes *attrs); - /* ---------------------------------------------------------------------------- * MISC */ diff --git a/gck/gck-session.c b/gck/gck-session.c index fa62af1..50681bb 100644 --- a/gck/gck-session.c +++ b/gck/gck-session.c @@ -1387,7 +1387,7 @@ perform_create_object (CreateObject *args) &args->object); if (_gck_debugging) { - gchar *string = _gck_attributes_format (args->attrs); + gchar *string = gck_attributes_to_string (args->attrs); if (rv == CKR_OK) _gck_debug ("created object: %s", string); else @@ -1511,7 +1511,7 @@ perform_find_objects (FindObjects *args) CK_RV rv; if (_gck_debugging) { - gchar *string = _gck_attributes_format (args->attrs); + gchar *string = gck_attributes_to_string (args->attrs); _gck_debug ("matching: %s", string); g_free (string); } @@ -290,6 +290,8 @@ GckAttributes * gck_attributes_dup (GckAttributes *attr void gck_attributes_dump (GckAttributes *attrs); +gchar * gck_attributes_to_string (GckAttributes *attrs); + /* ------------------------------------------------------------------------- * FORWARDS */ diff --git a/gck/gck.symbols b/gck/gck.symbols index 7e87aa1..d3aef3e 100644 --- a/gck/gck.symbols +++ b/gck/gck.symbols @@ -60,6 +60,7 @@ gck_attributes_set_boolean gck_attributes_set_date gck_attributes_set_string gck_attributes_set_ulong +gck_attributes_to_string gck_attributes_unref gck_enumerator_get_chained gck_enumerator_get_interaction |