-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathccp4_diskio_fem.hpp
242 lines (209 loc) · 3.43 KB
/
ccp4_diskio_fem.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#ifndef CCP4IO_ADAPTBX_CCP4_DISKIO_FEM_HPP
#define CCP4IO_ADAPTBX_CCP4_DISKIO_FEM_HPP
#include <fem.hpp> // Fortran EMulation library of fable module
namespace ccp4_diskio_fem {
extern "C" {
void qopen_(
int const* iunit,
char const* lognam,
char const* atbuta,
int lognam_len,
int atbuta_len);
void qmode_(
int const* iunit,
int const* mode,
int* size);
void qqinq_(
int const* iunit,
char const* lfn,
char* filnam,
int const* length,
int lfn_len,
int filnam_len);
void qread_(
int const* iunit,
unsigned long* buffer,
int const* nitems,
int* result);
void qclose_(
int const* iunit);
void qseek_(
int const* iunit,
int const* irec,
int const* iel,
int const* lrecl);
void
qwrite_(
int const* iunit,
const unsigned long* buffer,
int const* nitems);
bool
qisnan_(
float const* value);
void
qback_(
int const* iunit,
int const* lrecl);
}
using namespace fem::major_types;
inline
void
qopen(
int const& iunit,
str_cref lognam,
str_cref atbuta)
{
qopen_(&iunit, lognam.elems(), atbuta.elems(), lognam.len(), atbuta.len());
}
inline
void
qwrite(
int const& iunit,
arr_cref<int> buffer,
int const& nitems)
{
qwrite_(&iunit, (const unsigned long*)(const void*)buffer.begin(),&nitems);
}
inline
void
qwrite(
int const& iunit,
fem::integer_star_2 const& buffer,
int const& nitems)
{
qwrite_(&iunit, (const unsigned long*)(const void*)(&buffer),&nitems);
}
inline
void
qwrite(
int const& iunit,
arr_ref<fem::integer_star_2> buffer,
int const& nitems)
{
qwrite_(&iunit, (const unsigned long*)(const void*)buffer.begin(),&nitems);
}
inline
void
qwrite(
int const& iunit,
arr_cref<fem::integer_star_8> buffer,
int const& nitems)
{
throw TBXX_NOT_IMPLEMENTED();
}
inline
bool
qisnan(
float const& value)
{
return qisnan_(&value);
}
inline
void
qclose(
int const& iunit)
{
qclose_(&iunit);
}
inline
void
qseek(
int const& iunit,
int const& irec,
int const& iel,
int const& lrecl)
{
qseek_(&iunit, &irec, &iel, &lrecl);
}
inline
void
qmode(
int const& iunit,
int const& mode,
int& size)
{
qmode_(&iunit, &mode, &size);
}
inline
void
qread(
int const& /* iunit */,
arr_ref<float> buffer,
int const& /* nitems */,
int& result)
{
throw TBXX_NOT_IMPLEMENTED();
}
inline
void
qread(
int const& iunit,
arr_ref<fem::integer_star_1> buffer,
int const& nitems,
int& result)
{
qread_(&iunit, (unsigned long*)(void*)buffer.begin(),
&nitems, &result);
}
inline
void
qread(
int const& iunit,
arr_ref<fem::integer_star_2> buffer,
int const& nitems,
int& result)
{
qread_(&iunit, (unsigned long*)(void*)buffer.begin(),
&nitems, &result);
}
inline
void
qread(
int const& iunit,
arr_ref<int> buffer,
int const& nitems,
int& result)
{
qread_(&iunit, (unsigned long*)(void*)buffer.begin(),
&nitems, &result);
}
inline
void
qqinq(
int const& iunit,
str_cref lfn,
str_ref filnam,
int const& length)
{
qqinq_(&iunit, lfn.elems(), filnam.elems(), &length, lfn.len(), filnam.len());
}
inline
void
qback(
int const& iunit,
int const& lrecl)
{
qback_(&iunit, &lrecl);
}
inline
void
qreadi(
int const& iunit,
arr_ref<int> buffer,
int const& nitems,
int& result)
{
throw TBXX_NOT_IMPLEMENTED();
}
inline
void
qreadi2(
int const& /* iunit */,
arr_ref<fem::integer_star_2> buffer,
int const& /* nitems */,
int& result)
{
throw TBXX_NOT_IMPLEMENTED();
}
} // namespace ccp4_diskio_fem
#endif // GUARD