-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathole.h
70 lines (60 loc) · 1.71 KB
/
ole.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* @file ole.h
* @author Alex Ott <[email protected]>
* @date 03 éÀÎ 2003
* Version: $Id: ole.h,v 1.1.1.1 2006/02/24 17:44:06 vitus Exp $
* Copyright: Alex Ott, 2003,
*
* @brief
*
*
*/
#ifndef _OLE_H
#define _OLE_H 1
#define BBD_BLOCK_SIZE 512
#define SBD_BLOCK_SIZE 64
#define PROP_BLOCK_SIZE 128
#define OLENAMELENGHT 32
#define MSAT_ORIG_SIZE 436
typedef enum {
oleDir=1,
oleStream=2,
oleRootDir=5,
oleUnknown=3
} oleType;
typedef struct {
FILE *file;
char name[OLENAMELENGHT+1];
long int startBlock;
long int curBlock;
unsigned long int length;
long int ole_offset;
long int file_offset;
unsigned char *dirPos;
oleType type;
long int numOfBlocks;
long int *blocks; /**< array of blocks numbers */
int isBigBlock;
} oleEntry;
/**
* Functions
*
*/
struct ole_params_t;
struct io_funcs_t;
FILE* ole_init(FILE *f, void *buffer, size_t bufSize, struct ole_params_t *ole_params);
FILE *ole_readdir(FILE *f, struct ole_params_t *ole_params);
int ole_seek(FILE *stream, long offset, int whence, struct ole_params_t *ole_params);
long ole_tell(FILE *stream);
int ole_eof(FILE *stream);
size_t ole_read(void *ptr, size_t size, size_t nmemb, FILE *stream, struct ole_params_t *ole_params);
int ole_open(FILE *);
int ole_close(FILE *);
void ole_finish(struct ole_params_t *ole_params);
extern size_t (*catdoc_read)(void *ptr, size_t size, size_t nmemb, FILE *stream, struct ole_params_t *ole_params);
extern int (*catdoc_eof)(FILE *stream);
extern int (*catdoc_seek)(FILE *stream, long offset, int whence, struct ole_params_t *ole_params);
extern long (*catdoc_tell)(FILE *stream);
void set_ole_func(struct io_funcs_t*);
void set_std_func(struct io_funcs_t*);
#endif /* _OLE_H */