delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2005/01/04/18:57:24

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Tue, 04 Jan 2005 16:56:32 -0700
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: More complaints from tests/libclink/check
In-reply-to: <200501012001.j01K1YMM023795@speedy.ludd.ltu.se>
To: djgpp-workers AT delorie DOT com
Message-id: <jnamt0hbni7sacd529hkh8tqq7eelc0qob@4ax.com>
Organization: Systematic Software
MIME-version: 1.0
X-Mailer: Forte Agent 1.93/32.576 English (American)
References: <m4ect01p964inq4g0pb0dtk3u90p4e3mn2 AT 4ax DOT com>
<200501012001 DOT j01K1YMM023795 AT speedy DOT ludd DOT ltu DOT se>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j04NuYZp011948
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 01 Jan 2005 21:01:34 +0100 (CET), ams AT ludd DOT ltu DOT se wrote:

>According to Brian Inglis:
>> On Sat, 01 Jan 2005 04:13:50 +0100 (CET), ams AT ludd DOT ltu DOT se wrote:
>> >You just define your (POSIX) functions that does the real work, adding
>> >them as stubs to <libc/stubs.h> and letting the C (89 or 99) call them
>> >as necessary.
>> 
>> I am not sure what you mean by stubs here? 
>
>I implemented strtok_r() yesterday. This is what I did.
>
>1. Move strtok.c to strtok_r.c (note: different directories).
>
>2. Edit strtok_r.c to have the right parameters and adjust code for
>"function parameter memory" instead of static variable.
>
>3. Add strtok_r.c to makefile.
>
>4. Add new strtok() in strtok.c that calls strtok_r().
>
>5. 4 means that strtok_r will pollute ansi namespace, hence I added
>strtok_r to <libc/stubs.h>. Added #include <libc/stubs.h> to strtok.c
>and strtok_r.c. (Actually I haven't done this yet, but will.)
>
>6. Copied strtok.txh to strtok_r.txh and adjusted it accordingly.
>
>Questions?

Does strtok_r.c define _strtok_r()?

Does the prototype declaration for strtok_r() appear in string.h
between #ifndef _STRICT_ANSI and #ifndef _POSIX_SOURCE? 

The time *_r() functions make most sense if implemented in ctime.c, as
static functions there do most of the work. 

I found I had to prototype the _*_r() functions in ctime.c to quiet
3.4.* compiler warnings. 

-- 
Thanks. Take care, Brian Inglis

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019