Changeset 698457 in git


Ignore:
Timestamp:
Nov 6, 1999, 4:07:56 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
e5295aa5284b62bfbf5d03c92cdf5f62238ed425
Parents:
9d0697170908a6e9669c18eaf6ea6c461ed24375
Message:
* added proc iiLocateLib:
  sees wheter library lib has already been loaded
   if yes, writes filename of lib into where and returns TRUE,
      no, returns FALSE

* healp ~/my.lib" works


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

Legend:

Unmodified
Added
Removed
  • Singular/fehelp.cc

    r9d06971 r698457  
    575575  char libnamebuf[128];
    576576  FILE *fp=NULL;
    577   if ((str[1]!='\0') && ((fp=feFopen(str,"rb", libnamebuf))!=NULL))
     577  // first, search for library of that name in LIB string
     578  if ((str[1]!='\0') &&
     579      ((iiLocateLib(str, libnamebuf) && (fp=feFopen(libnamebuf, "rb")) !=NULL)
     580       ||
     581       ((fp=feFopen(str,"rb", libnamebuf))!=NULL)))
    578582  {
    579583    extern FILE *yylpin;
  • Singular/iplib.cc

    r9d06971 r698457  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.66 1999-10-14 14:27:09 obachman Exp $ */
     4/* $Id: iplib.cc,v 1.67 1999-11-06 15:07:56 obachman Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    653653
    654654/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
     655/* sees wheter library lib has already been loaded
     656   if yes, writes filename of lib into where and returns TRUE,
     657      no, returns FALSE
     658*/
     659BOOLEAN iiLocateLib(const char* lib, char* where)
     660{
     661  idhdl hl;
     662 
     663  hl = idroot->get("LIB", 0);
     664  if (hl == NULL || strstr(IDSTRING(hl), lib) == NULL) return FALSE;
     665 
     666  if (strstr(IDSTRING(hl), ",") == NULL)
     667  {
     668    strcpy(where, IDSTRING(hl));
     669  }
     670  else
     671  {
     672    char* tmp = mstrdup(IDSTRING(hl));
     673    char* tok = strtok(tmp, ",");
     674    do
     675    {
     676      if (strstr(tok, lib) != NULL) break;
     677      tok = strtok(NULL, ",");
     678    }
     679    while (tok != NULL);
     680    assume(tok != NULL);
     681    strcpy(where, tok);
     682    FreeL(tmp);
     683  }
     684  return TRUE;
     685}
     686   
     687 
    655688#ifdef HAVE_NAMESPACES
    656689BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror )
  • Singular/ipshell.h

    r9d06971 r698457  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipshell.h,v 1.21 1999-10-25 18:21:52 Singular Exp $ */
     6/* $Id: ipshell.h,v 1.22 1999-11-06 15:07:56 obachman Exp $ */
    77/*
    88* ABSTRACT
     
    6363BOOLEAN iiLibCmd( char *newlib, BOOLEAN tellerror=TRUE );
    6464#endif /* HAVE_NAMESPACES */
     65/* sees wheter library lib has already been loaded
     66   if yes, writes filename of lib into where and returns TRUE,
     67   if  no, returns FALSE
     68*/
     69BOOLEAN iiLocateLib(const char* lib, char* where);
    6570leftv   iiMap(map theMap, char * what);
    6671void    iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0,
Note: See TracChangeset for help on using the changeset viewer.