41#ifdef HAVE_DYNAMIC_LOADING
57VAR package currPack = NULL;
58VAR package basePack = NULL;
65static inline long iiS2I(
const char *
s)
68 strncpy((
char*)&
l,
s,SIZEOF_LONG);
81 char *dummy=(
char*)&
i;
82 BOOLEAN less4=(dummy[SIZEOF_LONG-1]==
'\0');
92 if (less4 || (0 == strcmp(
s+SIZEOF_LONG,id_+SIZEOF_LONG)))
112 int less4=(
i < (1L<<((SIZEOF_LONG-1)*8)));
120 if (less4 || (0 == strcmp(
s+SIZEOF_LONG,id_+SIZEOF_LONG)))
147 return (
void*)n2Init(0,
NULL);
149 return (
void*)p2Init(0,
NULL);
159 WerrorS(
"need basering for polyBucket");
164 return (
void *)
new intvec();
176 return (
void*)
idInit(1,1);
196 package pa=(package)omAlloc0Bin(sip_package_bin);
224 Print(
"bb-type %d\n",t);
228 return (
void *)bb->blackbox_Init(bb);
231 Werror(
"unknown type in idrecDataInit:%d",t);
294 if ((
h=(*root)->get_level(
s,lev))!=
NULL)
300 if (strcmp(
s,
"Top")==0)
311 if (strcmp(
f,
"STDIN")==0)
336 if (strcmp(
f,
"STDIN")==0)
359 if (strcmp(
f,
"STDIN")==0)
374 *root = (*root)->
set(
s, lev, t, init);
382 Werror(
"identifier `%s` in use",
s);
405 Werror(
"`%s` is not defined",
id);
458 if (
h->attribute!=
NULL)
463 h->attribute->killAll(r);
470 || (strcmp(
IDID(
h),
"Top")==0))
523 PrintS(
">>?<< not found for kill\n");
548 if (h2==
NULL)
return h;
567 if (h2!=
NULL)
return h2;
589 if (h2!=
NULL)
return h2;
610 if (h2!=
NULL)
return h2;
726 else if (strcmp(request,
"libname") == 0)
return pi->libname;
727 else if (strcmp(request,
"procname") == 0)
return pi->procname;
728 else if (strcmp(request,
"type") == 0)
730 switch (
pi->language)
733 case LANG_C:
return "object";
break;
735 default:
return "unknown language";
738 else if (strcmp(request,
"ref") == 0)
741 sprintf(
p,
"%d",
pi->ref);
757 if (
p->pi==
pi &&
pi->ref <= 1)
759 Warn(
"`%s` in use, can not be killed",
pi->procname);
772 if (
pi->data.s.body !=
NULL)
790 if( pack->language ==
LANG_C)
792 Print(
"//dlclose(%s)\n",pack->libname);
793#ifdef HAVE_DYNAMIC_LOADING
862 if ((
h->Typ()!=
p->Typ()) &&(
p->Typ()!=
DEF_CMD))
911 Werror(
"unknown type %d",
p->Typ());
916 int eff_typ=
h->Typ();
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
idhdl get(const char *s, int lev)
idhdl get_level(const char *s, int lev)
idhdl set(const char *s, int lev, int t, BOOLEAN init=TRUE)
char * String(BOOLEAN typed=FALSE)
Class used for (list of) interpreter objects.
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
INLINE_THIS void Init(int l=0)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
void nKillChar(coeffs r)
undo all initialisations
static BOOLEAN pa(leftv res, leftv args)
const CanonicalForm int s
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
void WerrorS(const char *s)
VAR char my_yylinebuf[80]
const char * Tok2Cmdname(int tok)
static int RingDependend(int t)
#define idDelete(H)
delete an ideal
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
VAR omBin sip_command_bin
lists ipNameListLev(idhdl root, int lev)
VAR omBin sip_package_bin
void paCleanUp(package pack)
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
void killid(const char *id, idhdl *ih)
idhdl ggetid(const char *n)
void killhdl2(idhdl h, idhdl *ih, ring r)
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
VAR proclevel * procstack
static long iiS2I(const char *s)
void killhdl(idhdl h, package proot)
void * idrecDataInit(int t)
idhdl packFindHdl(package r)
lists ipNameList(idhdl root)
void ipMoveId(idhdl tomove)
BOOLEAN piKill(procinfov pi)
const char * piProcinfo(procinfov pi, const char *request)
EXTERN_VAR omBin sleftv_bin
void paKill(package pack)
void iiCheckPack(package &p)
BOOLEAN lRingDependend(lists L)
int dynl_close(void *handle)
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omFreeSize(addr, size)
#define omCheckAddr(addr)
#define omFreeBin(addr, bin)
#define omFreeBinAddr(addr)
#define omGetSpecBin(size)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
void PrintS(const char *s)
void Werror(const char *fmt,...)
sBucket_pt sBucketCreate(const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void s_internalDelete(const int t, void *d, const ring r)