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