Changeset 6123fa2 in git


Ignore:
Timestamp:
Sep 21, 1999, 4:44:59 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'd1ba061a762c62d3a25159d8da8b6e17332291fa')
Children:
e874ad4d87f4276d7b99b274b118e8d6d8e6280c
Parents:
9f8d5d3ce9044926152c6915b3b05def5c0129a8
Message:
* on start-up look also for .singularrc in path
* febase: * allow .files to be loaded
          * allow loading of files only from path (not cwd)


git-svn-id: file:///usr/local/Singular/svn/trunk@3631 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/feOpt.cc

    r9f8d5d r6123fa2  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feOpt.cc,v 1.2 1999-09-21 12:03:06 obachman Exp $ */
     4/* $Id: feOpt.cc,v 1.3 1999-09-21 14:44:57 obachman Exp $ */
    55/*
    66* ABSTRACT: Implementation of option buisness
     
    116116#endif
    117117
     118  {"allow-net",         no_argument,  0,  LONG_OPTION_RETURN,
     119   0,          "Allow to fetch (html) help pages from the net",                feOptBool,    0,      0},
     120
    118121  {"browser",           required_argument,  0,  LONG_OPTION_RETURN,
    119122   "BROWSER",  "Display help in BROWSER ([x,tk]info, netscape)",       feOptString, 0,   0},
     
    128131 
    129132  {"no-rc",             no_argument,  0,  LONG_OPTION_RETURN,
    130    0,          "Do not execute `.singularrc' file on start-up",        feOptBool,    0,      0},
     133   0,          "Do not execute `.singularrc' file(s) on start-up",     feOptBool,    0,      0},
    131134
    132135  {"no-warn",           no_argument,  0,  LONG_OPTION_RETURN,
     
    412415
    413416      case FE_OPT_BROWSER:
    414         feHelpBrowser(feOptSpec[FE_OPT_BROWSER].value, 1);
     417        feHelpBrowser((char*) feOptSpec[FE_OPT_BROWSER].value, 1);
    415418
    416419      case FE_OPT_TICKS_PER_SEC:
  • Singular/febase.cc

    r9f8d5d r6123fa2  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.82 1999-09-20 18:03:46 obachman Exp $ */
     4/* $Id: febase.cc,v 1.83 1999-09-21 14:44:58 obachman Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    9696 *****************************************************************/
    9797
    98 FILE * feFopen(char *path, char *mode, char *where,int useWerror)
     98FILE * feFopen(char *path, char *mode, char *where,int useWerror,
     99               int path_only)
    99100{
    100101  char longpath[MAXPATHLEN];
     
    109110    }
    110111  }
    111   FILE * f=myfopen(path,mode);
     112  FILE * f=NULL;
     113  if (! path_only)
     114    f = myfopen(path,mode);
    112115  if (where!=NULL) strcpy(where,path);
    113   if ((*mode=='r') && (path[0]!=DIR_SEP)&&(path[0]!='.')
    114   &&(f==NULL))
     116  if ((*mode=='r') &&
     117      (path[0]!=DIR_SEP) &&
     118      ! (path[0] == '.' && path[1] == DIR_SEP) &&
     119      (f==NULL))
    115120  {
    116121    char found = 0;
     
    604609#ifndef unix
    605610// Make sure that mode contains binary option
    606 FILE *myfopen(char *path, char *mode)
     611FILE* myfopen(char *path, char *mode)
    607612{
    608613  char mmode[4];
  • Singular/febase.h

    r9f8d5d r6123fa2  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.37 1999-09-20 18:03:47 obachman Exp $ */
     6/* $Id: febase.h,v 1.38 1999-09-21 14:44:58 obachman Exp $ */
    77/*
    88* ABSTRACT: basic i/o
     
    170170 *
    171171 *****************************************************************/
    172 FILE *  feFopen(char *path, char *mode, char *where=NULL, int useWerror=FALSE);
     172FILE *  feFopen(char *path, char *mode, char *where=NULL, int useWerror=FALSE,
     173                int path_only=FALSE);
     174
    173175#ifndef __MWERKS__
    174176#ifdef HAVE_TCL
  • Singular/fehelp.cc

    r9f8d5d r6123fa2  
    741741  {
    742742    if (warn) WarnS("no local HtmlDir found");
    743     return FALSE;
    744 //    if (warn) Warn("using %s instead", feResource('u' /*"ManualUrl"*/, warn));
     743    if (feOptValue(FE_OPT_ALLOW_NET))
     744    {
     745      if (warn) Warn("using URL %s instead", feResource('u' /*"ManualUrl"*/, warn));
     746    }
     747    else
     748      return FALSE;
    745749  }
    746750  return TRUE;
    747751}
     752
    748753static void heNetscapeHelp(heEntry hentry)
    749754{
  • Singular/tesths.cc

    r9f8d5d r6123fa2  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: tesths.cc,v 1.72 1999-09-21 12:03:07 obachman Exp $ */
     4/* $Id: tesths.cc,v 1.73 1999-09-21 14:44:59 obachman Exp $ */
    55
    66/*
     
    176176    newBuffer(mstrdup((char*) feOptValue(FE_OPT_EXECUTE)), BT_execute);
    177177
    178   // first thing, however, is to load .singularrc
     178  // first thing, however, is to load .singularrc from Singularpath
     179  // and cwd/$HOME (in that order).
    179180  if (! feOptValue(FE_OPT_NO_RC))
    180181  {
     182    char buf[MAXPATHLEN];
    181183    FILE * rc=myfopen(".singularrc","r");
    182184    if (rc!=NULL)
     
    187189    else
    188190    {
    189       char buf[MAXPATHLEN];
    190191      char *home = getenv("HOME");
    191192      if (home != NULL)
     
    201202      }
    202203    }
     204    //
     205    FILE *fd = feFopen(".singularrc", "r", buf, FALSE, TRUE);
     206    if (fd != NULL)
     207    {
     208      fclose(fd);
     209      newFile(buf);
     210    }
    203211  }
    204212
Note: See TracChangeset for help on using the changeset viewer.