diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-03-15 11:54:55 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-03-15 11:54:55 +0200 |
commit | 35052b96232810cbf0d91a4f1d1d3ff25a142fd0 (patch) | |
tree | e950369f14295a9f35eca7a4cd37b20a746bf363 /rpmio/argv.h | |
parent | 8c5332984e32d27d28f9a440947b070af0d14c45 (diff) | |
download | librpm-tizen-35052b96232810cbf0d91a4f1d1d3ff25a142fd0.tar.gz librpm-tizen-35052b96232810cbf0d91a4f1d1d3ff25a142fd0.tar.bz2 librpm-tizen-35052b96232810cbf0d91a4f1d1d3ff25a142fd0.zip |
Add an enhanced argvSplitString() function for splitting strings to argv's
- Returns the newly created argv instead of useless "this always returns 0"
- By default make a "real" split, including empty strings
- Flags argument allows controlling behavior, for now only flag is to
preserve argvSplit() behavior but leaves room for future enhancements
such as quoted splitting etc
Diffstat (limited to 'rpmio/argv.h')
-rw-r--r-- | rpmio/argv.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rpmio/argv.h b/rpmio/argv.h index 6a6fc7f14..86ec1373a 100644 --- a/rpmio/argv.h +++ b/rpmio/argv.h @@ -138,6 +138,20 @@ int argvAddNum(ARGV_t * argvp, int val); */ int argvAppend(ARGV_t * argvp, ARGV_const_t av); +typedef enum argvFlags_e { + ARGV_NONE = 0, + ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */ +} argvFlags; + +/** \ingroup rpmargv + * Split a string into an argv array. + * @param str string arg to split + * @param seps seperator characters + * @param flags flags to control behavior + * @return argv array + */ +ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags); + /** \ingroup rpmargv * Split a string into an argv array. * @retval *argvp argv array |