Changeset e37080 in git


Ignore:
Timestamp:
Dec 18, 2007, 11:01:42 AM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3b8b19f46828b935a75f3812d5297470f2f8431b
Parents:
3dd3ff38f00730440e515860672d534044923a46
Message:
*hannes: removed MSDOS


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

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r3dd3ff re37080  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.260 2007-11-20 13:22:59 Singular Exp $ */
     4/* $Id: extra.cc,v 1.261 2007-12-18 09:55:26 Singular Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    320320    {
    321321      res->rtyp=INT_CMD;
    322     #ifndef MSDOS
    323322      res->data=(void *)(long) getpid();
    324     #else
    325       res->data=(void *)1;
    326     #endif
    327323      return FALSE;
    328324    }
     
    21112107#endif
    21122108/*==================== alarm ==================================*/
    2113 #ifndef MSDOS
    2114 #ifndef atarist
    21152109#ifdef unix
    21162110    if(strcmp(sys_cmd,"alarm")==0)
     
    21312125    }
    21322126    else
    2133 #endif
    2134 #endif
    21352127#endif
    21362128/*==================== red =============================*/
  • Singular/misc.cc

    r3dd3ff re37080  
    9898* testet on : linux, HP 9.0
    9999*
    100 *#ifndef MSDOS
    101100*#include <sys/times.h>
    102101*#include <sys/resource.h>
     
    109108*  sleep(10);
    110109*}
    111 *#else
    112 *void very_nice(){}
    113 *#endif
    114110*/
    115111
  • Singular/mod2.h.in

    r3dd3ff re37080  
    66 *          DO NOT EDIT!
    77 *
    8  *  Version: $Id: mod2.h.in,v 1.123 2007-11-27 11:55:57 Singular Exp $
     8 *  Version: $Id: mod2.h.in,v 1.124 2007-12-18 09:56:57 Singular Exp $
    99 *******************************************************************/
    1010#ifndef MOD2_H
     
    220220/* Undefine to disable real time measurments  */
    221221#ifdef HAVE_GETTIMEOFDAY
    222 #if ! defined(MSDOS)
    223222#define HAVE_RTIMER
    224 #else
    225 #undef HAVE_RTIMER
    226 #endif
    227223#endif
    228224
  • kernel/febase.h

    r3dd3ff re37080  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.7 2007-11-08 09:20:33 Singular Exp $ */
     6/* $Id: febase.h,v 1.8 2007-12-18 09:56:22 Singular Exp $ */
    77/*
    88* ABSTRACT: basic i/o
     
    284284extern "C" void fe_reset_input_mode();
    285285
    286 #ifndef MSDOS
    287286extern "C" {
    288287#ifndef HAVE_ATEXIT
     
    292291#endif
    293292}
    294 #endif
    295293
    296294
  • kernel/fereadl.c

    r3dd3ff re37080  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: fereadl.c,v 1.3 2007-04-02 07:38:21 Singular Exp $ */
     4/* $Id: fereadl.c,v 1.4 2007-12-18 10:01:42 Singular Exp $ */
    55/*
    66* ABSTRACT: input from ttys, simulating fgets
     
    6666#define feCTRL(C) ((C) & 0x1F)    /* <ctrl> character  */
    6767
    68 #ifndef MSDOS
    69 
    70   /* Use this variable to remember original terminal attributes. */
    71   #if defined( atarist ) || defined( NeXT )
    72     struct sgttyb  fe_saved_attributes;
    73   #else
    74     struct termios fe_saved_attributes;
    75   #endif
     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;
    7673#endif
    7774
     
    8986int     fe_cursor_line; /* 0..pagelength-1*/
    9087
    91 #ifndef MSDOS
    92   #ifndef HAVE_ATEXIT
    93     int on_exit(void (*f)(int, void *), void *arg);
    94     #ifdef HAVE_FEREAD
    95       void fe_reset_fe (int i, void *v)
    96     #endif
    97   #else
    98     #ifdef HAVE_FEREAD
    99       void fe_reset_fe (void)
    100     #endif
     88#ifndef HAVE_ATEXIT
     89  int on_exit(void (*f)(int, void *), void *arg);
     90  #ifdef HAVE_FEREAD
     91    void fe_reset_fe (int i, void *v)
    10192  #endif
    102   {
    103     if (fe_stdin_is_tty)
    104     {
    105       int i;
    106       if (fe_is_raw_tty)
    107       {
    108         #ifdef atarist
    109           stty(0, &fe_saved_attributes);
    110         #else
    111           #ifdef NeXT
    112             ioctl(STDIN_FILENO, TIOCSETP, &fe_saved_attributes);
    113           #else
    114             tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
    115           #endif
    116         #endif
    117         fe_is_raw_tty=0;
    118       }
    119       if (fe_hist!=NULL)
    120       {
    121         for(i=fe_hist_max-1;i>=0;i--)
    122         {
    123           if (fe_hist[i] != NULL) omFree((ADDRESS)fe_hist[i]);
    124         }
    125         omFreeSize((ADDRESS)fe_hist,fe_hist_max*sizeof(char *));
    126         fe_hist=NULL;
    127       }
    128       if (!fe_stdout_is_tty)
    129       {
    130         fclose(fe_echo);
    131       }
    132     }
    133   }
    134   void fe_temp_reset (void)
    135   {
     93#else
     94  #ifdef HAVE_FEREAD
     95    void fe_reset_fe (void)
     96  #endif
     97#endif
     98{
     99  if (fe_stdin_is_tty)
     100  {
     101    int i;
    136102    if (fe_is_raw_tty)
    137103    {
     
    147113      fe_is_raw_tty=0;
    148114    }
    149   }
    150   void fe_temp_set (void)
    151   {
    152     if(fe_is_raw_tty==0)
    153     {
     115    if (fe_hist!=NULL)
     116    {
     117      for(i=fe_hist_max-1;i>=0;i--)
     118      {
     119        if (fe_hist[i] != NULL) omFree((ADDRESS)fe_hist[i]);
     120      }
     121      omFreeSize((ADDRESS)fe_hist,fe_hist_max*sizeof(char *));
     122      fe_hist=NULL;
     123    }
     124    if (!fe_stdout_is_tty)
     125    {
     126      fclose(fe_echo);
     127    }
     128  }
     129}
     130void fe_temp_reset (void)
     131{
     132  if (fe_is_raw_tty)
     133  {
     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
     143    fe_is_raw_tty=0;
     144  }
     145}
     146void fe_temp_set (void)
     147{
     148  if(fe_is_raw_tty==0)
     149  {
     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
     162
     163    /* 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
     188    fe_is_raw_tty=1;
     189  }
     190}
     191
     192static char termcap_buff[2048];
     193static int fe_out_char(int c)
     194{
     195  fputc(c,fe_echo);
     196  return c;
     197}
     198void fe_init (void)
     199{
     200  fe_is_initialized=TRUE;
     201  if ((!fe_use_fgets) && (isatty (STDIN_FILENO)))
     202  {
     203    /* Make sure stdin is a terminal. */
     204    char *term=getenv("TERM");
     205
     206    /*setup echo*/
     207    if(isatty(STDOUT_FILENO))
     208    {
     209      fe_stdout_is_tty=1;
     210      fe_echo=stdout;
     211    }
     212    else
     213    {
     214      fe_stdout_is_tty=0;
    154215      #ifdef atarist
    155         /*set line wrap mode*/
    156         if(fe_stdout_is_tty)
    157         {
    158           printf("\033v");
    159         }
    160       #endif
     216        fe_echo = fopen( "/dev/tty", "w" );
     217      #else
     218        fe_echo = fopen( ttyname(fileno(stdin)), "w" );
     219      #endif
     220    }
     221    /* Save the terminal attributes so we can restore them later. */
     222    {
    161223      #if defined( atarist ) || defined( NeXT )
    162224        struct sgttyb tattr;
     225        #ifdef atarist
     226          gtty(0, &fe_saved_attributes);
     227        #else
     228          ioctl(STDIN_FILENO, TIOCGETP, &fe_saved_attributes);
     229        #endif
    163230      #else
    164231        struct termios tattr;
     232        tcgetattr (STDIN_FILENO, &fe_saved_attributes);
     233      #endif
     234      #ifdef HAVE_FEREAD
     235        #ifdef HAVE_ATEXIT
     236          atexit(fe_reset_fe);
     237        #else
     238          on_exit(fe_reset_fe,NULL);
     239        #endif
    165240      #endif
    166241
    167242      /* Set the funny terminal modes. */
    168243      #ifdef atarist
    169          gtty(0, &tattr);
    170          tattr.sg_flags |= RAW;
    171          tattr.sg_flags |= CBREAK;
    172          tattr.sg_flags &= ~ECHO;
    173          stty(0, &tattr);
     244        gtty(0, &tattr);
     245        tattr.sg_flags |= RAW;
     246        tattr.sg_flags |= CBREAK;
     247        tattr.sg_flags &= ~ECHO;
     248        stty(0, &tattr);
    174249      #else
    175250        #ifdef NeXT
     
    189264          tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
    190265        #endif
    191       #endif
    192       fe_is_raw_tty=1;
    193     }
    194   }
    195 #endif
    196 
    197 static char termcap_buff[2048];
    198 static int fe_out_char(int c)
    199 {
    200   fputc(c,fe_echo);
    201   return c;
    202 }
    203 void fe_init (void)
    204 {
    205   #ifdef MSDOS
    206   /*extern short ospeed;*/
    207   #endif
    208   fe_is_initialized=TRUE;
    209   if ((!fe_use_fgets) && (isatty (STDIN_FILENO)))
    210   {
    211     /* Make sure stdin is a terminal. */
    212     #ifndef MSDOS
    213       char *term=getenv("TERM");
    214 
    215       /*setup echo*/
    216       if(isatty(STDOUT_FILENO))
    217       {
    218         fe_stdout_is_tty=1;
    219         fe_echo=stdout;
    220       }
    221       else
    222       {
    223         fe_stdout_is_tty=0;
    224         #ifdef atarist
    225           fe_echo = fopen( "/dev/tty", "w" );
    226         #else
    227           fe_echo = fopen( ttyname(fileno(stdin)), "w" );
    228         #endif
    229       }
    230       /* Save the terminal attributes so we can restore them later. */
    231       {
    232         #if defined( atarist ) || defined( NeXT )
    233           struct sgttyb tattr;
    234           #ifdef atarist
    235             gtty(0, &fe_saved_attributes);
    236           #else
    237             ioctl(STDIN_FILENO, TIOCGETP, &fe_saved_attributes);
    238           #endif
    239         #else
    240           struct termios tattr;
    241           tcgetattr (STDIN_FILENO, &fe_saved_attributes);
    242         #endif
    243         #ifdef HAVE_FEREAD
    244           #ifdef HAVE_ATEXIT
    245             atexit(fe_reset_fe);
    246           #else
    247             on_exit(fe_reset_fe,NULL);
    248           #endif
    249         #endif
    250 
    251       /* Set the funny terminal modes. */
    252         #ifdef atarist
    253           gtty(0, &tattr);
    254           tattr.sg_flags |= RAW;
    255           tattr.sg_flags |= CBREAK;
    256           tattr.sg_flags &= ~ECHO;
    257           stty(0, &tattr);
    258         #else
    259           #ifdef NeXT
    260             ioctl(STDIN_FILENO, TIOCGETP, &tattr);
    261             //tattr.sg_flags |= RAW;
    262             tattr.sg_flags |= CBREAK;
    263             tattr.sg_flags &= ~ECHO;
    264             ioctl(STDIN_FILENO, TIOCSETP, &tattr);
    265             ioctl(STDOUT_FILENO, TIOCGETP, &tattr);
    266             tattr.sg_flags |= CRMOD;
    267             ioctl(STDOUT_FILENO, TIOCSETP, &tattr);
    268           #else
    269             tcgetattr (STDIN_FILENO, &tattr);
    270             tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
    271             tattr.c_cc[VMIN] = 1;
    272             tattr.c_cc[VTIME] = 0;
    273             tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
    274           #endif
    275           /*ospeed=cfgetospeed(&tattr);*/
    276         #endif
    277       }
    278     #endif
     266        /*ospeed=cfgetospeed(&tattr);*/
     267      #endif
     268    }
    279269    if(term==NULL)
    280270    {
     
    417407static int fe_getchar()
    418408{
    419   #ifndef MSDOS
    420409  char c='\0';
    421410  while (1!=read (STDIN_FILENO, &c, 1));
    422   #else
    423   int c=getkey();
    424   #endif
    425   #ifndef MSDOS
    426411  if (c == 033)
    427412  {
     
    451436    }
    452437  }
    453   #endif
    454438  return c;
    455439}
     
    484468    int h=fe_hist_pos;
    485469    int change=0;
    486     #ifdef MSDOS
    487       int c;
    488     #else
    489       char c;
    490     #endif
     470    char c;
    491471    int i=0;
    492472
     
    532512          return s;
    533513        }
    534         #ifdef MSDOS
    535         case 0x153:
    536         #endif
    537514        case feCTRL('H'):
    538515        case 127:       /*delete the character left of the cursor*/
     
    580557            }
    581558          }
    582           #ifdef MSDOS
    583           fputc('\b',fe_echo);
    584           #endif
    585559          change=1;
    586560          fflush(fe_echo);
     
    952926  }
    953927#endif
    954 #if !defined(MSDOS) && defined(HAVE_FEREAD)
     928#if defined(HAVE_FEREAD)
    955929  #ifndef HAVE_ATEXIT
    956930  fe_reset_fe(NULL,NULL);
  • kernel/misc.cc

    r3dd3ff re37080  
    124124* testet on : linux, HP 9.0
    125125*
    126 *#ifndef MSDOS
    127126*#include <sys/times.h>
    128127*#include <sys/resource.h>
     
    135134*  sleep(10);
    136135*}
    137 *#else
    138 *void very_nice(){}
    139 *#endif
    140136*/
    141137
  • kernel/mod2.h.in

    r3dd3ff re37080  
    66 *          DO NOT EDIT!
    77 *
    8  *  Version: $Id: mod2.h.in,v 1.16 2007-11-28 17:28:44 Singular Exp $
     8 *  Version: $Id: mod2.h.in,v 1.17 2007-12-18 09:56:49 Singular Exp $
    99 *******************************************************************/
    1010#ifndef MOD2_H
     
    220220/* Undefine to disable real time measurments  */
    221221#ifdef HAVE_GETTIMEOFDAY
    222 #if ! defined(MSDOS)
    223222#define HAVE_RTIMER
    224 #else
    225 #undef HAVE_RTIMER
    226 #endif
    227223#endif
    228224
Note: See TracChangeset for help on using the changeset viewer.