[PD-cvs] externals/grill/pool/source data.cpp,1.4,1.5 main.cpp,1.7,1.8 pool.cpp,1.12,1.13 pool.h,1.7,1.8
Thomas Grill
xovo at users.sourceforge.net
Tue Jan 4 06:00:41 CET 2005
Update of /cvsroot/pure-data/externals/grill/pool/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18865/source
Modified Files:
data.cpp main.cpp pool.cpp pool.h
Log Message:
fixes for Max 4.5 SDK headers
fixes for Max/OSX
cleanups
preparing the release 0.1.2
update for flext build system
roll back to working version
Index: data.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/source/data.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** data.cpp 30 Oct 2004 03:58:58 -0000 1.4
--- data.cpp 4 Jan 2005 05:00:38 -0000 1.5
***************
*** 3,7 ****
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2004 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
--- 3,7 ----
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2005 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
***************
*** 33,122 ****
const A pooldata::nullatom = { A_NULL };
- /*
- V pooldata::Reset()
- {
- root.Reset();
- }
-
- BL pooldata::MkDir(const AtomList &d,I vcnt,I dcnt)
- {
- root.AddDir(d,vcnt,dcnt);
- return true;
- }
-
-
- BL pooldata::ChkDir(const AtomList &d)
- {
- return root.GetDir(d) != NULL;
- }
-
- BL pooldata::RmDir(const AtomList &d)
- {
- return root.DelDir(d);
- }
-
- BL pooldata::Set(const AtomList &d,const A &key,AtomList *data,BL over)
- {
- pooldir *pd = root.GetDir(d);
- if(!pd) return false;
- pd->SetVal(key,data,over);
- return true;
- }
-
- BL pooldata::Clr(const AtomList &d,const A &key)
- {
- pooldir *pd = root.GetDir(d);
- if(!pd) return false;
- pd->ClrVal(key);
- return true;
- }
-
- V pooldata::Clri(const AtomList &d,I ix)
- {
- pooldir *pd = root.GetDir(d);
- if(!pd) return false;
- pd->ClrVali(ix);
- return true;
- }
-
- BL pooldata::ClrAll(const AtomList &d,BL rec,BL dironly)
- {
- pooldir *pd = root.GetDir(d);
- if(!pd) return false;
- pd->Clear(rec,dironly);
- return true;
- }
-
- flext::AtomList *pooldata::Peek(const AtomList &d,const A &key)
- {
- pooldir *pd = root.GetDir(d);
- return pd?pd->PeekVal(key):NULL;
- }
-
- poolval *pooldata::Ref(const AtomList &d,const A &key)
- {
- pooldir *pd = root.GetDir(d);
- return pd?pd->RefVal(key):NULL;
- }
-
- poolval *pooldata::Refi(const AtomList &d,I ix)
- {
- pooldir *pd = root.GetDir(d);
- return pd?pd->RefVali(ix):NULL;
- }
-
- flext::AtomList *pooldata::Get(const AtomList &d,const A &key)
- {
- pooldir *pd = root.GetDir(d);
- return pd?pd->GetVal(key):NULL;
- }
-
- I pooldata::CntAll(const AtomList &d)
- {
- pooldir *pd = root.GetDir(d);
- return pd?pd->CntAll():0;
- }
- */
-
I pooldata::GetAll(const AtomList &d,A *&keys,AtomList *&lst)
{
--- 33,36 ----
***************
*** 139,150 ****
}
- /*
- I pooldata::CntSub(const AtomList &d)
- {
- pooldir *pd = root.GetDir(d);
- return pd?pd->CntSub():0;
- }
- */
-
I pooldata::GetSub(const AtomList &d,const t_atom **&dirs)
{
--- 53,56 ----
***************
*** 200,207 ****
! static const C *CnvFlnm(C *dst,const C *src,I sz)
{
#if FLEXT_SYS == FLEXT_SYS_PD && FLEXT_OS == FLEXT_OS_WIN
! I i,cnt = strlen(src);
if(cnt >= sz-1) return NULL;
for(i = 0; i < cnt; ++i)
--- 106,113 ----
! static const char *CnvFlnm(char *dst,const char *src,int sz)
{
#if FLEXT_SYS == FLEXT_SYS_PD && FLEXT_OS == FLEXT_OS_WIN
! int i,cnt = strlen(src);
if(cnt >= sz-1) return NULL;
for(i = 0; i < cnt; ++i)
***************
*** 214,226 ****
}
! BL pooldata::LdDir(const AtomList &d,const C *flnm,I depth,BL mkdir)
{
pooldir *pd = root.GetDir(d);
if(pd) {
! C tmp[1024];
! const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ifstream fl(t);
! return fl.good() && pd->LdDir(fl,depth,mkdir);
}
else return false;
--- 120,132 ----
}
! bool pooldata::LdDir(const AtomList &d,const char *flnm,int depth,bool mkdir)
{
pooldir *pd = root.GetDir(d);
if(pd) {
! char tmp[1024];
! const char *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ifstream file(t);
! return file.good() && pd->LdDir(file,depth,mkdir);
}
else return false;
***************
*** 237,244 ****
const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ofstream fl(t);
AtomList tmp;
if(absdir) tmp = d;
! return fl.good() && pd->SvDir(fl,depth,tmp);
}
else return false;
--- 143,150 ----
const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ofstream file(t);
AtomList tmp;
if(absdir) tmp = d;
! return file.good() && pd->SvDir(file,depth,tmp);
}
else return false;
***************
*** 255,262 ****
const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ifstream fl(t);
! BL ret = fl.good() != 0;
if(ret) {
! fl.getline(tmp,sizeof tmp);
ret = !strncmp(tmp,"<?xml",5);
}
--- 161,168 ----
const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ifstream file(t);
! BL ret = file.good() != 0;
if(ret) {
! file.getline(tmp,sizeof tmp);
ret = !strncmp(tmp,"<?xml",5);
}
***************
*** 269,273 ****
*/
if(ret)
! ret = pd->LdDirXML(fl,depth,mkdir);
return ret;
}
--- 175,179 ----
*/
if(ret)
! ret = pd->LdDirXML(file,depth,mkdir);
return ret;
}
***************
*** 284,296 ****
const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ofstream fl(t);
AtomList tmp;
if(absdir) tmp = d;
! if(fl.good()) {
! fl << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" << endl;
! fl << "<!DOCTYPE pool SYSTEM \"http://www.parasitaere-kapazitaeten.net/ext/pool/pool-0.2.dtd\">" << endl;
! fl << "<pool>" << endl;
! BL ret = pd->SvDirXML(fl,depth,tmp);
! fl << "</pool>" << endl;
return ret;
}
--- 190,202 ----
const C *t = CnvFlnm(tmp,flnm,sizeof tmp);
if(t) {
! ofstream file(t);
AtomList tmp;
if(absdir) tmp = d;
! if(file.good()) {
! file << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" << endl;
! file << "<!DOCTYPE pool SYSTEM \"http://grrrr.org/ext/pool/pool-0.2.dtd\">" << endl;
! file << "<pool>" << endl;
! BL ret = pd->SvDirXML(file,depth,tmp);
! file << "</pool>" << endl;
return ret;
}
Index: main.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/source/main.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** main.cpp 31 Oct 2004 04:59:26 -0000 1.7
--- main.cpp 4 Jan 2005 05:00:38 -0000 1.8
***************
*** 3,7 ****
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2004 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
--- 3,7 ----
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2005 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
***************
*** 154,158 ****
static V RmvPool(pooldata *p);
! std::string MakeFilename(const C *fn) const;
FLEXT_CALLVAR_V(mg_pool,ms_pool)
--- 154,158 ----
static V RmvPool(pooldata *p);
! string MakeFilename(const C *fn) const;
FLEXT_CALLVAR_V(mg_pool,ms_pool)
***************
*** 976,981 ****
post("%s - %s: no filename given",thisName(),GetString(thisTag()));
else {
! string fl(MakeFilename(flnm));
! if(!(xml?pl->LoadXML(fl.c_str()):pl->Load(fl.c_str())))
post("%s - %s: error loading data",thisName(),GetString(thisTag()));
}
--- 976,981 ----
post("%s - %s: no filename given",thisName(),GetString(thisTag()));
else {
! string file(MakeFilename(flnm));
! if(!(xml?pl->LoadXML(file.c_str()):pl->Load(file.c_str())))
post("%s - %s: error loading data",thisName(),GetString(thisTag()));
}
***************
*** 995,1000 ****
post("%s - %s: no filename given",thisName(),GetString(thisTag()));
else {
! string fl(MakeFilename(flnm));
! if(!(xml?pl->SaveXML(fl.c_str()):pl->Save(fl.c_str())))
post("%s - %s: error saving data",thisName(),GetString(thisTag()));
}
--- 995,1000 ----
post("%s - %s: no filename given",thisName(),GetString(thisTag()));
else {
! string file(MakeFilename(flnm));
! if(!(xml?pl->SaveXML(file.c_str()):pl->Save(file.c_str())))
post("%s - %s: error saving data",thisName(),GetString(thisTag()));
}
***************
*** 1014,1019 ****
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string fl(MakeFilename(flnm));
! if(!(xml?pl->LdDirXML(curdir,fl.c_str(),0):pl->LdDir(curdir,fl.c_str(),0)))
post("%s - %s: directory couldn't be loaded",thisName(),GetString(thisTag()));
}
--- 1014,1019 ----
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string file(MakeFilename(flnm));
! if(!(xml?pl->LdDirXML(curdir,file.c_str(),0):pl->LdDir(curdir,file.c_str(),0)))
post("%s - %s: directory couldn't be loaded",thisName(),GetString(thisTag()));
}
***************
*** 1048,1053 ****
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string fl(MakeFilename(flnm));
! if(!(xml?pl->LdDirXML(curdir,fl.c_str(),depth,mkdir):pl->LdDir(curdir,fl.c_str(),depth,mkdir)))
post("%s - %s: directory couldn't be saved",thisName(),GetString(thisTag()));
}
--- 1048,1053 ----
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string file(MakeFilename(flnm));
! if(!(xml?pl->LdDirXML(curdir,file.c_str(),depth,mkdir):pl->LdDir(curdir,file.c_str(),depth,mkdir)))
post("%s - %s: directory couldn't be saved",thisName(),GetString(thisTag()));
}
***************
*** 1067,1072 ****
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string fl(MakeFilename(flnm));
! if(!(xml?pl->SvDirXML(curdir,fl.c_str(),0,absdir):pl->SvDir(curdir,fl.c_str(),0,absdir)))
post("%s - %s: directory couldn't be saved",thisName(),GetString(thisTag()));
}
--- 1067,1072 ----
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string file(MakeFilename(flnm));
! if(!(xml?pl->SvDirXML(curdir,file.c_str(),0,absdir):pl->SvDir(curdir,file.c_str(),0,absdir)))
post("%s - %s: directory couldn't be saved",thisName(),GetString(thisTag()));
}
***************
*** 1086,1091 ****
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string fl(MakeFilename(flnm));
! if(!(xml?pl->SvDirXML(curdir,fl.c_str(),-1,absdir):pl->SvDir(curdir,fl.c_str(),-1,absdir)))
post("%s - %s: directory couldn't be saved",thisName(),GetString(thisTag()));
}
--- 1086,1091 ----
post("%s - %s: invalid filename",thisName(),GetString(thisTag()));
else {
! string file(MakeFilename(flnm));
! if(!(xml?pl->SvDirXML(curdir,file.c_str(),-1,absdir):pl->SvDir(curdir,file.c_str(),-1,absdir)))
post("%s - %s: directory couldn't be saved",thisName(),GetString(thisTag()));
}
***************
*** 1159,1163 ****
}
! std::string pool::MakeFilename(const C *fn) const
{
#if FLEXT_SYS == FLEXT_SYS_PD
--- 1159,1163 ----
}
! string pool::MakeFilename(const C *fn) const
{
#if FLEXT_SYS == FLEXT_SYS_PD
Index: pool.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/source/pool.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** pool.cpp 3 Jan 2005 05:02:34 -0000 1.12
--- pool.cpp 4 Jan 2005 05:00:39 -0000 1.13
***************
*** 3,7 ****
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2004 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
--- 3,7 ----
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2005 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
Index: pool.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/source/pool.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pool.h 30 Oct 2004 03:59:01 -0000 1.7
--- pool.h 4 Jan 2005 05:00:39 -0000 1.8
***************
*** 3,7 ****
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2004 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
--- 3,7 ----
pool - hierarchical storage object for PD and Max/MSP
! Copyright (c) 2002-2005 Thomas Grill
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
More information about the Pd-cvs
mailing list