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 "ut_compiler.h"
00027 ABI_W_NO_CONST_QUAL
00028 #include <gsf/gsf.h>
00029 ABI_W_POP
00030
00031 #define CT_IGNORE 0
00032 #define CT_VALUE 1
00033 #define CT_BLOB 2
00034
00035
00036 typedef struct
00037 {
00038 int value;
00039 char *data;
00040 short size;
00041 short type;
00042 const char *name;
00043 } wri_struct;
00044
00045 bool read_wri_struct(wri_struct *w, GsfInput *f);
00046 bool read_wri_struct_mem(wri_struct *w, unsigned char *blob);
00047 int wri_struct_value(const wri_struct *w, const char *name);
00048 void free_wri_struct(wri_struct *w);
00049 void DEBUG_WRI_STRUCT(wri_struct *w, int spaces = 1);
00050
00051
00052
00053 #define READ_WORD(d) (*(d) + (*((d) + 1) << 8))
00054
00055 #define READ_DWORD(d) (*(d) + (*((d) + 1) << 8) + \
00056 (*((d) + 2) << 16) + \
00057 (*((d) + 3) << 24))
00058
00059 #define WRITE_WORD(d, s) \
00060 { \
00061 char *p = reinterpret_cast<char *>(&(d)); \
00062 \
00063 p[0] = (s) & 0xff; \
00064 p[1] = ((s) & 0xff00) >> 8; \
00065 }
00066
00067 #define WRITE_DWORD(d, s) \
00068 { \
00069 char *p = reinterpret_cast<char *>(&(d)); \
00070 \
00071 p[0] = (s) & 0xff; \
00072 p[1] = ((s) & 0xff00) >> 8; \
00073 p[2] = ((s) & 0xff0000) >> 16; \
00074 p[3] = ((s) & 0xff000000) >> 24; \
00075 }
00076
00077 #endif