Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix Subject: Re: an inquiry about 4.2 stdio.h Message-ID: <2353@sun.uucp> Date: Wed, 26-Jun-85 05:12:57 EDT Article-I.D.: sun.2353 Posted: Wed Jun 26 05:12:57 1985 Date-Received: Sat, 29-Jun-85 01:26:41 EDT References: <1902@ukma.UUCP> Organization: Sun Microsystems, Inc. Lines: 29 > In stdio.h on 4.2BSD, this line appears > > #define _IOSTRG 0100 > > This isn't in (at least I havn't been able to find it) in either > 2.9BSD or sysV. > > Can someone please tell me what effect _IOSTRG has so that I > can (attempt) to emulate it? It tells the standard I/O library that what it thinks is a stream is really a fake stream set up temporarily by "sprintf" or "sscanf". The fake stream's "buffer" is the string being scanned or printed into. "IOSTRG" tells it not to do something dumb with that stream, like trying to do real live I/O into or from the buffer. There's no need to simulate it. The only semi-valid reason why *anybody* should be using that flag is if they're duplicating the code in "sprintf" or "sscanf". Your best bet is to rewrite the code so it doesn't use undocumented internal interfaces to standard I/O which are 1) not guaranteed to be the same in all implementations of the standard I/O library and 2) not even guaranteed to stay the same in different releases of the same implementation. Barring that, if you really must sneak in through the back door you should rip off the code from the 2.9BSD/SysV standard I/O library and use it (if you don't have the source, do some disassembly; if you can't do that, reconsider whether you shouldn't just rewrite it not to use the back door). Guy Harris