Fixed some memory leaks.
[gromacs/qmmm-gamess-us.git] / include / statusio.h
blob575a98beff08622357b5fdd88d41afbb598b8fb7
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * Gromacs Runs On Most of All Computer Systems
36 #ifndef _statusio_h
37 #define _statusio_h
39 #ifdef HAVE_CONFIG_H
40 #include <config.h>
41 #endif
43 #include "typedefs.h"
44 #include "sheader.h"
47 * This module handles status file io. All read and write operations from
48 * and to a status file should use this functions to be independent of the
49 * actual file layout (text versus binary file).
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
55 extern size_t wr_status(FILE *fp,int step,real t,real lambda,
56 t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
57 int natoms,rvec *x,rvec *v,rvec *f,
58 int nre,t_energy *e,t_topology *top);
60 * Writes a complete status to the file, specified by fp. NULL pointers
61 * indicate that this field should not be written. The function returns
62 * the number of bytes written.
65 extern char *rd_hstatus(FILE *fp,t_statheader *sh,int *step,real *t,
66 real *lambda,t_inputrec *ir,rvec *box,
67 rvec *vir,rvec *pres,int *natoms,
68 rvec *x,rvec *v,rvec *f,int *nre,t_energy *e,
69 t_topology *top);
71 * Reads a complete status from the file, specified by fp. It uses
72 * the status header to find the items in the file, also the file
73 * should be positioned right for reading the first item. The function
74 * returns the version string from the header.
77 extern char *rd_status(FILE *fp,int *step,real *t,real *lambda,
78 t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
79 int *natoms,rvec *x,
80 rvec *v,rvec *f,int *nre,t_energy *e,
81 t_topology *top);
83 * Reads a complete status from the file, specified by fp. First it
84 * reads the header and then invokes rd_hstatus() to read the rest
85 * of the status. It returns the version returned from rd_hstatus().
88 extern void write_status(char *fn,int step,real t,real lambda,t_inputrec *ir,
89 rvec *box,rvec *vir,rvec *pres,
90 int natoms,rvec *x,rvec *v,rvec *f,
91 int nre,t_energy *e,t_topology *top);
93 * Writes a complete status to the file, specified by fn. NULL pointers
94 * indicate that this field should not be written.
97 extern char *read_status(char *fn,int *step,real *t,real *lambda,
98 t_inputrec *ir,rvec *box,rvec *vir,rvec *pres,
99 int *natoms,rvec *x,
100 rvec *v,rvec *f,int *nre,t_energy *e,
101 t_topology *top);
103 * Reads a complete status from the file, specified by fn. It returns
104 * the version returned from rd_hstatus().
107 extern void read_status_header(char *fn,t_statheader *header);
109 * Reads a (status) header from the file, specified by fn. If
110 * available, it returns the version string from the file, else
111 * it returns a version string from the statusio module.
114 #ifdef __cplusplus
116 #endif
118 #endif /* _statusio_h */