]> www.wagner.pp.ru Git - oss/catdoc.git/blob - src/ole.h
Added all the history to NEWS file
[oss/catdoc.git] / src / ole.h
1 /**
2  * @file   ole.h
3  * @author Alex Ott <ott@jet.msk.su>
4  * @date   03 éÀΠ2003
5  * Version: $Id: ole.h,v 1.1 2006-02-24 17:44:06 vitus Exp $
6  * Copyright: Alex Ott, 2003, 
7  * 
8  * @brief  
9  * 
10  * 
11  */
12
13 #ifndef _OLE_H
14 #define _OLE_H 1
15
16 #define BBD_BLOCK_SIZE     512
17 #define SBD_BLOCK_SIZE      64
18 #define PROP_BLOCK_SIZE    128
19 #define OLENAMELENGTH       32
20 #define MSAT_ORIG_SIZE     436
21
22 typedef enum {
23         oleDir=1,
24         oleStream=2,
25         oleRootDir=5,
26         oleUnknown=3
27 } oleType;
28
29 typedef struct {
30         FILE *file;
31         char name[OLENAMELENGTH+1];
32         long int startBlock;
33         long int curBlock;
34         unsigned long int length;
35         long int ole_offset;
36         long int file_offset;
37         unsigned char *dirPos;
38         oleType type;
39         long int numOfBlocks;
40         long int *blocks;                       /**< array of blocks numbers */
41         int isBigBlock;
42 } oleEntry;
43
44 /**
45  * Functions
46  * 
47  */
48 FILE* ole_init(FILE *f, void *buffer, size_t bufSize);
49 FILE *ole_readdir(FILE *f);
50 int ole_seek(FILE *stream, long offset, int whence);
51 long ole_tell(FILE *stream);
52 int ole_eof(FILE *stream);
53 size_t ole_read(void *ptr, size_t size, size_t nmemb, FILE *stream);
54 int ole_open(FILE *);
55 int ole_close(FILE *);
56 void ole_finish(void);
57
58 extern size_t (*catdoc_read)(void *ptr, size_t size, size_t nmemb, FILE *stream);
59 extern int (*catdoc_eof)(FILE *stream);
60 extern int (*catdoc_seek)(FILE *stream, long offset, int whence);
61 extern long (*catdoc_tell)(FILE *stream);
62
63 void set_ole_func(void);
64 void set_std_func(void);
65
66 #endif /* _OLE_H */
67