Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / fileio / xdrf.h
index 1edafcc1ec918792d263548a348e5c9b330eba2a..dd2959e9863924c8b3f5e9ae6ebdffe0d0fcfba2 100644 (file)
@@ -2,8 +2,8 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-
 #ifndef GMX_FILEIO_XDRF_H
 #define GMX_FILEIO_XDRF_H
 
-
 #include <stdio.h>
-#include "../legacyheaders/typedefs.h"
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __PGI    /*Portland group compiler*/
 #define int64_t long long
 #endif
 
-#include "../utility/gmx_header_config.h"
+#include "config.h"
+
 #ifdef GMX_INTERNAL_XDR
-#include "gmx_system_xdr.h"
+#include "gromacs/fileio/gmx_system_xdr.h"
 #else
 #include <rpc/rpc.h>
 #include <rpc/xdr.h>
 extern "C" {
 #endif
 
-
-/* THESE 3 FUNCTIONS (xdropen, xdrclose and xdr_get_fp) ARE NOW OBSOLETE
-   AND ONLY PROVIDED FOR BACKWARD COMPATIBILITY OF 3D PARTY TOOLS.
-   THEY SHOULD NOT BE USED ANYWHERE IN GROMACS ITSELF.
-   int xdropen(XDR *xdrs, const char *filename, const char *type);
-   int xdrclose(XDR *xdrs);
- */
-
-/* the xdr data types; note that there is no data type 'real' because
-   here we deal with the types as they are actually written to disk.  */
-typedef enum
-{
-    xdr_datatype_int,
-    xdr_datatype_float,
-    xdr_datatype_double,
-    xdr_datatype_large_int,
-    xdr_datatype_char,
-    xdr_datatype_string
-} xdr_datatype;
-
-/* names corresponding to the xdr_datatype enum */
-extern const char *xdr_datatype_names[];
+struct t_fileio;
 
 /* Read or write reduced precision *float* coordinates */
 int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision);
@@ -93,10 +73,8 @@ int xdr_real(XDR *xdrs, real *r);
 int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision);
 
 
-int xdr_gmx_large_int(XDR *xdrs, gmx_large_int_t *i);
-/* Read or write a gmx_large_int_t value.
- * 32bit code reading a 64bit gmx_large_int_t value from xdrs could
- * lead to values out of int range.
+int xdr_int64(XDR *xdrs, gmx_int64_t *i);
+/* Read or write a gmx_int64_t value.
  * When warn!=NULL a warning will be written to stderr
  * when a value does not fit,
  * the first line is:
@@ -114,6 +92,16 @@ float xdr_xtc_get_last_frame_time(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bO
 
 int xdr_xtc_get_last_frame_number(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK);
 
+
+/* Defined in gmxfio.c.
+ * TODO: It would be nice to decouple this header from t_fileio completely,
+ * and not need the XDR struct in gmxfio.h, but that would require some
+ * extra code that is not warranted for this single function.
+ * Can be reconsidered if the file I/O gets refactored in the future.
+ */
+XDR *gmx_fio_getxdr(struct t_fileio *fio);
+/* Return the file pointer itself */
+
 #ifdef __cplusplus
 }
 #endif