X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Date: Mon, 17 Oct 2011 22:24:32 +0200 From: Eli Zaretskii Subject: Re: I need strtok_r() function In-reply-to: <3533b2fa-8962-47c1-a6a8-373cc0e8a1f3@g7g2000vbv.googlegroups.com> To: djgpp AT delorie DOT com Message-id: <83zkgzv01r.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 X-012-Sender: halo1 AT inter DOT net DOT il References: <8339erwjdk DOT fsf AT gnu DOT org> <3533b2fa-8962-47c1-a6a8-373cc0e8a1f3 AT g7g2000vbv DOT googlegroups DOT com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by delorie.com id p9HKPgxM004538 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: RayeR > Date: Mon, 17 Oct 2011 12:39:00 -0700 (PDT) > > > Just use strtok.  There are no reentrancy issues with DJGPP, since > > it's all single-threaded. > > OK, but > char *strtok(char *_s1, const char *_s2); > has only 2 arguments. The 3rd argument is described: > s3 is a value-return parameter used by strtok_r() to record its > progress through s1. > > I'm not sure if I could safely delete s3 in function call. Yes, you can. s3 is set by strtok_r and used only by it. strtok doesn't need this argument, because it keeps track of its progress internally. If you want less source level changes, you can define a macro, something like (untested): #define strtok_r(s1,s2,s3) strtok(s1,s2)