Changeset 667247 in git
- Timestamp:
- May 2, 1997, 5:10:23 PM (27 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 713fe8641a9dff2efe5d93b24d2de16fb640aeda
- Parents:
- fde1a8734f321f72cbe87001fd682d36e955e8a1
- Location:
- Singular
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/febase.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.1 4 1997-04-30 17:44:35Singular Exp $ */4 /* $Id: febase.cc,v 1.15 1997-05-02 15:10:11 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system, handling of 'voices' … … 147 147 FILE * feFopen(char *path, char *mode, char *where,int useWerror) 148 148 { 149 FILE * f=fopen(path,mode); 149 150 if (where!=NULL) strcpy(where,path); 150 FILE * f=fopen(path,mode); 151 if ((*mode=='a') ||(*mode=='w') || (path[0]==DIR_SEP)||(path[0]=='.') 152 ||(f!=NULL)) 153 return f; 154 char found = 0; 155 #ifdef MSDOS 156 char *env=getenv("SPATH"); 157 #else 158 char *env=getenv("SINGULARPATH"); 159 #endif 160 char *s; 161 if (where==NULL) s=(char *)AllocL(250); 162 else s=where; 163 if (env!=NULL) 164 { 165 char *p,*q; 166 p = env; 167 while( (q=strchr(p, FS_SEP)) != NULL) 168 { 169 *q = '\0'; 170 strcpy(s,p); 171 *q = FS_SEP; 172 strcat(s, DIR_SEPP); 173 strcat(s, path); 174 #ifndef macintosh 175 if(!access(s, R_OK)) { found++; break; } 176 #else 151 if ((*mode=='r') && (path[0]!=DIR_SEP)&&(path[0]!='.') 152 &&(f==NULL)) 153 { 154 char found = 0; 155 #ifdef MSDOS 156 char *env=getenv("SPATH"); 157 #else 158 char *env=getenv("SINGULARPATH"); 159 #endif 160 char *s; 161 if (where==NULL) s=(char *)AllocL(250); 162 else s=where; 163 if (env!=NULL) 164 { 165 char *p,*q; 166 p = env; 167 while( (q=strchr(p, FS_SEP)) != NULL) 168 { 169 *q = '\0'; 170 strcpy(s,p); 171 *q = FS_SEP; 172 strcat(s, DIR_SEPP); 173 strcat(s, path); 174 #ifndef macintosh 175 if(!access(s, R_OK)) { found++; break; } 176 #else 177 f=fopen(s,mode); 178 if (f!=NULL) { found++; fclose(f); break; } 179 #endif 180 p = q+1; 181 } 182 if(!found) 183 { 184 strcpy(s,p); 185 strcat(s, DIR_SEPP); 186 strcat(s, path); 187 } 177 188 f=fopen(s,mode); 178 if (f!=NULL) { found++; fclose(f); break; } 179 #endif 180 p = q+1; 181 } 182 if(!found) 183 { 184 strcpy(s,p); 185 strcat(s, DIR_SEPP); 186 strcat(s, path); 187 } 188 f=fopen(s,mode); 189 if (f!=NULL) 190 { 191 if (where==NULL) FreeL((ADDRESS)s); 192 return f; 193 } 194 } 195 else 196 { 197 if (where!=NULL) strcpy(s/*where*/,path); 198 f=fopen(path,mode); 199 } 200 #ifndef macintosh 201 if (f==NULL) 202 { 203 char* ss = s; 204 int need_len = strlen(path) + strlen(SINGULAR_DATADIR) + 2; 205 206 if (where == NULL) 207 { 208 if (need_len > 250) ss = (char *) AllocL(need_len); 209 strcpy(ss,s); 189 if (f!=NULL) 190 { 191 if (where==NULL) FreeL((ADDRESS)s); 192 return f; 193 } 210 194 } 211 195 else 212 196 { 213 if (need_len > strlen(where)) ss = (char *) AllocL(need_len); 214 strcpy(ss, s); 215 } 216 strcpy(ss,SINGULAR_DATADIR); 217 strcat(s, DIR_SEPP); 218 strcat(ss,path); 219 f=fopen(ss,mode); 220 if (ss != s) FreeL((ADDRESS)ss); 221 } 222 #endif 223 if (where==NULL) FreeL((ADDRESS)s); 197 if (where!=NULL) strcpy(s/*where*/,path); 198 f=fopen(path,mode); 199 } 200 #ifndef macintosh 201 if (f==NULL) 202 { 203 char* ss = s; 204 int need_len = strlen(path) + strlen(SINGULAR_DATADIR) + 2; 205 206 if (where == NULL) 207 { 208 if (need_len > 250) ss = (char *) AllocL(need_len); 209 strcpy(ss,s); 210 } 211 else 212 { 213 if (need_len > strlen(where)) ss = (char *) AllocL(need_len); 214 strcpy(ss, s); 215 } 216 strcpy(ss,SINGULAR_DATADIR); 217 strcat(s, DIR_SEPP); 218 strcat(ss,path); 219 f=fopen(ss,mode); 220 if (ss != s) FreeL((ADDRESS)ss); 221 } 222 #endif 223 if (where==NULL) FreeL((ADDRESS)s); 224 } 224 225 if ((f==NULL)&&(useWerror)) 225 226 Werror("cannot open `%s`",path); -
Singular/ffields.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ffields.cc,v 1.1 0 1997-04-25 15:54:02 Singular Exp $ */4 /* $Id: ffields.cc,v 1.11 1997-05-02 15:10:12 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: finite fields with a none-prime number of elements (via tables) … … 16 16 #include "ffields.h" 17 17 18 static int nfCharQ=0; /* the number of elemts: q*/ 18 int nfCharQ=0; /* the number of elemts: q*/ 19 int nfM1; /*representation of -1*/ 19 20 static int nfCharP=0; /* the characteristic: p*/ 20 21 static int nfCharQ1=0; /* q-1 */ 21 static int nfM1; /*representation of -1*/22 22 CARDINAL *nfPlus1Table=NULL; /* the table i=log(z^i) -> log(z^i+1) */ 23 23 char * nfParameter; /* the name of the primitive element */ -
Singular/ideals.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1. 5 1997-04-12 16:04:35Singular Exp $ */4 /* $Id: ideals.cc,v 1.6 1997-05-02 15:10:13 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 221 221 ideal h2; 222 222 223 #ifdef TEST223 //#ifdef TEST 224 224 if (h1 == NULL) 225 225 { … … 231 231 } 232 232 else 233 #endif233 //#endif 234 234 { 235 235 #ifdef MDEBUG -
Singular/ipassign.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipassign.cc,v 1. 9 1997-04-12 16:04:39Singular Exp $ */4 /* $Id: ipassign.cc,v 1.10 1997-05-02 15:10:14 Singular Exp $ */ 5 5 6 6 /* … … 1358 1358 nok=TRUE; 1359 1359 break; 1360 #ifdef TEST1361 1360 default: 1362 1361 WerrorS("assign not impl."); 1363 1362 nok=TRUE; 1364 1363 break; 1365 #endif1366 1364 } /* end switch: typ */ 1367 1365 if (nok && (!errorreported)) WerrorS("incompatible type in list assignment"); -
Singular/ipconv.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipconv.cc,v 1. 4 1997-04-02 15:07:10Singular Exp $ */4 /* $Id: ipconv.cc,v 1.5 1997-05-02 15:10:15 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: automatic type conversions … … 279 279 else 280 280 { 281 Werror ("wrong name, should not happen");281 WerrorS("wrong name, should not happen"); 282 282 output->name=mstrdup("?"); 283 283 } -
Singular/iplib.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iplib.cc,v 1. 5 1997-04-25 15:04:00 obachmanExp $ */4 /* $Id: iplib.cc,v 1.6 1997-05-02 15:10:15 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: LIB and help … … 634 634 v=0; 635 635 sscanf( buf+7, "%d", &v); 636 if(v!=( VERSION/100))636 if(v!=(SINGULAR_VERSION/100)) 637 637 Warn("version mismatch - library `%s` requires:%d.%d", 638 638 newlib,v/1000,(v%1000)/100); -
Singular/ipshell.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1. 8 1997-04-30 15:25:32Singular Exp $ */4 /* $Id: ipshell.cc,v 1.9 1997-05-02 15:10:17 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 207 207 { 208 208 idhdl nexth = IDNEXT(h); 209 #ifdef TEST210 // if ((('0'<r) && (r<='9'))211 // && ((IDTYP(h)==RING_CMD) || (IDTYP(h)==QRING_CMD)))212 // {213 // PrintS("## parameter type was (q)ring\n");214 // IDTYP(h)=0;215 // }216 #endif217 209 //Print("kill %s, lev: %d\n",IDID(h),IDLEV(h)); 218 210 killhdl(h,localhdl); -
Singular/longalg.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1. 3 1997-04-02 15:07:21Singular Exp $ */4 /* $Id: longalg.cc,v 1.4 1997-05-02 15:10:19 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 156 156 else 157 157 { 158 Print(" hier ging was schief:c=%d compl=%d param=%d\n",i,complete,param);158 Print("naSetChar:c=%d compl=%d param=%d\n",i,complete,param); 159 159 } 160 160 #endif … … 1714 1714 mmTestP(a,sizeof(rnumber)); 1715 1715 #ifdef TEST 1716 if (a->z==NULL) WerrorS("internal zero error( 4)");1716 if (a->z==NULL) WerrorS("internal zero error(5)"); 1717 1717 #endif 1718 1718 if (a->n==NULL) -
Singular/misc.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: misc.cc,v 1. 8 1997-04-28 09:57:56Singular Exp $ */4 /* $Id: misc.cc,v 1.9 1997-05-02 15:10:20 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 393 393 struct soptionStruct optionStruct[]= 394 394 { 395 /*Aenderung: Namen fuer test 24,23,27 einfuehren*/396 395 {"prot", Sy_bit(OPT_PROT), ~Sy_bit(OPT_PROT) }, 397 396 {"redSB", Sy_bit(OPT_REDSB), ~Sy_bit(OPT_REDSB) }, … … 480 479 } 481 480 } 481 if(strcmp(n,"none")==0) 482 { 483 test=0; 484 verbose=0; 485 goto okay; 486 } 482 487 for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++) 483 488 { … … 497 502 && (strcmp(n+2,optionStruct[i].name)==0)) 498 503 { 499 if ((optionStruct[i].setval & validOpts) 500 || (strcmp(n+2,"ne")==0)) 504 if (optionStruct[i].setval & validOpts) 501 505 { 502 506 test &= optionStruct[i].resetval; -
Singular/modulop.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: modulop.cc,v 1. 5 1997-04-12 16:04:42 Singular Exp $ */4 /* $Id: modulop.cc,v 1.6 1997-05-02 15:10:22 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: numbers modulo p (<=32003) … … 221 221 222 222 if (c==npPrimeM) return; 223 #ifdef TEST224 if ((c==-npPrimeM) || ((c^1)==0))225 {226 Print("internal error: %d as np\n",c);227 return;228 }229 // should never happen:if ((c^1)==0) return;230 #endif231 223 if (npPrimeM > 1) 232 224 { -
Singular/numbers.cc
rfde1a8 r667247 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: numbers.cc,v 1. 3 1997-04-02 15:07:43 Singular Exp $ */4 /* $Id: numbers.cc,v 1.4 1997-05-02 15:10:23 Singular Exp $ */ 5 5 6 6 /* … … 289 289 } 290 290 else 291 if (c==(-1))291 //if (c==(-1)) // the rest... 292 292 { 293 293 #ifdef LDEBUG … … 330 330 } 331 331 } 332 #ifdef TEST333 else334 {335 Werror("invalid char %d\n",c);336 }337 #endif338 332 if (complete&&(!errorreported)) nNULL=nInit(0); 339 333 }
Note: See TracChangeset
for help on using the changeset viewer.