~ubuntu-branches/ubuntu/lucid/mc/lucid

« back to all changes in this revision

Viewing changes to slang/slutty.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-09-16 10:38:59 UTC
  • mfrom: (3.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080916103859-2uwn8w61xk5mbxxq
Tags: 2:4.6.2~git20080311-4
Corrected fix for odt2txt issue (Closes: #492019) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* slutty.c --- Unix Low level terminal (tty) functions for S-Lang */
2
 
/* Copyright (c) 1992, 1999, 2001, 2002, 2003 John E. Davis
3
 
 * This file is part of the S-Lang library.
4
 
 *
5
 
 * You may distribute under the terms of either the GNU General Public
6
 
 * License or the Perl Artistic License.
7
 
 */
 
2
/*
 
3
Copyright (C) 2004, 2005, 2006 John E. Davis
 
4
 
 
5
This file is part of the S-Lang Library.
 
6
 
 
7
The S-Lang Library is free software; you can redistribute it and/or
 
8
modify it under the terms of the GNU General Public License as
 
9
published by the Free Software Foundation; either version 2 of the
 
10
License, or (at your option) any later version.
 
11
 
 
12
The S-Lang Library 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 GNU
 
15
General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with this library; if not, write to the Free Software
 
19
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
20
USA.  
 
21
*/
8
22
 
9
23
#include "slinclud.h"
10
24
 
91
105
static TTY_Termio_Type Old_TTY;
92
106
 
93
107
#ifdef HAVE_TERMIOS_H
94
 
typedef const struct
 
108
typedef SLCONST struct
95
109
{
96
110
   unsigned int key;
97
111
   unsigned int value;
432
446
   sig = errno;                        /* use parameter */
433
447
 
434
448
   SLKeyBoard_Quit = 1;
435
 
   if (SLang_Ignore_User_Abort == 0) SLang_Error = SL_USER_BREAK;
 
449
   if (SLang_Ignore_User_Abort == 0) SLang_set_error (SL_USER_BREAK);
436
450
   SLsignal_intr (SIGINT, default_sigint);
437
451
   errno = sig;
438
452
}
464
478
 
465
479
/* HACK: If > 0, use 1/10 seconds.  If < 0, use 1/1000 seconds */
466
480
 
467
 
int _SLsys_input_pending(int tsecs)
 
481
int _pSLsys_input_pending(int tsecs)
468
482
{
469
483
   struct timeval wait;
470
484
   long usecs, secs;
515
529
   return 0;
516
530
}
517
531
 
518
 
unsigned int _SLsys_getkey (void)
 
532
unsigned int _pSLsys_getkey (void)
519
533
{
520
534
   unsigned char c;
521
535
 
533
547
        if (SLKeyBoard_Quit)
534
548
          return SLang_Abort_Char;
535
549
 
536
 
        if (0 == (ret = _SLsys_input_pending (100)))
 
550
        if (0 == (ret = _pSLsys_input_pending (100)))
537
551
          continue;
538
552
 
539
553
        if (ret != -1)
593
607
#ifdef EIO
594
608
        if (errno == EIO)
595
609
          {
596
 
             SLang_exit_error ("_SLsys_getkey: EIO error.");
 
610
             SLang_verror (SL_Read_Error, "_pSLsys_getkey: EIO error");
597
611
          }
598
612
#endif
599
613
        return SLANG_GETKEY_ERROR;