Changeset c72254 in git


Ignore:
Timestamp:
Sep 15, 2010, 6:27:24 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
c16aa06112c9be7ae12a574a08b2d1bb42709ccc
Parents:
7504ddfe25cbc97ca03089b2d7dd8c1a3ff1d050
Message:
pagelength

git-svn-id: file:///usr/local/Singular/svn/trunk@13195 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/febase.cc

    r7504dd rc72254  
    4444int     si_echo = 0;
    4545int     printlevel = 0;
    46 int     pagelength = 24;
    4746int     colmax = 80;
    4847char    prompt_char = '>'; /*1 either '>' or '.'*/
  • kernel/fereadl.c

    r7504dd rc72254  
    4646    #endif
    4747
    48     #ifdef atarist
    49       #include <ioctl.h>
    50     #else
    51       #ifdef NeXT
    52         #include <sgtty.h>
    53         #include <sys/ioctl.h>
    54       #endif
    55     #endif
    5648  #endif
    5749
     
    6658#define feCTRL(C) ((C) & 0x1F)    /* <ctrl> character  */
    6759
    68 /* Use this variable to remember original terminal attributes. */
    69 #if defined( atarist ) || defined( NeXT )
    70   struct sgttyb  fe_saved_attributes;
    71 #else
    72   struct termios fe_saved_attributes;
    73 #endif
     60struct termios fe_saved_attributes;
    7461
    7562static BOOLEAN fe_stdout_is_tty;
     
    7764BOOLEAN fe_use_fgets=FALSE;
    7865static BOOLEAN fe_is_initialized=FALSE;
     66static int     pagelength = 24;
     67
    7968FILE *  fe_echo; /*the output file for echoed characters*/
    8069
     
    10291    if (fe_is_raw_tty)
    10392    {
    104       #ifdef atarist
    105         stty(0, &fe_saved_attributes);
    106       #else
    107         #ifdef NeXT
    108           ioctl(STDIN_FILENO, TIOCSETP, &fe_saved_attributes);
    109         #else
    110           tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
    111         #endif
    112       #endif
     93      tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
    11394      fe_is_raw_tty=0;
    11495    }
     
    132113  if (fe_is_raw_tty)
    133114  {
    134     #ifdef atarist
    135       stty(0, &fe_saved_attributes);
    136     #else
    137       #ifdef NeXT
    138         ioctl(STDIN_FILENO, TIOCSETP, &fe_saved_attributes);
    139       #else
    140         tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
    141       #endif
    142     #endif
     115    tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
    143116    fe_is_raw_tty=0;
    144117  }
     
    148121  if(fe_is_raw_tty==0)
    149122  {
    150     #ifdef atarist
    151       /*set line wrap mode*/
    152       if(fe_stdout_is_tty)
    153       {
    154         printf("\033v");
    155       }
    156     #endif
    157     #if defined( atarist ) || defined( NeXT )
    158       struct sgttyb tattr;
    159     #else
    160       struct termios tattr;
    161     #endif
     123    struct termios tattr;
    162124
    163125    /* Set the funny terminal modes. */
    164     #ifdef atarist
    165        gtty(0, &tattr);
    166        tattr.sg_flags |= RAW;
    167        tattr.sg_flags |= CBREAK;
    168        tattr.sg_flags &= ~ECHO;
    169        stty(0, &tattr);
    170     #else
    171       #ifdef NeXT
    172         ioctl(STDIN_FILENO, TIOCGETP, &tattr);
    173         //tattr.sg_flags |= RAW;
    174         tattr.sg_flags |= CBREAK;
    175         tattr.sg_flags &= ~ECHO;
    176         ioctl(STDIN_FILENO, TIOCSETP, &tattr);
    177         ioctl(STDOUT_FILENO, TIOCGETP, &tattr);
    178         tattr.sg_flags |= CRMOD;
    179         ioctl(STDOUT_FILENO, TIOCSETP, &tattr);
    180       #else
    181         tcgetattr (STDIN_FILENO, &tattr);
    182         tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
    183         tattr.c_cc[VMIN] = 1;
    184         tattr.c_cc[VTIME] = 0;
    185         tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
    186       #endif
    187     #endif
     126    tcgetattr (STDIN_FILENO, &tattr);
     127    tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
     128    tattr.c_cc[VMIN] = 1;
     129    tattr.c_cc[VTIME] = 0;
     130    tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
    188131    fe_is_raw_tty=1;
    189132  }
     
    213156    {
    214157      fe_stdout_is_tty=0;
    215       #ifdef atarist
    216         fe_echo = fopen( "/dev/tty", "w" );
    217       #else
    218         fe_echo = fopen( ttyname(fileno(stdin)), "w" );
    219       #endif
     158      fe_echo = fopen( ttyname(fileno(stdin)), "w" );
    220159    }
    221160    /* Save the terminal attributes so we can restore them later. */
    222161    {
    223       #if defined( atarist ) || defined( NeXT )
    224         struct sgttyb tattr;
    225         #ifdef atarist
    226           gtty(0, &fe_saved_attributes);
    227         #else
    228           ioctl(STDIN_FILENO, TIOCGETP, &fe_saved_attributes);
    229         #endif
    230       #else
    231         struct termios tattr;
    232         tcgetattr (STDIN_FILENO, &fe_saved_attributes);
    233       #endif
     162      struct termios tattr;
     163      tcgetattr (STDIN_FILENO, &fe_saved_attributes);
    234164      #ifdef HAVE_FEREAD
    235165        #ifdef HAVE_ATEXIT
     
    241171
    242172      /* Set the funny terminal modes. */
    243       #ifdef atarist
    244         gtty(0, &tattr);
    245         tattr.sg_flags |= RAW;
    246         tattr.sg_flags |= CBREAK;
    247         tattr.sg_flags &= ~ECHO;
    248         stty(0, &tattr);
    249       #else
    250         #ifdef NeXT
    251           ioctl(STDIN_FILENO, TIOCGETP, &tattr);
    252           //tattr.sg_flags |= RAW;
    253           tattr.sg_flags |= CBREAK;
    254           tattr.sg_flags &= ~ECHO;
    255           ioctl(STDIN_FILENO, TIOCSETP, &tattr);
    256           ioctl(STDOUT_FILENO, TIOCGETP, &tattr);
    257           tattr.sg_flags |= CRMOD;
    258           ioctl(STDOUT_FILENO, TIOCSETP, &tattr);
    259         #else
    260           tcgetattr (STDIN_FILENO, &tattr);
    261           tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
    262           tattr.c_cc[VMIN] = 1;
    263           tattr.c_cc[VTIME] = 0;
    264           tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
    265         #endif
    266         /*ospeed=cfgetospeed(&tattr);*/
    267       #endif
     173      tcgetattr (STDIN_FILENO, &tattr);
     174      tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
     175      tattr.c_cc[VMIN] = 1;
     176      tattr.c_cc[VTIME] = 0;
     177      tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
     178      /*ospeed=cfgetospeed(&tattr);*/
    268179    }
    269180    if(term==NULL)
Note: See TracChangeset for help on using the changeset viewer.