diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-04-04 17:21:40 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-04-04 17:21:40 +0200 |
commit | 37497bd5fa0f070e12c1c28d849aef1af8f369b5 (patch) | |
tree | 28f16eee27219c6125326acfa5f4ac16514797ce /ftparchive/cachedb.cc | |
parent | 53ba4e2c2dd29758be0a911489ca5c23e5107513 (diff) |
refactor _InitQuery()
Diffstat (limited to 'ftparchive/cachedb.cc')
-rw-r--r-- | ftparchive/cachedb.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index f63aa88ab..4feb7bbfb 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -199,7 +199,7 @@ bool CacheDB::GetCurStat() in the database */ /* Get the flags (and mtime) */ - InitQuery("st"); + InitQueryStats(); // Ensure alignment of the returned structure Data.data = &CurStat; Data.ulen = sizeof(CurStat); @@ -262,7 +262,7 @@ bool CacheDB::LoadSource() if ((CurStat.Flags & FlSource) == FlSource) { // Lookup the control information - InitQuery("cs"); + InitQuerySource(); if (Get() == true && Dsc.TakeDsc(Data.data, Data.size) == true) { return true; @@ -280,7 +280,7 @@ bool CacheDB::LoadSource() return _error->Error(_("Failed to read .dsc")); // Write back the control information - InitQuery("cs"); + InitQuerySource(); if (Put(Dsc.Data, Dsc.Length) == true) CurStat.Flags |= FlSource; @@ -296,7 +296,7 @@ bool CacheDB::LoadControl() if ((CurStat.Flags & FlControl) == FlControl) { // Lookup the control information - InitQuery("cl"); + InitQueryControl(); if (Get() == true && Control.TakeControl(Data.data,Data.size) == true) return true; CurStat.Flags &= ~FlControl; @@ -313,7 +313,7 @@ bool CacheDB::LoadControl() return _error->Error(_("Archive has no control record")); // Write back the control information - InitQuery("cl"); + InitQueryControl(); if (Put(Control.Control,Control.Length) == true) CurStat.Flags |= FlControl; return true; @@ -331,7 +331,7 @@ bool CacheDB::LoadContents(bool const &GenOnly) return true; // Lookup the contents information - InitQuery("cn"); + InitQueryContent(); if (Get() == true) { if (Contents.TakeContents(Data.data,Data.size) == true) @@ -349,7 +349,7 @@ bool CacheDB::LoadContents(bool const &GenOnly) return false; // Write back the control information - InitQuery("cn"); + InitQueryContent(); if (Put(Contents.Data,Contents.CurSize) == true) CurStat.Flags |= FlContents; return true; @@ -519,7 +519,7 @@ bool CacheDB::Finish() // Write the stat information CurStat.Flags = htonl(CurStat.Flags); CurStat.FileSize = htonl(CurStat.FileSize); - InitQuery("st"); + InitQueryStats(); Put(&CurStat,sizeof(CurStat)); CurStat.Flags = ntohl(CurStat.Flags); CurStat.FileSize = ntohl(CurStat.FileSize); |