"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Singular/iplib.cc" between
singular-4.2.0p3.tar.gz and singular-4.2.1.tar.gz

About: SINGULAR is a Computer Algebra System for polynomial computations, with special emphasis on commutative and non-commutative algebra, algebraic geometry, and singularity theory.

iplib.cc  (singular-4.2.0p3):iplib.cc  (singular-4.2.1)
skipping to change at line 1183 skipping to change at line 1183
/* /*
typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procna me, typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procna me,
BOOLEAN pstatic, BOOLEAN pstatic,
BOOLEAN(*func)(leftv res, leftv v))); BOOLEAN(*func)(leftv res, leftv v)));
*/ */
SModulFunc_t fktn; SModulFunc_t fktn;
idhdl pl; idhdl pl;
char *plib = iiConvName(newlib); char *plib = iiConvName(newlib);
BOOLEAN RET=TRUE; BOOLEAN RET=TRUE;
int token; int token;
char FullName[256]; int l=si_max((int)strlen(fullname),(int)strlen(newlib))+3;
char *FullName=(char*)omAlloc0(l);
memset(FullName,0,sizeof(FullName));
if( *fullname != '/' && *fullname != '.' ) if( *fullname != '/' && *fullname != '.' )
sprintf(FullName, "./%s", newlib); sprintf(FullName, "./%s", newlib);
else strncpy(FullName, fullname,255); else strncpy(FullName, fullname,l);
if(IsCmd(plib, token)) if(IsCmd(plib, token))
{ {
Werror("'%s' is resered identifier\n", plib); Werror("'%s' is resered identifier\n", plib);
goto load_modules_end; goto load_modules_end;
} }
pl = basePack->idroot->get(plib,0); /* packages only in top level pl = basePack->idroot->get(plib,0); /* packages only in top level
(see enterid) */ (see enterid) */
if ((pl!=NULL) if ((pl!=NULL)
&&(IDTYP(pl)==PACKAGE_CMD)) &&(IDTYP(pl)==PACKAGE_CMD))
skipping to change at line 1224 skipping to change at line 1223
else else
{ {
pl = enterid( plib,0, PACKAGE_CMD, &IDROOT, TRUE ); pl = enterid( plib,0, PACKAGE_CMD, &IDROOT, TRUE );
omFree(plib); /* enterid copied plib*/ omFree(plib); /* enterid copied plib*/
IDPACKAGE(pl)->libname=omStrDup(newlib); IDPACKAGE(pl)->libname=omStrDup(newlib);
} }
IDPACKAGE(pl)->language = LANG_C; IDPACKAGE(pl)->language = LANG_C;
if (dynl_check_opened(FullName)) if (dynl_check_opened(FullName))
{ {
if (BVERBOSE(V_LOAD_LIB)) Warn( "%s already loaded as C library", fullname); if (BVERBOSE(V_LOAD_LIB)) Warn( "%s already loaded as C library", fullname);
omFreeSize(FullName,l);
return FALSE; return FALSE;
} }
if((IDPACKAGE(pl)->handle=dynl_open(FullName))==(void *)NULL) if((IDPACKAGE(pl)->handle=dynl_open(FullName))==(void *)NULL)
{ {
Werror("dynl_open failed:%s", dynl_error()); Werror("dynl_open failed:%s", dynl_error());
Werror("%s not found", newlib); Werror("%s not found", newlib);
killhdl2(pl,&(basePack->idroot),NULL); // remove package killhdl2(pl,&(basePack->idroot),NULL); // remove package
goto load_modules_end; goto load_modules_end;
} }
else else
skipping to change at line 1269 skipping to change at line 1269
else else
{ {
Werror("mod_init not found:: %s\nThis is probably not a dynamic module for Singular!\n", dynl_error()); Werror("mod_init not found:: %s\nThis is probably not a dynamic module for Singular!\n", dynl_error());
errorreported=0; errorreported=0;
if(IDPACKAGE(pl)->idroot==NULL) if(IDPACKAGE(pl)->idroot==NULL)
killhdl2(pl,&(basePack->idroot),NULL); // remove package killhdl2(pl,&(basePack->idroot),NULL); // remove package
} }
} }
load_modules_end: load_modules_end:
omFreeSize(FullName,l);
return RET; return RET;
} }
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport) BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
{ {
GLOBAL_VAR static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; GLOBAL_VAR static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
BOOLEAN r = load_modules_aux(newlib, fullname, autoexport); BOOLEAN r = load_modules_aux(newlib, fullname, autoexport);
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
return r; return r;
 End of changes. 4 change blocks. 
4 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)