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: comp.lang.c
Subject: Re: Distinguished pointers (was Re: Weird syscall returns)
Message-ID: <8317@utzoo.UUCP>
Date: Sat, 18-Jul-87 20:54:38 EDT
Article-I.D.: utzoo.8317
Posted: Sat Jul 18 20:54:38 1987
Date-Received: Sat, 18-Jul-87 20:54:38 EDT
References: <1158@copper.TEK.COM>
Organization: U of Toronto Zoology
Lines: 21

> On the contrary, I think we need more distinguished pointer values, not
> just a single zero or NULL value.  I have a set of custom I/O routines
> that use the pointer value NOFILE... and another pointer value NULLFILE...

This is utterly trivial to do without any language extensions whatsoever.
Put the following code fragment into a file and include it in your library:

	char myio_no;
	char myio_null;

And then include this in the include file for your library:

	#define	NOFILE		((FILE *)&myio_no)
	#define	NULLFILE	((FILE *)&myio_null)

This works just fine without any unportable messes like "(char *) -1".
It isn't quite so handy for system calls, although equivalents could be
devised.
-- 
Support sustained spaceflight: fight |  Henry Spencer @ U of Toronto Zoology
the soi-disant "Planetary Society"!  | {allegra,ihnp4,decvax,utai}!utzoo!henry