diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2014-03-07 17:49:19 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2014-03-07 17:49:19 +0000 |
commit | fcd6f1683a42f841732fd8f49273f84e4536b516 (patch) | |
tree | c3d4c632c84139dc073c259cbd5fbcb2bc428856 /include/apr_strings.h | |
parent | 41b846d4e4dfc9d5e5ce3942623dc9bed098b4d9 (diff) | |
download | libapr-fcd6f1683a42f841732fd8f49273f84e4536b516.tar.gz |
A mechanism to avoid strlen reparsing of newly parsed apr_strtok elements
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1575341 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_strings.h')
-rw-r--r-- | include/apr_strings.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/apr_strings.h b/include/apr_strings.h index ed41931fb..c0642adb2 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -235,8 +235,14 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * first call to apr_strtok() for a given string, and NULL * on subsequent calls. * @param sep The set of delimiters - * @param last Internal state saved by apr_strtok() between calls. + * @param last State saved by apr_strtok() between calls. * @return The next token from the string + * @note the 'last' state points to the trailing NUL char of the final + * token, otherwise it points to the character following the current + * token (all successive or empty occurances of sep are skiped on the + * subsequent call to apr_strtok). Therefore it is possible to avoid + * a strlen() determination, with the following logic; + * toklen = last - retval; if (*last) --toklen; */ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); |