-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxls2txt.h
More file actions
51 lines (43 loc) · 1.24 KB
/
Copy pathxls2txt.h
File metadata and controls
51 lines (43 loc) · 1.24 KB
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
#ifndef _LIBXLS2CVS_H
#define _LIBXLS2CVS_H
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include "myerr.h"
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef signed int s32;
typedef unsigned long
#ifndef __LP64__
long
#endif
u64;
#ifdef __i386__
#define g16(P) (*(const u16*)(P))
#define g32(P) (*(const u32*)(P))
#define g64(P) (*(const u64*)(P))
#define p16(P,V) (*(u16*)(P)=(V))
#else
static inline u16 g16(const void *p) {return ((const u8*)p)[0] | ((const u8*)p)[1]<<8;}
static inline u32 g32(const void *p) {return g16(p) | g16((const u8*)p+2)<<16;}
static inline u64 g64(const void *p) {return g32(p) | (u64)g32((const u8*)p+4)<<32;}
static inline void p16(void *p, u16 v) {((u8*)p)[0]=v; ((u8*)p)[1]=v>>8;}
#endif
#define elemof(T) (sizeof T/sizeof*T)
#define endof(T) (T+elemof(T))
typedef struct {
u8 *ptr;
unsigned len;
} meml_t;
double ieee754(u64);
int ole_open(char *name);
meml_t get_workbook();
int find_charset(char *name);
void set_charset(int n); // output charset
u8 *print_uni(u8 *p, int l, u8 f, FILE * fp);
void set_codepage(int n); // sheet codepage
u8 *print_cp_str(u8 *p, int l, FILE * fp);
int xls2cvs(char *srcname,char *dstname);
#endif /* _LIBXLS2CVS_H */