dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/support input.c, NONE, 1.1 Makefile.am,


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/support input.c, NONE, 1.1 Makefile.am, 1.45, 1.46
Date: Tue, 22 Jul 2003 20:38:12 -0400

Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv1728/support

Modified Files:
        Makefile.am 
Added Files:
        input.c 
Log Message:


Move the console input code to "support" so that it is easier to redirect.


--- NEW FILE ---
/*
 * input.c - Simple line input facilities for stdin.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "il_system.h"
#include "il_utils.h"
#include <stdio.h>

#ifdef  __cplusplus
extern  "C" {
#endif

int ILInputGetChar(void)
{
#ifndef REDUCED_STDIO
        return getc(stdin);
#else
        return -1;
#endif
}

void ILInputUngetChar(int ch)
{
#ifndef REDUCED_STDIO
        ungetc(ch, stdin);
#endif
}

int ILInputReadLine(void *buffer, int len)
{
#ifndef REDUCED_STDIO
        return (fgets(buffer, len, stdin) != 0);
#else
        return 0;
#endif
}

int ILInputRead(void *buffer, int len)
{
#ifndef REDUCED_STDIO
        return (int)fread(buffer, 1, len, stdin);
#else
        return -1;
#endif
}

#ifdef  __cplusplus
};
#endif

Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/Makefile.am,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** Makefile.am 22 Jul 2003 03:41:20 -0000      1.45
--- Makefile.am 23 Jul 2003 00:38:09 -0000      1.46
***************
*** 24,27 ****
--- 24,28 ----
                                                 hashtab.c \
                                                 hb_gc.c \
+                                                input.c \
                                                 intern.c \
                                                 locale.c \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]