7b0cf78303ebbefdbd84d7bd7ed96ffbd3a7a764
[alexxy/gromacs.git] / include / gmxfio.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team,
6  * check out http://www.gromacs.org for more information.
7  * Copyright (c) 2012, by the GROMACS development team, led by
8  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9  * others, as listed in the AUTHORS file in the top-level source
10  * directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38
39 #ifndef _gmxfio_h
40 #define _gmxfio_h
41
42 #include <stdio.h>
43 #include "visibility.h"
44 #include "sysstuff.h"
45 #include "typedefs.h"
46 #include "xdrf.h"
47 #include "futil.h"
48
49 /* types */
50
51
52 /* Enumerated for different items in files */
53 enum { eitemHEADER, eitemIR, eitemBOX, 
54        eitemTOP, eitemX, eitemV, eitemF, eitemNR };
55        
56 /* Enumerated for data types in files */
57 enum { eioREAL, eioFLOAT, eioDOUBLE, eioINT, eioGMX_LARGE_INT,
58        eioUCHAR, eioNUCHAR, eioUSHORT,
59        eioRVEC, eioNRVEC, eioIVEC, eioSTRING, eioNR };
60
61 typedef struct t_fileio t_fileio;
62
63 extern const char *itemstr[eitemNR];
64 extern const char *comment_str[eitemNR];
65
66 /* NOTE ABOUT THREAD SAFETY:
67
68    The functions are all thread-safe, provided that two threads don't 
69    do something silly like closing the same file, or one thread 
70    accesses a file that has been closed by another.
71    */
72
73 /********************************************************
74  * Open and Close 
75  ********************************************************/
76
77 t_fileio *gmx_fio_open(const char *fn,const char *mode);
78 /* Open a new file for reading or writing.
79  * The file type will be deduced from the file name.
80  * If fn is NULL, stdin / stdout will be used for Ascii I/O (TPA type)
81  * mode may be "r", "w", or "a". You should append a "b" to the mode
82  * if you are writing a binary file, but the routine will also 
83  * doublecheck it and try to do it if you forgot. This has no effect on
84  * unix, but is important on windows.
85  */
86  
87 int gmx_fio_close(t_fileio *fp);
88 /* Close the file corresponding to fp (if not stdio)
89  * The routine will exit when an invalid fio is handled.
90  * Returns 0 on success.
91  */
92
93 int gmx_fio_fp_close(t_fileio *fp);
94 /* Close the file corresponding to fp without closing the FIO entry
95  * Needed e.g. for trxio because the FIO entries are used to store 
96  * additional data.
97  * NOTE that the fp still needs to be properly closed with gmx_fio_close().
98  * The routine will exit when an invalid fio is handled.
99  * Returns 0 on success.
100  */
101
102
103 /* Open a file, return a stream, record the entry in internal FIO object */
104 GMX_LIBGMX_EXPORT
105 FILE* gmx_fio_fopen(const char *fn,const char *mode);
106
107 /* Close a file previously opened with gmx_fio_fopen. 
108  * Do not mix these calls with standard fopen/fclose ones!
109  * Returns 0 on success.  */
110 GMX_LIBGMX_EXPORT
111 int gmx_fio_fclose(FILE *fp);
112
113
114
115 /********************************************************
116  * Change properties of the open file
117  ********************************************************/
118
119 void gmx_fio_setprecision(t_fileio *fio,gmx_bool bDouble);
120 /* Select the floating point precision for reading and writing files */
121
122 char *gmx_fio_getname(t_fileio *fio);
123 /* Return the filename corresponding to the fio index */
124
125 GMX_LIBGMX_EXPORT
126 int gmx_fio_getftp(t_fileio *fio);
127 /* Return the filetype corresponding to the fio index. 
128     There is as of now no corresponding setftp function because the file
129     was opened as a specific file type and changing that midway is most 
130     likely an evil hack. */
131
132 GMX_LIBGMX_EXPORT
133 void gmx_fio_setdebug(t_fileio *fio,gmx_bool bDebug);
134 /* Set the debug mode */
135
136 gmx_bool gmx_fio_getdebug(t_fileio *fio);
137 /* Return  whether debug mode is on in fio  */
138
139 gmx_bool gmx_fio_getread(t_fileio *fio);
140 /* Return  whether read mode is on in fio  */
141
142
143 void gmx_fio_checktype(t_fileio *fio);
144 /* Check whether the fio is of a sane type */
145
146 /***************************************************
147  * FILE Operations
148  ***************************************************/
149
150 void gmx_fio_rewind(t_fileio *fio);
151 /* Rewind the tpa file in fio */
152
153 GMX_LIBGMX_EXPORT
154 int gmx_fio_flush(t_fileio *fio);
155 /* Flush the fio, returns 0 on success */
156
157 int gmx_fio_fsync(t_fileio *fio);
158 /* fsync the fio, returns 0 on success. 
159    NOTE: don't use fsync function unless you're absolutely sure you need it
160    because it deliberately interferes with the OS's caching mechanisms and
161    can cause dramatically slowed down IO performance. Some OSes (Linux, 
162    for example), may implement fsync as a full sync() point. */
163
164 GMX_LIBGMX_EXPORT
165 gmx_off_t gmx_fio_ftell(t_fileio *fio);
166 /* Return file position if possible */
167
168 GMX_LIBGMX_EXPORT
169 int gmx_fio_seek(t_fileio *fio,gmx_off_t fpos);
170 /* Set file position if possible, quit otherwise */
171
172 GMX_LIBGMX_EXPORT
173 FILE *gmx_fio_getfp(t_fileio *fio);
174 /* Return the file pointer itself */
175
176 GMX_LIBGMX_EXPORT
177 XDR *gmx_fio_getxdr(t_fileio *fio);
178 /* Return the file pointer itself */
179
180
181
182
183
184 /* Element with information about position in a currently open file.
185  * gmx_off_t should be defined by autoconf if your system does not have it.
186  * If you do not have it on some other platform you do not have largefile 
187  * support at all, and you can define it to int (or better, find out how to 
188  * enable large files).  */
189 typedef struct
190 {
191         char      filename[STRLEN];
192         gmx_off_t offset; 
193         unsigned char chksum[16];
194         int       chksum_size;
195
196 gmx_file_position_t;
197
198
199 GMX_LIBGMX_EXPORT
200 int gmx_fio_check_file_position(t_fileio *fio);
201 /* Check if the file position is out of the range of off_t.
202  * The result is stored along with the other file data of fio.
203  */
204
205 int gmx_fio_get_output_file_positions(gmx_file_position_t ** outputfiles,
206                                       int *nfiles );
207 /* Return the name and file pointer positions for all currently open
208  * output files. This is used for saving in the checkpoint files, so we
209  * can truncate output files upon restart-with-appending.
210  *
211  * For the first argument you should use a pointer, which will be set to
212  * point to a list of open files.
213  */
214
215 t_fileio *gmx_fio_all_output_fsync(void);
216 /* fsync all open output files. This is used for checkpointing, where
217    we need to ensure that all output is actually written out to 
218    disk. 
219    This is most important in the case of some networked file systems, 
220    where data is not synced with the file server until close() or 
221    fsync(), so data could remain in cache for days.
222    Note the caveats reported with gmx_fio_fsync(). 
223    
224     returns: NULL if no error occurred, or a pointer to the first file that
225              failed if an error occurred 
226 */
227
228
229 int gmx_fio_get_file_md5(t_fileio *fio, gmx_off_t offset,  
230                          unsigned char digest[]);
231
232
233 int xtc_seek_frame(t_fileio *fio, int frame, int natoms);
234
235 GMX_LIBGMX_EXPORT
236 int xtc_seek_time(t_fileio *fio, real time, int natoms,gmx_bool bSeekForwardOnly);
237
238         
239 /* Add this to the comment string for debugging */
240 void gmx_fio_set_comment(t_fileio *fio, const char *comment);
241
242 /* Remove previously set comment */
243 void gmx_fio_unset_comment(t_fileio *fio);
244
245
246
247
248 /********************************************************
249  * Read and write
250  ********************************************************/
251
252
253 /* basic reading & writing */
254 gmx_bool gmx_fio_reade_real(t_fileio *fio, real *item, 
255                         const char *desc, const char *srcfile, int line);
256 gmx_bool gmx_fio_reade_float(t_fileio *fio, float *item, 
257                           const char *desc, const char *srcfile, int line);
258 gmx_bool gmx_fio_reade_double(t_fileio *fio, double *item, 
259                           const char *desc, const char *srcfile, int line);
260 gmx_bool gmx_fio_reade_int(t_fileio *fio, int *item, 
261                        const char *desc, const char *srcfile, int line);
262 gmx_bool gmx_fio_reade_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, 
263                                  const char *desc, const char *srcfile, int line);
264 gmx_bool gmx_fio_reade_uchar(t_fileio *fio, unsigned char *item, 
265                          const char *desc, const char *srcfile, int line);
266 gmx_bool gmx_fio_reade_ushort(t_fileio *fio, unsigned short *item, 
267                          const char *desc, const char *srcfile, int line);
268 gmx_bool gmx_fio_reade_rvec(t_fileio *fio, rvec *item, 
269                         const char *desc, const char *srcfile, int line);
270 gmx_bool gmx_fio_reade_ivec(t_fileio *fio, ivec *item, 
271                         const char *desc, const char *srcfile, int line);
272 gmx_bool gmx_fio_reade_string(t_fileio *fio, char *item, 
273                           const char *desc, const char *srcfile, int line);
274
275 gmx_bool gmx_fio_writee_real(t_fileio *fio, real item, 
276                          const char *desc, const char *srcfile, int line);
277 gmx_bool gmx_fio_writee_float(t_fileio *fio, float item, 
278                            const char *desc, const char *srcfile, int line);
279 gmx_bool gmx_fio_writee_double(t_fileio *fio, double item, 
280                            const char *desc, const char *srcfile, int line);
281 gmx_bool gmx_fio_writee_int(t_fileio *fio, int item, 
282                         const char *desc, const char *srcfile, int line);
283 gmx_bool gmx_fio_writee_gmx_large_int(t_fileio *fio, gmx_large_int_t item, 
284                                   const char *desc, const char *srcfile, int line);
285 gmx_bool gmx_fio_writee_uchar(t_fileio *fio, unsigned char item, 
286                           const char *desc, const char *srcfile, int line);
287 gmx_bool gmx_fio_writee_ushort(t_fileio *fio, unsigned short item, 
288                           const char *desc, const char *srcfile, int line);
289 gmx_bool gmx_fio_writee_rvec(t_fileio *fio, rvec *item, 
290                          const char *desc, const char *srcfile, int line);
291 gmx_bool gmx_fio_writee_ivec(t_fileio *fio, ivec *item, 
292                          const char *desc, const char *srcfile, int line);
293 gmx_bool gmx_fio_writee_string(t_fileio *fio, const char *item, 
294                            const char *desc, const char *srcfile, int line);
295
296 /* reading or writing, depending on the file's opening mode string */
297 gmx_bool gmx_fio_doe_real(t_fileio *fio, real *item, 
298                       const char *desc, const char *srcfile, int line);
299 gmx_bool gmx_fio_doe_float(t_fileio *fio, float *item, 
300                        const char *desc, const char *srcfile, int line);
301 gmx_bool gmx_fio_doe_double(t_fileio *fio, double *item, 
302                         const char *desc, const char *srcfile, int line);
303 gmx_bool gmx_fio_doe_gmx_bool(t_fileio *fio, gmx_bool *item, 
304                      const char *desc, const char *srcfile, int line);
305 gmx_bool gmx_fio_doe_int(t_fileio *fio, int *item, 
306                      const char *desc, const char *srcfile, int line);
307 gmx_bool gmx_fio_doe_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, 
308                                const char *desc, const char *srcfile, int line);
309 gmx_bool gmx_fio_doe_uchar(t_fileio *fio, unsigned char *item, 
310                        const char *desc, const char *srcfile, int line);
311 gmx_bool gmx_fio_doe_ushort(t_fileio *fio, unsigned short *item, 
312                        const char *desc, const char *srcfile, int line);
313 gmx_bool gmx_fio_doe_rvec(t_fileio *fio, rvec *item, 
314                       const char *desc, const char *srcfile, int line);
315 gmx_bool gmx_fio_doe_ivec(t_fileio *fio, ivec *item, 
316                       const char *desc, const char *srcfile, int line);
317 gmx_bool gmx_fio_doe_string(t_fileio *fio, char *item, 
318                         const char *desc, const char *srcfile, int line);
319
320
321
322
323 /* array reading & writing */
324 gmx_bool gmx_fio_nreade_real(t_fileio *fio, real *item, int n, 
325                          const char *desc, const char *srcfile, int line);
326 gmx_bool gmx_fio_nreade_float(t_fileio *fio, float *item, int n, 
327                           const char *desc, const char *srcfile, int line);
328 gmx_bool gmx_fio_nreade_double(t_fileio *fio, double *item, int n, 
329                            const char *desc, const char *srcfile, int line);
330 gmx_bool gmx_fio_nreade_int(t_fileio *fio, int *item, int n, 
331                         const char *desc, const char *srcfile, int line);
332 gmx_bool gmx_fio_nreade_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, int n, 
333                                   const char *desc, const char *srcfile, 
334                                   int line);
335 gmx_bool gmx_fio_nreade_uchar(t_fileio *fio, unsigned char *item, int n, 
336                           const char *desc, const char *srcfile, int line);
337 gmx_bool gmx_fio_nreade_ushort(t_fileio *fio, unsigned short *item, int n, 
338                           const char *desc, const char *srcfile, int line);
339 gmx_bool gmx_fio_nreade_rvec(t_fileio *fio, rvec *item, int n, 
340                          const char *desc, const char *srcfile, int line);
341 gmx_bool gmx_fio_nreade_ivec(t_fileio *fio, ivec *item, int n, 
342                          const char *desc, const char *srcfile, int line);
343 gmx_bool gmx_fio_nreade_string(t_fileio *fio, char *item[], int n, 
344                            const char *desc, const char *srcfile, int line);
345
346 gmx_bool gmx_fio_nwritee_real(t_fileio *fio, const real *item, int n, 
347                           const char *desc, const char *srcfile, int line);
348 gmx_bool gmx_fio_nwritee_float(t_fileio *fio, const float *item, int n, 
349                            const char *desc, const char *srcfile, int line);
350 gmx_bool gmx_fio_nwritee_double(t_fileio *fio, const double *item, int n, 
351                             const char *desc, const char *srcfile, int line);
352 gmx_bool gmx_fio_nwritee_int(t_fileio *fio, const int *item, int n, 
353                          const char *desc, const char *srcfile, int line);
354 gmx_bool gmx_fio_nwritee_gmx_large_int(t_fileio *fio, 
355                                    const gmx_large_int_t *item, int n,
356                                    const char *desc, const char *srcfile, 
357                                    int line);
358 gmx_bool gmx_fio_nwritee_uchar(t_fileio *fio, const unsigned char *item, int n, 
359                            const char *desc, const char *srcfile, int line);
360 gmx_bool gmx_fio_nwritee_ushort(t_fileio *fio, const unsigned short *item, int n, 
361                            const char *desc, const char *srcfile, int line);
362 gmx_bool gmx_fio_nwritee_rvec(t_fileio *fio, const rvec *item, int n, 
363                           const char *desc, const char *srcfile, int line);
364 gmx_bool gmx_fio_nwritee_ivec(t_fileio *fio, const ivec *item, int n, 
365                           const char *desc, const char *srcfile, int line);
366 gmx_bool gmx_fio_nwritee_string(t_fileio *fio, const char *item[], int n, 
367                             const char *desc, const char *srcfile, int line);
368
369 gmx_bool gmx_fio_ndoe_real(t_fileio *fio, real *item, int n, 
370                        const char *desc, const char *srcfile, int line);
371 gmx_bool gmx_fio_ndoe_float(t_fileio *fio, float *item, int n, 
372                          const char *desc, const char *srcfile, int line);
373 gmx_bool gmx_fio_ndoe_double(t_fileio *fio, double *item, int n, 
374                          const char *desc, const char *srcfile, int line);
375 gmx_bool gmx_fio_ndoe_gmx_bool(t_fileio *fio, gmx_bool *item, int n, 
376                       const char *desc, const char *srcfile, int line);
377 gmx_bool gmx_fio_ndoe_int(t_fileio *fio, int *item, int n, 
378                       const char *desc, const char *srcfile, int line);
379 gmx_bool gmx_fio_ndoe_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, int n, 
380                                 const char *desc, const char *srcfile, 
381                                 int line);
382 gmx_bool gmx_fio_ndoe_uchar(t_fileio *fio, unsigned char *item, int n, 
383                         const char *desc, const char *srcfile, int line);
384 gmx_bool gmx_fio_ndoe_ushort(t_fileio *fio, unsigned short *item, int n, 
385                         const char *desc, const char *srcfile, int line);
386 gmx_bool gmx_fio_ndoe_rvec(t_fileio *fio, rvec *item, int n, 
387                        const char *desc, const char *srcfile, int line);
388 gmx_bool gmx_fio_ndoe_ivec(t_fileio *fio, ivec *item, int n, 
389                        const char *desc, const char *srcfile, int line);
390 gmx_bool gmx_fio_ndoe_string(t_fileio *fio, char *item[], int n, 
391                          const char *desc, const char *srcfile, int line);
392
393
394
395 /* convenience macros */
396 #define gmx_fio_read_real(fio, item)           gmx_fio_reade_real(fio, &item, (#item), __FILE__, __LINE__)
397 #define gmx_fio_read_float(fio, item)          gmx_fio_reade_float(fio, &item, (#item), __FILE__, __LINE__)
398 #define gmx_fio_read_double(fio, item)         gmx_fio_reade_double(fio, &item, (#item), __FILE__, __LINE__)
399 #define gmx_fio_read_int(fio, item)            gmx_fio_reade_int(fio, &item, (#item), __FILE__, __LINE__)
400 #define gmx_fio_read_gmx_large_int(fio, item)  gmx_fio_reade_gmx_large_int(fio, &item, (#item), __FILE__, __LINE__)
401 #define gmx_fio_read_uchar(fio, item)          gmx_fio_reade_uchar(fio, &item, (#item), __FILE__, __LINE__)
402 #define gmx_fio_read_ushort(fio, item)         gmx_fio_reade_ushort(fio, &item, (#item), __FILE__, __LINE__)
403 #define gmx_fio_read_rvec(fio, item)           gmx_fio_reade_rvec(fio, item, (#item), __FILE__, __LINE__)
404 #define gmx_fio_read_ivec(fio, item)           gmx_fio_reade_ivec(fio, item, (#item), __FILE__, __LINE__)
405 #define gmx_fio_read_string(fio, item)         gmx_fio_reade_string(fio, item, (#item), __FILE__, __LINE__)
406
407 #define gmx_fio_write_real(fio, item)           gmx_fio_writee_real(fio, item, (#item), __FILE__, __LINE__)
408 #define gmx_fio_write_float(fio, item)          gmx_fio_writee_float(fio, item, (#item), __FILE__, __LINE__)
409 #define gmx_fio_write_double(fio, item)         gmx_fio_writee_double(fio, item, (#item), __FILE__, __LINE__)
410 #define gmx_fio_write_int(fio, item)            gmx_fio_writee_int(fio, item, (#item), __FILE__, __LINE__)
411 #define gmx_fio_write_gmx_large_int(fio, item)  gmx_fio_writee_gmx_large_int(fio, item, (#item), __FILE__, __LINE__)
412 #define gmx_fio_write_uchar(fio, item)          gmx_fio_writee_uchar(fio, item, (#item), __FILE__, __LINE__)
413 #define gmx_fio_write_ushort(fio, item)         gmx_fio_writee_ushort(fio, item, (#item), __FILE__, __LINE__)
414 #define gmx_fio_write_rvec(fio, item)           gmx_fio_writee_rvec(fio, item, (#item), __FILE__, __LINE__)
415 #define gmx_fio_write_ivec(fio, item)           gmx_fio_writee_ivec(fio, item, (#item), __FILE__, __LINE__)
416 #define gmx_fio_write_string(fio, item)         gmx_fio_writee_string(fio, item, (#item), __FILE__, __LINE__)
417
418 #define gmx_fio_do_real(fio, item)              gmx_fio_doe_real(fio, &item, (#item), __FILE__, __LINE__)
419 #define gmx_fio_do_float(fio, item)             gmx_fio_doe_float(fio, &item, (#item), __FILE__, __LINE__)
420 #define gmx_fio_do_double(fio, item)            gmx_fio_doe_double(fio, &item, (#item), __FILE__, __LINE__)
421 #define gmx_fio_do_gmx_bool(fio, item)              gmx_fio_doe_gmx_bool(fio, &item, (#item), __FILE__, __LINE__)
422 #define gmx_fio_do_int(fio, item)               gmx_fio_doe_int(fio, &item, (#item), __FILE__, __LINE__)
423 #define gmx_fio_do_gmx_large_int(fio, item)     gmx_fio_doe_gmx_large_int(fio, &item, (#item), __FILE__, __LINE__)
424 #define gmx_fio_do_uchar(fio, item)             gmx_fio_doe_uchar(fio, &item, (#item), __FILE__, __LINE__)
425 #define gmx_fio_do_ushort(fio, item)            gmx_fio_doe_ushort(fio, &item, (#item), __FILE__, __LINE__)
426 #define gmx_fio_do_rvec(fio, item)              gmx_fio_doe_rvec(fio, &item, (#item), __FILE__, __LINE__)
427 #define gmx_fio_do_ivec(fio, item)              gmx_fio_doe_ivec(fio, &item, (#item), __FILE__, __LINE__)
428 #define gmx_fio_do_string(fio, item)            gmx_fio_doe_string(fio, item, (#item), __FILE__, __LINE__)
429
430
431
432
433 #define gmx_fio_nread_real(fio, item, n)            gmx_fio_nreade_real(fio, item, n, (#item), __FILE__, __LINE__)
434 #define gmx_fio_nread_float(fio, item, n)           gmx_fio_nreade_float(fio, item, n, (#item), __FILE__, __LINE__)
435 #define gmx_fio_nread_double(fio, item, n)          gmx_fio_nreade_double(fio, item, n, (#item), __FILE__, __LINE__)
436 #define gmx_fio_nread_int(fio, item, n)             gmx_fio_nreade_int(fio, item, n, (#item), __FILE__, __LINE__)
437 #define gmx_fio_nread_gmx_large_int(fio, item, n)   gmx_fio_nreade_gmx_large_int(fio, item, n, (#item), __FILE__, __LINE__)
438 #define gmx_fio_nread_uchar(fio, item, n)           gmx_fio_nreade_uchar(fio, item, n, (#item), __FILE__, __LINE__)
439 #define gmx_fio_nread_ushort(fio, item, n)          gmx_fio_nreade_ushort(fio, item, n, (#item), __FILE__, __LINE__)
440 #define gmx_fio_nread_rvec(fio, item, n)            gmx_fio_nreade_rvec(fio, item, n, (#item), __FILE__, __LINE__)
441 #define gmx_fio_nread_ivec(fio, item, n)            gmx_fio_nreade_ivec(fio, item, n, (#item), __FILE__, __LINE__)
442 #define gmx_fio_nread_string(fio, item, n)          gmx_fio_nreade_string(fio, item, n, (#item), __FILE__, __LINE__)
443
444 #define gmx_fio_nwrite_real(fio, item, n)           gmx_fio_nwritee_real(fio, item, n, (#item), __FILE__, __LINE__)
445 #define gmx_fio_nwrite_float(fio, item, n)          gmx_fio_nwritee_float(fio, item, n, (#item), __FILE__, __LINE__)
446 #define gmx_fio_nwrite_double(fio, item, n)         gmx_fio_nwritee_double(fio, item, n, (#item), __FILE__, __LINE__)
447 #define gmx_fio_nwrite_int(fio, item, n)            gmx_fio_nwritee_int(fio, item, n, (#item), __FILE__, __LINE__)
448 #define gmx_fio_nwrite_gmx_large_int(fio, item, n)  gmx_fio_nwritee_gmx_large_int(fio, item, n, (#item), __FILE__, __LINE__)
449 #define gmx_fio_nwrite_uchar(fio, item, n)          gmx_fio_nwritee_uchar(fio, item, n, (#item), __FILE__, __LINE__)
450 #define gmx_fio_nwrite_ushort(fio, item, n)         gmx_fio_nwritee_ushort(fio, item, n, (#item), __FILE__, __LINE__)
451 #define gmx_fio_nwrite_rvec(fio, item, n)           gmx_fio_nwritee_rvec(fio, item, n, (#item), __FILE__, __LINE__)
452 #define gmx_fio_nwrite_ivec(fio, item, n)           gmx_fio_nwritee_ivec(fio, item, n, (#item), __FILE__, __LINE__)
453 #define gmx_fio_nwrite_string(fio, item, n)         gmx_fio_nwritee_string(fio, item, n, (#item), __FILE__, __LINE__)
454
455 #define gmx_fio_ndo_real(fio, item, n)              gmx_fio_ndoe_real(fio, item, n, (#item), __FILE__, __LINE__)
456 #define gmx_fio_ndo_float(fio, item, n)             gmx_fio_ndoe_float(fio, item, n, (#item), __FILE__, __LINE__)
457 #define gmx_fio_ndo_double(fio, item, n)            gmx_fio_ndoe_double(fio, item, n, (#item), __FILE__, __LINE__)
458 #define gmx_fio_ndo_gmx_bool(fio, item, n)              gmx_fio_ndoe_gmx_bool(fio, item, n, (#item), __FILE__, __LINE__)
459 #define gmx_fio_ndo_int(fio, item, n)               gmx_fio_ndoe_int(fio, item, n, (#item), __FILE__, __LINE__)
460 #define gmx_fio_ndo_gmx_large_int(fio, item, n)     gmx_fio_ndoe_gmx_large_int(fio, item, n, (#item), __FILE__, __LINE__)
461 #define gmx_fio_ndo_uchar(fio, item, n)             gmx_fio_ndoe_uchar(fio, item, n, (#item), __FILE__, __LINE__)
462 #define gmx_fio_ndo_ushort(fio, item, n)            gmx_fio_ndoe_ushort(fio, item, n, (#item), __FILE__, __LINE__)
463 #define gmx_fio_ndo_rvec(fio, item, n)              gmx_fio_ndoe_rvec(fio, item, n, (#item), __FILE__, __LINE__)
464 #define gmx_fio_ndo_ivec(fio, item, n)              gmx_fio_ndoe_ivec(fio, item, n, (#item), __FILE__, __LINE__)
465 #define gmx_fio_ndo_string(fio, item, n)            gmx_fio_ndoe_string(fio, item, n, (#item), __FILE__, __LINE__)
466
467
468
469 #endif