aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-02-15 23:36:23 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-02-15 23:36:23 +0100
commite391a0a83f1336478d2171bbae321689b7fe8d03 (patch)
tree55d2f347612f680dd98953fdbad3bbc1f3abc1ea /src/include
parent9c0ac480cb4148a0970c915a7d8aadc2ca47874d (diff)
downloadgnunet-e391a0a83f1336478d2171bbae321689b7fe8d03.tar.gz
gnunet-e391a0a83f1336478d2171bbae321689b7fe8d03.zip
-sanitize utf8 api a bit
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_gnsrecord_lib.h12
-rw-r--r--src/include/gnunet_strings_lib.h14
2 files changed, 9 insertions, 17 deletions
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index cbf7ee15c..590d83476 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -431,7 +431,8 @@ GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd);
431 431
432 432
433/** 433/**
434 * Normalize a UTF-8 string to UTF-8 NFC 434 * Normalize a UTF-8 string to a GNS name
435 *
435 * @param src source string 436 * @param src source string
436 * @return converted result 437 * @return converted result
437 */ 438 */
@@ -440,15 +441,6 @@ GNUNET_GNSRECORD_string_normalize (const char *src);
440 441
441 442
442/** 443/**
443 * Convert a UTF-8 string to UTF-8 lowercase
444 * @param src source string
445 * @return converted result
446 */
447char *
448GNUNET_GNSRECORD_string_to_lowercase (const char *src);
449
450
451/**
452 * Convert a zone to a string (for printing debug messages). 444 * Convert a zone to a string (for printing debug messages).
453 * This is one of the very few calls in the entire API that is 445 * This is one of the very few calls in the entire API that is
454 * NOT reentrant! 446 * NOT reentrant!
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index 9dd2f733e..09c547b09 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -159,14 +159,12 @@ GNUNET_STRINGS_to_utf8 (const char *input,
159 159
160/** 160/**
161 * Normalize the utf-8 input string to NFC. 161 * Normalize the utf-8 input string to NFC.
162 * Output needs to be allocated appropriately.
163 * 162 *
164 * @param input input string 163 * @param input input string
165 * @param output output buffer 164 * @return result (freshly allocated) or NULL on error.
166 */ 165 */
167void 166char*
168GNUNET_STRINGS_utf8_normalize (const char *input, 167GNUNET_STRINGS_utf8_normalize (const char *input);
169 char *output);
170 168
171 169
172/** 170/**
@@ -192,8 +190,9 @@ GNUNET_STRINGS_from_utf8 (const char *input,
192 * 190 *
193 * @param input input string 191 * @param input input string
194 * @param output output buffer 192 * @param output output buffer
193 * @return GNUNET_OK on success
195 */ 194 */
196void 195enum GNUNET_GenericReturnValue
197GNUNET_STRINGS_utf8_tolower (const char *input, 196GNUNET_STRINGS_utf8_tolower (const char *input,
198 char *output); 197 char *output);
199 198
@@ -204,8 +203,9 @@ GNUNET_STRINGS_utf8_tolower (const char *input,
204 * 203 *
205 * @param input input string 204 * @param input input string
206 * @param output output buffer 205 * @param output output buffer
206 * @return GNUNET_OK on success
207 */ 207 */
208void 208enum GNUNET_GenericReturnValue
209GNUNET_STRINGS_utf8_toupper (const char *input, 209GNUNET_STRINGS_utf8_toupper (const char *input,
210 char *output); 210 char *output);
211 211