Changeset 6d3ffec in git
- Timestamp:
- Apr 30, 1997, 5:25:34 PM (27 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 30637f47193073ce6445ef3c06828b2ec3d7d019
- Parents:
- 01a20e5ae23d2ee1d178accd9cc46711ec2e30d1
- Location:
- Singular
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
r01a20e r6d3ffec 165 165 mod2.h: config.status config.cache mod2.h.in Makefile.in 166 166 ./config.status 167 touch -r mod2.h configure configure.in Makefile .in167 touch -r mod2.h configure configure.in Makefile Makefile.in 168 168 169 169 config.status config.cache : configure -
Singular/febase.cc
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.1 1 1997-04-29 19:54:48 obachmanExp $ */4 /* $Id: febase.cc,v 1.12 1997-04-30 15:25:27 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system, handling of 'voices' … … 37 37 class Voices 38 38 { 39 private:40 void Init()41 {42 memset(this,0,sizeof(*this));43 v_lineno = 1;44 }45 39 public: 46 40 int v_lineno; // lineno, to restore in recursion … … 56 50 57 51 void Next(); 58 Voices() { Init(); }52 Voices() { v_lineno = 1; } 59 53 Voices * VFile(char* fname); 60 54 Voices * Buffer(char* buf, int t); … … 72 66 int levmax = START_LEVMAX; 73 67 Voices *currentVoice = NULL; 74 Voices *FileAttribs =(Voices *)Alloc (START_LEVMAX*sizeof(Voices));68 Voices *FileAttribs =(Voices *)Alloc0(START_LEVMAX*sizeof(Voices)); 75 69 short *ifswitch =(short *)Alloc0(START_LEVMAX*sizeof(short)); 76 70 /*1 ifswitch==0: no if statement, else is invalid … … 277 271 v_echo = si_echo; 278 272 fileVoice = voice; 279 yylineno = 1;273 yylineno = v_lineno = 1; 280 274 if (files==NULL) 281 275 { … … 299 293 levmax*sizeof(Voices), 300 294 (levmax+16)*sizeof(Voices)); 295 memset(&FileAttribs[levmax],0,16*sizeof(Voices)); 301 296 ifswitch=(short *)ReAlloc(ifswitch, 302 297 levmax*sizeof(short), … … 318 313 319 314 currentVoice = &FileAttribs[voice]; 320 currentVoice->Init();321 315 } 322 316 … … 461 455 int exitFile() 462 456 { 463 int oldswitch; 464 465 while ((voice > 0) && (inputswitch > 0)) 466 { 467 exitVoice(); 468 } 469 // now we have left all if-, else-, while-, for-, proc-levels 470 // inside this file; 471 // if the file is the terminal (inputswitch == 0) and 472 // voice >0, so return 1 else return 0 473 // (used for EXIT_CMD in CNTRLC-C-handling) 474 oldswitch = inputswitch; 475 exitVoice(); 476 #ifdef SIC 477 return 1; 478 #else 479 if ((oldswitch)||(myynest<0)) return 0; 480 else return 1; 481 #endif 457 /*4 first check for valid buffer type*/ 458 for (int i=voice; i>0; i--) 459 { 460 if (FileAttribs[i].typ == 0) break; 461 if (FileAttribs[i].typ == BT_file) 462 { 463 while ((BT_file != currentVoice->typ) 464 && (voice > 0)) 465 { 466 exitVoice(); 467 } 468 exitVoice(); 469 } 470 } 482 471 } 483 472 … … 598 587 void I_FEbase(void) 599 588 { 600 FileAttribs[0].files = yyin = stdin; 601 FileAttribs[0].filename = mstrdup("STDIN"); 602 yylineno = 1; 603 currentVoice = &FileAttribs[0]; 589 currentVoice=FileAttribs[0].VFile("STDIN"); 590 //FileAttribs[0].files = yyin = stdin; 591 //FileAttribs[0].filename = mstrdup("STDIN"); 592 //yylineno = 1; 593 //currentVoice = &FileAttribs[0]; 604 594 } 605 595 -
Singular/grammar.y
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: grammar.y,v 1. 7 1997-04-10 16:34:42Singular Exp $ */4 /* $Id: grammar.y,v 1.8 1997-04-30 15:25:27 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: SINGULAR shell grammatik … … 343 343 { 344 344 ifswitch[voice]=0; 345 exitFile(); 345 346 /* Print("exit found\n"); */ 346 YYACCEPT;347 347 } 348 348 | SYS_BREAK -
Singular/intvec.cc
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: intvec.cc,v 1. 5 1997-04-12 16:04:37Singular Exp $ */4 /* $Id: intvec.cc,v 1.6 1997-04-30 15:25:28 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: class intvec: lists/vectors of integers … … 77 77 } 78 78 79 char * intvec::ivString( )79 char * intvec::ivString(int mat,int spaces) 80 80 { 81 81 StringSetS(""); 82 if ( col == 1)82 if ((col == 1)&&(mat!=INTMAT_CMD)) 83 83 { 84 84 for (int i=0; i<row; i++) … … 105 105 } 106 106 } 107 if (j+1<row) StringAppend("\n"); 107 if (j+1<row) 108 { 109 StringAppend("\n"); 110 if (spaces>0) StringAppend("%-*.*s",spaces,spaces," "); 111 } 108 112 } 109 113 } … … 116 120 } 117 121 118 void intvec::show(int spaces)122 void intvec::show(int mat,int spaces) 119 123 { 120 124 if (spaces>0) 121 Print("%-*.*s%s",spaces,spaces," ",ivString( ));125 Print("%-*.*s%s",spaces,spaces," ",ivString(mat,spaces)); 122 126 else 123 PrintS(ivString( ));127 PrintS(ivString(mat,0)); 124 128 } 125 129 -
Singular/intvec.h
r01a20e r6d3ffec 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: intvec.h,v 1. 3 1997-04-09 12:19:45Singular Exp $ */6 /* $Id: intvec.h,v 1.4 1997-04-30 15:25:29 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: class intvec: lists/vectors of integers … … 51 51 int rows() const { return row; } 52 52 void length(int l) { row = l; col = 1; } 53 void show(int spaces=0);53 void show(int mat=0,int spaces=0); 54 54 void makeVector() { row*=col;col=1; } 55 55 // keiner (ausser obachman) darf das folgenden benutzen !!! 56 56 int * ivGetVec() { return v; } 57 57 char * String(); 58 char * ivString( );58 char * ivString(int mat=0,int spaces=0); 59 59 ~intvec() 60 60 { -
Singular/iparith.cc
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.2 4 1997-04-28 09:57:54Singular Exp $ */4 /* $Id: iparith.cc,v 1.25 1997-04-30 15:25:30 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: table driven kernel interface, used by interpreter … … 1176 1176 static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v) 1177 1177 { 1178 if(u->name==NULL) return TRUE; 1178 1179 char * n = (char *)AllocL(strlen(u->name) + 6); 1179 1180 sprintf(n,"%s(%d)",u->name,(int)v->Data()); … … 4222 4223 } 4223 4224 fprintf(outfile,"/*---------------------------------------------*/\n"); 4224 char ops[]="=><+*/[.^,%( ";4225 char ops[]="=><+*/[.^,%(;"; 4225 4226 for(i=0;ops[i]!='\0';i++) 4226 4227 fprintf(outfile,"// token %d : %c\n", (int)ops[i], ops[i]); -
Singular/ipshell.cc
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1. 7 1997-04-28 17:47:15Singular Exp $ */4 /* $Id: ipshell.cc,v 1.8 1997-04-30 15:25:32 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 640 640 if (r==NULL) return TRUE; 641 641 res->data=(char *)syBetti(r,len,®); 642 // int i,j;643 // for(i=0;i<betti->rows();i++)644 // {645 // Print("%2d:",i);646 // for(j=1;j<=betti->cols();j++)647 // {648 // Print(" %5d",IMATELEM(*betti,i+1,j));649 // }650 // PrintLn();651 // }652 642 Free((ADDRESS)r,(len)*sizeof(ideal)); 653 643 return FALSE; -
Singular/ring.cc
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1. 8 1997-04-18 15:49:40Singular Exp $ */4 /* $Id: ring.cc,v 1.9 1997-04-30 15:25:33 Singular Exp $ */ 5 5 6 6 /* … … 288 288 { 289 289 while ((ch!=fftable[l]) && (fftable[l])) l++; 290 if (fftable[l]==0) ch = IsPrime(ch); 290 if (fftable[l]==0) 291 { 292 ch = IsPrime(ch); 293 } 291 294 else 292 295 { 293 296 char *m[1]={(char *)sNoName}; 294 297 nfSetChar(ch,m); 295 if(errorreported) ch=IsPrime(ch); 296 else ffChar=TRUE; 298 if(errorreported) 299 { 300 errorreported=0; 301 ch=IsPrime(ch); 302 } 303 else 304 { 305 ffChar=TRUE; 306 } 297 307 } 298 308 } … … 319 329 else hs=pn; 320 330 hs->CleanUp(); 321 Free((ADDRESS)hs,sizeof(sleftv)); 322 if (ffChar) pn->next=NULL; 331 if (ffChar) 332 { 333 pn->next=NULL; 334 Free((ADDRESS)hs,sizeof(sleftv)); 335 } 323 336 else pn=NULL; 324 337 } -
Singular/subexpr.cc
r01a20e r6d3ffec 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: subexpr.cc,v 1.1 5 1997-04-22 14:50:28Singular Exp $ */4 /* $Id: subexpr.cc,v 1.16 1997-04-30 15:25:34 Singular Exp $ */ 5 5 6 6 /* … … 116 116 case INTVEC_CMD: 117 117 case INTMAT_CMD: 118 ((intvec *)d)->show( spaces);118 ((intvec *)d)->show(t,spaces); 119 119 break; 120 120 case RING_CMD: … … 664 664 return rString((ring)d); 665 665 } 666 #ifdef TEST667 666 default: 667 #ifdef TEST 668 668 ::Print("String:unknown type %s(%d)", Tok2Cmdname(Typ()),Typ()); 669 #endif 669 670 return NULL; 670 #endif671 671 } /* end switch: (Typ()) */ 672 672 return mstrdup(s);
Note: See TracChangeset
for help on using the changeset viewer.