This option lets you do things like:
doprint("usage: %s: not found", argv[0]);
and for doprint we have:
doprint(fmt)
char *fmt;
{
stuff ...
printf("%r", &fmt);
other stuff ...
}
The %r tells printf to use &fmt as the address of a
printf formatting string, and to get the arguments
for it off the stack. I don't know if it would
work if fmt contained another %r. Can vprintf be
used to produce the same result ?
Thanks,
--
Larry Cipriani AT&T Network Systems
danews!lvc Mail responses to ihnp4!cbsck!lvc please - thanks
"Nothing is worse than an itch you can never scratch."
Vprintf and varargs.h can be used to produce a very
similar result, but portably.
There is no portable way to write the corresponding argument. vprintf
(in cooperation with varargs.h) is intended as a portable way to get
the same effect.
--
Usenet(n): AT&T scheme to earn
revenue from otherwise-unused Henry Spencer @ U of Toronto Zoology
late-night phone capacity. {allegra,ihnp4,decvax,pyramid}!utzoo!henry
This format was maybe used on V6 UNIX to talk to RT11 file system,
or for debug ???
[pa]
Nope. No version of UNIX released by AT&T has any support for RADIX50
whatsoever. The "r" stood for "remote", not "RADIX50"; "%r" told "printf"
that the next argument was a pointer to a "printf"-style argument list, and
that it should use that list instead of the one it was passed. This is very
tricky to do portably, and impossible to do on some implementations, so it
was nuked in V7.
> This format was maybe used on V6 UNIX to talk to RT11 file system,
Nope. No version of UNIX released by AT&T knows anything about RT11, except
for VAX versions which have to deal with VAX-11/780 console floppies.
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
g...@sun.com (or g...@sun.arpa)