Changeset 70433b5 in git
- Timestamp:
- Oct 25, 1999, 8:21:53 PM (24 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 3ce7b66ce4f4c6aa1846f4edb90839c950a9c891
- Parents:
- fc7421d294f85b2020c01c2d1fd1603f1ebf4cb8
- Location:
- Singular
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
rfc7421 r70433b5 426 426 CXXFLAGSP = -pg -O3 ${PIPE} 427 427 CXXTEMPLFLAGSP = -fno-implicit-templates 428 DEFSP = -DNDEBUG -DDO_PROFILE -D@SING_UNAME@ 428 DEFSP = -DNDEBUG -DDO_PROFILE -D@SING_UNAME@ @DEFS@ 429 429 LDFLAGSP = -static @LDFLAGS@ 430 430 … … 432 432 CXXFLAGSB = -g -O3 ${PIPE} 433 433 CXXTEMPLFLAGSB = -fno-implicit-templates 434 DEFSB = -D@SING_UNAME@ -DNDEBUG 434 DEFSB = -D@SING_UNAME@ -DNDEBUG @DEFS@ 435 435 LDFLAGSB = -static @LDFLAGS@ 436 436 … … 438 438 BPROFOBJ = /usr/local/lib/bmon.o 439 439 440 DEFST = -DNDEBUG -D@SING_UNAME@ -DMTRACK 441 LDFLAGST = -static@LDFLAGS@440 DEFST = -DNDEBUG -D@SING_UNAME@ -DMTRACK @DEFS@ 441 LDFLAGST = @LDFLAGS@ 442 442 CFLAGST = -g -w ${PIPE} 443 443 CXXFLAGST = -g -w ${PIPE} -
Singular/feResource.cc
rfc7421 r70433b5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: feResource.cc,v 1.1 4 1999-10-22 12:15:07 obachmanExp $ */4 /* $Id: feResource.cc,v 1.15 1999-10-25 18:21:50 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: management of resources … … 21 21 22 22 #if defined(MAKE_DISTRIBUTION) 23 #if defined(WINNT) 23 #if defined(WINNT) 24 24 #define SINGULAR_DEFAULT_DIR "/Singular/"S_VERSION1 25 25 #elif defined(macintosh) … … 27 27 #else // unix 28 28 #define SINGULAR_DEFAULT_DIR "/usr/local/Singular/"S_VERSION1 29 #endif 29 #endif 30 30 #else // ! defined(MAKE_DISTRIBUTION) 31 31 #define SINGULAR_DEFAULT_DIR S_ROOT_DIR 32 #endif // defined(MAKE_DISTRIBUTION) 32 #endif // defined(MAKE_DISTRIBUTION) 33 33 34 34 /***************************************************************** … … 46 46 char* env; // env variable to look for 47 47 char* fmt; // format string -- see below for epxlaination 48 char* value; // what it was set to 48 char* value; // what it was set to 49 49 } feResourceConfig_s; 50 50 typedef feResourceConfig_s * feResourceConfig; 51 51 52 // feSprintf transforms format strings as follows format string: 52 // feSprintf transforms format strings as follows format string: 53 53 // 1.) substrings of the form %c (c being a letter) are replaced by respective resource value 54 54 // 2.) substrings of the form $string are replaced by value of resp. env variable … … 57 57 // 1.) '/' characters are replaced by respective directory - separators 58 58 // 2.) ';' characters are replaced by respective path separators 59 static feResourceConfig_s feResourceConfigs[20] = 60 { 61 {"SearchPath", 's', feResPath, NULL, 59 static feResourceConfig_s feResourceConfigs[20] = 60 { 61 {"SearchPath", 's', feResPath, NULL, 62 62 "$SINGULARPATH;" 63 63 "%b/LIB;" … … 83 83 {"Path", 'p', feResPath, NULL, "%b;$PATH", ""}, 84 84 #endif // ! defined(macintosh) 85 85 86 86 #ifdef ESINGULAR 87 87 {"emacs", 'E', feResBinary, "EMACS", "%b/emacs", ""}, … … 98 98 * 99 99 *****************************************************************/ 100 char* feArgv0 ;100 char* feArgv0=NULL; 101 101 #define MAXRESOURCELEN 5*MAXPATHLEN 102 char fePathSep = 102 103 #ifdef MTRACK 104 BOOLEAN feRes_works=FALSE; 105 #endif 106 107 char fePathSep = 103 108 #if defined(WINNT) 104 109 ';' … … 172 177 // don't complain about stuff when initializing SingularPath 173 178 feResource('s',0); 174 175 176 179 177 180 #ifdef HAVE_SETENV 178 181 char* path = feResource('p'); … … 181 184 #endif 182 185 if (path != NULL) setenv("PATH", path, 1); 186 #endif 187 #ifdef MTRACK 188 feRes_works=TRUE; 183 189 #endif 184 190 } … … 261 267 if (config->env != NULL) 262 268 { 263 char* evalue = getenv(config->env); 269 char* evalue = getenv(config->env); 264 270 if (evalue != NULL) 265 { 271 { 266 272 #ifdef RESOURCE_DEBUG 267 273 printf("feInitResource: Found value from env:%s\n", evalue); … … 270 276 if (config->type == feResBinary // do not verify binaries 271 277 || 272 feVerifyResourceValue(config->type, 278 feVerifyResourceValue(config->type, 273 279 feCleanResourceValue(config->type, value))) 274 280 { … … 281 287 } 282 288 } 283 289 284 290 *value = '\0'; 285 291 // Special treatment of executable … … 287 293 { 288 294 char* executable = feGetExpandedExecutable(); 289 if (executable != NULL) 295 if (executable != NULL) 290 296 { 291 297 strcpy(value, executable); … … 307 313 } 308 314 } 309 315 310 316 if (*value == '\0' && config->fmt != NULL ) 311 317 { … … 320 326 321 327 // Clean and verify 322 if (feVerifyResourceValue(config->type, 328 if (feVerifyResourceValue(config->type, 323 329 feCleanResourceValue(config->type, value))) 324 330 { … … 337 343 strcpy(value, executable); 338 344 FreeL(executable); 339 if (feVerifyResourceValue(config->type, 345 if (feVerifyResourceValue(config->type, 340 346 feCleanResourceValue(config->type, value))) 341 347 { … … 349 355 } 350 356 351 // issue warning if explicitely requested, or if 357 // issue warning if explicitely requested, or if 352 358 // this value is gotten for the first time 353 359 if (warn > 0 || (warn < 0 && config->value != NULL)) 354 360 { 355 361 Warn("Could not get %s. ", config->key); 356 Warn("Either set environment variable %s to %s,", 362 Warn("Either set environment variable %s to %s,", 357 363 config->env, config->key); 358 364 feSprintf(value, config->fmt, warn); … … 405 411 #endif 406 412 } 407 408 413 414 409 415 static BOOLEAN feVerifyResourceValue(feResourceType type, char* value) 410 416 { … … 417 423 case feResPath: 418 424 return TRUE; 419 425 420 426 case feResFile: 421 427 return ! access(value, R_OK); … … 424 430 case feResDir: 425 431 return ! access(value, X_OK); 426 432 427 433 default: 428 434 return FALSE; … … 446 452 strcat(value, ".exe"); 447 453 } 448 #endif 454 #endif 449 455 if (type == feResFile || type == feResBinary || type == feResDir) 450 456 return feCleanUpFile(value); … … 500 506 } 501 507 } 502 508 503 509 #ifdef macintosh 504 510 // replace / and .. by DIR_SEP and UP_DIR … … 517 523 } 518 524 #endif 519 525 520 526 #ifdef RESOURCE_DEBUG 521 527 printf("feCleanUpFile: leaving with =%s=\n", fname); … … 637 643 *d = '\0'; 638 644 } 639 645 640 646 /***************************************************************** 641 647 * … … 647 653 char* s_in = s; 648 654 if (fmt == NULL) return NULL; 649 655 650 656 while (*fmt != '\0') 651 657 { 652 658 *s = *fmt; 653 659 654 660 if (*fmt == '%' && *(fmt + 1) != '\0') 655 661 { … … 691 697 return s_in; 692 698 } 693 699 694 700 void feStringAppendResources(int warn = -1) 695 701 { … … 699 705 { 700 706 r = feResource(feResourceConfigs[i].key, warn); 701 StringAppend("%-10s:\t%s\n", feResourceConfigs[i].key, 707 StringAppend("%-10s:\t%s\n", feResourceConfigs[i].key, 702 708 (r != NULL ? r : "")); 703 709 i++; 704 710 } 705 711 } 706 707 708 709 -
Singular/febase.h
rfc7421 r70433b5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1.4 1 1999-10-22 11:14:07 obachmanExp $ */6 /* $Id: febase.h,v 1.42 1999-10-25 18:21:51 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: basic i/o … … 53 53 54 54 extern char* feErrors; 55 extern char* feArgv0; 55 56 extern int feErrorsLen; 56 57 extern FILE* feProtFile; … … 61 62 extern int yy_blocklineno; 62 63 extern int yy_noeof; 64 #ifdef MTRACK 65 extern BOOLEAN feRes_works; 66 #endif 63 67 extern char prompt_char; 64 68 extern const char feNotImplemented[]; … … 128 132 // returns value of Resource as read-only string, or NULL 129 133 // if Resource not found 130 // issues warning, if explicitely requested (warn > 0), or 134 // issues warning, if explicitely requested (warn > 0), or 131 135 // if warn < 0 and Resource is gotten for the first time 132 136 // Always quiet if warn == 0 … … 149 153 // display general help, otherwise 150 154 void feHelp(char* str = NULL); 151 // if browser != NULL or feOpt("browser") != NULL 152 // set HelpBrowser to browser 153 // otherwise, if browser was already set, leave as is, 155 // if browser != NULL or feOpt("browser") != NULL 156 // set HelpBrowser to browser 157 // otherwise, if browser was already set, leave as is, 154 158 // if not, choose first available browser 155 159 // return string identifying current browser … … 267 271 /* fgets: */ 268 272 char * fe_fgets(char *pr,char *s, int size); 269 273 270 274 #ifdef HAVE_TCL 271 275 /* tcl: */ -
Singular/ipshell.cc
rfc7421 r70433b5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.5 0 1999-10-14 14:27:10 obachmanExp $ */4 /* $Id: ipshell.cc,v 1.51 1999-10-25 18:21:51 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 311 311 currRing=NULL; 312 312 currRingHdl=NULL; 313 rSetHdl(sh,TRUE);313 if (sh!=NULL) rSetHdl(sh,TRUE); 314 314 } 315 315 -
Singular/ipshell.h
rfc7421 r70433b5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ipshell.h,v 1.2 0 1999-09-20 18:03:49 obachmanExp $ */6 /* $Id: ipshell.h,v 1.21 1999-10-25 18:21:52 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 24 24 extern int myynest; 25 25 extern char * currid; 26 extern char * feArgv0;27 26 extern int iiRETURNEXPR_len; 28 27 extern sleftv *iiRETURNEXPR; -
Singular/mmbt.c
rfc7421 r70433b5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmbt.c,v 1. 19 1999-10-25 16:13:19Singular Exp $ */4 /* $Id: mmbt.c,v 1.20 1999-10-25 18:21:52 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: backtrace: part of memory subsystem (for linux/elf) … … 28 28 #include "febase.h" 29 29 #include "mmbt.h" 30 #include "febase.h"31 30 32 31 … … 65 64 return 0; 66 65 } 67 else 66 else if (feRes_works) 68 67 { 69 68 char buf[255]; … … 74 73 { 75 74 fprintf(stderr, 76 75 "environment variable MPRPC not found\nand pipe to `%s`failed\n",buf); 77 76 m2_end(1); 78 77 } … … 96 95 pclose(nm); 97 96 } 97 return 0; 98 98 } 99 99 } … … 121 121 122 122 if (mm_lowpc==0) mmTrackInit(); 123 124 123 125 124 while ((fp!=NULL) && ((unsigned long)fp>4095) … … 176 175 mm_p2n_max=i; 177 176 } 177 178 178 char * mmP2cName(unsigned long p) 179 179 { -
Singular/ring.cc
rfc7421 r70433b5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.7 7 1999-10-25 08:32:18 obachmanExp $ */4 /* $Id: ring.cc,v 1.78 1999-10-25 18:21:53 Singular Exp $ */ 5 5 6 6 /* … … 1984 1984 if (r == NULL) 1985 1985 { 1986 Werror("Null ring in %s:% l\n", fn, l);1986 Werror("Null ring in %s:%d\n", fn, l); 1987 1987 return FALSE; 1988 1988 }
Note: See TracChangeset
for help on using the changeset viewer.