[PD-cvs] externals/grill/pool pool.cpp,1.13,1.14

xovo at users.sourceforge.net xovo at users.sourceforge.net
Mon Dec 15 04:37:55 CET 2003


Update of /cvsroot/pure-data/externals/grill/pool
In directory sc8-pr-cvs1:/tmp/cvs-serv27114

Modified Files:
	pool.cpp 
Log Message:
 ""

Index: pool.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/pool.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** pool.cpp	12 Dec 2003 03:38:10 -0000	1.13
--- pool.cpp	15 Dec 2003 03:37:53 -0000	1.14
***************
*** 425,429 ****
  				pooldir *ndir = p->AddDir(1,&dix->dir);
  				if(ndir)
! 					ok = ndir->Copy(dix,depth > 0?depth-1:depth,cut);
  				else
  					ok = false;
--- 425,429 ----
  				pooldir *ndir = p->AddDir(1,&dix->dir);
  				if(ndir)
! 					ok = dix->Copy(ndir,depth > 0?depth-1:depth,cut);
  				else
  					ok = false;
***************
*** 662,673 ****
                  )
              ) {
!                 BL ret;
!                 if(indata)
!                     ret = ParseAtoms(s,v);
                  else // inkey
!                     if(inval)
!                         ret = ParseAtoms(s,k);
                      else {
!                         SetString(d[d.Count()-1],s.c_str());
                          ret = true;
                      }
--- 662,687 ----
                  )
              ) {
!                 BL ret = true;
!                 if(indata) {
!                     if(v.Count())
!                         post("pool - XML load: value data already given, ignoring new data");
!                     else
!                         ret = ParseAtoms(s,v);
!                 }
                  else // inkey
!                     if(inval) {
!                         if(k.Count())
!                             post("pool - XML load, value key already given, ignoring new key");
!                         else
!                             ret = ParseAtoms(s,k);
!                     }
                      else {
!                         t_atom &dkey = d[d.Count()-1];
!                         const char *ds = GetString(dkey);
!                         FLEXT_ASSERT(ds);
!                         if(*ds) 
!                             post("pool - XML load: dir key already given, ignoring new key");
!                         else
!                             SetString(dkey,s.c_str());
                          ret = true;
                      }
***************
*** 684,687 ****
--- 698,702 ----
              if(tag == "dir") {
                  if(tag.type == xmltag::t_start) {
+                     // initialize dir key as empty
                      t_atom at; SetString(at,"");
                      d.Append(at);
***************
*** 691,695 ****
                          d.Part(0,d.Count()-1);
                      else
!                         post("pool - superfluous </dir> in XML data");
                  }
              }
--- 706,710 ----
                          d.Part(0,d.Count()-1);
                      else
!                         post("pool - XML load: superfluous </dir> in XML data");
                  }
              }
***************
*** 702,713 ****
          			if(depth < 0 || d.Count() <= depth) {
                          // NOW set value
! 				        pooldir *nd = mkdir?AddDir(d):GetDir(d);
! 				        if(nd) {
!                             // only use first word of key
!                             if(k.Count() == 1)
! 					            nd->SetVal(k[0],new AtomList(v));
!                             else
!                                 post("pool - Invalid key (!= 1 atom)");
! 				        }
                      }
                      inval = false;
--- 717,733 ----
          			if(depth < 0 || d.Count() <= depth) {
                          // NOW set value
!                         const char *ds = d.Count()?GetString(d[d.Count()-1]):NULL;
!                         if(!ds || !*ds)
!                             post("pool - XML load: dir key must be given prior to dir values");
!                         else {
! 				            pooldir *nd = mkdir?AddDir(d):GetDir(d);
! 				            if(nd) {
!                                 // only use first word of key
!                                 if(k.Count() == 1)
!                                     nd->SetVal(k[0],new AtomList(v));
!                                 else
!                                     post("pool - XML load: value key must be exactly one word, value not stored");
! 				            }
!                         }
                      }
                      inval = false;






More information about the Pd-cvs mailing list