File:  [gforth] / gforth / engine / io.h
Revision 1.14: download - view: text, annotated - select for diffs
Fri Mar 16 20:34:23 2012 UTC (7 years, 10 months ago) by pazsan
Branches: MAIN
CVS tags: HEAD
Exception handling for threads

    1: /* Input driver header
    2: 
    3:   Copyright (C) 1995,1996,1997,1998,1999,2003,2007 Free Software Foundation, Inc.
    4: 
    5:   This file is part of Gforth.
    6: 
    7:   Gforth is free software; you can redistribute it and/or
    8:   modify it under the terms of the GNU General Public License
    9:   as published by the Free Software Foundation, either version 3
   10:   of the License, or (at your option) any later version.
   11: 
   12:   This program is distributed in the hope that it will be useful,
   13:   but WITHOUT ANY WARRANTY; without even the implied warranty of
   14:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15:   GNU General Public License for more details.
   16: 
   17:   You should have received a copy of the GNU General Public License
   18:   along with this program; if not, see http://www.gnu.org/licenses/.
   19: */
   20: 
   21: #include <setjmp.h>
   22: 
   23: extern __thread jmp_buf throw_jmp_buf;
   24: 
   25: #if defined(MSDOS) || defined(SHARC)
   26: #  define prep_terminal()
   27: #  define deprep_terminal()
   28: #  include <conio.h>
   29: 
   30: #  define key(stdin)		getch()
   31: #  define key_query(stdin)	FLAG(kbhit())
   32: #else
   33: Cell getkey(FILE *);
   34: long key_avail(FILE *);
   35: void prep_terminal(void);
   36: void deprep_terminal(void);
   37: void get_winsize(void);
   38: 
   39: #  define key(stdin)		getkey(stdin)
   40: #  define key_query(stdin)	-(!!key_avail(stdin)) /* !! FLAG(...)? - anton */
   41:          		/* flag was originally wrong -- lennart */
   42: #endif
   43: 
   44: extern UCell rows, cols;
   45: extern int terminal_prepped;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>