Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / statusio.h
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 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  * 
21  * If you want to redistribute modifications, please consider that
22  * scientific software is very special. Version control is crucial -
23  * bugs must be traceable. We will be happy to consider code for
24  * inclusion in the official distribution, but derived work must not
25  * be called official GROMACS. Details are found in the README & COPYING
26  * files - if they are missing, get the official version at www.gromacs.org.
27  * 
28  * To help us fund GROMACS development, we humbly ask that you cite
29  * the papers on the package - you can find them in the top README file.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Giving Russians Opium May Alter Current Situation
35  */
36
37 #ifndef _statusio_h
38 #define _statusio_h
39
40 static char *SRCID_statusio_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) statusio.h 1.46 2/2/97"
47 #endif /* HAVE_IDENT */
48
49 #include "typedefs.h"
50 #include "sheader.h"
51
52 /*
53  * This module handles status file io. All read and write operations from
54  * and to a status file should use this functions to be independent of the
55  * actual file layout (text versus binary file).
56  */
57 #ifdef CPLUSPLUS
58 extern "C" { 
59 #endif
60
61 extern size_t wr_status(FILE *fp,int step,real t,real lambda,
62                         t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
63                         int natoms,rvec *x,rvec *v,rvec *f,
64                         int nre,t_energy *e,t_topology *top);
65 /*
66  * Writes a complete status to the file, specified by fp. NULL pointers
67  * indicate that this field should not be written. The function returns
68  * the number of bytes written.
69  */
70
71 extern char *rd_hstatus(FILE *fp,t_statheader *sh,int *step,real *t,
72                         real *lambda,t_inputrec *ir,rvec *box,
73                         rvec *vir,rvec *pres,int *natoms,
74                         rvec *x,rvec *v,rvec *f,int *nre,t_energy *e,
75                         t_topology *top);
76 /*
77  * Reads a complete status from the file, specified by fp. It uses
78  * the status header to find the items in the file, also the file
79  * should be positioned right for reading the first item. The function
80  * returns the version string from the header.
81  */
82
83 extern char *rd_status(FILE *fp,int *step,real *t,real *lambda,
84                        t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
85                        int *natoms,rvec *x,
86                        rvec *v,rvec *f,int *nre,t_energy *e,
87                        t_topology *top);
88 /*
89  * Reads a complete status from the file, specified by fp. First it
90  * reads the header and then invokes rd_hstatus() to read the rest
91  * of the status. It returns the version returned from rd_hstatus().
92  */
93
94 extern void write_status(char *fn,int step,real t,real lambda,t_inputrec *ir,
95                          rvec *box,rvec *vir,rvec *pres,
96                          int natoms,rvec *x,rvec *v,rvec *f,
97                          int nre,t_energy *e,t_topology *top);
98 /*
99  * Writes a complete status to the file, specified by fn. NULL pointers
100  * indicate that this field should not be written.
101  */
102
103 extern char *read_status(char *fn,int *step,real *t,real *lambda,
104                          t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
105                          int *natoms,rvec *x,
106                          rvec *v,rvec *f,int *nre,t_energy *e,
107                          t_topology *top);
108 /*
109  * Reads a complete status from the file, specified by fn. It returns
110  * the version returned from rd_hstatus().
111  */
112
113 extern void read_status_header(char *fn,t_statheader *header);
114 /*
115  * Reads a (status) header from the file, specified by fn. If
116  * available, it returns the version string from the file, else
117  * it returns a version string from the statusio module.
118  */
119
120 #ifdef CPLUSPLUS
121 }
122 #endif
123
124 #endif  /* _statusio_h */