[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine lib_stdio.c,1.4,1.5
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine lib_stdio.c,1.4,1.5 |
Date: |
Tue, 22 Jul 2003 20:38:12 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv1728/engine
Modified Files:
lib_stdio.c
Log Message:
Move the console input code to "support" so that it is easier to redirect.
Index: lib_stdio.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_stdio.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** lib_stdio.c 15 May 2003 06:02:07 -0000 1.4
--- lib_stdio.c 23 Jul 2003 00:38:09 -0000 1.5
***************
*** 34,37 ****
--- 34,38 ----
#include "engine.h"
#include "lib_defs.h"
+ #include "il_utils.h"
#ifdef __cplusplus
***************
*** 170,177 ****
ILInt32 _IL_Stdio_StdRead_i(ILExecThread *thread, ILInt32 fd)
{
- #ifndef REDUCED_STDIO
if(fd == 0)
{
! return (ILInt32)(getc(stdin));
}
else
--- 171,177 ----
ILInt32 _IL_Stdio_StdRead_i(ILExecThread *thread, ILInt32 fd)
{
if(fd == 0)
{
! return (ILInt32)ILInputGetChar();
}
else
***************
*** 179,185 ****
return -1;
}
- #else
- return -1;
- #endif
}
--- 179,182 ----
***************
*** 191,195 ****
ILInt32 count)
{
- #ifndef REDUCED_STDIO
ILUInt16 *buf = ((ILUInt16 *)(ArrayToBuffer(value))) + index;
ILInt32 result = 0;
--- 188,191 ----
***************
*** 201,206 ****
while(count > 0)
{
! ch = getc(stdin);
! if(ch == EOF)
{
break;
--- 197,202 ----
while(count > 0)
{
! ch = ILInputGetChar();
! if(ch == -1)
{
break;
***************
*** 210,216 ****
}
return result;
- #else
- return -1;
- #endif
}
--- 206,209 ----
***************
*** 222,235 ****
ILInt32 count)
{
- #ifndef REDUCED_STDIO
if(fd != 0)
{
return -1;
}
! return (ILInt32)(fread(((ILUInt8 *)ArrayToBuffer(value)) + index,
! 1, count, stdin));
! #else
! return -1;
! #endif
}
--- 215,224 ----
ILInt32 count)
{
if(fd != 0)
{
return -1;
}
! return (ILInt32)ILInputRead
! (((ILUInt8 *)ArrayToBuffer(value)) + index, (int)count);
}
***************
*** 239,249 ****
ILInt32 _IL_Stdio_StdPeek(ILExecThread *thread, ILInt32 fd)
{
- #ifndef REDUCED_STDIO
if(fd == 0)
{
! int ch = getc(stdin);
if(ch != -1)
{
! ungetc(ch, stdin);
}
return (ILInt32)ch;
--- 228,237 ----
ILInt32 _IL_Stdio_StdPeek(ILExecThread *thread, ILInt32 fd)
{
if(fd == 0)
{
! int ch = ILInputGetChar();
if(ch != -1)
{
! ILInputUngetChar(ch);
}
return (ILInt32)ch;
***************
*** 253,259 ****
return -1;
}
- #else
- return -1;
- #endif
}
--- 241,244 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine lib_stdio.c,1.4,1.5,
Rhys Weatherley <address@hidden> <=