| 1 | /* $Id$ */ |
| 2 | /*************************************************************** |
| 3 | ** I/O subsystem for PForth for common systems. |
| 4 | ** |
| 5 | ** Author: Phil Burk |
| 6 | ** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom |
| 7 | ** |
| 8 | ** The pForth software code is dedicated to the public domain, |
| 9 | ** and any third party may reproduce, distribute and modify |
| 10 | ** the pForth software code or any derivative works thereof |
| 11 | ** without any compensation or license. The pForth software |
| 12 | ** code is provided on an "as is" basis without any warranty |
| 13 | ** of any kind, including, without limitation, the implied |
| 14 | ** warranties of merchantability and fitness for a particular |
| 15 | ** purpose and their equivalents under the laws of any jurisdiction. |
| 16 | ** |
| 17 | **************************************************************** |
| 18 | ** 941004 PLB Extracted IO calls from pforth_main.c |
| 19 | ***************************************************************/ |
| 20 | |
| 21 | #include "../pf_all.h" |
| 22 | |
| 23 | /* Default portable terminal I/O. */ |
| 24 | int sdTerminalOut( char c ) |
| 25 | { |
| 26 | return putchar(c); |
| 27 | } |
| 28 | /* We don't need to echo because getchar() echos. */ |
| 29 | int sdTerminalEcho( char c ) |
| 30 | { |
| 31 | return 0; |
| 32 | } |
| 33 | int sdTerminalIn( void ) |
| 34 | { |
| 35 | return getchar(); |
| 36 | } |
| 37 | int sdQueryTerminal( void ) |
| 38 | { |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | int sdTerminalFlush( void ) |
| 43 | { |
| 44 | #ifdef PF_NO_FILEIO |
| 45 | return -1; |
| 46 | #else |
| 47 | return fflush(PF_STDOUT); |
| 48 | #endif |
| 49 | } |
| 50 | |
| 51 | void sdTerminalInit( void ) |
| 52 | { |
| 53 | } |
| 54 | void sdTerminalTerm( void ) |
| 55 | { |
| 56 | } |
| 57 | |