Subject: Re: INPUT_LEFT macro?
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 08/08/1995 14:38:53
> 	#define INPUT_LEFT(__fp) ((__fp)->_cnt > 0)

> Apparently the _cnt field represents characters left in an input
> buffer..not having a system in front of me which uses that I can't
> say for sure.  Could someone clarify it for me?

That's its traditional use, yes.

> Anyway, poking around in FILE* is not particularly portable, so I'm
> coming up with alternative solutions.  Suggestions?

Unfortunately, when stdio was designed, no interface was included to do
what that code wants to do.  Thus, there is no generally portable way
to do it; you have to either stop using stdio or do something
system-dependent.  It may be accessing an internal field, the way the
code you quote does, or it may be some non-standardized stdio call....

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu