Go to the source code of this file.
|
int | newstruct_desc_size () |
|
char * | newstruct_String (blackbox *b, void *d) |
|
lists | lCopy_newstruct (lists L) |
|
void * | newstruct_Copy (blackbox *, void *d) |
|
BOOLEAN | newstruct_Assign_user (int op, leftv l, leftv r) |
|
void | lClean_newstruct (lists l) |
|
static BOOLEAN | newstruct_Assign_same (leftv l, leftv r) |
|
BOOLEAN | newstruct_Op1 (int op, leftv res, leftv arg) |
|
BOOLEAN | newstruct_Assign (leftv l, leftv r) |
|
BOOLEAN | newstruct_Op2 (int op, leftv res, leftv a1, leftv a2) |
|
BOOLEAN | newstruct_OpM (int op, leftv res, leftv args) |
|
void | newstruct_destroy (blackbox *, void *d) |
|
void * | newstruct_Init (blackbox *b) |
|
BOOLEAN | newstruct_CheckAssign (blackbox *, leftv L, leftv R) |
|
BOOLEAN | newstruct_serialize (blackbox *b, void *d, si_link f) |
|
BOOLEAN | newstruct_deserialize (blackbox **b, void **d, si_link f) |
|
void | newstruct_Print (blackbox *b, void *d) |
|
void | newstruct_setup (const char *n, newstruct_desc d) |
|
static newstruct_desc | scanNewstructFromString (const char *s, newstruct_desc res) |
|
newstruct_desc | newstructFromString (const char *s) |
|
newstruct_desc | newstructChildFromString (const char *parent, const char *s) |
|
void | newstructShow (newstruct_desc d) |
|
BOOLEAN | newstruct_set_proc (const char *bbname, const char *func, int args, procinfov pr) |
|
struct newstruct_member_s |
Definition at line 14 of file newstruct.cc.
Data Fields |
char * |
name |
|
newstruct_member |
next |
|
int |
pos |
|
int |
typ |
|
Definition at line 32 of file newstruct.cc.
Data Fields |
int |
id |
|
newstruct_member |
member |
|
newstruct_desc |
parent |
|
newstruct_proc |
procs |
|
int |
size |
|
void lClean_newstruct |
( |
lists |
l | ) |
|
Definition at line 204 of file newstruct.cc.
210 for(i=l->
nr;i>=0;i--)
213 r=(ring)(l->
m[i-1].
data);
Class used for (list of) interpreter objects.
#define omFreeSize(addr, size)
void CleanUp(ring r=currRing)
#define omFreeBin(addr, bin)
Definition at line 120 of file newstruct.cc.
153 N->
m[
n].
data=(
void *)b->blackbox_Copy(b,L->
m[n].
data);
void * idrecDataInit(int t)
const CanonicalForm CFMap CFMap int &both_non_zero int n
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
const CanonicalForm CFMap CFMap & N
void rChangeCurrRing(ring r)
INLINE_THIS void Init(int l=0)
BOOLEAN lRingDependend(lists L)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition at line 278 of file newstruct.cc.
290 newstruct_desc rrn=(newstruct_desc)rr->data;
294 Werror(
"custom type %s(%d) cannot be assigned to newstruct %s(%d)",
300 newstruct_desc rrp=rrn->parent;
301 while ((rrp!=
NULL)&&(rrp->id!=l->
Typ())) rrp=rrp->parent;
330 Werror(
"assign %s(%d) = %s(%d)",
Class used for (list of) interpreter objects.
BOOLEAN newstruct_Op1(int op, leftv res, leftv arg)
BOOLEAN newstruct_Assign_user(int op, leftv l, leftv r)
int int kStrategy strat if(h==NULL) return NULL
static BOOLEAN newstruct_Assign_same(leftv l, leftv r)
BOOLEAN newstruct_Assign(leftv l, leftv r)
const char * Tok2Cmdname(int tok)
void Werror(const char *fmt,...)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition at line 224 of file newstruct.cc.
lists lCopy_newstruct(lists L)
void lClean_newstruct(lists l)
void CleanUp(ring r=currRing)
Definition at line 168 of file newstruct.cc.
172 newstruct_desc nt=(newstruct_desc)ll->data;
173 newstruct_proc
p=nt->procs;
175 while( (
p!=
NULL) && ((
p->t!=
'=')||(
p->args!=1)) )
p=
p->next;
181 memset(&hh,0,
sizeof(hh));
186 memset(&tmp,0,
sizeof(
sleftv));
Class used for (list of) interpreter objects.
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
const char * Tok2Cmdname(int tok)
void CleanUp(ring r=currRing)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition at line 554 of file newstruct.cc.
565 Werror(
"can not assign %s(%d) to member of type %s(%d)",
570 Werror(
"can not assign %s to member of type %s",rt1,lt1);
const char * Tok2Cmdname(int tok)
void Werror(const char *fmt,...)
void* newstruct_Copy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 161 of file newstruct.cc.
lists lCopy_newstruct(lists L)
int newstruct_desc_size |
( |
| ) |
|
Definition at line 640 of file newstruct.cc.
647 int Ll=(int)(
long)(l->
data);
651 for(
int i=0;
i<=Ll;
i++)
654 memcpy(&(L->
m[
i]),l,
sizeof(
sleftv));
Class used for (list of) interpreter objects.
INLINE_THIS void Init(int l=0)
void newstruct_destroy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 528 of file newstruct.cc.
const CanonicalForm CFMap CFMap int &both_non_zero int n
void lClean_newstruct(lists l)
void* newstruct_Init |
( |
blackbox * |
b | ) |
|
Definition at line 537 of file newstruct.cc.
539 newstruct_desc
n=(newstruct_desc)
b->data;
542 newstruct_member nm=n->member;
545 l->m[nm->pos].rtyp=nm->typ;
void * idrecDataInit(int t)
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition at line 246 of file newstruct.cc.
250 newstruct_desc nt=(newstruct_desc)a->data;
251 newstruct_proc
p=nt->procs;
253 while((
p!=
NULL) &&( (
p->t!=op) || (
p->args!=1) ))
p=
p->next;
259 memset(&tmp,0,
sizeof(
sleftv));
262 memset(&hh,0,
sizeof(hh));
Class used for (list of) interpreter objects.
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
const char * Tok2Cmdname(int tok)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition at line 335 of file newstruct.cc.
343 nt=(newstruct_desc)a->data;
351 newstruct_member nm=nt->member;
352 while ((nm!=
NULL)&&(strcmp(nm->name,a2->
name)!=0)) nm=nm->next;
353 if ((nm==
NULL) && (strncmp(a2->
name,
"r_",2)==0))
356 while ((nm!=
NULL)&&(strcmp(nm->name,a2->
name+2)!=0)) nm=nm->next;
376 if (r!=
NULL) r->ref++;
377 else Werror(
"ring of this member is not set and no basering found");
387 ring r=(ring)al->
m[nm->pos-1].
data;
399 &&(al->
m[nm->pos-1].
data!=(
void*)0L))
401 Werror(
"different ring %lx(data) - %lx(basering)",
402 (
long unsigned)(al->
m[nm->pos-1].
data),(
long unsigned)
currRing);
408 Werror(
"(possible) name of ring of data: %s",nn);
431 r->start = nm->pos+1;
432 memcpy(res,a1,
sizeof(
sleftv));
433 memset(a1,0,
sizeof(
sleftv));
438 while (sh->next !=
NULL) sh=sh->next;
454 nt=(newstruct_desc)a->data;
457 newstruct_proc
p=nt->procs;
458 while((p!=
NULL) && ( (p->t!=op) || (p->args!=2) )) p=p->next;
463 memset(&tmp,0,
sizeof(
sleftv));
468 memset(&hh,0,
sizeof(hh));
Class used for (list of) interpreter objects.
void WerrorS(const char *s)
int int kStrategy strat if(h==NULL) return NULL
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
BOOLEAN blackboxDefaultOp2(int op, leftv, leftv r1, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
idhdl rFindHdl(ring r, idhdl n)
void rWrite(ring r, BOOLEAN details)
const char * Tok2Cmdname(int tok)
void Werror(const char *fmt,...)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition at line 485 of file newstruct.cc.
489 newstruct_desc nt=(newstruct_desc)a->data;
494 res->
data=(
void *)a->blackbox_String(a,args->
Data());
501 newstruct_proc
p=nt->procs;
503 while((p!=
NULL) &&( (p->t!=op) || (p->args!=4) )) p=p->next;
509 memset(&tmp,0,
sizeof(
sleftv));
512 memset(&hh,0,
sizeof(hh));
Class used for (list of) interpreter objects.
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
const char * Tok2Cmdname(int tok)
BOOLEAN blackboxDefaultOpM(int op, leftv res, leftv args)
default procedure blackboxDefaultOpM, to be called as "default:" branch
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
void newstruct_Print |
( |
blackbox * |
b, |
|
|
void * |
d |
|
) |
| |
Definition at line 663 of file newstruct.cc.
665 newstruct_desc dd=(newstruct_desc)
b->data;
666 newstruct_proc
p=dd->procs;
673 memset(&tmp,0,
sizeof(tmp));
677 memset(&hh,0,
sizeof(hh));
void blackbox_default_Print(blackbox *b, void *d)
default procedure blackbox_default_Print: print the string
Class used for (list of) interpreter objects.
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
void * newstruct_Copy(blackbox *, void *d)
const char * Tok2Cmdname(int tok)
void CleanUp(ring r=currRing)
Definition at line 599 of file newstruct.cc.
601 newstruct_desc dd=(newstruct_desc)
b->data;
603 memset(&
l,0,
sizeof(
l));
610 l.data=(
void*)(
long)Ll;
614 newstruct_member elem=dd->member;
617 rings[elem->pos]=
'\1';
633 f->m->Write(
f,&(ll->
m[i]));
636 f->m->SetRing(
f,save_ring,
FALSE);
Class used for (list of) interpreter objects.
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
Definition at line 849 of file newstruct.cc.
855 Werror(
">>%s<< is not a newstruct type",bbname);
859 newstruct_desc desc=(newstruct_desc)bb->data;
860 newstruct_proc
p=(newstruct_proc)
omAlloc(
sizeof(*
p));
861 p->next=desc->procs; desc->procs=
p;
867 if(!(tt=
IsCmd(func,
p->t)))
887 Werror(
">>%s<< is not a kernel command",func);
#define omFreeSize(addr, size)
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
int iiOpsTwoChar(const char *s)
void Werror(const char *fmt,...)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
int IsCmd(const char *n, int &tok)
void newstruct_setup |
( |
const char * |
n, |
|
|
newstruct_desc |
d |
|
) |
| |
Definition at line 692 of file newstruct.cc.
694 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
BOOLEAN newstruct_deserialize(blackbox **b, void **d, si_link f)
BOOLEAN newstruct_Op1(int op, leftv res, leftv arg)
void newstruct_destroy(blackbox *, void *d)
BOOLEAN newstruct_OpM(int op, leftv res, leftv args)
const CanonicalForm CFMap CFMap int &both_non_zero int n
BOOLEAN newstruct_Op2(int op, leftv res, leftv a1, leftv a2)
void * newstruct_Init(blackbox *b)
BOOLEAN newstruct_serialize(blackbox *b, void *d, si_link f)
BOOLEAN newstruct_Assign(leftv l, leftv r)
char * newstruct_String(blackbox *b, void *d)
void * newstruct_Copy(blackbox *, void *d)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
void newstruct_Print(blackbox *b, void *d)
BOOLEAN newstruct_CheckAssign(blackbox *, leftv L, leftv R)
char* newstruct_String |
( |
blackbox * |
b, |
|
|
void * |
d |
|
) |
| |
Definition at line 46 of file newstruct.cc.
51 newstruct_desc ad=(newstruct_desc)(
b->data);
53 newstruct_proc
p=ad->procs;
61 memset(&tmp,0,
sizeof(tmp));
66 memset(&hh,0,
sizeof(hh));
84 newstruct_member
a=ad->member;
101 if ((strlen(tmp2)>80)||(strchr(tmp2,
'\n')!=
NULL))
112 if (a->next==
NULL)
break;
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(..),..)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
void StringSetS(const char *st)
void StringAppendS(const char *st)
void * newstruct_Copy(blackbox *, void *d)
const char * Tok2Cmdname(int tok)
void CleanUp(ring r=currRing)
newstruct_desc newstructChildFromString |
( |
const char * |
parent, |
|
|
const char * |
s |
|
) |
| |
Definition at line 802 of file newstruct.cc.
809 Werror(
">>%s< not found",parent);
816 Werror(
">>%s< is not a user defined type",parent);
820 newstruct_desc
res=(newstruct_desc)
omAlloc0(
sizeof(*res));
821 newstruct_desc parent_desc=(newstruct_desc)parent_bb->data;
822 res->size=parent_desc->size;
823 res->member=parent_desc->member;
824 res->parent=parent_desc;
const CanonicalForm int s
void newstruct_destroy(blackbox *, void *d)
static newstruct_desc scanNewstructFromString(const char *s, newstruct_desc res)
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
void Werror(const char *fmt,...)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
newstruct_desc newstructFromString |
( |
const char * |
s | ) |
|
Definition at line 795 of file newstruct.cc.
797 newstruct_desc
res=(newstruct_desc)
omAlloc0(
sizeof(*res));
const CanonicalForm int s
static newstruct_desc scanNewstructFromString(const char *s, newstruct_desc res)
void newstructShow |
( |
newstruct_desc |
d | ) |
|
Definition at line 829 of file newstruct.cc.
831 newstruct_member elem;
832 Print(
"id: %d\n",d->id);
836 Print(
">>%s<< at pos %d, type %d (%s)\n",elem->name,elem->pos,elem->typ,
Tok2Cmdname(elem->typ));
838 Print(
">>r_%s<< at pos %d, shadow ring\n",elem->name,elem->pos-1);
841 newstruct_proc
p=d->procs;
844 Print(
"op:%d(%s) with %d args -> %s\n",p->t,
iiTwoOps(p->t),p->args,p->p->procname);
const char * iiTwoOps(int t)
const char * Tok2Cmdname(int tok)
static newstruct_desc scanNewstructFromString |
( |
const char * |
s, |
|
|
newstruct_desc |
res |
|
) |
| |
|
static |
Definition at line 718 of file newstruct.cc.
725 newstruct_member elem;
732 while ((*p!=
'\0') && (*p<=
' ')) p++;
734 while (isalnum(*p)) p++;
739 Werror(
"unknown type `%s`",start);
748 elem=(newstruct_member)
omAlloc0(
sizeof(*elem));
751 while ((*p!=
'\0') && (*p<=
' ')) p++;
753 while (isalnum(*p)) p++;
758 if ((*start==
'\0') ||(isdigit(*start)))
760 WerrorS(
"illegal/empty name for element");
761 goto error_in_newstruct_def;
765 elem->next=
res->member;
771 while ((*p!=
'\0') && (*p<=
' ')) p++;
776 Werror(
"unknown character in newstruct:>>%s<<",p);
777 goto error_in_newstruct_def;
788 error_in_newstruct_def:
const CanonicalForm int s
void WerrorS(const char *s)
void Werror(const char *fmt,...)
int IsCmd(const char *n, int &tok)