Deutsch   English   Français   Italiano  
<87o716w5w2.fsf@nosuchdomain.example.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: Something like string-streams existing in "C"?
Date: Fri, 20 Dec 2024 10:45:01 -0800
Organization: None to speak of
Lines: 20
Message-ID: <87o716w5w2.fsf@nosuchdomain.example.com>
References: <vjvsvb$2i07u$1@dont-email.me>
	<vk179b$2s9oa$1@bluemanedhawk.eternal-september.org>
	<20241219114135.611@kylheku.com> <20241219220435.00001140@yahoo.com>
	<20241219140545.869@kylheku.com> <vk2jtp$34hel$1@dont-email.me>
	<20241220130056.000029e4@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 20 Dec 2024 19:45:03 +0100 (CET)
Injection-Info: dont-email.me; posting-host="02872b6dfbe0db08082cdbb7f2d2a958";
	logging-data="3763686"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19uZ4VwlWT3AdTMd/YYetcS"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:B4v60iYqR9yrHNbvVDO3Lf4Z7kI=
	sha1:firTSmQUo36AyOLUOurkB44O+/o=
Bytes: 2031

Michael S <already5chosen@yahoo.com> writes:
> On Thu, 19 Dec 2024 23:14:17 -0300
> Thiago Adams <thiago.adams@gmail.com> wrote:
[...]
>> The standard should have a string stream compatible with FILE because
>> - differently of asprintf - if cannot be implemented separately.
>
> What level of compatibility?
> IMHO, the level that makes sense is where compatibility excludes
> fopen, fclose and fflush. I.e. you have new functions, mem_fopen()
> and mem_fclose() and do not allow fflush(). Pluse, you add few more
> functions or macros for direct access to buffer.

POSIX defines fmemopen(), similar to fopen().

FILE *fmemopen(void *restrict buf, size_t max_size, const char *restrict mode);

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */