aboutsummaryrefslogtreecommitdiffstats
path: root/common/stringhelp.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-01-08 07:58:21 +0000
committerWerner Koch <[email protected]>2016-01-08 07:58:21 +0000
commit4d7ac43ff71fdadfd2e04621f74840a82fbe788a (patch)
treeacdc15bbc063cec98d836327a8129ccbf0aaaef2 /common/stringhelp.h
parentcommon: New function get_assuan_server_version. (diff)
downloadgnupg-4d7ac43ff71fdadfd2e04621f74840a82fbe788a.tar.gz
gnupg-4d7ac43ff71fdadfd2e04621f74840a82fbe788a.zip
common: New function compare_version_strings.
* common/stringhelp.c (parse_version_number): New. (parse_version_string): New. (compare_version_strings): New. * common/t-stringhelp.c (test_compare_version_strings): New. (main): Call test. Return ERRCOUNT instead of 0. -- The code for that function is based on code from libgcrypt. Similar code is in all GnuPG related libraries this function is a candidates for inclusion in libgpg-error. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--common/stringhelp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/stringhelp.h b/common/stringhelp.h
index c813662c7..d9225a3bb 100644
--- a/common/stringhelp.h
+++ b/common/stringhelp.h
@@ -148,6 +148,9 @@ char **strsplit (char *string, char delim, char replacement, int *count);
/* Tokenize STRING using the set of delimiters in DELIM. */
char **strtokenize (const char *string, const char *delim);
+/* Return True if MYVERSION is greater or equal than REQ_VERSION. */
+int compare_version_strings (const char *my_version, const char *req_version);
+
/* Format a string so that it fits within about TARGET_COLS columns. */
char *format_text (char *text, int in_place, int target_cols, int max_cols);