Changeset e37080 in git
- Timestamp:
- Dec 18, 2007, 11:01:42 AM (16 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 3b8b19f46828b935a75f3812d5297470f2f8431b
- Parents:
- 3dd3ff38f00730440e515860672d534044923a46
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
r3dd3ff re37080 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.26 0 2007-11-20 13:22:59Singular Exp $ */4 /* $Id: extra.cc,v 1.261 2007-12-18 09:55:26 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 320 320 { 321 321 res->rtyp=INT_CMD; 322 #ifndef MSDOS323 322 res->data=(void *)(long) getpid(); 324 #else325 res->data=(void *)1;326 #endif327 323 return FALSE; 328 324 } … … 2111 2107 #endif 2112 2108 /*==================== alarm ==================================*/ 2113 #ifndef MSDOS2114 #ifndef atarist2115 2109 #ifdef unix 2116 2110 if(strcmp(sys_cmd,"alarm")==0) … … 2131 2125 } 2132 2126 else 2133 #endif2134 #endif2135 2127 #endif 2136 2128 /*==================== red =============================*/ -
Singular/misc.cc
r3dd3ff re37080 98 98 * testet on : linux, HP 9.0 99 99 * 100 *#ifndef MSDOS101 100 *#include <sys/times.h> 102 101 *#include <sys/resource.h> … … 109 108 * sleep(10); 110 109 *} 111 *#else112 *void very_nice(){}113 *#endif114 110 */ 115 111 -
Singular/mod2.h.in
r3dd3ff re37080 6 6 * DO NOT EDIT! 7 7 * 8 * Version: $Id: mod2.h.in,v 1.12 3 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 $ 9 9 *******************************************************************/ 10 10 #ifndef MOD2_H … … 220 220 /* Undefine to disable real time measurments */ 221 221 #ifdef HAVE_GETTIMEOFDAY 222 #if ! defined(MSDOS)223 222 #define HAVE_RTIMER 224 #else225 #undef HAVE_RTIMER226 #endif227 223 #endif 228 224 -
kernel/febase.h
r3dd3ff re37080 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1. 7 2007-11-08 09:20:33Singular Exp $ */6 /* $Id: febase.h,v 1.8 2007-12-18 09:56:22 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: basic i/o … … 284 284 extern "C" void fe_reset_input_mode(); 285 285 286 #ifndef MSDOS287 286 extern "C" { 288 287 #ifndef HAVE_ATEXIT … … 292 291 #endif 293 292 } 294 #endif295 293 296 294 -
kernel/fereadl.c
r3dd3ff re37080 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: fereadl.c,v 1. 3 2007-04-02 07:38:21Singular Exp $ */4 /* $Id: fereadl.c,v 1.4 2007-12-18 10:01:42 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: input from ttys, simulating fgets … … 66 66 #define feCTRL(C) ((C) & 0x1F) /* <ctrl> character */ 67 67 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; 76 73 #endif 77 74 … … 89 86 int fe_cursor_line; /* 0..pagelength-1*/ 90 87 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) 101 92 #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; 136 102 if (fe_is_raw_tty) 137 103 { … … 147 113 fe_is_raw_tty=0; 148 114 } 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 } 130 void 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 } 146 void 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 192 static char termcap_buff[2048]; 193 static int fe_out_char(int c) 194 { 195 fputc(c,fe_echo); 196 return c; 197 } 198 void 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; 154 215 #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 { 161 223 #if defined( atarist ) || defined( NeXT ) 162 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 163 230 #else 164 231 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 165 240 #endif 166 241 167 242 /* Set the funny terminal modes. */ 168 243 #ifdef atarist 169 170 171 172 173 244 gtty(0, &tattr); 245 tattr.sg_flags |= RAW; 246 tattr.sg_flags |= CBREAK; 247 tattr.sg_flags &= ~ECHO; 248 stty(0, &tattr); 174 249 #else 175 250 #ifdef NeXT … … 189 264 tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr); 190 265 #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 } 279 269 if(term==NULL) 280 270 { … … 417 407 static int fe_getchar() 418 408 { 419 #ifndef MSDOS420 409 char c='\0'; 421 410 while (1!=read (STDIN_FILENO, &c, 1)); 422 #else423 int c=getkey();424 #endif425 #ifndef MSDOS426 411 if (c == 033) 427 412 { … … 451 436 } 452 437 } 453 #endif454 438 return c; 455 439 } … … 484 468 int h=fe_hist_pos; 485 469 int change=0; 486 #ifdef MSDOS 487 int c; 488 #else 489 char c; 490 #endif 470 char c; 491 471 int i=0; 492 472 … … 532 512 return s; 533 513 } 534 #ifdef MSDOS535 case 0x153:536 #endif537 514 case feCTRL('H'): 538 515 case 127: /*delete the character left of the cursor*/ … … 580 557 } 581 558 } 582 #ifdef MSDOS583 fputc('\b',fe_echo);584 #endif585 559 change=1; 586 560 fflush(fe_echo); … … 952 926 } 953 927 #endif 954 #if !defined(MSDOS) &&defined(HAVE_FEREAD)928 #if defined(HAVE_FEREAD) 955 929 #ifndef HAVE_ATEXIT 956 930 fe_reset_fe(NULL,NULL); -
kernel/misc.cc
r3dd3ff re37080 124 124 * testet on : linux, HP 9.0 125 125 * 126 *#ifndef MSDOS127 126 *#include <sys/times.h> 128 127 *#include <sys/resource.h> … … 135 134 * sleep(10); 136 135 *} 137 *#else138 *void very_nice(){}139 *#endif140 136 */ 141 137 -
kernel/mod2.h.in
r3dd3ff re37080 6 6 * DO NOT EDIT! 7 7 * 8 * Version: $Id: mod2.h.in,v 1.1 6 2007-11-28 17:28:44Singular Exp $8 * Version: $Id: mod2.h.in,v 1.17 2007-12-18 09:56:49 Singular Exp $ 9 9 *******************************************************************/ 10 10 #ifndef MOD2_H … … 220 220 /* Undefine to disable real time measurments */ 221 221 #ifdef HAVE_GETTIMEOFDAY 222 #if ! defined(MSDOS)223 222 #define HAVE_RTIMER 224 #else225 #undef HAVE_RTIMER226 #endif227 223 #endif 228 224
Note: See TracChangeset
for help on using the changeset viewer.