aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-05-21 08:21:06 +0000
committerWerner Koch <[email protected]>2016-05-21 08:31:20 +0000
commita92946a8cacc44f655249d84b316deae59e62671 (patch)
treea3b25f4cef4cb6ab3cfdb5940d92f714949a88e9 /src/util.h
parentQt: Add test for changeownertrust (diff)
downloadgpgme-a92946a8cacc44f655249d84b316deae59e62671.tar.gz
gpgme-a92946a8cacc44f655249d84b316deae59e62671.zip
core: New functions to help parsing of status lines.
* src/conversion.c (_gpgme_split_fields): New. (_gpgme_strtoul_field): New. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 365f1d83..9c62f57d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -124,6 +124,15 @@ gpgme_error_t _gpgme_decode_percent_string (const char *src, char **destp,
gpgme_error_t _gpgme_encode_percent_string (const char *src, char **destp,
size_t len);
+/* Split a string into space delimited fields and remove leading and
+ * trailing spaces from each field. A pointer to the each field is
+ * stored in ARRAY. Stop splitting at ARRAYSIZE fields. The function
+ * modifies STRING. The number of parsed fields is returned. */
+int _gpgme_split_fields (char *string, char **array, int arraysize);
+
+/* 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);
/* Parse the string TIMESTAMP into a time_t. The string may either be
seconds since Epoch or in the ISO 8601 format like