1 | #ifndef ATTRIB_H |
---|
2 | #define ATTRIB_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* |
---|
7 | * ABSTRACT: attributes to leftv and idhdl |
---|
8 | */ |
---|
9 | #include <string.h> |
---|
10 | #include <kernel/structs.h> |
---|
11 | |
---|
12 | class sattr; |
---|
13 | typedef sattr * attr; |
---|
14 | class sattr |
---|
15 | { |
---|
16 | public: |
---|
17 | inline void Init() { memset(this,0,sizeof(*this)); } |
---|
18 | const char * name; |
---|
19 | void * data; |
---|
20 | attr next; |
---|
21 | int atyp; /* the type of the attribut, describes the data field |
---|
22 | */ |
---|
23 | |
---|
24 | void Print(); |
---|
25 | attr Copy(); /* copy all arguments */ |
---|
26 | void * CopyA(); /* copy the data of this attribute */ |
---|
27 | attr set(const char * s, void * data, int t); |
---|
28 | attr get(const char * s); |
---|
29 | void kill(const ring r); |
---|
30 | void killAll(const ring r); |
---|
31 | }; |
---|
32 | |
---|
33 | void * atGet(idhdl root,const char * name); |
---|
34 | void * atGet(leftv root,const char * name); |
---|
35 | void * atGet(idhdl root,const char * name, int t, void *defaultReturnValue = NULL); |
---|
36 | void * atGet(leftv root,const char * name, int t); |
---|
37 | void atSet(idhdl root,const char * name,void * data,int typ); |
---|
38 | void atSet(leftv root,const char * name,void * data,int typ); |
---|
39 | void at_KillAll(idhdl root,const ring r); |
---|
40 | void at_KillAll(leftv root,const ring r); |
---|
41 | #define atKillAll(H) at_KillAll(H,currRing) |
---|
42 | void at_Kill(idhdl root,const char * name,const ring r); |
---|
43 | #define atKill(H,A) at_Kill(H,A,currRing) |
---|
44 | |
---|
45 | BOOLEAN atATTRIB1(leftv res,leftv a); |
---|
46 | BOOLEAN atATTRIB2(leftv res,leftv a,leftv b); |
---|
47 | BOOLEAN atATTRIB3(leftv res,leftv a,leftv b,leftv c); |
---|
48 | BOOLEAN atKILLATTR1(leftv res,leftv a); |
---|
49 | BOOLEAN atKILLATTR2(leftv res,leftv a,leftv b); |
---|
50 | #endif |
---|