 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
Go to the source code of this file.
|
BOOLEAN | load_modules (const char *newlib, char *fullname, BOOLEAN autoexport) |
|
int | iiArithAddCmd (const char *szName, short nAlias, short nTokval, short nToktype, short nPos) |
|
void | yylprestart (FILE *input_file) |
|
int | current_pos (int i=0) |
|
void | print_init () |
|
char | mytolower (char c) |
|
BOOLEAN | iiGetLibStatus (char *lib) |
|
char * | iiProcName (char *buf, char &ct, char *&e) |
|
char * | iiProcArgs (char *e, BOOLEAN withParenth) |
|
char * | iiGetLibProcBuffer (procinfo *pi, int part) |
|
BOOLEAN | iiAllStart (procinfov pi, char *p, feBufferTypes t, int l) |
|
BOOLEAN | iiPStart (idhdl pn, leftv v) |
|
static void | iiShowLevRings () |
|
static void | iiCheckNest () |
|
BOOLEAN | iiMake_proc (idhdl pn, package pack, leftv sl) |
|
static void | iiCallLibProcBegin () |
|
static void | iiCallLibProcEnd (idhdl save_ringhdl, ring save_ring) |
|
void * | iiCallLibProc1 (const char *n, void *arg, int arg_type, BOOLEAN &err) |
|
void * | iiCallLibProcM (const char *n, void **args, int *arg_types, BOOLEAN &err) |
| args: NULL terminated arry of arguments arg_types: 0 terminated array of corresponding types More...
|
|
BOOLEAN | iiEStart (char *example, procinfo *pi) |
|
| SI_FOREACH_BUILTIN (SI_GET_BUILTIN_MOD_INIT0) } |
|
SModulFunc_t | iiGetBuiltinModInit (const char *libname) |
|
BOOLEAN | iiTryLoadLib (leftv v, const char *id) |
|
BOOLEAN | iiLocateLib (const char *lib, char *where) |
|
BOOLEAN | iiLibCmd (char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force) |
|
static void | iiCleanProcs (idhdl &root) |
|
static void | iiRunInit (package p) |
|
BOOLEAN | iiLoadLIB (FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror) |
|
procinfo * | iiInitSingularProcinfo (procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic) |
|
int | iiAddCproc (const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v)) |
|
int | iiAddCprocTop (const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v)) |
|
BOOLEAN | load_builtin (const char *newlib, BOOLEAN autoexport, SModulFunc_t init) |
|
void | module_help_main (const char *newlib, const char *help) |
|
void | module_help_proc (const char *newlib, const char *p, const char *help) |
|
void * | binary_module_function (const char *newlib, const char *funcname) |
|
char | mytoupper (char c) |
|
char * | iiConvName (const char *libname) |
|
◆ MODULE_SUFFIX
◆ MODULE_SUFFIX_STRING
◆ SI_GET_BUILTIN_MOD_INIT
◆ SI_GET_BUILTIN_MOD_INIT0
◆ SI_MAX_NEST
◆ binary_module_function()
void* binary_module_function |
( |
const char * |
newlib, |
|
|
const char * |
funcname |
|
) |
| |
◆ current_pos()
int current_pos |
( |
int |
i = 0 | ) |
|
◆ iiAddCproc()
Definition at line 1004 of file iplib.cc.
1013 if (
IsCmd(procname,dummy))
1015 Werror(
">>%s< is a reserved name",procname);
1027 Warn(
"extend `%s`",procname);
1045 pi->is_static = pstatic;
1046 pi->data.o.function = func;
1050 if(
pi->data.o.function == func)
1062 pi->is_static = pstatic;
1063 pi->data.o.function = func;
1067 Warn(
"internal error: unknown procedure type %d",
pi->language);
1073 WarnS(
"iiAddCproc: failed.");
◆ iiAddCprocTop()
◆ iiAllStart()
Definition at line 292 of file iplib.cc.
310 (
pi->libname!=
NULL) && (
pi->libname[0]!=
'\0'))
312 if ((
pi->libname!=
NULL) && (
pi->libname[0]!=
'\0'))
313 Warn(
"option changed in proc %s from %s",
pi->procname,
pi->libname);
315 Warn(
"option changed in proc %s",
pi->procname);
◆ iiArithAddCmd()
int iiArithAddCmd |
( |
const char * |
szName, |
|
|
short |
nAlias, |
|
|
short |
nTokval, |
|
|
short |
nToktype, |
|
|
short |
nPos |
|
) |
| |
Definition at line 9024 of file iparith.cc.
9048 if(szName==
NULL)
return -1;
9052 Print(
"'%s' already exists at %d\n", szName, nIndex);
◆ iiCallLibProc1()
void* iiCallLibProc1 |
( |
const char * |
n, |
|
|
void * |
arg, |
|
|
int |
arg_type, |
|
|
BOOLEAN & |
err |
|
) |
| |
◆ iiCallLibProcBegin()
static void iiCallLibProcBegin |
( |
| ) |
|
|
static |
◆ iiCallLibProcEnd()
static void iiCallLibProcEnd |
( |
idhdl |
save_ringhdl, |
|
|
ring |
save_ring |
|
) |
| |
|
static |
Definition at line 587 of file iplib.cc.
606 WarnS(
"internal: lost ring in iiCallLib");
◆ iiCallLibProcM()
void* iiCallLibProcM |
( |
const char * |
n, |
|
|
void ** |
args, |
|
|
int * |
arg_types, |
|
|
BOOLEAN & |
err |
|
) |
| |
args: NULL terminated arry of arguments arg_types: 0 terminated array of corresponding types
Definition at line 646 of file iplib.cc.
668 tmp.
rtyp=arg_types[0];
669 while(arg_types[
i]!=0)
673 tt->
rtyp=arg_types[
i];
◆ iiCheckNest()
static void iiCheckNest |
( |
| ) |
|
|
static |
◆ iiCleanProcs()
static void iiCleanProcs |
( |
idhdl & |
root | ) |
|
|
static |
Definition at line 869 of file iplib.cc.
875 if (root==
NULL)
return;
880 && (
pi->data.s.body_start == 0L))
◆ iiConvName()
char* iiConvName |
( |
const char * |
libname | ) |
|
Definition at line 1330 of file iplib.cc.
1334 char *
p = strrchr(tmpname,
DIR_SEP);
1336 if(
p==
NULL)
p = tmpname;
else p++;
1339 while(isalnum(*r)||(*r==
'_')) r++;
◆ iiEStart()
Definition at line 698 of file iplib.cc.
710 printf(
"entering example (level %d)\n",
myynest);
722 printf(
"leaving -example- (level %d)\n",
myynest);
◆ iiGetBuiltinModInit()
Definition at line 750 of file iplib.cc.
753 # define SI_GET_BUILTIN_MOD_INIT(name) if (strcmp(libname, #name ".so") == 0){ return SI_MOD_INIT0(name); }
755 # undef SI_GET_BUILTIN_MOD_INIT
◆ iiGetLibProcBuffer()
char* iiGetLibProcBuffer |
( |
procinfo * |
pi, |
|
|
int |
part |
|
) |
| |
Definition at line 191 of file iplib.cc.
207 long head =
pi->data.s.def_end -
pi->data.s.proc_start;
208 procbuflen =
pi->data.s.help_end -
pi->data.s.help_start;
222 s[procbuflen+
head+1] =
'\n';
223 s[procbuflen+
head+2] =
'\0';
225 for(
i=0;
i<=procbuflen+
head+2;
i++)
228 (
s[
i+1]==
'"' ||
s[
i+1]==
'{' ||
s[
i+1]==
'}' ||
s[
i+1]==
'\\'))
239 procbuflen =
pi->data.s.def_end -
pi->data.s.proc_start;
240 char *ss=(
char *)
omAlloc(procbuflen+2);
250 assume(
pi->data.s.body_end >
pi->data.s.body_start);
252 procbuflen =
pi->data.s.body_end -
pi->data.s.body_start;
253 pi->data.s.body = (
char *)
omAlloc( strlen(argstr)+procbuflen+15+
254 strlen(
pi->libname) );
259 strcpy(
pi->data.s.body,argstr);
260 myfread(
pi->data.s.body+strlen(argstr), procbuflen, 1,
fp);
262 procbuflen+=strlen(argstr);
265 pi->data.s.body[procbuflen] =
'\0';
266 strcat(
pi->data.s.body+procbuflen,
"\n;return();\n\n" );
267 strcat(
pi->data.s.body+procbuflen+13,
pi->libname);
268 s=(
char *)strchr(
pi->data.s.body,
'{');
274 if (
pi->data.s.example_lineno == 0)
279 procbuflen =
pi->data.s.proc_end -
pi->data.s.example_start - strlen(
buf);
284 s[procbuflen] =
'\0';
285 strcat(
s+procbuflen-3,
"\n;return();\n\n" );
286 p=(
char *)strchr(
s,
'{');
◆ iiGetLibStatus()
BOOLEAN iiGetLibStatus |
( |
char * |
lib | ) |
|
◆ iiInitSingularProcinfo()
Definition at line 990 of file iplib.cc.
994 memset(
pi,0,
sizeof(*
pi));
999 pi->is_static = pstatic;
1000 pi->data.s.proc_start = pos;
◆ iiLibCmd()
Definition at line 825 of file iplib.cc.
855 WarnS(
"not of type package.");
859 if (!force)
return FALSE;
◆ iiLoadLIB()
Definition at line 914 of file iplib.cc.
944 WerrorS(
"Cannot load library,... aborting.");
954 Warn(
"library %s has old format. This format is still accepted,", newlib);
955 WarnS(
"but for functionality you may wish to change to the new");
956 WarnS(
"format. Please refer to the manual for further information.");
971 ls = ls->
pop(newlib);
975 PrintS(
"--------------------\n");
978 Print(
"%s: LIB-stack:(%d), %s %s\n", newlib, ls->
cnt, ls->
get(),
981 PrintS(
"--------------------\n");
◆ iiLocateLib()
◆ iiMake_proc()
Definition at line 484 of file iplib.cc.
491 Werror(
"'%s::%s()' is a local procedure and cannot be accessed by an user.",
492 pi->libname,
pi->procname);
509 switch (
pi->language)
536 err = (
pi->data.o.function)(
res, sl);
560 if (!err)
Warn(
"too many arguments for %s",
IDID(pn));
◆ iiProcArgs()
char* iiProcArgs |
( |
char * |
e, |
|
|
BOOLEAN |
withParenth |
|
) |
| |
Definition at line 108 of file iplib.cc.
111 while ((*e==
' ') || (*e==
'\t') || (*e==
'(')) e++;
117 return omStrDup(
"parameter list #;");
128 char *argstr=(
char *)
omAlloc(127);
140 if ((*
s==
' ')||(*
s==
'\t'))
142 else if ((*
s==
'\n')&&(*(
s+1)==
' '))
149 &&((par!=0) || (*e!=
')'))
153 else if (*e==
')') par--;
154 args_found=args_found || (*e>
' ');
162 if ((
int)strlen(argstr)+12 +(int)strlen(
s)>= argstrlen)
165 char *a=(
char *)
omAlloc( argstrlen);
171 if(strncmp(
s,
"alias ",6)!=0)
173 strcat(argstr,
"parameter ");
◆ iiProcName()
char* iiProcName |
( |
char * |
buf, |
|
|
char & |
ct, |
|
|
char *& |
e |
|
) |
| |
Definition at line 94 of file iplib.cc.
100 while ((*e>
' ') && (*e!=
'(')) e++;
◆ iiPStart()
Definition at line 352 of file iplib.cc.
367 save_flags=
pi->trace_flag;
368 if(
pi->data.s.body==
NULL )
414 if (oh!=
NULL) o=oh->id;
420 Werror(
"ring change during procedure call %s: %s -> %s (level %d)",
pi->procname,o,n,
myynest);
447 pi->trace_flag=save_flags;
◆ iiRunInit()
◆ iiShowLevRings()
static void iiShowLevRings |
( |
| ) |
|
|
static |
◆ iiTryLoadLib()
Definition at line 763 of file iplib.cc.
768 char *libname = (
char *)
omAlloc(strlen(
id)+5);
769 const char *suffix[] = {
"",
".lib",
".so",
".sl",
NULL };
775 for(
i=0; suffix[
i] !=
NULL;
i++)
777 sprintf(libname,
"%s%s",
id, suffix[
i]);
782 #ifdef HAVE_DYNAMIC_LOADING
788 #ifdef HAVE_DYNAMIC_LOADING
◆ load_builtin()
Definition at line 1196 of file iplib.cc.
1212 pl =
basePack->idroot->get(plib,0);
1240 (*init)(&sModulFunctions);
◆ load_modules()
Definition at line 1090 of file iplib.cc.
1094 WerrorS(
"mod_init: static version can not load modules");
1109 memset(FullName,0,256);
1111 if( *fullname !=
'/' && *fullname !=
'.' )
1112 sprintf(FullName,
"./%s", newlib);
1113 else strncpy(FullName, fullname,255);
1116 if(
IsCmd(plib, token))
1118 Werror(
"'%s' is resered identifier\n", plib);
1119 goto load_modules_end;
1121 pl =
basePack->idroot->get(plib,0);
1153 Werror(
"%s not found", newlib);
1155 goto load_modules_end;
1169 int ver=(*fktn)(&sModulFunctions);
1176 Warn(
"loaded %s for a different version of Singular(expected MAX_TOK: %d, got %d)",fullname,
MAX_TOK,ver);
1184 Werror(
"mod_init not found:: %s\nThis is probably not a dynamic module for Singular!\n",
dynl_error());
◆ module_help_main()
void module_help_main |
( |
const char * |
newlib, |
|
|
const char * |
help |
|
) |
| |
Definition at line 1248 of file iplib.cc.
1254 Werror(
">>%s<< is not a package (trying to add package help)",plib);
◆ module_help_proc()
void module_help_proc |
( |
const char * |
newlib, |
|
|
const char * |
p, |
|
|
const char * |
help |
|
) |
| |
Definition at line 1263 of file iplib.cc.
1269 Werror(
">>%s<< is not a package(trying to add help for %s)",plib,
p);
1276 strncpy(buff,
p,255);
1277 strncat(buff,
"_help",255-strlen(
p));
◆ mytolower()
Definition at line 1317 of file iplib.cc.
1320 if(c>=65 && c<=(65+26)) c+=32;
◆ mytoupper()
Definition at line 1311 of file iplib.cc.
1314 if(c>=97 && c<=(97+26)) c-=32;
◆ print_init()
◆ SI_FOREACH_BUILTIN()
◆ yylprestart()
void yylprestart |
( |
FILE * |
input_file | ) |
|
◆ iiLocalRing
◆ iiRETURNEXPR
◆ iiRETURNEXPR_len
◆ library_stack
◆ yylp_errlist
◆ yylp_errno
◆ yylplineno
int iiArithFindCmd(const char *szName)
void iiCheckPack(package &p)
char * iiProcName(char *buf, char &ct, char *&e)
int(* iiArithAddCmd)(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
static void iiCallLibProcBegin()
#define MODULE_SUFFIX_STRING
SI_FOREACH_BUILTIN(SI_GET_BUILTIN_MOD_INIT0) }
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv sl)
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
BOOLEAN iiAllStart(procinfov pi, char *p, feBufferTypes t, int l)
const struct soptionStruct verboseStruct[]
Class used for (list of) interpreter objects.
const char * dynl_error()
SModulFunc_t iiGetBuiltinModInit(const char *libname)
static void iiCleanProcs(idhdl &root)
#define omRealloc(addr, size)
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
idhdl packFindHdl(package r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
int status int void * buf
void PrintS(const char *s)
void killhdl2(idhdl h, idhdl *ih, ring r)
char * iiProcArgs(char *e, BOOLEAN withParenth)
#define TRACE_SHOW_LINENO
char * iiGetLibProcBuffer(procinfo *pi, int part)
char * iiConvName(const char *libname)
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
int(* SModulFunc_t)(SModulFunctions *)
unsigned nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
void killhdl(idhdl h, package proot)
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
void CleanUp(ring r=currRing)
libstackv pop(const char *p)
#define SI_GET_BUILTIN_MOD_INIT(name)
cmdnames * sCmds
array of existing commands
static void iiCallLibProcEnd(idhdl save_ringhdl, ring save_ring)
void * dynl_open(char *filename)
idhdl rFindHdl(ring r, idhdl n)
static void iiShowLevRings()
int IsCmd(const char *n, int &tok)
static void iiRunInit(package p)
void Werror(const char *fmt,...)
#define omreallocSize(addr, o_size, size)
static SArithBase sArithBase
Base entry for arithmetic.
char name(const Variable &v)
void * dynl_sym(void *handle, const char *symbol)
void WerrorS(const char *s)
unsigned nCmdAllocated
number of commands-slots allocated
char * feGetResource(const char id, int warn)
BOOLEAN iiPStart(idhdl pn, leftv v)
const Variable & v
< [in] a sqrfree bivariate poly
unsigned nCmdUsed
number of commands used
idhdl ggetid(const char *n)
const CanonicalForm int s
const struct soptionStruct optionStruct[]
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
int dynl_check_opened(char *filename)
static void iiCheckNest()
BOOLEAN iiLibCmd(char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
#define omFreeBin(addr, bin)
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)