MCPcopy Create free account
hub / github.com/Singular/Singular / iiLoadLIB

Function iiLoadLIB

Singular/iplib.cc:982–1054  ·  view source on GitHub ↗

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

Source from the content-addressed store, hash-verified

980}
981/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
982BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char*newlib,
983 idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
984{
985 EXTERN_VAR FILE *yylpin;
986 libstackv ls_start = library_stack;
987 lib_style_types lib_style;
988
989 yylpin = fp;
990 #if YYLPDEBUG > 1
991 print_init();
992 #endif
993 EXTERN_VAR int lpverbose;
994 if (BVERBOSE(V_DEBUG_LIB)) lpverbose=1;
995 else lpverbose=0;
996 // yylplex sets also text_buffer
997 if (text_buffer!=NULL) *text_buffer='\0';
998 yylplex(newlib, libnamebuf, &lib_style, pl, autoexport);
999 if(yylp_errno)
1000 {
1001 Werror("Library %s: ERROR occurred: in line %d, %d.", newlib, yylplineno,
1002 current_pos(0));
1003 if(yylp_errno==YYLP_BAD_CHAR)
1004 {
1005 Werror(yylp_errlist[yylp_errno], *text_buffer, yylplineno);
1006 omFree((ADDRESS)text_buffer);
1007 text_buffer=NULL;
1008 }
1009 else
1010 Werror(yylp_errlist[yylp_errno], yylplineno);
1011 WerrorS("Cannot load library,... aborting.");
1012 reinit_yylp();
1013 fclose( yylpin );
1014 iiCleanProcs(IDROOT);
1015 return TRUE;
1016 }
1017 if (BVERBOSE(V_LOAD_LIB))
1018 Print( "// ** loaded %s %s\n", libnamebuf, text_buffer);
1019 if( (lib_style == OLD_LIBSTYLE) && (BVERBOSE(V_LOAD_LIB)))
1020 {
1021 Warn( "library %s has old format. This format is still accepted,", newlib);
1022 WarnS( "but for functionality you may wish to change to the new");
1023 WarnS( "format. Please refer to the manual for further information.");
1024 }
1025 reinit_yylp();
1026 fclose( yylpin );
1027 fp = NULL;
1028 iiRunInit(IDPACKAGE(pl));
1029
1030 {
1031 libstackv ls;
1032 for(ls = library_stack; (ls != NULL) && (ls != ls_start); )
1033 {
1034 if(ls->to_be_done)
1035 {
1036 ls->to_be_done=FALSE;
1037 iiLibCmd(ls->get(),autoexport,tellerror,FALSE);
1038 ls = ls->pop(newlib);
1039 }

Callers 2

jjLOADFunction · 0.85
iiLibCmdFunction · 0.85

Calls 14

print_initFunction · 0.85
WerrorFunction · 0.85
current_posFunction · 0.85
WerrorSFunction · 0.85
reinit_yylpFunction · 0.85
iiCleanProcsFunction · 0.85
WarnFunction · 0.85
WarnSFunction · 0.85
iiRunInitFunction · 0.85
iiLibCmdFunction · 0.85
PrintSFunction · 0.85
PrintFunction · 0.50

Tested by

no test coverage detected