Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef IE_IMPEXP_MSWRITE_H
00024 #define IE_IMPEXP_MSWRITE_H
00025
00026 #include <gsf/gsf.h>
00027
00028 #define CT_IGNORE 0
00029 #define CT_VALUE 1
00030 #define CT_BLOB 2
00031
00032
00033 typedef struct
00034 {
00035 int value;
00036 char *data;
00037 short size;
00038 short type;
00039 const char *name;
00040 } wri_struct;
00041
00042 bool read_wri_struct(wri_struct *w, GsfInput *f);
00043 bool read_wri_struct_mem(wri_struct *w, unsigned char *blob);
00044 int wri_struct_value(const wri_struct *w, const char *name);
00045 void free_wri_struct(wri_struct *w);
00046 void DEBUG_WRI_STRUCT(wri_struct *w, int spaces = 1);
00047
00048
00049
00050 #define READ_WORD(d) (*(d) + (*((d) + 1) << 8))
00051
00052 #define READ_DWORD(d) (*(d) + (*((d) + 1) << 8) + \
00053 (*((d) + 2) << 16) + \
00054 (*((d) + 3) << 24))
00055
00056 #define WRITE_WORD(d, s) \
00057 { \
00058 char *p = reinterpret_cast<char *>(&(d)); \
00059 \
00060 p[0] = (s) & 0xff; \
00061 p[1] = ((s) & 0xff00) >> 8; \
00062 }
00063
00064 #define WRITE_DWORD(d, s) \
00065 { \
00066 char *p = reinterpret_cast<char *>(&(d)); \
00067 \
00068 p[0] = (s) & 0xff; \
00069 p[1] = ((s) & 0xff00) >> 8; \
00070 p[2] = ((s) & 0xff0000) >> 16; \
00071 p[3] = ((s) & 0xff000000) >> 24; \
00072 }
00073
00074 #endif