changed reading hint
[gromacs/adressmacs.git] / include / statusio.h
blob30ec8ddcb31701f70a6896ffa11d689b0b9057db
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Green Red Orange Magenta Azure Cyan Skyblue
30 #ifndef _statusio_h
31 #define _statusio_h
33 static char *SRCID_statusio_h = "$Id$";
35 #ifdef HAVE_IDENT
36 #ident "@(#) statusio.h 1.46 2/2/97"
37 #endif /* HAVE_IDENT */
39 #include "typedefs.h"
40 #include "sheader.h"
43 * This module handles status file io. All read and write operations from
44 * and to a status file should use this functions to be independent of the
45 * actual file layout (text versus binary file).
47 #ifdef CPLUSPLUS
48 extern "C" {
49 #endif
51 extern size_t wr_status(FILE *fp,int step,real t,real lambda,
52 t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
53 int natoms,rvec *x,rvec *v,rvec *f,
54 int nre,t_energy *e,t_topology *top);
56 * Writes a complete status to the file, specified by fp. NULL pointers
57 * indicate that this field should not be written. The function returns
58 * the number of bytes written.
61 extern char *rd_hstatus(FILE *fp,t_statheader *sh,int *step,real *t,
62 real *lambda,t_inputrec *ir,rvec *box,
63 rvec *vir,rvec *pres,int *natoms,
64 rvec *x,rvec *v,rvec *f,int *nre,t_energy *e,
65 t_topology *top);
67 * Reads a complete status from the file, specified by fp. It uses
68 * the status header to find the items in the file, also the file
69 * should be positioned right for reading the first item. The function
70 * returns the version string from the header.
73 extern char *rd_status(FILE *fp,int *step,real *t,real *lambda,
74 t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
75 int *natoms,rvec *x,
76 rvec *v,rvec *f,int *nre,t_energy *e,
77 t_topology *top);
79 * Reads a complete status from the file, specified by fp. First it
80 * reads the header and then invokes rd_hstatus() to read the rest
81 * of the status. It returns the version returned from rd_hstatus().
84 extern void write_status(char *fn,int step,real t,real lambda,t_inputrec *ir,
85 rvec *box,rvec *vir,rvec *pres,
86 int natoms,rvec *x,rvec *v,rvec *f,
87 int nre,t_energy *e,t_topology *top);
89 * Writes a complete status to the file, specified by fn. NULL pointers
90 * indicate that this field should not be written.
93 extern char *read_status(char *fn,int *step,real *t,real *lambda,
94 t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
95 int *natoms,rvec *x,
96 rvec *v,rvec *f,int *nre,t_energy *e,
97 t_topology *top);
99 * Reads a complete status from the file, specified by fn. It returns
100 * the version returned from rd_hstatus().
103 extern void read_status_header(char *fn,t_statheader *header);
105 * Reads a (status) header from the file, specified by fn. If
106 * available, it returns the version string from the file, else
107 * it returns a version string from the statusio module.
110 #ifdef CPLUSPLUS
112 #endif
114 #endif /* _statusio_h */