Changeset 098f457 in git for Singular


Ignore:
Timestamp:
May 12, 2020, 11:10:14 AM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
1a1d56caf454024233cd6058c9e85a02bb4d3430
Parents:
d7085a5fab165816d2c6c0df031e0e838d694526
Message:
opt: iiLibCmd
Location:
Singular
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/iplib.cc

    rd7085a r098f457  
    663663  if (h==NULL)
    664664  {
    665     BOOLEAN bo=iiLibCmd(omStrDup(lib),TRUE,TRUE,FALSE);
     665    BOOLEAN bo=iiLibCmd(lib,TRUE,TRUE,FALSE);
    666666    if (bo) return NULL;
    667667  }
     
    682682  if (h==NULL)
    683683  {
    684     BOOLEAN bo=iiLibCmd(omStrDup(lib),TRUE,TRUE,FALSE);
     684    BOOLEAN bo=iiLibCmd(lib,TRUE,TRUE,FALSE);
    685685    if (bo) return 0;
    686686  }
     
    837837
    838838      if (LT==LT_SINGULAR)
    839         LoadResult = iiLibCmd(s, FALSE, FALSE,TRUE);
     839      {
     840        omFree(s);
     841        LoadResult = iiLibCmd(libname, FALSE, FALSE,TRUE);
     842      }
    840843      #ifdef HAVE_DYNAMIC_LOADING
    841844      else if ((LT==LT_ELF) || (LT==LT_HPUX))
     
    876879}
    877880
    878 BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force )
     881BOOLEAN iiLibCmd( const char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force )
    879882{
    880883  char libnamebuf[1024];
    881   // procinfov pi;
    882   // idhdl h;
    883884  idhdl pl;
    884   // idhdl hl;
    885   // long pos = 0L;
    886   char *plib = iiConvName(newlib);
     885  // handle "special" lib Singular:
     886  if (strcmp(newlib,"Singular")==0) return FALSE;
    887887  FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
    888888  // int lines = 1;
     
    893893    return TRUE;
    894894  }
     895  char *plib = iiConvName(newlib);
    895896  pl = basePack->idroot->get(plib,0);
    896897  if (pl==NULL)
     
    917918  }
    918919  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, pl, autoexport, tellerror);
    919   omFree((ADDRESS)newlib);
    920920
    921921  if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
  • Singular/ipshell.h

    rd7085a r098f457  
    6868char *  iiProcName(char *buf, char & ct, char* &e);
    6969char *  iiProcArgs(char *e,BOOLEAN withParenth);
    70 BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force );
    71 /* sees wheter library lib has already been loaded
    72    if yes, writes filename of lib into where and returns TRUE,
    73    if  no, returns FALSE
    74 */
     70BOOLEAN iiLibCmd(const char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force );
    7571/// load lib/module given in v
    7672BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport = FALSE);
  • Singular/misc_ip.cc

    rd7085a r098f457  
    14601460    SI_SAVE_OPT(save1,save2);
    14611461    si_opt_2 &= ~Sy_bit(V_LOAD_LIB);
    1462     iiLibCmd(omStrDup("standard.lib"), TRUE,TRUE,TRUE);
     1462    iiLibCmd("standard.lib", TRUE,TRUE,TRUE);
    14631463    SI_RESTORE_OPT(save1,save2);
    14641464  }
  • Singular/subexpr.cc

    rd7085a r098f457  
    485485        {
    486486          r->ref++;
    487           //Print("s_internalCopy:+  ring %d, ref %d\n",r,r->ref);
     487          Print("s_internalCopy:+  ring %lx, ref %d\n",r,r->ref);
    488488        }
    489489        return d;
Note: See TracChangeset for help on using the changeset viewer.