aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-10-29 09:37:15 +0000
committerWerner Koch <[email protected]>2024-10-29 11:00:11 +0000
commitc835676f7dfe39830d5b0500ad2cb809832428d1 (patch)
treeddb8f1016ff8bb67f7cef0bc5fedfdfd4b3c1eb3 /src/util.h
parentqt: Fix typo (diff)
downloadgpgme-c835676f7dfe39830d5b0500ad2cb809832428d1.tar.gz
gpgme-c835676f7dfe39830d5b0500ad2cb809832428d1.zip
core: Add new helper _gpgme_strtokenize.
* src/conversion.c (spacep): New. (_gpgme_strtokenize): New. -- Function taken from GnuPG and license changed to LGPL 2.1. The version in GnuPG was entirely written by the author.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 03b800a0..ea92440a 100644
--- a/src/util.h
+++ b/src/util.h
@@ -140,6 +140,11 @@ gpgme_error_t _gpgme_encode_percent_string (const char *src, char **destp,
* modifies STRING. The number of parsed fields is returned. */
int _gpgme_split_fields (char *string, char **array, int arraysize);
+/* Tokenize STRING using the set of delimiters in DELIM into a NULL
+ * delimited array. Leading spaces and tabs are removed from all
+ * tokens if TRIM is set. The caller must free the result. */
+char **_gpgme_strtokenize (const char *string, const char *delim, int trim);
+
/* Convert the field STRING into an unsigned long value. Check for
* trailing garbage. */
gpgme_error_t _gpgme_strtoul_field (const char *string, unsigned long *result);