Newsgroups: comp.sys.transputer
From: schedan@eskimo.com (Daniel Scheurell)
Subject: Re: ANSI C: Missing macros and definitions
Organization: Eskimo North (206) For-Ever
Date: 21 May 94 03:47:50 GMT
Message-ID: <Cq4vvr.ALC@eskimo.com>

Manfred Sever (mse@wolverine.utias.utoronto.ca) wrote:

: In compiling the code under ICC, the following function 
: definitions were missing:
:   fileno()
:   isascii()

"fileno( FILE *stream )" returns the file handle associated with the 
argument stream.  In stdio.h (as implemented in Turbo C, for instance), fileno 
returns the value of the file handle field of the FILE structure 
( fileno( stream ) == stream->fd ).  If the FILE structure in stdio.h of 
the Inmos toolset is fully described and contains such a field, then a 
simple macro will do:
	#define fileno(s) ((s)->fd)

"isascii( int c )" returns true if the argument is < 128.  This one can also 
be implemented as a macro (as it is in ctype.h):
	#define isascii(c) ( (unsigned int)(c) < 128 )
or
	#define isascii(c) ( ! ((c) & 0x80) )

--

Dan

