From 5ba99d9302cd86aee99958b71075d5288bb430aa Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 11 Jun 2016 12:09:48 +0200 Subject: common: New function split_fields. * common/stringhelp.c (split_fields): New. * common/t-stringhelp.c: Include assert.h. (test_split_fields): New. (main): Call test. Signed-off-by: Werner Koch --- common/stringhelp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/stringhelp.h') diff --git a/common/stringhelp.h b/common/stringhelp.h index d9225a3bb..b6f4167f7 100644 --- a/common/stringhelp.h +++ b/common/stringhelp.h @@ -148,6 +148,10 @@ 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); +/* Split STRING into space delimited fields and store them in the + * provided ARRAY. */ +int split_fields (char *string, char **array, int arraysize); + /* Return True if MYVERSION is greater or equal than REQ_VERSION. */ int compare_version_strings (const char *my_version, const char *req_version); -- cgit v1.2.3