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 #ifndef IE_IMPEXP_PALM_H
00021 #define IE_IMPEXP_PALM_H
00022
00023 #include <limits.h>
00024 #include <stdio.h>
00025 #include <stdlib.h>
00026 #include <string.h>
00027
00028 #include "ut_types.h"
00029
00030
00031
00032
00033
00034
00035
00036
00037 typedef UT_uint8 Byte;
00038 typedef UT_uint16 Word;
00039 typedef UT_uint32 DWord;
00040
00041 #define RECORD_SIZE_MAX 4096
00042 #define BUFFER_SIZE 4096
00043 #define COUNT_BITS 3
00044 #define DISP_BITS 11
00045 #define DOC_CREATOR "REAd"
00046 #define DOC_TYPE "TEXt"
00047
00048
00049
00050
00051
00052
00053
00054 #define dmDBNameLength 32
00055
00056 typedef struct {
00057 char name[ dmDBNameLength ];
00058 Word attributes;
00059 Word version;
00060 DWord create_time;
00061 DWord modify_time;
00062 DWord backup_time;
00063 DWord modificationNumber;
00064 DWord appInfoID;
00065 DWord sortInfoID;
00066 char type[4];
00067 char creator[4];
00068 DWord id_seed;
00069 DWord nextRecordList;
00070 Word numRecords;
00071 } pdb_header;
00072
00073
00074
00075
00076
00077 #define PDB_HEADER_SIZE 78
00078 #define PDB_RECORD_HEADER_SIZE 8
00079
00080
00081
00082
00083
00084
00085
00086 typedef struct {
00087 Word version;
00088 Word reserved1;
00089 DWord doc_size;
00090 Word numRecords;
00091 Word rec_size;
00092 DWord reserved2;
00093 } doc_record0;
00094
00095
00096
00097
00098
00099
00100
00101 typedef struct {
00102 Byte buf[BUFFER_SIZE];
00103 UT_uint32 len;
00104 UT_uint32 position;
00105 } buffer;
00106
00107 #define PUT_Word(f,n) { Word n1 = _swap_Word ( n ); gsf_output_write(f, 2, (guint8*)&n1); }
00108 #define PUT_DWord(f,n) { DWord n1 = _swap_DWord( n ); gsf_output_write(f, 4, (guint8*)&n1); }
00109
00110 #define GET_Word(f,n) { gsf_input_read( f, 2, (guint8*)&n ); n = _swap_Word ( n ); }
00111 #define GET_DWord(f,n) { gsf_input_read( f, 4, (guint8*)&n ); n = _swap_DWord( n ); }
00112
00113 #endif