MsOlePropertySetID
typedef enum {
MS_OLE_PS_SUMMARY_INFO,
MS_OLE_PS_DOCUMENT_SUMMARY_INFO,
MS_OLE_PS_USER_DEFINED_SUMMARY_INFO
} MsOlePropertySetID;
MsOleSummary
typedef struct {
guint8 class_id[16];
GArray * sections;
GArray * items;
GList * write_items;
gboolean read_mode;
MsOleStream * s;
MsOlePropertySetID ps_id;
} MsOleSummary;
MsOleSummarySection
typedef struct {
guint32 offset;
guint32 props;
guint32 bytes;
MsOlePropertySetID ps_id;
} MsOleSummarySection;
ms_ole_summary_open
MsOleSummary *
MsOle *f
ms_ole_docsummary_open
MsOleSummary *
MsOle *f
ms_ole_summary_open_stream
MsOleSummary *
MsOleStream *stream,const MsOlePropertySetID psid
ms_ole_summary_create
MsOleSummary *
MsOle *f
ms_ole_docsummary_create
MsOleSummary *
MsOle *f
ms_ole_summary_create_stream
MsOleSummary *
MsOleStream *s,const MsOlePropertySetID psid
ms_ole_summary_get_properties
GArray *
MsOleSummary *si
ms_ole_summary_close
void
MsOleSummary *si
MsOleSummaryType
typedef enum {
MS_OLE_SUMMARY_TYPE_STRING = 0x10,
MS_OLE_SUMMARY_TYPE_TIME = 0x20,
MS_OLE_SUMMARY_TYPE_LONG = 0x30,
MS_OLE_SUMMARY_TYPE_SHORT = 0x40,
MS_OLE_SUMMARY_TYPE_BOOLEAN = 0x50,
MS_OLE_SUMMARY_TYPE_OTHER = 0x60
} MsOleSummaryType;
MS_OLE_SUMMARY_TYPE
#define MS_OLE_SUMMARY_TYPE(x) ((MsOleSummaryType)((x)>>8))
MsOleSummaryPID
typedef enum {
/* SummaryInformation Stream Properties */
/* String properties */
MS_OLE_SUMMARY_TITLE = 0x1002,
MS_OLE_SUMMARY_SUBJECT = 0x1003,
MS_OLE_SUMMARY_AUTHOR = 0x1004,
MS_OLE_SUMMARY_KEYWORDS = 0x1005,
MS_OLE_SUMMARY_COMMENTS = 0x1006,
MS_OLE_SUMMARY_TEMPLATE = 0x1007,
MS_OLE_SUMMARY_LASTAUTHOR = 0x1008,
MS_OLE_SUMMARY_REVNUMBER = 0x1009,
MS_OLE_SUMMARY_APPNAME = 0x1012,
/* Time properties */
MS_OLE_SUMMARY_TOTAL_EDITTIME = 0x200A,
MS_OLE_SUMMARY_LASTPRINTED = 0x200B,
MS_OLE_SUMMARY_CREATED = 0x200C,
MS_OLE_SUMMARY_LASTSAVED = 0x200D,
/* Long integer properties */
MS_OLE_SUMMARY_PAGECOUNT = 0x300E,
MS_OLE_SUMMARY_WORDCOUNT = 0x300F,
MS_OLE_SUMMARY_CHARCOUNT = 0x3010,
MS_OLE_SUMMARY_SECURITY = 0x3013,
/* Short integer properties */
MS_OLE_SUMMARY_CODEPAGE = 0x4001,
/* Security */
MS_OLE_SUMMARY_THUMBNAIL = 0x6011,
/* DocumentSummaryInformation Properties */
/* String properties */
MS_OLE_SUMMARY_CATEGORY = 0x1002,
MS_OLE_SUMMARY_PRESFORMAT = 0x1003,
MS_OLE_SUMMARY_MANAGER = 0x100E,
MS_OLE_SUMMARY_COMPANY = 0x100F,
/* Long integer properties */
MS_OLE_SUMMARY_BYTECOUNT = 0x3004,
MS_OLE_SUMMARY_LINECOUNT = 0x3005,
MS_OLE_SUMMARY_PARCOUNT = 0x3006,
MS_OLE_SUMMARY_SLIDECOUNT = 0x3007,
MS_OLE_SUMMARY_NOTECOUNT = 0x3008,
MS_OLE_SUMMARY_HIDDENCOUNT = 0x3009,
MS_OLE_SUMMARY_MMCLIPCOUNT = 0X300A,
/* Boolean properties */
MS_OLE_SUMMARY_SCALE = 0x500B,
MS_OLE_SUMMARY_LINKSDIRTY = 0x5010
} MsOleSummaryPID;
MsOleSummaryAllSecurityFlagsEqNone
#define MsOleSummaryAllSecurityFlagsEqNone 0x00
MsOleSummarySecurityPassworded
#define MsOleSummarySecurityPassworded 0x01
MsOleSummarySecurityRORecommended
#define MsOleSummarySecurityRORecommended 0x02
MsOleSummarySecurityRO
#define MsOleSummarySecurityRO 0x04
MsOleSummarySecurityLockedForAnnotations
#define MsOleSummarySecurityLockedForAnnotations 0x08
MsOleSummaryTime
typedef struct {
GTimeVal time;
GDate date;
} MsOleSummaryTime;
MsOleSummaryPreview
typedef struct {
guint32 len;
guint8 *data;
} MsOleSummaryPreview;
ms_ole_summary_get_string
gchar *
MsOleSummary *si,MsOleSummaryPID id,gboolean *available
ms_ole_summary_get_boolean
gboolean
MsOleSummary *si,MsOleSummaryPID id,gboolean *available
ms_ole_summary_get_short
guint16
MsOleSummary *si,MsOleSummaryPID id,gboolean *available
ms_ole_summary_get_long
guint32
MsOleSummary *si,MsOleSummaryPID id,gboolean *available
ms_ole_summary_get_time
GTimeVal
MsOleSummary *si,MsOleSummaryPID id,gboolean *available
ms_ole_summary_get_preview
MsOleSummaryPreview
MsOleSummary *si,MsOleSummaryPID id,gboolean *available
ms_ole_summary_preview_destroy
void
MsOleSummaryPreview d
ms_ole_summary_set_string
void
MsOleSummary *si,MsOleSummaryPID id,const gchar *str
ms_ole_summary_set_boolean
void
MsOleSummary *si,MsOleSummaryPID id,gboolean bool
ms_ole_summary_set_short
void
MsOleSummary *si,MsOleSummaryPID id,guint16 i
ms_ole_summary_set_long
void
MsOleSummary *si,MsOleSummaryPID id,guint32 i
ms_ole_summary_set_time
void
MsOleSummary *si,MsOleSummaryPID id,GTimeVal time
ms_ole_summary_set_preview
void
MsOleSummary *si,MsOleSummaryPID id,constMsOleSummaryPreview *preview
MsOleErr
typedef enum {
MS_OLE_ERR_OK,
MS_OLE_ERR_EXIST,
MS_OLE_ERR_INVALID,
MS_OLE_ERR_FORMAT,
MS_OLE_ERR_PERM,
MS_OLE_ERR_MEM,
MS_OLE_ERR_SPACE,
MS_OLE_ERR_NOTEMPTY,
MS_OLE_ERR_BADARG
} MsOleErr;
MsOleSysWrappers
MsOleSysWrappers
struct MsOleSysWrappers {
int (*open2) (const char *pathname, int flags);
int (*open3) (const char *pathname, int flags, mode_t mode);
ssize_t (*read) (int fd, void *buf, size_t count);
int (*close) (int fd);
ssize_t (*write) (int fd, const void *buf, size_t count);
off_t (*lseek) (int fd, off_t offset, int whence);
int (*isregfile) (int fd);
int (*getfilesize) (int fd, guint32 *size);
};
MsOleSeek
typedef enum {
MsOleSeekSet,
MsOleSeekCur,
MsOleSeekEnd
} MsOleSeek;
MsOlePos
typedef guint32 MsOlePos;
MsOleSPos
typedef gint32 MsOleSPos;
MsOle
MsOleType
typedef enum {
MsOleStorageT = 1,
MsOleStreamT = 2,
MsOleRootT = 5
} MsOleType;
MsOleStat
MsOleStat
struct MsOleStat {
MsOleType type;
MsOlePos size;
};
ms_ole_open
#define ms_ole_open(fs,path) ms_ole_open_vfs ((fs), (path), TRUE, NULL)
ms_ole_open_vfs
MsOleErr
MsOle **fs,const char *path,gboolean try_mmap,MsOleSysWrappers *wrappers
ms_ole_create
#define ms_ole_create(fs,path) ms_ole_create_vfs ((fs), (path), TRUE, NULL)
ms_ole_create_vfs
MsOleErr
MsOle **fs,const char *path,int try_mmap,MsOleSysWrappers *wrappers
ms_ole_destroy
void
MsOle **fs
ms_ole_unlink
MsOleErr
MsOle *fs,const char *path
ms_ole_directory
MsOleErr
char ***names,MsOle *fs,const char *dirpath
ms_ole_stat
MsOleErr
MsOleStat *stat,MsOle *fs,const char *dirpath,const char *name
MsOleStream
MsOleStream
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 */
};
MS_OLE_GET_GUINT8
#define MS_OLE_GET_GUINT8(p) (*((const guint8 *)(p) + 0))
MS_OLE_GET_GUINT16
#define MS_OLE_GET_GUINT16(p) (guint16)(*((const guint8 *)(p)+0) | \
(*((const guint8 *)(p)+1)<<8))
MS_OLE_GET_GUINT32
#define MS_OLE_GET_GUINT32(p) (guint32)(*((const guint8 *)(p)+0) | \
(*((const guint8 *)(p)+1)<<8) | \
(*((const guint8 *)(p)+2)<<16) | \
(*((const guint8 *)(p)+3)<<24))
MS_OLE_GET_GUINT64
#define MS_OLE_GET_GUINT64(p) (MS_OLE_GET_GUINT32(p) | \
(((guint32)MS_OLE_GET_GUINT32((const guint8 *)(p)+4))<<32))
MS_OLE_SET_GUINT8
#define MS_OLE_SET_GUINT8(p,n) (*((guint8 *)(p) + 0) = n)
MS_OLE_SET_GUINT16
#define MS_OLE_SET_GUINT16(p,n) ((*((guint8 *)(p)+0)=((n)&0xff)), \
(*((guint8 *)(p)+1)=((n)>>8)&0xff))
MS_OLE_SET_GUINT32
#define MS_OLE_SET_GUINT32(p,n) ((*((guint8 *)(p)+0)=((n))&0xff), \
(*((guint8 *)(p)+1)=((n)>>8)&0xff), \
(*((guint8 *)(p)+2)=((n)>>16)&0xff), \
(*((guint8 *)(p)+3)=((n)>>24)&0xff))
ms_ole_stream_open
MsOleErr
MsOleStream ** const stream,MsOle *fs,const char *dirpath,const char *name,char mode
ms_ole_stream_close
MsOleErr
MsOleStream ** const stream
ms_ole_stream_duplicate
MsOleErr
MsOleStream **const stream_copy,const MsOleStream *const stream
ms_ole_dump
void
guint8 const *ptr,guint32 len
ms_ole_ref
void
MsOle *fs
ms_ole_unref
void
MsOle *fs
ms_ole_debug
void
MsOle *fs,int magic
libole2_major_version
extern int libole2_major_version;
libole2_minor_version
extern int libole2_minor_version;
libole2_micro_version
extern int libole2_micro_version;
LIBOLE2_MAJOR_VERSION
#define LIBOLE2_MAJOR_VERSION 0
LIBOLE2_MINOR_VERSION
#define LIBOLE2_MINOR_VERSION 1
LIBOLE2_MICRO_VERSION
#define LIBOLE2_MICRO_VERSION 0