From 930f3fb508616c72c66ee6c86292bd6778b0a7fe Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sun, 8 Dec 2002 05:35:13 +0000 Subject: "" svn path=/trunk/; revision=282 --- externals/grill/pool/main.cpp | 44 ++++++++++++++++++++++++---------------- externals/grill/pool/pool.cw | Bin 95908 -> 95908 bytes externals/grill/pool/pool.h | 2 ++ externals/grill/pool/pool.help | Bin 5347 -> 5887 bytes externals/grill/pool/readme.txt | 4 ++++ 5 files changed, 32 insertions(+), 18 deletions(-) (limited to 'externals/grill/pool') diff --git a/externals/grill/pool/main.cpp b/externals/grill/pool/main.cpp index c8297e9c..ad1da05a 100644 --- a/externals/grill/pool/main.cpp +++ b/externals/grill/pool/main.cpp @@ -10,7 +10,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "pool.h" -#define POOL_VERSION "0.1.0" +#define POOL_VERSION "0.1.1" class pool: public flext_base @@ -28,16 +28,12 @@ public: protected: // switch to other pool - V m_pool(I argc,const A *argv); + V ms_pool(const AtomList &l); + V mg_pool(AtomList &l); // clear all data in pool V m_reset(); - // output absolute directory paths? - V m_absdir(BL abs) { absdir = abs; } - // always output current directory - V m_echodir(BL e) { echo = e; } - // handle directories V m_getdir(); @@ -119,10 +115,14 @@ private: static pooldata *GetPool(const S *s); static V RmvPool(pooldata *p); - FLEXT_CALLBACK_V(m_pool) + FLEXT_CALLVAR_V(mg_pool,ms_pool) + FLEXT_ATTRVAR_B(absdir) + FLEXT_ATTRVAR_B(echo) + FLEXT_ATTRGET_B(priv) +// FLEXT_ATTRGET_B(curdir) + FLEXT_CALLBACK(m_reset) - FLEXT_CALLBACK_B(m_absdir) - FLEXT_CALLBACK_B(m_echodir) + FLEXT_CALLBACK(m_getdir) FLEXT_CALLBACK_V(m_mkdir) FLEXT_CALLBACK_V(m_chdir) @@ -191,13 +191,14 @@ pool::pool(I argc,const A *argv): AddOutList(); AddOutAnything(); - FLEXT_ADDMETHOD_(0,"pool",m_pool); + FLEXT_ADDATTR_VAR("pool",mg_pool,ms_pool); + FLEXT_ADDATTR_VAR1("absdir",absdir); + FLEXT_ADDATTR_VAR1("echodir",echo); + FLEXT_ADDATTR_GET("private",priv); + FLEXT_ADDMETHOD_(0,"reset",m_reset); FLEXT_ADDMETHOD_(0,"set",m_set); FLEXT_ADDMETHOD_(0,"add",m_add); - FLEXT_ADDMETHOD_(0,"reset",m_reset); - FLEXT_ADDMETHOD_(0,"absdir",m_absdir); - FLEXT_ADDMETHOD_(0,"echodir",m_echodir); FLEXT_ADDMETHOD_(0,"getdir",m_getdir); FLEXT_ADDMETHOD_(0,"mkdir",m_mkdir); FLEXT_ADDMETHOD_(0,"chdir",m_chdir); @@ -272,18 +273,24 @@ V pool::FreePool() if(clip) { delete clip; clip = NULL; } } -V pool::m_pool(I argc,const A *argv) +V pool::ms_pool(const AtomList &l) { const S *s = NULL; - if(argc > 0) { - if(argc > 1) post("%s - pool: superfluous arguments ignored",thisName()); - s = GetASymbol(argv[0]); + if(l.Count()) { + if(l.Count() > 1) post("%s - pool: superfluous arguments ignored",thisName()); + s = GetASymbol(l[0]); if(!s) post("%s - pool: invalid pool name, pool set to private",thisName()); } SetPool(s); } +V pool::mg_pool(AtomList &l) +{ + if(priv) l(); + else { l(1); SetSymbol(l[0],pl->sym); } +} + V pool::m_reset() { pl->Reset(); @@ -548,6 +555,7 @@ I pool::getsub(const S *tag,I level,BL cntonly,const AtomList &rdir) ToOutAnything(3,tag,0,NULL); ToOutList(2,curdir); ToOutList(1,ndir); + ToOutBang(0); } if(level != 0) diff --git a/externals/grill/pool/pool.cw b/externals/grill/pool/pool.cw index 123cb10f..3e596aee 100755 Binary files a/externals/grill/pool/pool.cw and b/externals/grill/pool/pool.cw differ diff --git a/externals/grill/pool/pool.h b/externals/grill/pool/pool.h index 348a4127..af73341d 100644 --- a/externals/grill/pool/pool.h +++ b/externals/grill/pool/pool.h @@ -11,6 +11,8 @@ WARRANTIES, see the file, "license.txt," in this distribution. #ifndef __POOL_H #define __POOL_H +#define FLEXT_ATTRIBUTES 1 + #include #if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) diff --git a/externals/grill/pool/pool.help b/externals/grill/pool/pool.help index c4ce9d74..3f160c45 100755 Binary files a/externals/grill/pool/pool.help and b/externals/grill/pool/pool.help differ diff --git a/externals/grill/pool/readme.txt b/externals/grill/pool/readme.txt index 513b1966..0fc0f7f3 100644 --- a/externals/grill/pool/readme.txt +++ b/externals/grill/pool/readme.txt @@ -52,6 +52,9 @@ o CodeWarrior: edit "pool.cw" and build Version history: +0.1.1: +- attributes (pool,private,echodir,absdir) + 0.1.0: - first public release @@ -61,5 +64,6 @@ TODO list: general: - speed up the database +- what is output as value if it is key only? (Max->nothing!) -- cgit v1.2.1