Stimfit
@PACKAGE_VERSION@
Loading...
Searching...
No Matches
src
libstfio
igor
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
5
extern
"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
25
typedef
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
43
typedef
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.
47
}
BinHeader1
;
48
49
typedef
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.
55
}
BinHeader2
;
56
57
typedef
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.
64
}
BinHeader3
;
65
66
typedef
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.
78
}
BinHeader5
;
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
89
struct
WaveHeader2
{
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
};
123
typedef
struct
WaveHeader2
WaveHeader2
;
124
typedef
WaveHeader2
*
WavePtr2
;
125
typedef
WavePtr2
*
waveHandle2
;
126
127
128
struct
WaveHeader5
{
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
};
203
typedef
struct
WaveHeader5
WaveHeader5
;
204
205
typedef
WaveHeader5
*
WavePtr5
;
206
typedef
WavePtr5
*
WaveHandle5
;
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
MAX_WAVE_NAME2
#define MAX_WAVE_NAME2
Definition
IgorBin.h:83
WaveHandle5
WavePtr5 * WaveHandle5
Definition
IgorBin.h:206
MAXDIMS
#define MAXDIMS
Definition
IgorBin.h:38
MAX_UNIT_CHARS
#define MAX_UNIT_CHARS
Definition
IgorBin.h:85
WavePtr5
WaveHeader5 * WavePtr5
Definition
IgorBin.h:205
waveHandle2
WavePtr2 * waveHandle2
Definition
IgorBin.h:125
MAX_WAVE_NAME5
#define MAX_WAVE_NAME5
Definition
IgorBin.h:84
WavePtr2
WaveHeader2 * WavePtr2
Definition
IgorBin.h:124
Handle
void ** Handle
Definition
IgorBin.h:25
IGORLONG
#define IGORLONG
Definition
IgorBin.h:22
BinHeader1
Definition
IgorBin.h:43
BinHeader1::checksum
short checksum
Definition
IgorBin.h:46
BinHeader1::wfmSize
IGORLONG wfmSize
Definition
IgorBin.h:45
BinHeader1::version
short version
Definition
IgorBin.h:44
BinHeader2
Definition
IgorBin.h:49
BinHeader2::pictSize
IGORLONG pictSize
Definition
IgorBin.h:53
BinHeader2::wfmSize
IGORLONG wfmSize
Definition
IgorBin.h:51
BinHeader2::noteSize
IGORLONG noteSize
Definition
IgorBin.h:52
BinHeader2::version
short version
Definition
IgorBin.h:50
BinHeader2::checksum
short checksum
Definition
IgorBin.h:54
BinHeader3
Definition
IgorBin.h:57
BinHeader3::pictSize
IGORLONG pictSize
Definition
IgorBin.h:62
BinHeader3::wfmSize
IGORLONG wfmSize
Definition
IgorBin.h:59
BinHeader3::checksum
short checksum
Definition
IgorBin.h:63
BinHeader3::formulaSize
IGORLONG formulaSize
Definition
IgorBin.h:61
BinHeader3::version
short version
Definition
IgorBin.h:58
BinHeader3::noteSize
IGORLONG noteSize
Definition
IgorBin.h:60
BinHeader5
Definition
IgorBin.h:66
BinHeader5::noteSize
IGORLONG noteSize
Definition
IgorBin.h:71
BinHeader5::dimEUnitsSize
IGORLONG dimEUnitsSize[MAXDIMS]
Definition
IgorBin.h:73
BinHeader5::optionsSize1
IGORLONG optionsSize1
Definition
IgorBin.h:76
BinHeader5::optionsSize2
IGORLONG optionsSize2
Definition
IgorBin.h:77
BinHeader5::dimLabelsSize
IGORLONG dimLabelsSize[MAXDIMS]
Definition
IgorBin.h:74
BinHeader5::sIndicesSize
IGORLONG sIndicesSize
Definition
IgorBin.h:75
BinHeader5::checksum
short checksum
Definition
IgorBin.h:68
BinHeader5::formulaSize
IGORLONG formulaSize
Definition
IgorBin.h:70
BinHeader5::wfmSize
IGORLONG wfmSize
Definition
IgorBin.h:69
BinHeader5::dataEUnitsSize
IGORLONG dataEUnitsSize
Definition
IgorBin.h:72
BinHeader5::version
short version
Definition
IgorBin.h:67
WaveHeader2
Definition
IgorBin.h:89
WaveHeader2::waveNoteH
Handle waveNoteH
Definition
IgorBin.h:119
WaveHeader2::srcFldr
short srcFldr
Definition
IgorBin.h:95
WaveHeader2::wData
float wData[4]
Definition
IgorBin.h:121
WaveHeader2::xUnits
char xUnits[MAX_UNIT_CHARS+1]
Definition
IgorBin.h:99
WaveHeader2::useBits
char useBits
Definition
IgorBin.h:111
WaveHeader2::wUnused
char wUnused[2]
Definition
IgorBin.h:116
WaveHeader2::topFullScale
double topFullScale
Definition
IgorBin.h:109
WaveHeader2::fileName
Handle fileName
Definition
IgorBin.h:96
WaveHeader2::bname
char bname[MAX_WAVE_NAME2+2]
Definition
IgorBin.h:93
WaveHeader2::wModified
short wModified
Definition
IgorBin.h:106
WaveHeader2::fsValid
short fsValid
Definition
IgorBin.h:108
WaveHeader2::swModified
short swModified
Definition
IgorBin.h:107
WaveHeader2::npnts
IGORLONG npnts
Definition
IgorBin.h:101
WaveHeader2::aModified
short aModified
Definition
IgorBin.h:103
WaveHeader2::depID
IGORLONG depID
Definition
IgorBin.h:114
WaveHeader2::dataUnits
char dataUnits[MAX_UNIT_CHARS+1]
Definition
IgorBin.h:98
WaveHeader2::next
struct WaveHeader2 ** next
Definition
IgorBin.h:91
WaveHeader2::botFullScale
double botFullScale
Definition
IgorBin.h:109
WaveHeader2::type
short type
Definition
IgorBin.h:90
WaveHeader2::creationDate
unsigned IGORLONG creationDate
Definition
IgorBin.h:115
WaveHeader2::formula
void ** formula
Definition
IgorBin.h:113
WaveHeader2::hsA
double hsA
Definition
IgorBin.h:104
WaveHeader2::whVersion
short whVersion
Definition
IgorBin.h:94
WaveHeader2::kindBits
char kindBits
Definition
IgorBin.h:112
WaveHeader2::modDate
unsigned IGORLONG modDate
Definition
IgorBin.h:118
WaveHeader2::hsB
double hsB
Definition
IgorBin.h:104
WaveHeader5
Definition
IgorBin.h:128
WaveHeader5::dFolder
struct DataFolder ** dFolder
Definition
IgorBin.h:146
WaveHeader5::modDate
unsigned IGORLONG modDate
Definition
IgorBin.h:135
WaveHeader5::waveNoteH
Handle waveNoteH
Definition
IgorBin.h:168
WaveHeader5::bname
char bname[MAX_WAVE_NAME5+1]
Definition
IgorBin.h:143
WaveHeader5::kindBits
char kindBits
Definition
IgorBin.h:184
WaveHeader5::dimEUnits
Handle dimEUnits[MAXDIMS]
Definition
IgorBin.h:166
WaveHeader5::type
short type
Definition
IgorBin.h:138
WaveHeader5::sIndices
IGORLONG ** sIndices
Definition
IgorBin.h:196
WaveHeader5::sfA
double sfA[MAXDIMS]
Definition
IgorBin.h:153
WaveHeader5::dataEUnits
Handle dataEUnits
Definition
IgorBin.h:165
WaveHeader5::formula
void ** formula
Definition
IgorBin.h:186
WaveHeader5::whpad4
short whpad4
Definition
IgorBin.h:192
WaveHeader5::npnts
IGORLONG npnts
Definition
IgorBin.h:137
WaveHeader5::srcFldr
short srcFldr
Definition
IgorBin.h:193
WaveHeader5::whVersion
short whVersion
Definition
IgorBin.h:142
WaveHeader5::fsValid
short fsValid
Definition
IgorBin.h:160
WaveHeader5::swModified
short swModified
Definition
IgorBin.h:181
WaveHeader5::topFullScale
double topFullScale
Definition
IgorBin.h:162
WaveHeader5::sfB
double sfB[MAXDIMS]
Definition
IgorBin.h:154
WaveHeader5::whpad2
IGORLONG whpad2
Definition
IgorBin.h:144
WaveHeader5::useBits
char useBits
Definition
IgorBin.h:183
WaveHeader5::aModified
short aModified
Definition
IgorBin.h:179
WaveHeader5::wData
float wData[1]
Definition
IgorBin.h:201
WaveHeader5::dLock
short dLock
Definition
IgorBin.h:139
WaveHeader5::botFullScale
double botFullScale
Definition
IgorBin.h:162
WaveHeader5::wModified
short wModified
Definition
IgorBin.h:180
WaveHeader5::whUnused
IGORLONG whUnused[16]
Definition
IgorBin.h:175
WaveHeader5::nDim
IGORLONG nDim[MAXDIMS]
Definition
IgorBin.h:152
WaveHeader5::fileName
Handle fileName
Definition
IgorBin.h:195
WaveHeader5::dataUnits
char dataUnits[MAX_UNIT_CHARS+1]
Definition
IgorBin.h:157
WaveHeader5::whpad1
char whpad1[6]
Definition
IgorBin.h:141
WaveHeader5::dimUnits
char dimUnits[MAXDIMS][MAX_UNIT_CHARS+1]
Definition
IgorBin.h:158
WaveHeader5::next
struct WaveHeader5 ** next
Definition
IgorBin.h:130
WaveHeader5::depID
IGORLONG depID
Definition
IgorBin.h:190
WaveHeader5::whpad3
short whpad3
Definition
IgorBin.h:161
WaveHeader5::dimLabels
Handle dimLabels[MAXDIMS]
Definition
IgorBin.h:167
WaveHeader5::creationDate
unsigned IGORLONG creationDate
Definition
IgorBin.h:134
Generated by
1.14.0