libole2 Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#include <libole2/libole2.h> struct MsOleStream; MsOleErr ms_ole_stream_open (MsOleStream **const stream, MsOle *fs, const char *dirpath, const char *name, char mode); MsOleErr ms_ole_stream_close (MsOleStream **const stream); MsOleErr ms_ole_stream_duplicate (MsOleStream **const stream_copy, const MsOleStream *const stream); |
struct MsOleStream { MsOlePos size; gint (*read_copy) (MsOleStream *stream, guint8 *ptr, MsOlePos length); guint8 * (*read_ptr) (MsOleStream *stream, MsOlePos length); MsOleSPos (*lseek) (MsOleStream *stream, MsOleSPos bytes, MsOleSeek type); MsOlePos (*tell) (MsOleStream *stream); MsOlePos (*write) (MsOleStream *stream, guint8 *ptr, MsOlePos length); /** * PRIVATE (do not use) **/ enum { MsOleSmallBlock, MsOleLargeBlock } type; MsOle *file; void *pps; /* Straight PPS */ GArray *blocks; /* A list of the blocks in the file if NULL: no file */ MsOlePos position; /* Current offset into file. Points to the next byte to read */ }; |
MsOleErr ms_ole_stream_open (MsOleStream **const stream, MsOle *fs, const char *dirpath, const char *name, char mode); |
Opens the stream in dirpath with the name name and creates the stream object stream. If mode is 'r' it opens read only, and if it is 'w' it opens for write only.
stream : | stream object. |
fs : | filesystem object. |
dirpath : | directory of the stream. |
name : | stream name. |
mode : | mode of opening stream. |
Returns : | a MsOleErr code. |
MsOleErr ms_ole_stream_close (MsOleStream **const stream); |
Closes the stream.
stream : | stream object to be closed. |
Returns : | a MsOleErr code. |
MsOleErr ms_ole_stream_duplicate (MsOleStream **const stream_copy, const MsOleStream *const stream); |
Duplicates the stream object stream.
stream_copy : | stream object copy. |
stream : | stream object to be duplicated. |
Returns : | a MsOleErr code. |