🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.computers.apollo
Article #134

(none)

#134
From: Russ Fish
Date: Thu, 20 Mar 1986 16:29
39 lines
2260 bytes
Date: Wed, 19 Mar 86 05:35:40 MST
From: fish@utah-gr (Russ Fish)
Newsgroups: mod.computers.apollo
Subject: Re: need sprintf for BSD4.2/IX
References: <8603130738.AA13849@mips.UUCP>
Reply-To: fish@utah-gr.UUCP (Russ Fish)
Organization: University of Utah CS Dept
Apparently-To: apollo@yale.arpa

>  Or, to ask another way, does anyone know what to replace _IOSTRNG
>  with to port sprintf-like functions from VAX 4.2 to Apollo "4.2"?

Try this:

#ifdef apollo		/* Apollo Stdio compatibility definitions. */
#define	_IOREAD	_SIRD		/* (1) */
#define	_IOWRT	_SIWR		/* (2) */
#define	_IONBF	_SIUNB		/* (4) */
#define	_IOMYBUF _SIUBF		/* (8->256, Apollo 8 is malloc'ed buffer.) */
#define	_IOEOF	_SIEOF		/* (16) */
#define	_IOERR	_SIERR		/* (32) */
#define	_IOSTRG	01000		/* (64->512, not Apollo supplied.) */
#define	_IOLBF	_SINLB		/* (128->64) */
#define	_IORW	_SIUP		/* (256->128) */
#endif

Since everybody is getting into the business of rewriting stdio these days,
I think it is becoming questionable practice to know about the internal
stdio FILE structure and flags, at least if you care about your programs
running on other computers.  I intend to use these definitions in our code
only as a stopgap until I kill off the sprintf clones.

I looked through our code here, and found only two functions using _IOSTRG.
They are being clever in different ways to accumulate a string across
multiple printfs.  Both of them could instead use sprintf with a moving
buffer base pointer to accomplish the same function portably with little
loss of "efficiency" (no inner loops are involved.)

-Russ Fish
Technical Details
Message-ID: <8603201629.AA13557@utah-gr.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!decvax!ittatc!dcdwest!sdcsvax!ucbvax!utah-cs.arpa!fish%utah-gr

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU
Path: arc1-ca.pugleaf.net!utzoo!decvax!ittatc!dcdwest!sdcsvax!ucbvax!utah-cs.arpa!fish%utah-gr
From: fish%utah-gr@UTAH-CS.ARPA (Russ Fish)
Newsgroups: mod.computers.apollo
Subject: (none)
Message-ID: <8603201629.AA13557@utah-gr.ARPA>
Date: Thu, 20-Mar-86 11:29:14 EST
Article-I.D.: utah-gr.8603201629.AA13557
Posted: Thu Mar 20 11:29:14 1986
Date-Received: Sat, 22-Mar-86 08:00:37 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 39
Approved: apollo@yale-comix.arpa