Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsrgv.UUCP Path: utzoo!utcsrgv!dave From: dave@utcsrgv.UUCP (Dave Sherman) Newsgroups: net.unix-wizards Subject: Re: _print/_doprnt; curses on sys III Message-ID: <4558@utcsrgv.UUCP> Date: Sun, 17-Jun-84 10:01:50 EDT Article-I.D.: utcsrgv.4558 Posted: Sun Jun 17 10:01:50 1984 Date-Received: Sun, 17-Jun-84 11:21:32 EDT References: <148@gargoyle.UChicago.UUCP> <1973@utcsstat.UUCP> Reply-To: dave@utcsrgv.UUCP (& Sherman) Organization: The Law Society of Upper Canada, Toronto Lines: 32 In article <1973@utcsstat.UUCP> geoff@utcsstat.UUCP (Geoff Collyer) writes: ~| Any program that calls _doprnt (or _print or whatever) directly is ~| *broken*. The internals of a given stdio implementation are the ~| business of no one but its author(s) and maintainer(s). If you think ~| you need to call _doprnt or whatever, try sprintf'ing into a buffer and ~| passing the buffer. ~| Geoff, you would be correct to call such programs "non-portable". I think "broken" is going a little too far. I have some implementations which "work" just fine. sprintf'ing into a buffer isn't always the answer. For one, it requires two or more lines of code for what is conceptually one action. Secondly, it may not work for the particular need. In my code which interposes termcap interpretation at the output level, for example, "putc" is redefined. For this to work, _strout (called by _doprnt which is called by printf) has to be recompiled with "putc" #undef'ed from being a macro. Sure it's non-portable, when I next hit a system which uses some other stdio. When the time comes I'll make whatever trivial changes are needed to make it run on such a system. So far I've ported it from PDP-11 (v7) to a Perkin-Elmer 3220 and an IBM-PC running Venix/86, and it runs like a charm. So don't tell me it's "broken". (If you persist, I will define my programs as "written for v7 UNIX" rather than "written for UNIX". So there.) Dave Sherman Toronto -- {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave