+ delete [] d->Buffer;
+ delete d;
+}
+ /*}}}*/
+// TagFile::Offset - Return the current offset in the buffer /*{{{*/
+unsigned long pkgTagFile::Offset()
+{
+ return d->iOffset;
+}
+ /*}}}*/
+// TagFile::Resize - Resize the internal buffer /*{{{*/
+// ---------------------------------------------------------------------
+/* Resize the internal buffer (double it in size). Fail if a maximum size
+ * size is reached.
+ */
+bool pkgTagFile::Resize()
+{
+ char *tmp;
+ unsigned long long EndSize = d->End - d->Start;
+
+ // fail is the buffer grows too big
+ if(d->Size > 1024*1024+1)
+ return false;
+
+ // get new buffer and use it
+ tmp = new char[2*d->Size];
+ memcpy(tmp, d->Buffer, d->Size);
+ d->Size = d->Size*2;
+ delete [] d->Buffer;
+ d->Buffer = tmp;
+
+ // update the start/end pointers to the new buffer
+ d->Start = d->Buffer;
+ d->End = d->Start + EndSize;
+ return true;