]> granicus.if.org Git - p11-kit/commitdiff
Add function p11_kit_uri_space_strlen() for figuring out the length
authorStef Walter <stefw@collabora.co.uk>
Mon, 30 May 2011 11:12:01 +0000 (13:12 +0200)
committerStef Walter <stefw@collabora.co.uk>
Mon, 30 May 2011 11:12:46 +0000 (13:12 +0200)
of space terminated strings.

doc/p11-kit-sections.txt
p11-kit/uri.c
p11-kit/uri.h

index baae53fe08117ba3a3e39ded2a22531e98e35d0f..c82d6e342e206d34ac944d3be3e066dfe97cebaf 100644 (file)
@@ -43,6 +43,7 @@ p11_kit_finalize_module
 <SECTION>
 <FILE>p11-kit-util</FILE>
 p11_kit_strerror
+p11_kit_uri_space_strlen
 <SUBSECTION Private>
 CK_FUNCTION_LIST_PTR
 CK_RV
index 55b08095443e1f4b17037784c95af8f7b85c6b19..b3cbc6ab0989969300352101a3bb93913c9f3f30 100644 (file)
@@ -724,8 +724,8 @@ p11_kit_uri_new (void)
        return uri;
 }
 
-static size_t
-space_strlen (const unsigned char *string, size_t max_length)
+size_t
+p11_kit_uri_space_strlen (const unsigned char *string, size_t max_length)
 {
        size_t i = max_length - 1;
 
@@ -796,7 +796,7 @@ format_struct_string (char **string, size_t *length, int *is_first,
        if (!value[0])
                return 1;
 
-       len = space_strlen (value, value_max);
+       len = p11_kit_uri_space_strlen (value, value_max);
        return format_encode_string (string, length, is_first, name, value, len);
 }
 
index e19166d131de22e166ef67114f173daef51ab925..c8bc9c79248a79078ee080d8519ff816677aae53 100644 (file)
@@ -140,6 +140,9 @@ void                p11_kit_uri_free                        (P11KitUri *uri);
 
 const char*         p11_kit_uri_message                     (int code);
 
+size_t              p11_kit_uri_space_strlen                (const unsigned char *string,
+                                                             size_t max_length);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif