Revert "Move ZlibDecompressor to libshared"
This reverts commit 9af2105d36.
Conflicts:
src/kits/package/Jamfile
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#include <../private/package/hpkg/ZlibCompressionBase.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../private/package/hpkg/ZlibDecompressor.h>
|
||||
@@ -1 +0,0 @@
|
||||
#include <../private/shared/ZlibCompressionBase.h>
|
||||
@@ -1 +0,0 @@
|
||||
#include <../private/shared/ZlibDecompressor.h>
|
||||
@@ -6,7 +6,6 @@
|
||||
#define _PACKAGE__HPKG__DATA_OUTPUT_H_
|
||||
|
||||
|
||||
#include <DataIO.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
@@ -15,15 +14,21 @@ namespace BPackageKit {
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BBufferDataOutput : public BDataIO {
|
||||
class BDataOutput {
|
||||
public:
|
||||
virtual ~BDataOutput();
|
||||
|
||||
virtual status_t WriteData(const void* buffer, size_t size) = 0;
|
||||
};
|
||||
|
||||
|
||||
class BBufferDataOutput : public BDataOutput {
|
||||
public:
|
||||
BBufferDataOutput(void* buffer, size_t size);
|
||||
|
||||
size_t BytesWritten() const { return fBytesWritten; }
|
||||
|
||||
virtual status_t Write(const void* buffer, size_t size);
|
||||
virtual ssize_t Read(void* buffer, size_t size)
|
||||
{ return B_NOT_SUPPORTED; }
|
||||
virtual status_t WriteData(const void* buffer, size_t size);
|
||||
|
||||
private:
|
||||
void* fBuffer;
|
||||
@@ -9,14 +9,14 @@
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
class BDataIO;
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BDataOutput;
|
||||
|
||||
|
||||
class BDataReader {
|
||||
public:
|
||||
virtual ~BDataReader();
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
virtual status_t ReadData(off_t offset, void* buffer,
|
||||
size_t size);
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output) = 0;
|
||||
BDataOutput* output) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
virtual status_t ReadData(off_t offset, void* buffer,
|
||||
size_t size);
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output);
|
||||
BDataOutput* output);
|
||||
|
||||
private:
|
||||
const void* fData;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define _PACKAGE__HPKG__PRIVATE__DATA_WRITERS_H_
|
||||
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/ZlibCompressor.h>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class ZlibDataWriter : public AbstractDataWriter, private BDataIO {
|
||||
class ZlibDataWriter : public AbstractDataWriter, private BDataOutput {
|
||||
public:
|
||||
ZlibDataWriter(AbstractDataWriter* dataWriter);
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
private:
|
||||
// BDataOutput
|
||||
virtual status_t Write(const void* buffer, size_t size);
|
||||
virtual status_t WriteData(const void* buffer, size_t size);
|
||||
|
||||
private:
|
||||
AbstractDataWriter* fDataWriter;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
// BAbstractBufferedDataReader
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output);
|
||||
BDataOutput* output);
|
||||
|
||||
public:
|
||||
static const size_t kChunkSize = 64 * 1024;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <package/hpkg/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/DataWriters.h>
|
||||
#include <package/hpkg/PackageWriter.h>
|
||||
#include <package/hpkg/Strings.h>
|
||||
|
||||
+12
-3
@@ -2,13 +2,17 @@
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
#define _PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
#ifndef _PACKAGE__HPKG__PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
#define _PACKAGE__HPKG__PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
@@ -20,4 +24,9 @@ public:
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
#endif // _PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__HPKG__PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
@@ -8,10 +8,7 @@
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#include <ZlibCompressionBase.h>
|
||||
|
||||
|
||||
class BDataIO;
|
||||
#include <package/hpkg/ZlibCompressionBase.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -19,12 +16,15 @@ namespace BPackageKit {
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BDataOutput;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class ZlibCompressor : public ::BPrivate::ZlibCompressionBase {
|
||||
class ZlibCompressor : public ZlibCompressionBase {
|
||||
public:
|
||||
ZlibCompressor(BDataIO* output);
|
||||
ZlibCompressor(BDataOutput* output);
|
||||
~ZlibCompressor();
|
||||
|
||||
status_t Init(int compressionLevel = Z_BEST_COMPRESSION);
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
private:
|
||||
z_stream fStream;
|
||||
BDataIO* fOutput;
|
||||
BDataOutput* fOutput;
|
||||
bool fStreamInitialized;
|
||||
};
|
||||
|
||||
|
||||
+16
-6
@@ -2,16 +2,21 @@
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
#define _PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
#ifndef _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
#define _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#include <ZlibCompressionBase.h>
|
||||
#include <package/hpkg/ZlibCompressionBase.h>
|
||||
|
||||
|
||||
class BDataIO;
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BDataOutput;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
@@ -19,7 +24,7 @@ namespace BPrivate {
|
||||
|
||||
class ZlibDecompressor : public ZlibCompressionBase {
|
||||
public:
|
||||
ZlibDecompressor(BDataIO* output);
|
||||
ZlibDecompressor(BDataOutput* output);
|
||||
~ZlibDecompressor();
|
||||
|
||||
status_t Init();
|
||||
@@ -34,7 +39,7 @@ public:
|
||||
|
||||
private:
|
||||
z_stream fStream;
|
||||
BDataIO* fOutput;
|
||||
BDataOutput* fOutput;
|
||||
bool fStreamInitialized;
|
||||
bool fFinished;
|
||||
};
|
||||
@@ -42,4 +47,9 @@ private:
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
@@ -75,8 +75,8 @@ HAIKU_PACKAGE_FS_SHARED_SOURCES =
|
||||
|
||||
HAIKU_PACKAGE_FS_PACKAGE_READER_SOURCES =
|
||||
BlockBufferPoolImpl.cpp
|
||||
BufferDataOutput.cpp
|
||||
BufferPool.cpp
|
||||
DataOutput.cpp
|
||||
DataReader.cpp
|
||||
ErrorOutput.cpp
|
||||
FDDataReader.cpp
|
||||
@@ -91,6 +91,10 @@ HAIKU_PACKAGE_FS_PACKAGE_READER_SOURCES =
|
||||
PackageFileHeapReader.cpp
|
||||
PackageReaderImpl.cpp
|
||||
ReaderImplBase.cpp
|
||||
|
||||
# compression
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibDecompressor.cpp
|
||||
;
|
||||
|
||||
HAIKU_PACKAGE_FS_PACKAGE_READER_SOURCES_V1 =
|
||||
@@ -111,14 +115,6 @@ Includes
|
||||
|
||||
local libSharedSources =
|
||||
NaturalCompare.cpp
|
||||
|
||||
# compression
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibDecompressor.cpp
|
||||
;
|
||||
|
||||
local supportKitSources =
|
||||
DataIO.cpp
|
||||
;
|
||||
|
||||
|
||||
@@ -129,7 +125,6 @@ KernelAddon packagefs
|
||||
$(HAIKU_PACKAGE_FS_PACKAGE_READER_SOURCES)
|
||||
$(HAIKU_PACKAGE_FS_PACKAGE_READER_SOURCES_V1)
|
||||
$(libSharedSources)
|
||||
$(supportKitSources)
|
||||
|
||||
: $(TARGET_KERNEL_LIBSUPC++) kernel_libz.a
|
||||
;
|
||||
@@ -143,5 +138,3 @@ SEARCH on [ FGristFiles $(HAIKU_PACKAGE_FS_PACKAGE_READER_SOURCES_V1) ]
|
||||
+= [ FDirName $(HAIKU_TOP) src kits package hpkg v1 ] ;
|
||||
SEARCH on [ FGristFiles $(libSharedSources) ]
|
||||
+= [ FDirName $(HAIKU_TOP) src kits shared ] ;
|
||||
SEARCH on [ FGristFiles $(supportKitSources) ]
|
||||
+= [ FDirName $(HAIKU_TOP) src kits support ] ;
|
||||
|
||||
@@ -31,7 +31,7 @@ page_physical_number_less(const vm_page* a, const vm_page* b)
|
||||
// #pragma mark - PagesDataOutput
|
||||
|
||||
|
||||
struct CachedDataReader::PagesDataOutput : public BDataIO {
|
||||
struct CachedDataReader::PagesDataOutput : public BDataOutput {
|
||||
PagesDataOutput(vm_page** pages, size_t pageCount)
|
||||
:
|
||||
fPages(pages),
|
||||
@@ -40,7 +40,7 @@ struct CachedDataReader::PagesDataOutput : public BDataIO {
|
||||
{
|
||||
}
|
||||
|
||||
virtual status_t Write(const void* buffer, size_t size)
|
||||
virtual status_t WriteData(const void* buffer, size_t size)
|
||||
{
|
||||
while (size > 0) {
|
||||
if (fPageCount == 0)
|
||||
@@ -67,11 +67,6 @@ struct CachedDataReader::PagesDataOutput : public BDataIO {
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
virtual ssize_t Read(void* buffer, size_t size)
|
||||
{
|
||||
return B_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
private:
|
||||
vm_page** fPages;
|
||||
size_t fPageCount;
|
||||
@@ -137,7 +132,7 @@ CachedDataReader::ReadData(off_t offset, void* buffer, size_t size)
|
||||
|
||||
status_t
|
||||
CachedDataReader::ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output)
|
||||
BDataOutput* output)
|
||||
{
|
||||
if (offset > fCache->virtual_end
|
||||
|| (off_t)size > fCache->virtual_end - offset) {
|
||||
@@ -173,7 +168,7 @@ CachedDataReader::ReadDataToOutput(off_t offset, size_t size,
|
||||
|
||||
status_t
|
||||
CachedDataReader::_ReadCacheLine(off_t lineOffset, size_t lineSize,
|
||||
off_t requestOffset, size_t requestLength, BDataIO* output)
|
||||
off_t requestOffset, size_t requestLength, BDataOutput* output)
|
||||
{
|
||||
PRINT("CachedDataReader::_ReadCacheLine(%" B_PRIdOFF ", %zu, %" B_PRIdOFF
|
||||
", %zu, %p\n", lineOffset, lineSize, requestOffset, requestLength,
|
||||
@@ -371,7 +366,7 @@ CachedDataReader::_CachePages(vm_page** pages, size_t firstPage,
|
||||
*/
|
||||
status_t
|
||||
CachedDataReader::_WritePages(vm_page** pages, size_t pagesRelativeOffset,
|
||||
size_t requestLength, BDataIO* output)
|
||||
size_t requestLength, BDataOutput* output)
|
||||
{
|
||||
PRINT("%p->CachedDataReader::_WritePages(%" B_PRIuSIZE ", %" B_PRIuSIZE
|
||||
", %p)\n", this, pagesRelativeOffset, requestLength, output);
|
||||
@@ -394,7 +389,7 @@ CachedDataReader::_WritePages(vm_page** pages, size_t pagesRelativeOffset,
|
||||
|
||||
// write the page's data
|
||||
size_t toCopy = std::min(B_PAGE_SIZE - inPageOffset, requestLength);
|
||||
error = output->Write((uint8*)(address + inPageOffset), toCopy);
|
||||
error = output->WriteData((uint8*)(address + inPageOffset), toCopy);
|
||||
|
||||
// unmap the page
|
||||
vm_put_physical_page(address, handle);
|
||||
|
||||
@@ -15,12 +15,10 @@
|
||||
|
||||
|
||||
using BPackageKit::BHPKG::BAbstractBufferedDataReader;
|
||||
using BPackageKit::BHPKG::BDataOutput;
|
||||
using BPackageKit::BHPKG::BDataReader;
|
||||
|
||||
|
||||
class BDataIO;
|
||||
|
||||
|
||||
class CachedDataReader : public BAbstractBufferedDataReader {
|
||||
public:
|
||||
CachedDataReader();
|
||||
@@ -32,7 +30,7 @@ public:
|
||||
virtual status_t ReadData(off_t offset, void* buffer,
|
||||
size_t size);
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output);
|
||||
BDataOutput* output);
|
||||
|
||||
private:
|
||||
class CacheLineLocker
|
||||
@@ -123,7 +121,7 @@ private:
|
||||
private:
|
||||
status_t _ReadCacheLine(off_t lineOffset,
|
||||
size_t lineSize, off_t requestOffset,
|
||||
size_t requestLength, BDataIO* output);
|
||||
size_t requestLength, BDataOutput* output);
|
||||
|
||||
void _DiscardPages(vm_page** pages, size_t firstPage,
|
||||
size_t pageCount);
|
||||
@@ -131,7 +129,7 @@ private:
|
||||
size_t pageCount);
|
||||
status_t _WritePages(vm_page** pages,
|
||||
size_t pagesRelativeOffset,
|
||||
size_t requestLength, BDataIO* output);
|
||||
size_t requestLength, BDataOutput* output);
|
||||
status_t _ReadIntoPages(vm_page** pages,
|
||||
size_t firstPage, size_t pageCount);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
using namespace BPackageKit;
|
||||
|
||||
using BPackageKit::BHPKG::BDataOutput;
|
||||
using BPackageKit::BHPKG::BErrorOutput;
|
||||
using BPackageKit::BHPKG::BFDDataReader;
|
||||
using BPackageKit::BHPKG::BPackageInfoAttributeValue;
|
||||
|
||||
@@ -29,7 +29,7 @@ using namespace BPackageKit::BHPKG;
|
||||
// #pragma mark - DataAccessor
|
||||
|
||||
|
||||
struct PackageFile::IORequestOutput : BDataIO {
|
||||
struct PackageFile::IORequestOutput : BDataOutput {
|
||||
public:
|
||||
IORequestOutput(io_request* request)
|
||||
:
|
||||
@@ -37,16 +37,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual status_t Write(const void* buffer, size_t size)
|
||||
virtual status_t WriteData(const void* buffer, size_t size)
|
||||
{
|
||||
RETURN_ERROR(write_to_io_request(fRequest, buffer, size));
|
||||
}
|
||||
|
||||
virtual ssize_t Read(void* buffer, size_t size)
|
||||
{
|
||||
return B_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
private:
|
||||
io_request* fRequest;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SubDir HAIKU_TOP src build libpackage ;
|
||||
|
||||
UsePrivateBuildHeaders kernel package shared storage support ;
|
||||
UsePrivateBuildHeaders kernel package shared storage ;
|
||||
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package hpkg ] ;
|
||||
@@ -33,9 +33,9 @@ HPKG_SOURCES =
|
||||
BlockBufferPool.cpp
|
||||
BlockBufferPoolImpl.cpp
|
||||
BlockBufferPoolNoLock.cpp
|
||||
BufferDataOutput.cpp
|
||||
BufferPool.cpp
|
||||
PoolBuffer.cpp
|
||||
DataOutput.cpp
|
||||
DataReader.cpp
|
||||
DataWriters.cpp
|
||||
ErrorOutput.cpp
|
||||
@@ -77,7 +77,9 @@ HPKG_SOURCES =
|
||||
ReaderImplBaseV1.cpp
|
||||
|
||||
# compression
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibCompressor.cpp
|
||||
ZlibDecompressor.cpp
|
||||
;
|
||||
|
||||
# TODO: remove this hack once gcc2 has -iquote implemented
|
||||
|
||||
@@ -10,8 +10,4 @@ BuildPlatformStaticLibraryPIC libshared_build.a :
|
||||
Keymap.cpp
|
||||
NaturalCompare.cpp
|
||||
SHA256.cpp
|
||||
|
||||
# compression
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibDecompressor.cpp
|
||||
;
|
||||
|
||||
@@ -13,9 +13,9 @@ HPKG_SOURCES =
|
||||
BlockBufferPool.cpp
|
||||
BlockBufferPoolImpl.cpp
|
||||
BlockBufferPoolNoLock.cpp
|
||||
BufferDataOutput.cpp
|
||||
BufferPool.cpp
|
||||
CommitTransactionResult.cpp
|
||||
DataOutput.cpp
|
||||
DataReader.cpp
|
||||
DataWriters.cpp
|
||||
ErrorOutput.cpp
|
||||
@@ -58,7 +58,9 @@ HPKG_SOURCES =
|
||||
ReaderImplBaseV1.cpp
|
||||
|
||||
# compression
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibCompressor.cpp
|
||||
ZlibDecompressor.cpp
|
||||
;
|
||||
|
||||
local architectureObject ;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -14,6 +14,14 @@ namespace BPackageKit {
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
// #pragma mark - BDataOutput
|
||||
|
||||
|
||||
BDataOutput::~BDataOutput()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - BBufferDataOutput
|
||||
|
||||
|
||||
@@ -27,7 +35,7 @@ BBufferDataOutput::BBufferDataOutput(void* buffer, size_t size)
|
||||
|
||||
|
||||
status_t
|
||||
BBufferDataOutput::Write(const void* buffer, size_t size)
|
||||
BBufferDataOutput::WriteData(const void* buffer, size_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
return B_OK;
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <package/hpkg/DataReader.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <DataIO.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -71,7 +70,7 @@ BBufferDataReader::ReadData(off_t offset, void* buffer, size_t size)
|
||||
|
||||
status_t
|
||||
BBufferDataReader::ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output)
|
||||
BDataOutput* output)
|
||||
{
|
||||
if (size == 0)
|
||||
return B_OK;
|
||||
@@ -82,7 +81,7 @@ BBufferDataReader::ReadDataToOutput(off_t offset, size_t size,
|
||||
if (size > fSize || offset > (off_t)fSize - (off_t)size)
|
||||
return B_ERROR;
|
||||
|
||||
return output->Write((const uint8*)fData + offset, size);
|
||||
return output->WriteData((const uint8*)fData + offset, size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ ZlibDataWriter::WriteDataNoThrow(const void* buffer,
|
||||
|
||||
|
||||
status_t
|
||||
ZlibDataWriter::Write(const void* buffer, size_t size)
|
||||
ZlibDataWriter::WriteData(const void* buffer, size_t size)
|
||||
{
|
||||
return fDataWriter->WriteDataNoThrow(buffer, size);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <package/hpkg/HPKGDefsPrivate.h>
|
||||
#include <package/hpkg/PackageData.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
}
|
||||
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output)
|
||||
BDataOutput* output)
|
||||
{
|
||||
if (size == 0)
|
||||
return B_OK;
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
#include <new>
|
||||
|
||||
#include <ByteOrder.h>
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/ErrorOutput.h>
|
||||
|
||||
#include <AutoDeleter.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -140,7 +140,7 @@ PackageFileHeapAccessorBase::~PackageFileHeapAccessorBase()
|
||||
|
||||
status_t
|
||||
PackageFileHeapAccessorBase::ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output)
|
||||
BDataOutput* output)
|
||||
{
|
||||
if (size == 0)
|
||||
return B_OK;
|
||||
@@ -174,8 +174,8 @@ PackageFileHeapAccessorBase::ReadDataToOutput(off_t offset, size_t size,
|
||||
// The last chunk may be shorter than kChunkSize, but since
|
||||
// size (and thus remainingSize) had been clamped, that doesn't
|
||||
// harm.
|
||||
error = output->Write((char*)uncompressedDataBuffer + inChunkOffset,
|
||||
toWrite);
|
||||
error = output->WriteData(
|
||||
(char*)uncompressedDataBuffer + inChunkOffset, toWrite);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
@@ -213,7 +213,7 @@ PackageFileHeapAccessorBase::DecompressChunkData(void* compressedDataBuffer,
|
||||
size_t uncompressedSize)
|
||||
{
|
||||
size_t actualSize;
|
||||
status_t error = ::BPrivate::ZlibDecompressor::DecompressSingleBuffer(
|
||||
status_t error = ZlibDecompressor::DecompressSingleBuffer(
|
||||
compressedDataBuffer, compressedSize, uncompressedDataBuffer,
|
||||
uncompressedSize, actualSize);
|
||||
if (error != B_OK) {
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
#include <package/hpkg/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/PackageData.h>
|
||||
#include <package/hpkg/PackageEntry.h>
|
||||
#include <package/hpkg/PackageEntryAttribute.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <package/hpkg/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/DataReader.h>
|
||||
#include <package/hpkg/PackageFileHeapWriter.h>
|
||||
#include <package/hpkg/PackageReaderImpl.h>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
#include <package/hpkg/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/PackageFileHeapReader.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
+9
-1
@@ -4,13 +4,17 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <ZlibCompressionBase.h>
|
||||
#include <package/hpkg/ZlibCompressionBase.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
@@ -44,3 +48,7 @@ ZlibCompressionBase::TranslateZlibError(int error)
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -22,7 +22,7 @@ namespace BPrivate {
|
||||
static const size_t kOutputBufferSize = 1024;
|
||||
|
||||
|
||||
ZlibCompressor::ZlibCompressor(BDataIO* output)
|
||||
ZlibCompressor::ZlibCompressor(BDataOutput* output)
|
||||
:
|
||||
fOutput(output),
|
||||
fStreamInitialized(false)
|
||||
@@ -82,7 +82,7 @@ ZlibCompressor::CompressNext(const void* input, size_t inputSize)
|
||||
return TranslateZlibError(zlibError);
|
||||
|
||||
if (fStream.avail_out < sizeof(outputBuffer)) {
|
||||
status_t error = fOutput->Write(outputBuffer,
|
||||
status_t error = fOutput->WriteData(outputBuffer,
|
||||
sizeof(outputBuffer) - fStream.avail_out);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
@@ -109,7 +109,7 @@ ZlibCompressor::Finish()
|
||||
return TranslateZlibError(zlibError);
|
||||
|
||||
if (fStream.avail_out < sizeof(outputBuffer)) {
|
||||
status_t error = fOutput->Write(outputBuffer,
|
||||
status_t error = fOutput->WriteData(outputBuffer,
|
||||
sizeof(outputBuffer) - fStream.avail_out);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
@@ -4,14 +4,18 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <DataIO.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
@@ -19,7 +23,7 @@ namespace BPrivate {
|
||||
static const size_t kOutputBufferSize = 1024;
|
||||
|
||||
|
||||
ZlibDecompressor::ZlibDecompressor(BDataIO* output)
|
||||
ZlibDecompressor::ZlibDecompressor(BDataOutput* output)
|
||||
:
|
||||
fOutput(output),
|
||||
fStreamInitialized(false),
|
||||
@@ -85,7 +89,7 @@ ZlibDecompressor::DecompressNext(const void* input, size_t inputSize)
|
||||
return TranslateZlibError(zlibError);
|
||||
|
||||
if (fStream.avail_out < sizeof(outputBuffer)) {
|
||||
status_t error = fOutput->Write(outputBuffer,
|
||||
status_t error = fOutput->WriteData(outputBuffer,
|
||||
sizeof(outputBuffer) - fStream.avail_out);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
@@ -114,7 +118,7 @@ ZlibDecompressor::Finish()
|
||||
return TranslateZlibError(zlibError);
|
||||
|
||||
if (fStream.avail_out < sizeof(outputBuffer)) {
|
||||
status_t error = fOutput->Write(outputBuffer,
|
||||
status_t error = fOutput->WriteData(outputBuffer,
|
||||
sizeof(outputBuffer) - fStream.avail_out);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
@@ -182,3 +186,7 @@ ZlibDecompressor::DecompressSingleBuffer(const void* input, size_t inputSize,
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
@@ -11,12 +11,12 @@
|
||||
#include <algorithm>
|
||||
#include <new>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/BufferPool.h>
|
||||
#include <package/hpkg/PoolBuffer.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/v1/HPKGDefsPrivate.h>
|
||||
#include <package/hpkg/v1/PackageData.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -27,7 +27,7 @@ namespace V1 {
|
||||
|
||||
|
||||
using BHPKG::BPrivate::PoolBufferPutter;
|
||||
using ::BPrivate::ZlibDecompressor;
|
||||
using BHPKG::BPrivate::ZlibDecompressor;
|
||||
|
||||
|
||||
// minimum/maximum zlib chunk size we consider sane
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
}
|
||||
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output)
|
||||
BDataOutput* output)
|
||||
{
|
||||
if (size == 0)
|
||||
return B_OK;
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
return error;
|
||||
|
||||
// write to the output
|
||||
error = output->Write(buffer->Buffer(), toRead);
|
||||
error = output->WriteData(buffer->Buffer(), toRead);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
}
|
||||
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output)
|
||||
BDataOutput* output)
|
||||
{
|
||||
// check offset and size
|
||||
if (size == 0)
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
|
||||
// write data to output
|
||||
size_t toCopy = std::min(size, (size_t)fChunkSize - inChunkOffset);
|
||||
error = output->Write(
|
||||
error = output->WriteData(
|
||||
(uint8*)fUncompressBuffer->Buffer() + inChunkOffset, toCopy);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
#include <package/hpkg/v1/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/ErrorOutput.h>
|
||||
#include <package/hpkg/v1/PackageData.h>
|
||||
#include <package/hpkg/v1/PackageEntry.h>
|
||||
#include <package/hpkg/v1/PackageEntryAttribute.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
#include <package/hpkg/v1/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/ErrorOutput.h>
|
||||
#include <ZlibDecompressor.h>
|
||||
#include <package/hpkg/ZlibDecompressor.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -33,7 +33,7 @@ namespace V1 {
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
using ::BPrivate::ZlibDecompressor;
|
||||
using BHPKG::BPrivate::ZlibDecompressor;
|
||||
|
||||
|
||||
static const size_t kScratchBufferSize = 64 * 1024;
|
||||
|
||||
@@ -11,8 +11,6 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
on $(architectureObject) {
|
||||
local architecture = $(TARGET_PACKAGING_ARCH) ;
|
||||
|
||||
UseBuildFeatureHeaders zlib ;
|
||||
|
||||
UseHeaders [ FDirName
|
||||
$(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCHS[1]))
|
||||
servers input ] ;
|
||||
@@ -23,9 +21,6 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
# for RWLockManager only
|
||||
UsePrivateSystemHeaders ;
|
||||
UsePrivateHeaders kernel libroot ;
|
||||
|
||||
Includes [ FGristFiles $(HPKG_SOURCES) ]
|
||||
: [ BuildFeatureAttribute zlib : headers ] ;
|
||||
|
||||
StaticLibrary [ MultiArchDefaultGristFiles libshared.a ] :
|
||||
AboutMenuItem.cpp
|
||||
@@ -52,10 +47,6 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
TextTable.cpp
|
||||
Thread.cpp
|
||||
Variant.cpp
|
||||
|
||||
# compression
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibDecompressor.cpp
|
||||
;
|
||||
|
||||
Includes [ FGristFiles Keymap.cpp ]
|
||||
|
||||
@@ -13,8 +13,6 @@ SubDirC++Flags -fno-rtti -include $(kernelC++Header) ;
|
||||
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package hpkg ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits shared ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits support ] ;
|
||||
|
||||
|
||||
BootStaticLibrary boot_packagefs :
|
||||
@@ -27,9 +25,9 @@ BootStaticLibrary boot_packagefs :
|
||||
BlockBufferPool.cpp
|
||||
BlockBufferPoolImpl.cpp
|
||||
BlockBufferPoolNoLock.cpp
|
||||
BufferDataOutput.cpp
|
||||
BufferPool.cpp
|
||||
PoolBuffer.cpp
|
||||
DataOutput.cpp
|
||||
DataReader.cpp
|
||||
ErrorOutput.cpp
|
||||
FDDataReader.cpp
|
||||
@@ -44,7 +42,6 @@ BootStaticLibrary boot_packagefs :
|
||||
ReaderImplBase.cpp
|
||||
|
||||
# compression
|
||||
DataIO.cpp
|
||||
ZlibCompressionBase.cpp
|
||||
ZlibDecompressor.cpp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user