diff options
author | Werner Koch <[email protected]> | 2024-10-29 09:37:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-10-29 11:00:11 +0000 |
commit | c835676f7dfe39830d5b0500ad2cb809832428d1 (patch) | |
tree | ddb8f1016ff8bb67f7cef0bc5fedfdfd4b3c1eb3 /src/util.h | |
parent | qt: Fix typo (diff) | |
download | gpgme-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.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |