Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: expr?(void):(void) Message-ID: <7032@utzoo.UUCP> Date: Fri, 8-Aug-86 16:39:40 EDT Article-I.D.: utzoo.7032 Posted: Fri Aug 8 16:39:40 1986 Date-Received: Fri, 8-Aug-86 16:39:40 EDT References: <501@bunny.UUCP> Organization: U of Toronto Zoology Lines: 19 > we are working on a stdio-like library at waterloo which looks very > similar to this. Checking the value returned by putchar() every > single time can be quite a waste... > The solution we use is to have the _WriteBuf function, instead of > returning an indication of error, either print the message and > exit itself, or "raise an event" that can be trapped in the user's > code (signals or longjumps). [This wins big.] On the whole I think this an excellent idea... but Ray, is it too late to convince the people involved *not* to use signals for communications? This has long been recognized as a bad idea. And it's so unnecessary in this case, and related ones: it suffices to say that whenever the _WriteBuf function fails, it calls (say) _WBerror with some suitable parameters, and the user can substitute his own _WBerror function if he doesn't like the default one. This gets much of the benefit without the various problems and unportabilities of signals. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,decvax,pyramid}!utzoo!henry