void UploadXML::Found(const char *name,double lat,double lon) { WPVERIFY_DEF *f; HashEntry *he; int h,hh; #if 0 f=(WPVERIFY_DEF *)m_names.Find(name); if(f) { if(fabs(f->lat-lat)<0.0001f && fabs(f->lon-lon)<0.0001f) { f->found=true; return; } } #endif /* no direct name match, so scan through and find */ he=m_names.GetFirst(); hh=m_names.GetNum(); for(h=0;h<hh;++h) { f=(WPVERIFY_DEF *)he->m_data; if(fabs(f->lat-lat)<0.0001f && fabs(f->lon-lon)<0.0001f) { f->found=true; // return; } he=he->GetNext(); } /* this point is not one we downloaded */ }
void kGUIDb::UpdateLocks(void) { int i,numtables; HashEntry *he; int *lcount; kGUIString ls; int numlocked; kGUIDbCommand *c; if(m_lockschanged==false) return; c=new kGUIDbCommand(this,"UNLOCK TABLES;"); delete c; numlocked=0; numtables=m_lockedtables.GetNum(); he=m_lockedtables.GetFirst(); ls.SetString("LOCK TABLES "); for(i=0; i<numtables; ++i) { lcount=(int *)(he->m_data); /* get data pointer */ if(lcount[0]) { if(numlocked) ls.Append(", "); ls.ASprintf("%s WRITE",he->m_string); ++numlocked; } he=he->GetNext(); } if(numlocked) { ls.Append(";"); c=new kGUIDbCommand(this,ls.GetString()); delete c; } m_lockschanged=false; }
int UploadXML::GetNotFound(kGUIString *s) { WPVERIFY_DEF *f; HashEntry *he; int h,hh; int notfound; notfound=0; he=m_names.GetFirst(); hh=m_names.GetNum(); for(h=0;h<hh;++h) { f=(WPVERIFY_DEF *)he->m_data; if(f->found==false) { s->ASprintf("%s\n",he->m_string); ++notfound; } he=he->GetNext(); } return(notfound); }