Changeset 726d50 in git for Singular/feResource.cc


Ignore:
Timestamp:
Aug 6, 1999, 4:06:47 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
752871cd58b61cf450ea583fb80146c16c92a7c8
Parents:
36baed385512e1eb1c1731a1ebae7ac0130ea591
Message:
* changes and docu of help/Resources


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

Legend:

Unmodified
Added
Removed
  • Singular/feResource.cc

    r36baed r726d50  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feResource.cc,v 1.3 1999-08-05 11:28:02 obachman Exp $ */
     4/* $Id: feResource.cc,v 1.4 1999-08-06 14:06:38 obachman Exp $ */
    55/*
    66* ABSTRACT: management of resources
     
    1212#include "mmemory.h"
    1313#include "febase.h"
     14#include "version.h"
    1415
    1516// define RESOURCE_DEBUG for chattering about resource management
     
    6667  {"BinDir",    'b',    feResDir,   "SINGULAR_BIN_DIR",     "%d/"S_UNAME            ""},
    6768  {"RootDir",   'r',    feResDir,   "SINGULAR_ROOT_DIR",    "%b/..",                ""},
    68   {"DefaultDir",'d',    feResDir,   "SINGULAR_DEFAULT_DIR",  NULL,                  SINGULAR_DEFAULT_DIR},
     69  {"DefaultDir",'d',    feResDir,   "SINGULAR_DEFAULT_DIR",  SINGULAR_DEFAULT_DIR,  ""},
    6970  {"InfoFile",  'i',    feResFile,  "SINGULAR_INFO_FILE",   "%r/info/singular.hlp", ""},
    7071  {"IdxFile",   'x',    feResFile,  "SINGULAR_IDX_FILE",    "%r/doc/singular.idx",  ""},
     
    157158}
    158159
     160void feReInitResources()
     161{
     162  int i = 0;
     163  while (feResourceConfigs[i].key != NULL)
     164  {
     165    if (feResourceConfigs[i].value != "")
     166    {
     167      if (feResourceConfigs[i].value != NULL)
     168        FreeL(feResourceConfigs[i].value);
     169      feResourceConfigs[i].value = "";
     170    }
     171    i++;
     172  }
     173#ifdef RESOURCE_DEBUG
     174  printf("feReInitResources: entering with feArgv0=%s=\n", feArgv0);
     175  feResource('S');
     176  feResource('b');
     177  feResource('r');
     178  feResource('s');
     179#endif
     180}
    159181
    160182/*****************************************************************
     
    207229    char* evalue = getenv(config->env);
    208230    if (evalue != NULL)
    209     {
     231    { 
    210232#ifdef RESOURCE_DEBUG
    211233      printf("feInitResource: Found value from env:%s\n", evalue);
    212234#endif
    213235      strcpy(value, evalue);
    214       if (feVerifyResourceValue(config->type,
     236      if (config->type == feResBinary  // do not verify binaries
     237          ||
     238          feVerifyResourceValue(config->type,
    215239                                feCleanResourceValue(config->type, value)))
    216240      {
     
    282306                                feCleanResourceValue(config->type, value)))
    283307      {
    284         config->value = value;
     308        config->value = mstrdup(value);
    285309#ifdef RESOURCE_DEBUG
    286310        printf("feInitResource: Set value of %s to =%s=\n", config->key, config->value);
     
    637661{
    638662  int i = 0;
     663  char* r;
    639664  while (feResourceConfigs[i].key != NULL)
    640665  {
     666    r = feResource(feResourceConfigs[i].key, warn);
    641667    StringAppend("%-10s:\t%s\n", feResourceConfigs[i].key,
    642                  feResource(feResourceConfigs[i].key, warn));
     668                 (r != NULL ? r : ""));
    643669    i++;
    644670  }
Note: See TracChangeset for help on using the changeset viewer.