NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
IgorBin.h
Go to the documentation of this file.
1// IgorBin.h -- structures and #defines for dealing with Igor binary data.
2
3#ifndef IGORBIN_H
4#define IGORBIN_H
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10// All structures written to disk are 2-byte-aligned.
11#if GENERATINGPOWERPC
12 #pragma options align=mac68k
13#endif
14#ifdef WIN32
15 #pragma pack(2)
16#endif
17
18#ifdef WIN32
19 typedef void** Handle;
20#endif
21
22
23// From IgorMath.h
24#define NT_CMPLX 1 // Complex numbers.
25#define NT_FP32 2 // 32 bit fp numbers.
26#define NT_FP64 4 // 64 bit fp numbers.
27#define NT_I8 8 // 8 bit signed integer. Requires Igor Pro 2.0 or later.
28#define NT_I16 0x10 // 16 bit integer numbers. Requires Igor Pro 2.0 or later.
29#define NT_I32 0x20 // 32 bit integer numbers. Requires Igor Pro 2.0 or later.
30#define NT_UNSIGNED 0x40 // Makes above signed integers unsigned. Requires Igor Pro 3.0 or later.
31
32
33// From wave.h
34#define MAXDIMS 4
35
36
37// From binary.h
38
39typedef struct BinHeader1 {
40 short version; // Version number for backwards compatibility.
41 long wfmSize; // The size of the WaveHeader2 data structure plus the wave data plus 16 bytes of padding.
42 short checksum; // Checksum over this header and the wave header.
44
45typedef struct BinHeader2 {
46 short version; // Version number for backwards compatibility.
47 long wfmSize; // The size of the WaveHeader2 data structure plus the wave data plus 16 bytes of padding.
48 long noteSize; // The size of the note text.
49 long pictSize; // Reserved. Write zero. Ignore on read.
50 short checksum; // Checksum over this header and the wave header.
52
53typedef struct BinHeader3 {
54 short version; // Version number for backwards compatibility.
55 long wfmSize; // The size of the WaveHeader2 data structure plus the wave data plus 16 bytes of padding.
56 long noteSize; // The size of the note text.
57 long formulaSize; // The size of the dependency formula, if any.
58 long pictSize; // Reserved. Write zero. Ignore on read.
59 short checksum; // Checksum over this header and the wave header.
61
62typedef struct BinHeader5 {
63 short version; // Version number for backwards compatibility.
64 short checksum; // Checksum over this header and the wave header.
65 long wfmSize; // The size of the WaveHeader5 data structure plus the wave data.
66 long formulaSize; // The size of the dependency formula, if any.
67 long noteSize; // The size of the note text.
68 long dataEUnitsSize; // The size of optional extended data units.
69 long dimEUnitsSize[MAXDIMS]; // The size of optional extended dimension units.
70 long dimLabelsSize[MAXDIMS]; // The size of optional dimension labels.
71 long sIndicesSize; // The size of string indicies if this is a text wave.
72 long optionsSize1; // Reserved. Write zero. Ignore on read.
73 long optionsSize2; // Reserved. Write zero. Ignore on read.
75
76
77// From wave.h
78
79#define MAX_WAVE_NAME2 18 // Maximum length of wave name in version 1 and 2 files. Does not include the trailing null.
80#define MAX_WAVE_NAME5 31 // Maximum length of wave name in version 5 files. Does not include the trailing null.
81#define MAX_UNIT_CHARS 3
82
83// Header to an array of waveform data.
84
86 short type; // See types (e.g. NT_FP64) above. Zero for text waves.
87 struct WaveHeader2 **next; // Used in memory only. Write zero. Ignore on read.
88
89 char bname[MAX_WAVE_NAME2+2]; // Name of wave plus trailing null.
90 short whVersion; // Write 0. Ignore on read.
91 short srcFldr; // Used in memory only. Write zero. Ignore on read.
92 Handle fileName; // Used in memory only. Write zero. Ignore on read.
93
94 char dataUnits[MAX_UNIT_CHARS+1]; // Natural data units go here - null if none.
95 char xUnits[MAX_UNIT_CHARS+1]; // Natural x-axis units go here - null if none.
96
97 long npnts; // Number of data points in wave.
98
99 short aModified; // Used in memory only. Write zero. Ignore on read.
100 double hsA,hsB; // X value for point p = hsA*p + hsB
101
102 short wModified; // Used in memory only. Write zero. Ignore on read.
103 short swModified; // Used in memory only. Write zero. Ignore on read.
104 short fsValid; // True if full scale values have meaning.
105 double topFullScale,botFullScale; // The min full scale value for wave.
106
107 char useBits; // Used in memory only. Write zero. Ignore on read.
108 char kindBits; // Reserved. Write zero. Ignore on read.
109 void **formula; // Used in memory only. Write zero. Ignore on read.
110 long depID; // Used in memory only. Write zero. Ignore on read.
111 unsigned long creationDate; // DateTime of creation. Not used in version 1 files.
112 char wUnused[2]; // Reserved. Write zero. Ignore on read.
113
114 unsigned long modDate; // DateTime of last modification.
115 Handle waveNoteH; // Used in memory only. Write zero. Ignore on read.
116
117 float wData[4]; // The start of the array of waveform data.
118};
122
123
125 struct WaveHeader5 **next; // link to next wave in linked list.
126
127 unsigned long creationDate; // DateTime of creation.
128 unsigned long modDate; // DateTime of last modification.
129
130 long npnts; // Total number of points (multiply dimensions up to first zero).
131 short type; // See types (e.g. NT_FP64) above. Zero for text waves.
132 short dLock; // Reserved. Write zero. Ignore on read.
133
134 char whpad1[6]; // Reserved. Write zero. Ignore on read.
135 short whVersion; // Write 1. Ignore on read.
136 char bname[MAX_WAVE_NAME5+1]; // Name of wave plus trailing null.
137 long whpad2; // Reserved. Write zero. Ignore on read.
138 struct DataFolder **dFolder; // Used in memory only. Write zero. Ignore on read.
139
140 // Dimensioning info. [0] == rows, [1] == cols etc
141 long nDim[MAXDIMS]; // Number of of items in a dimension -- 0 means no data.
142 double sfA[MAXDIMS]; // Index value for element e of dimension d = sfA[d]*e + sfB[d].
143 double sfB[MAXDIMS];
144
145 // SI units
146 char dataUnits[MAX_UNIT_CHARS+1]; // Natural data units go here - null if none.
147 char dimUnits[MAXDIMS][MAX_UNIT_CHARS+1]; // Natural dimension units go here - null if none.
148
149 short fsValid; // TRUE if full scale values have meaning.
150 short whpad3; // Reserved. Write zero. Ignore on read.
151 double topFullScale,botFullScale; // The max and max full scale value for wave.
152
153 Handle dataEUnits; // Used in memory only. Write zero. Ignore on read.
154 Handle dimEUnits[MAXDIMS]; // Used in memory only. Write zero. Ignore on read.
155 Handle dimLabels[MAXDIMS]; // Used in memory only. Write zero. Ignore on read.
156
157 Handle waveNoteH; // Used in memory only. Write zero. Ignore on read.
158 long whUnused[16]; // Reserved. Write zero. Ignore on read.
159
160 // The following stuff is considered private to Igor.
161
162 short aModified; // Used in memory only. Write zero. Ignore on read.
163 short wModified; // Used in memory only. Write zero. Ignore on read.
164 short swModified; // Used in memory only. Write zero. Ignore on read.
165
166 char useBits; // Used in memory only. Write zero. Ignore on read.
167 char kindBits; // Reserved. Write zero. Ignore on read.
168 void **formula; // Used in memory only. Write zero. Ignore on read.
169 long depID; // Used in memory only. Write zero. Ignore on read.
170
171 short whpad4; // Reserved. Write zero. Ignore on read.
172 short srcFldr; // Used in memory only. Write zero. Ignore on read.
173 Handle fileName; // Used in memory only. Write zero. Ignore on read.
174
175 long **sIndices; // Used in memory only. Write zero. Ignore on read.
176
177 float wData[1]; // The start of the array of data. Must be 64 bit aligned.
178};
182
183
184#if GENERATINGPOWERPC
185 #pragma options align=reset
186#endif
187#ifdef WIN32
188 #pragma pack()
189#endif
190// All structures written to disk are 2-byte-aligned.
191
192#ifdef __cplusplus
193}
194#endif
195
196#endif
197
#define MAX_WAVE_NAME2
Definition: IgorBin.h:79
struct BinHeader2 BinHeader2
WavePtr5 * WaveHandle5
Definition: IgorBin.h:181
#define MAXDIMS
Definition: IgorBin.h:34
#define MAX_UNIT_CHARS
Definition: IgorBin.h:81
WaveHeader5 * WavePtr5
Definition: IgorBin.h:180
struct BinHeader5 BinHeader5
WavePtr2 * waveHandle2
Definition: IgorBin.h:121
#define MAX_WAVE_NAME5
Definition: IgorBin.h:80
WaveHeader2 * WavePtr2
Definition: IgorBin.h:120
struct BinHeader1 BinHeader1
struct BinHeader3 BinHeader3
short checksum
Definition: IgorBin.h:42
long wfmSize
Definition: IgorBin.h:41
short version
Definition: IgorBin.h:40
short version
Definition: IgorBin.h:46
long noteSize
Definition: IgorBin.h:48
short checksum
Definition: IgorBin.h:50
long wfmSize
Definition: IgorBin.h:47
long pictSize
Definition: IgorBin.h:49
long pictSize
Definition: IgorBin.h:58
long noteSize
Definition: IgorBin.h:56
long formulaSize
Definition: IgorBin.h:57
short checksum
Definition: IgorBin.h:59
long wfmSize
Definition: IgorBin.h:55
short version
Definition: IgorBin.h:54
long sIndicesSize
Definition: IgorBin.h:71
long noteSize
Definition: IgorBin.h:67
long formulaSize
Definition: IgorBin.h:66
long dimLabelsSize[MAXDIMS]
Definition: IgorBin.h:70
long wfmSize
Definition: IgorBin.h:65
long optionsSize2
Definition: IgorBin.h:73
long optionsSize1
Definition: IgorBin.h:72
short checksum
Definition: IgorBin.h:64
long dimEUnitsSize[MAXDIMS]
Definition: IgorBin.h:69
long dataEUnitsSize
Definition: IgorBin.h:68
short version
Definition: IgorBin.h:63
Handle waveNoteH
Definition: IgorBin.h:115
short srcFldr
Definition: IgorBin.h:91
float wData[4]
Definition: IgorBin.h:117
char xUnits[MAX_UNIT_CHARS+1]
Definition: IgorBin.h:95
char useBits
Definition: IgorBin.h:107
char wUnused[2]
Definition: IgorBin.h:112
double topFullScale
Definition: IgorBin.h:105
Handle fileName
Definition: IgorBin.h:92
unsigned long creationDate
Definition: IgorBin.h:111
char bname[MAX_WAVE_NAME2+2]
Definition: IgorBin.h:89
short wModified
Definition: IgorBin.h:102
short fsValid
Definition: IgorBin.h:104
short swModified
Definition: IgorBin.h:103
long depID
Definition: IgorBin.h:110
short aModified
Definition: IgorBin.h:99
unsigned long modDate
Definition: IgorBin.h:114
char dataUnits[MAX_UNIT_CHARS+1]
Definition: IgorBin.h:94
struct WaveHeader2 ** next
Definition: IgorBin.h:87
double botFullScale
Definition: IgorBin.h:105
short type
Definition: IgorBin.h:86
void ** formula
Definition: IgorBin.h:109
double hsA
Definition: IgorBin.h:100
short whVersion
Definition: IgorBin.h:90
char kindBits
Definition: IgorBin.h:108
long npnts
Definition: IgorBin.h:97
double hsB
Definition: IgorBin.h:100
long ** sIndices
Definition: IgorBin.h:175
struct DataFolder ** dFolder
Definition: IgorBin.h:138
long whUnused[16]
Definition: IgorBin.h:158
Handle waveNoteH
Definition: IgorBin.h:157
long npnts
Definition: IgorBin.h:130
char bname[MAX_WAVE_NAME5+1]
Definition: IgorBin.h:136
unsigned long creationDate
Definition: IgorBin.h:127
char kindBits
Definition: IgorBin.h:167
Handle dimEUnits[MAXDIMS]
Definition: IgorBin.h:154
short type
Definition: IgorBin.h:131
long whpad2
Definition: IgorBin.h:137
double sfA[MAXDIMS]
Definition: IgorBin.h:142
Handle dataEUnits
Definition: IgorBin.h:153
void ** formula
Definition: IgorBin.h:168
short whpad4
Definition: IgorBin.h:171
short srcFldr
Definition: IgorBin.h:172
short whVersion
Definition: IgorBin.h:135
short fsValid
Definition: IgorBin.h:149
short swModified
Definition: IgorBin.h:164
double topFullScale
Definition: IgorBin.h:151
long nDim[MAXDIMS]
Definition: IgorBin.h:141
unsigned long modDate
Definition: IgorBin.h:128
double sfB[MAXDIMS]
Definition: IgorBin.h:143
char useBits
Definition: IgorBin.h:166
short aModified
Definition: IgorBin.h:162
float wData[1]
Definition: IgorBin.h:177
short dLock
Definition: IgorBin.h:132
double botFullScale
Definition: IgorBin.h:151
short wModified
Definition: IgorBin.h:163
long depID
Definition: IgorBin.h:169
Handle fileName
Definition: IgorBin.h:173
char dataUnits[MAX_UNIT_CHARS+1]
Definition: IgorBin.h:146
char whpad1[6]
Definition: IgorBin.h:134
char dimUnits[MAXDIMS][MAX_UNIT_CHARS+1]
Definition: IgorBin.h:147
struct WaveHeader5 ** next
Definition: IgorBin.h:125
short whpad3
Definition: IgorBin.h:150
Handle dimLabels[MAXDIMS]
Definition: IgorBin.h:155