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 **, 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) |
|
◆ newstruct_member_s
struct newstruct_member_s |
Definition at line 15 of file newstruct.cc.
Data Fields |
char * |
name |
|
newstruct_member |
next |
|
int |
pos |
|
int |
typ |
|
◆ newstruct_proc_a
◆ newstruct_desc_s
Definition at line 33 of file newstruct.cc.
Data Fields |
int |
id |
|
newstruct_member |
member |
|
newstruct_desc |
parent |
|
newstruct_proc |
procs |
|
int |
size |
|
◆ lClean_newstruct()
void lClean_newstruct |
( |
lists |
l | ) |
|
Definition at line 207 of file newstruct.cc.
213 for(
i=
l->nr;
i>=0;
i--)
216 r=(ring)(
l->m[
i-1].data);
Class used for (list of) interpreter objects.
#define omFreeSize(addr, size)
#define omFreeBin(addr, bin)
◆ lCopy_newstruct()
Definition at line 123 of file newstruct.cc.
139 N->m[n].Copy(&L->
m[n]);
143 N->m[n].rtyp=L->
m[n].
rtyp;
149 N->m[n].rtyp=L->
m[n].
rtyp;
154 N->m[n].rtyp=L->
m[n].
rtyp;
156 N->m[n].data=(
void *)
b->blackbox_Copy(
b,L->
m[n].
data);
159 N->m[n].Copy(&L->
m[n]);
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
const CanonicalForm CFMap CFMap & N
void * idrecDataInit(int t)
BOOLEAN lRingDependend(lists L)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
◆ newstruct_Assign()
Definition at line 277 of file newstruct.cc.
280 if (
l->Typ()==r->
Typ())
287 if (
l->Typ()!=r->
Typ())
289 newstruct_desc rrn=(newstruct_desc)rr->data;
293 Werror(
"custom type %s(%d) cannot be assigned to newstruct %s(%d)",
299 newstruct_desc rrp=rrn->parent;
300 while ((rrp!=
NULL)&&(rrp->id!=
l->Typ())) rrp=rrp->parent;
319 if (
l->Typ()==r->
Typ())
329 Werror(
"assign %s(%d) = %s(%d)",
const char * Tok2Cmdname(int tok)
BOOLEAN newstruct_Assign_user(int op, leftv l, leftv r)
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)
void Werror(const char *fmt,...)
◆ newstruct_Assign_same()
Definition at line 227 of file newstruct.cc.
void CleanUp(ring r=currRing)
void lClean_newstruct(lists l)
lists lCopy_newstruct(lists L)
◆ newstruct_Assign_user()
Definition at line 171 of file newstruct.cc.
175 newstruct_desc nt=(newstruct_desc)ll->data;
176 newstruct_proc
p=nt->procs;
178 while( (
p!=
NULL) && ((
p->t!=
'=')||(
p->args!=1)) )
p=
p->next;
184 memset(&hh,0,
sizeof(hh));
189 memset(&tmp,0,
sizeof(
sleftv));
INST_VAR sleftv iiRETURNEXPR
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv sl)
◆ newstruct_CheckAssign()
Definition at line 566 of file newstruct.cc.
577 Werror(
"can not assign %s(%d) to member of type %s(%d)",
582 Werror(
"can not assign %s to member of type %s",rt1,lt1);
int iiTestConvert(int inputType, int outputType)
const struct sConvertTypes dConvertTypes[]
◆ newstruct_Copy()
void* newstruct_Copy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
◆ newstruct_desc_size()
int newstruct_desc_size |
( |
| ) |
|
◆ newstruct_deserialize()
Definition at line 653 of file newstruct.cc.
660 int Ll=(int)(
long)(
l->data);
664 for(
int i=0;
i<=Ll;
i++)
INLINE_THIS void Init(int l=0)
EXTERN_VAR omBin sleftv_bin
◆ newstruct_destroy()
void newstruct_destroy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
◆ newstruct_Init()
void* newstruct_Init |
( |
blackbox * |
b | ) |
|
Definition at line 545 of file newstruct.cc.
547 newstruct_desc n=(newstruct_desc)
b->data;
550 newstruct_member nm=n->member;
553 l->m[nm->pos].rtyp=nm->typ;
◆ newstruct_Op1()
Definition at line 249 of file newstruct.cc.
253 newstruct_desc nt=(newstruct_desc)a->data;
254 newstruct_proc
p=nt->procs;
256 while((
p!=
NULL) &&( (
p->t!=op) || (
p->args!=1) ))
p=
p->next;
261 memset(&hh,0,
sizeof(hh));
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
◆ newstruct_Op2()
Definition at line 334 of file newstruct.cc.
342 nt=(newstruct_desc)a->data;
350 newstruct_member nm=nt->member;
351 while ((nm!=
NULL)&&(strcmp(nm->name,a2->
name)!=0)) nm=nm->next;
352 if ((nm==
NULL) && (strncmp(a2->
name,
"r_",2)==0))
355 while ((nm!=
NULL)&&(strcmp(nm->name,a2->
name+2)!=0)) nm=nm->next;
375 if (r!=
NULL) r->ref++;
376 else WerrorS(
"ring of this member is not set and no basering found");
388 ring r=(ring)al->
m[nm->pos-1].
data;
401 &&(al->
m[nm->pos-1].
data!=(
void*)0L))
403 Werror(
"different ring %lx(data) - %lx(basering)",
404 (
long unsigned)(al->
m[nm->pos-1].
data),(
long unsigned)
currRing);
410 Werror(
"(possible) name of ring of data: %s",nn);
419 ring old=(ring)al->
m[nm->pos-1].
data;
431 ring old=(ring)al->
m[nm->pos-1].
data;
438 r->start = nm->pos+1;
440 memset(a1,0,
sizeof(
sleftv));
445 while (sh->next !=
NULL) sh=sh->next;
463 nt=(newstruct_desc)a->data;
466 newstruct_proc
p=nt->procs;
467 while((
p!=
NULL) && ( (
p->t!=op) || (
p->args!=2) ))
p=
p->next;
471 memset(&tmp,0,
sizeof(
sleftv));
476 memset(&hh,0,
sizeof(hh));
BOOLEAN blackboxDefaultOp2(int, leftv, leftv, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
void WerrorS(const char *s)
idhdl rFindHdl(ring r, idhdl n)
void rWrite(ring r, BOOLEAN details)
◆ newstruct_OpM()
Definition at line 495 of file newstruct.cc.
499 newstruct_desc nt=(newstruct_desc)a->data;
504 res->data=(
void *)a->blackbox_String(a,args->
Data());
512 newstruct_proc
p=nt->procs;
514 while((
p!=
NULL) &&( (
p->t!=op) || (
p->args!=4) ))
p=
p->next;
519 memset(&hh,0,
sizeof(hh));
BOOLEAN blackboxDefaultOpM(int op, leftv res, leftv args)
default procedure blackboxDefaultOpM, to be called as "default:" branch
◆ newstruct_Print()
void newstruct_Print |
( |
blackbox * |
b, |
|
|
void * |
d |
|
) |
| |
Definition at line 676 of file newstruct.cc.
678 newstruct_desc dd=(newstruct_desc)
b->data;
679 newstruct_proc
p=dd->procs;
686 memset(&tmp,0,
sizeof(tmp));
690 memset(&hh,0,
sizeof(hh));
void blackbox_default_Print(blackbox *b, void *d)
default procedure blackbox_default_Print: print the string
void * newstruct_Copy(blackbox *, void *d)
◆ newstruct_serialize()
Definition at line 611 of file newstruct.cc.
613 newstruct_desc dd=(newstruct_desc)
b->data;
615 memset(&
l,0,
sizeof(
l));
622 l.data=(
void*)(
long)Ll;
626 newstruct_member elem=dd->member;
629 rings[elem->pos]=
'\1';
645 f->m->Write(
f,&(ll->
m[
i]));
649 f->m->SetRing(
f,save_ring,
FALSE);
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
◆ newstruct_set_proc()
Definition at line 863 of file newstruct.cc.
869 Werror(
">>%s<< is not a newstruct type",bbname);
873 newstruct_desc desc=(newstruct_desc)bb->data;
874 newstruct_proc
p=(newstruct_proc)
omAlloc(
sizeof(*
p));
875 p->next=desc->procs; desc->procs=
p;
881 if(!(tt=
IsCmd(func,
p->t)))
901 Werror(
">>%s<< is not a kernel command",func);
917 if(args!=1) {
Warn(
"args must be 1 for %s in %s",func,
my_yylinebuf);args=1;}
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
VAR char my_yylinebuf[80]
int IsCmd(const char *n, int &tok)
int iiOpsTwoChar(const char *s)
◆ newstruct_setup()
void newstruct_setup |
( |
const char * |
n, |
|
|
newstruct_desc |
d |
|
) |
| |
Definition at line 705 of file newstruct.cc.
707 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
BOOLEAN newstruct_Op2(int op, leftv res, leftv a1, leftv a2)
char * newstruct_String(blackbox *b, void *d)
BOOLEAN newstruct_deserialize(blackbox **, void **d, si_link f)
void newstruct_destroy(blackbox *, void *d)
BOOLEAN newstruct_serialize(blackbox *b, void *d, si_link f)
BOOLEAN newstruct_OpM(int op, leftv res, leftv args)
BOOLEAN newstruct_CheckAssign(blackbox *, leftv L, leftv R)
void newstruct_Print(blackbox *b, void *d)
void * newstruct_Init(blackbox *b)
◆ newstruct_String()
char* newstruct_String |
( |
blackbox * |
b, |
|
|
void * |
d |
|
) |
| |
Definition at line 47 of file newstruct.cc.
52 newstruct_desc ad=(newstruct_desc)(
b->data);
54 newstruct_proc
p=ad->procs;
61 memset(&tmp,0,
sizeof(tmp));
66 memset(&hh,0,
sizeof(hh));
83 newstruct_member a=ad->member;
90 || ((
l->m[a->pos-1].data==(
void *)
currRing)
115 if (a->next==
NULL)
break;
void StringSetS(const char *st)
void StringAppendS(const char *st)
◆ newstructChildFromString()
newstruct_desc newstructChildFromString |
( |
const char * |
parent, |
|
|
const char * |
s |
|
) |
| |
Definition at line 816 of file newstruct.cc.
823 Werror(
">>%s< not found",parent);
830 Werror(
">>%s< is not a user defined type",parent);
835 newstruct_desc parent_desc=(newstruct_desc)parent_bb->data;
836 res->size=parent_desc->size;
837 res->member=parent_desc->member;
838 res->parent=parent_desc;
const CanonicalForm int s
static newstruct_desc scanNewstructFromString(const char *s, newstruct_desc res)
◆ newstructFromString()
newstruct_desc newstructFromString |
( |
const char * |
s | ) |
|
◆ newstructShow()
void newstructShow |
( |
newstruct_desc |
d | ) |
|
Definition at line 843 of file newstruct.cc.
845 newstruct_member elem;
846 Print(
"id: %d\n",d->id);
850 Print(
">>%s<< at pos %d, type %d (%s)\n",elem->name,elem->pos,elem->typ,
Tok2Cmdname(elem->typ));
852 Print(
">>r_%s<< at pos %d, shadow ring\n",elem->name,elem->pos-1);
855 newstruct_proc
p=d->procs;
858 Print(
"op:%d(%s) with %d args -> %s\n",
p->t,
iiTwoOps(
p->t),
p->args,
p->p->procname);
const char * iiTwoOps(int t)
◆ scanNewstructFromString()
static newstruct_desc scanNewstructFromString |
( |
const char * |
s, |
|
|
newstruct_desc |
res |
|
) |
| |
|
static |
Definition at line 731 of file newstruct.cc.
738 newstruct_member elem;
745 while ((*
p!=
'\0') && (*
p<=
' '))
p++;
747 while (isalnum(*
p))
p++;
752 Werror(
"unknown type `%s`",start);
762 elem=(newstruct_member)
omAlloc0(
sizeof(*elem));
765 while ((*
p!=
'\0') && (*
p<=
' '))
p++;
767 while (isalnum(*
p))
p++;
772 if ((*start==
'\0') ||(isdigit(*start)))
774 WerrorS(
"illegal/empty name for element");
775 goto error_in_newstruct_def;
779 elem->next=
res->member;
785 while ((*
p!=
'\0') && (*
p<=
' '))
p++;
790 Werror(
"unknown character in newstruct:>>%s<<",
p);
791 goto error_in_newstruct_def;
802 error_in_newstruct_def: