libopc
|
Go to the source code of this file.
Data Structures | |
struct | OPC_ZIP_SEGMENT_INFO_STRUCT |
Macros | |
#define | OPC_DEFAULT_GROWTH_HINT 512 |
Typedefs | |
typedef struct OPC_ZIP_STRUCT | opcZip |
typedef struct OPC_ZIPINPUTSTREAM_STRUCT | opcZipInputStream |
typedef struct OPC_ZIPOUTPUTSTREAM_STRUCT | opcZipOutputStream |
typedef struct OPC_ZIP_SEGMENT_INFO_STRUCT | opcZipSegmentInfo_t |
typedef int | opcZipLoaderOpenCallback(void *iocontext) |
typedef int | opcZipLoaderSkipCallback(void *iocontext) |
typedef int | opcZipLoaderReadCallback(void *iocontext, char *buffer, int len) |
typedef int | opcZipLoaderCloseCallback(void *iocontext) |
typedef opc_error_t( | opcZipLoaderSegmentCallback_t) (void *iocontext, void *userctx, opcZipSegmentInfo_t *info, opcZipLoaderOpenCallback *open, opcZipLoaderReadCallback *read, opcZipLoaderCloseCallback *close, opcZipLoaderSkipCallback *skip) |
typedef opc_error_t( | opcZipSegmentReleaseCallback) (opcZip *zip, opc_uint32_t segment_id) |
The ZIP file backend of an OPC container.
#define OPC_DEFAULT_GROWTH_HINT 512 |
Default growth hint of an OPC stream.
typedef struct OPC_ZIP_STRUCT opcZip |
Handle to a ZIP archive.
typedef struct OPC_ZIPINPUTSTREAM_STRUCT opcZipInputStream |
Handle to a raw ZIP input stream.
typedef int opcZipLoaderCloseCallback(void *iocontext) |
typedef int opcZipLoaderOpenCallback(void *iocontext) |
typedef int opcZipLoaderReadCallback(void *iocontext, char *buffer, int len) |
typedef opc_error_t( opcZipLoaderSegmentCallback_t) (void *iocontext, void *userctx, opcZipSegmentInfo_t *info, opcZipLoaderOpenCallback *open, opcZipLoaderReadCallback *read, opcZipLoaderCloseCallback *close, opcZipLoaderSkipCallback *skip) |
typedef int opcZipLoaderSkipCallback(void *iocontext) |
typedef struct OPC_ZIPOUTPUTSTREAM_STRUCT opcZipOutputStream |
Handle to a raw ZIP output stream.
typedef struct OPC_ZIP_SEGMENT_INFO_STRUCT opcZipSegmentInfo_t |
Holds all information of a ZIP segment.
typedef opc_error_t( opcZipSegmentReleaseCallback) (opcZip *zip, opc_uint32_t segment_id) |
void opcZipClose | ( | opcZip * | zip, |
opcZipSegmentReleaseCallback * | releaseCallback | ||
) |
Closes the ZIP archive zip
and will call releaseCallback
for every segment to give the implementer a chance to free user resources.
opc_error_t opcZipCloseInputStream | ( | opcZip * | zip, |
opcZipInputStream * | stream | ||
) |
Free all resources of the input stream.
opc_error_t opcZipCloseOutputStream | ( | opcZip * | zip, |
opcZipOutputStream * | stream, | ||
opc_uint32_t * | segment_id | ||
) |
Will close the stream and free all resources. Additionally the new segment id will be stored in *segment_id
.
opc_error_t opcZipCommit | ( | opcZip * | zip, |
opc_bool_t | trim | ||
) |
Commits all buffers and writes the ZIP archives local header directories. if trim
is true then padding bytes will be removed, i.e. the ZIP file size fill be minimalized.
Creates an empty ZIP archive with the given io
.
opcZipOutputStream* opcZipCreateOutputStream | ( | opcZip * | zip, |
opc_uint32_t * | segment_id, | ||
const xmlChar * | partName, | ||
opc_bool_t | relsSegment, | ||
opc_uint32_t | segment_size, | ||
opc_uint32_t | growth_hint, | ||
opc_uint16_t | compression_method, | ||
opc_uint16_t | bit_flag | ||
) |
Creates an output stream for the segment with segment_id
. If *segment_id
is -1 then a new segment will be created. Otherwise the segment with *segment_id
will be overwritten.
opc_uint32_t opcZipCreateSegment | ( | opcZip * | zip, |
const xmlChar * | partName, | ||
opc_bool_t | relsSegment, | ||
opc_uint32_t | segment_size, | ||
opc_uint32_t | growth_hint, | ||
opc_uint16_t | compression_method, | ||
opc_uint16_t | bit_flag | ||
) |
Create a segment with the given parameters.
opc_error_t opcZipGC | ( | opcZip * | zip | ) |
Garbage collection on the passed zip
archive. This will e.g. make deleted files available as free space.
opc_uint32_t opcZipGetFirstSegmentId | ( | opcZip * | zip | ) |
Returns the first segment id or -1. Use the following code to iterarte through all segments.
opc_uint32_t opcZipGetNextSegmentId | ( | opcZip * | zip, |
opc_uint32_t | segment_id | ||
) |
Returns the next segment id or -1.
opc_error_t opcZipGetSegmentInfo | ( | opcZip * | zip, |
opc_uint32_t | segment_id, | ||
const xmlChar ** | name, | ||
opc_bool_t * | rels_segment, | ||
opc_uint32_t * | crc | ||
) |
Returns info about the given segment id.
opc_error_t opcZipLoader | ( | opcIO_t * | io, |
void * | userctx, | ||
opcZipLoaderSegmentCallback_t * | segmentCallback | ||
) |
Walks every segment in a ZIP archive and calls the segmentCallback
callback method. The implementer segmentCallback
method must then eiher use the passed open
, read
and close
methods to read the stream or the passed skip
methods to skip the stream. This method can be used to e.g. read ZIP file in stream mode.
opc_uint32_t opcZipLoadSegment | ( | opcZip * | zip, |
const xmlChar * | partName, | ||
opc_bool_t | rels_segment, | ||
opcZipSegmentInfo_t * | info | ||
) |
Load segment information into info
. If rels_segment
is -1 then load the info for part with name partName
. Otherwise load the segment information for the ".rels." segment of partName
.
opcZipInputStream* opcZipOpenInputStream | ( | opcZip * | zip, |
opc_uint32_t | segment_id | ||
) |
Creates an input stream for the segment with segment_id
.
opcZipOutputStream* opcZipOpenOutputStream | ( | opcZip * | zip, |
opc_uint32_t * | segment_id | ||
) |
Opens an existing ouput stream for reading. The *segment_id
will be set to -1 and reset on opcZipCloseOutputStream.
opc_uint32_t opcZipReadInputStream | ( | opcZip * | zip, |
opcZipInputStream * | stream, | ||
opc_uint8_t * | buf, | ||
opc_uint32_t | buf_len | ||
) |
Read maximal buf_len
bytes from the input stream into .
opc_bool_t opcZipSegmentDelete | ( | opcZip * | zip, |
opc_uint32_t * | first_segment, | ||
opc_uint32_t * | last_segment, | ||
opcZipSegmentReleaseCallback * | releaseCallback | ||
) |
opc_uint32_t opcZipWriteOutputStream | ( | opcZip * | zip, |
opcZipOutputStream * | stream, | ||
const opc_uint8_t * | buf, | ||
opc_uint32_t | buf_len | ||
) |