projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1997-09-24 00:58:48 by sof]
[ghc-hetmet.git]
/
ghc
/
lib
/
cbits
/
fileLookAhead.lc
1
%
2
% (c) The GRASP/AQUA Project, Glasgow University, 1994
3
%
4
\subsection[fileLookAhead.lc]{hLookAhead Runtime Support}
5
6
\begin{code}
7
8
#include "rtsdefs.h"
9
#include "stgio.h"
10
11
StgInt
12
fileLookAhead(fp)
13
StgForeignObj fp;
14
{
15
int c;
16
17
if ((c = fileGetc(fp)) == EOF) {
18
return c;
19
} else if (ungetc(c, (FILE *) fp) == EOF) {
20
cvtErrno();
21
stdErrno();
22
return EOF;
23
} else
24
return c;
25
}
26
27
\end{code}