Changeset 698457 in git for Singular/iplib.cc


Ignore:
Timestamp:
Nov 6, 1999, 4:07:56 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 )
Note: See TracChangeset for help on using the changeset viewer.