_print/_doprnt; curses on sys III

Tony L. Hansen hansen at pegasus.UUCP
Sat Jun 23 00:36:10 AEST 1984


> > It is standard System III. AT&T finally wised up to how much software
> > broke when they took _doprnt away, and made it come back in System V.
> Well, I looked, and "_doprnt" is back; in S5R2, they also provide the
> "vprintf", "vfprintf", and "vsprintf" interfaces that were in S3 as
> distributed (and which can be used instead of "_doprnt"), but were
> ripped out of S5.  "_doprnt" is, alas, not in every implementation of
> standard I/O, so software which uses it will still break under some
> implementations.  

Still wrong! _doprnt() is only in SOME versions of System V. I have
worked with at least three different System V machines that did NOT
have _doprnt() in their libc. Nor did they have _print().  The Vax
version of System V DOES have _doprnt() in it for System V, but don't
count on it being there forever.

How to get around it? We've made extensive use of a C version of
_doprnt(), as well as the v*printf() family. There is a version of
v*printf() which works with _doprnt(). (Our curses uses vsprintf().)
In System Vr2, v*printf() is implemented as a supported part of the
stdio package and uses whatever underlying mechanism the rest of
stdio uses.

I wish BSD had picked up the v*printf() functions rather than
documenting the _doprnt() routine. Re-implementing v*printf() would
be a 15 minute job for someone who knows _doprnt() well.

					Tony Hansen
					pegasus!hansen



More information about the Comp.unix.wizards mailing list