1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
2  *
3  * $Id$
4  *
5  /* -*- mode: c; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
6  *
7  * $Id$
8  *
9  * Copyright (c) 2009-2014, Erik Lindahl & David van der Spoel
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  this
17  * list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright notice,
20  * this list of conditions and the following disclaimer in the documentation
21  * and/or other materials provided with the distribution.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef _xdrfile_xtc_h
37 #define _xdrfile_xtc_h
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include "xdrfile.h"
44 
45 /* All functions return exdrOK if succesfull.
46  * (error codes defined in xdrfile.h).
47  */
48 
49 /* This function returns the number of atoms in the xtc file in *natoms */
50 extern int read_xtc_natoms(char *fn, int *natoms);
51 
52 /* Read one frame of an open xtc file */
53 extern int read_xtc(XDRFILE * xd, int natoms, int *step, float *time,
54                     matrix box, rvec *x, float *prec);
55 
56 /* Write a frame to xtc file */
57 extern int write_xtc(XDRFILE * xd, int natoms, int step, float time,
58                        matrix box, rvec *x, float prec);
59 
60 /* Read Header information of the current frame */
61 extern int xtc_header(XDRFILE *xd, int *natoms, int *step, float *time,
62                       mybool bRead);
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif
68