1198 |
"to @code{read-char} would have hung.}") |
"to @code{read-char} would have hung.}") |
1199 |
#define FUNC_NAME s_scm_peek_char |
#define FUNC_NAME s_scm_peek_char |
1200 |
{ |
{ |
1201 |
int c; |
int c, column; |
1202 |
if (SCM_UNBNDP (port)) |
if (SCM_UNBNDP (port)) |
1203 |
port = scm_cur_inp; |
port = scm_cur_inp; |
1204 |
else |
else |
1205 |
SCM_VALIDATE_OPINPORT (1, port); |
SCM_VALIDATE_OPINPORT (1, port); |
1206 |
|
column = SCM_COL(port); |
1207 |
c = scm_getc (port); |
c = scm_getc (port); |
1208 |
if (EOF == c) |
if (EOF == c) |
1209 |
return SCM_EOF_VAL; |
return SCM_EOF_VAL; |
1210 |
scm_ungetc (c, port); |
scm_ungetc (c, port); |
1211 |
|
SCM_COL(port) = column; |
1212 |
return SCM_MAKE_CHAR (c); |
return SCM_MAKE_CHAR (c); |
1213 |
} |
} |
1214 |
#undef FUNC_NAME |
#undef FUNC_NAME |