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