[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 | */ |
---|
[b5dd9b] | 9 | #include "kernel/structs.h" |
---|
[474f55c] | 10 | #include "omalloc/omalloc.h" |
---|
[db143c] | 11 | #ifdef HAVE_OMALLOC |
---|
[b5dd9b] | 12 | #include "omalloc/omallocClass.h" |
---|
[474f55c] | 13 | #endif |
---|
[0e1846] | 14 | |
---|
| 15 | class sattr; |
---|
| 16 | typedef sattr * attr; |
---|
[474f55c] | 17 | class sattr |
---|
[6408aa] | 18 | #ifdef HAVE_OMALLOC |
---|
[474f55c] | 19 | : public omallocClass |
---|
| 20 | #endif |
---|
[0e1846] | 21 | { |
---|
| 22 | public: |
---|
[c4dab4] | 23 | inline void Init() { memset(this,0,sizeof(*this)); } |
---|
[f93ebb] | 24 | char * name; |
---|
[0e1846] | 25 | void * data; |
---|
| 26 | attr next; |
---|
| 27 | int atyp; /* the type of the attribut, describes the data field |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | void Print(); |
---|
| 31 | attr Copy(); /* copy all arguments */ |
---|
| 32 | void * CopyA(); /* copy the data of this attribute */ |
---|
[f93ebb] | 33 | attr set(char * s, void * data, int t); /* eats s, data */ |
---|
[85e68dd] | 34 | attr get(const char * s); |
---|
[2dbaba4] | 35 | void kill(const ring r); |
---|
| 36 | void killAll(const ring r); |
---|
[0e1846] | 37 | }; |
---|
| 38 | |
---|
[f4b7ce8] | 39 | //void * atGet(idhdl root,const char * name); |
---|
| 40 | //void * atGet(leftv root,const char * name); |
---|
[599813] | 41 | void * atGet(idhdl root,const char * name, int t, void *defaultReturnValue = NULL); |
---|
[85e68dd] | 42 | void * atGet(leftv root,const char * name, int t); |
---|
[f93ebb] | 43 | void atSet(idhdl root,char * name,void * data,int typ); |
---|
| 44 | void atSet(leftv root,char * name,void * data,int typ); |
---|
[2dbaba4] | 45 | void at_KillAll(idhdl root,const ring r); |
---|
[c227a2f] | 46 | void at_KillAll(leftv root,const ring r); |
---|
[2dbaba4] | 47 | #define atKillAll(H) at_KillAll(H,currRing) |
---|
| 48 | void at_Kill(idhdl root,const char * name,const ring r); |
---|
| 49 | #define atKill(H,A) at_Kill(H,A,currRing) |
---|
[0e1846] | 50 | |
---|
| 51 | BOOLEAN atATTRIB1(leftv res,leftv a); |
---|
| 52 | BOOLEAN atATTRIB2(leftv res,leftv a,leftv b); |
---|
| 53 | BOOLEAN atATTRIB3(leftv res,leftv a,leftv b,leftv c); |
---|
| 54 | BOOLEAN atKILLATTR1(leftv res,leftv a); |
---|
| 55 | BOOLEAN atKILLATTR2(leftv res,leftv a,leftv b); |
---|
| 56 | #endif |
---|