Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCB3C1016E for ; Fri, 7 Mar 2014 17:49:44 +0000 (UTC) Received: (qmail 46475 invoked by uid 500); 7 Mar 2014 17:49:43 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 46433 invoked by uid 500); 7 Mar 2014 17:49:41 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 46426 invoked by uid 99); 7 Mar 2014 17:49:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 17:49:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 17:49:40 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1B528238890D; Fri, 7 Mar 2014 17:49:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1575341 - /apr/apr/branches/1.5.x/include/apr_strings.h Date: Fri, 07 Mar 2014 17:49:20 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140307174920.1B528238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Fri Mar 7 17:49:19 2014 New Revision: 1575341 URL: http://svn.apache.org/r1575341 Log: A mechanism to avoid strlen reparsing of newly parsed apr_strtok elements Modified: apr/apr/branches/1.5.x/include/apr_strings.h Modified: apr/apr/branches/1.5.x/include/apr_strings.h URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_strings.h?rev=1575341&r1=1575340&r2=1575341&view=diff ============================================================================== --- apr/apr/branches/1.5.x/include/apr_strings.h (original) +++ apr/apr/branches/1.5.x/include/apr_strings.h Fri Mar 7 17:49:19 2014 @@ -235,8 +235,14 @@ APR_DECLARE(apr_status_t) apr_tokenize_t * 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);