Changeset 42c4e6 in git


Ignore:
Timestamp:
Sep 13, 2010, 10:13:12 AM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
9f8f6afb8ac99a39218070eaeb13288ac7400082
Parents:
5e9e9c1562faf9f0fa575cfb990e24bbcd147a43
Message:
iiRunInit

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

Legend:

Unmodified
Added
Removed
  • Singular/iplib.cc

    r5e9e9c r42c4e6  
    7272  char *plib = iiConvName(lib);
    7373  hl = basePack->idroot->get(plib,0);
     74  omFree(plib);
    7475  if((hl==NULL) ||(IDTYP(hl)!=PACKAGE_CMD))
    7576  {
    76     omFree(plib);
    7777    return FALSE;
    7878  }
    79   omFree(plib);
    8079  return (strcmp(lib,IDPACKAGE(hl)->libname)==0);
    8180}
     
    292291BOOLEAN iiPStart(idhdl pn, sleftv  * v)
    293292{
     293  procinfov pi=NULL;
     294  int old_echo=si_echo;
    294295  BOOLEAN err=FALSE;
    295   int old_echo=si_echo;
    296296  char save_flags=0;
    297   procinfov pi=NULL;
    298297
    299298  /* init febase ======================================== */
     
    747746BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force )
    748747{
    749   char buf[256];
    750748  char libnamebuf[128];
     749  procinfov pi;
    751750  idhdl h;
    752   BOOLEAN LoadResult = TRUE;
    753751  idhdl pl;
    754752  idhdl hl;
    755   int lines = 1;
    756753  long pos = 0L;
    757   procinfov pi;
    758754  char *plib = iiConvName(newlib);
    759755  FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
     756  int lines = 1;
     757  BOOLEAN LoadResult = TRUE;
     758
    760759  if (fp==NULL)
    761760  {
     
    789788}
    790789/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
    791 static void iiCleanProcs(idhdl &root)
     790static void iiCleanProcs(idhdl root)
    792791{
    793792  idhdl prev=NULL;
     
    818817  }
    819818}
     819static void iiRunInit(package p)
     820{
     821  idhdl h=p->idroot;
     822  idhdl prev=NULL;
     823  myynest++;
     824  loop
     825  {
     826    if (h==NULL) return;
     827    if (IDTYP(h)==PROC_CMD)
     828    {
     829      procinfo *pi=(procinfo*)IDDATA(h);
     830      if ((strcmp(IDID(h),"mod_init")==0)
     831      && (pi->language == LANG_SINGULAR))
     832      {
     833        //PrintS("mod_init found\n");
     834        iiMake_proc(h,p,NULL);
     835        idhdl hh=IDNEXT(h);
     836        killhdl(h);
     837        if (prev==NULL)
     838          p->idroot=hh;
     839      }
     840    }
     841    prev=h;
     842    h=IDNEXT(h);
     843  }
     844  myynest--;
     845}
    820846/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
    821847BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char*newlib,
    822848             idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
    823849{
    824   char buf[256];
    825850  extern FILE *yylpin;
    826851  libstackv ls_start = library_stack;
     
    866891  fclose( yylpin );
    867892  fp = NULL;
     893  iiRunInit(IDPACKAGE(pl));
    868894
    869895  {
Note: See TracChangeset for help on using the changeset viewer.