Create fileio module
[alexxy/gromacs.git] / src / gromacs / legacyheaders / statutil.h
index a2a8a446aa1dd5a02ff1006dd240924b94f7c640..6bd9dbab6dc58d9b60b1276df44bf2af8c1b4b20 100644 (file)
 #ifndef _statutil_h
 #define _statutil_h
 
-#include "typedefs.h"
-#include "filenm.h"
+#include "../fileio/filenm.h"
 #include "readinp.h"
-#include "pdbio.h"
 #include "oenv.h"
-#include "gmxfio.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -67,12 +64,6 @@ void setTimeValue(int tcontrol, real value);
 
 /* End trajectory time control */
 
-/* a dedicated status type contains fp, etc. */
-typedef struct t_trxstatus t_trxstatus;
-
-/* I/O function types */
-
-
 /* LEGACY FUNCTIONS
 
    The program names, command lines, etc. are now also set in the output_env
@@ -89,154 +80,6 @@ const char *Program(void);
 /* Id. without leading directory */
 const char *ShortProgram(void);
 
-/************************************************
- *             Trajectory functions
- ************************************************/
-
-int prec2ndec(real prec);
-/* Convert precision in 1/(nm) to number of decimal places */
-
-void clear_trxframe(t_trxframe *fr, gmx_bool bFirst);
-/* Set all content gmx_booleans to FALSE.
- * When bFirst = TRUE, set natoms=-1, all pointers to NULL
- *                     and all data to zero.
- */
-
-void set_trxframe_ePBC(t_trxframe *fr, int ePBC);
-/* Set the type of periodic boundary conditions, ePBC=-1 is not set */
-
-int nframes_read(t_trxstatus *status);
-/* Returns the number of frames read from the trajectory */
-
-int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
-                           const atom_id *ind, gmx_conect gc);
-/* Write an indexed frame to a TRX file, see write_trxframe. gc may be NULL */
-
-int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc);
-/* Write a frame to a TRX file.
- * Only entries for which the gmx_boolean is TRUE will be written,
- * except for step, time, lambda and/or box, which may not be
- * omitted for certain trajectory formats.
- * The precision for .xtc and .gro is fr->prec, when fr->bPrec=FALSE,
- * the precision is set to 1000.
- * gc is important for pdb file writing only and may be NULL.
- */
-
-int write_trx(t_trxstatus *status, int nind, const atom_id *ind, t_atoms *atoms,
-              int step, real time, matrix box, rvec x[], rvec *v,
-              gmx_conect gc);
-/* Write an indexed frame to a TRX file.
- * v can be NULL.
- * atoms can be NULL for file types which don't need atom names.
- */
-
-void close_trx(t_trxstatus *status);
-/* Close trj file as opened with read_first_x, read_frist_frame
- * or open_trx. Identical to close_trj.
- */
-
-t_trxstatus *open_trx(const char *outfile, const char *filemode);
-/* Open a TRX file and return an allocated status pointer */
-
-/* get a fileio from a trxstatus */
-t_fileio *trx_get_fileio(t_trxstatus *status);
-
-
-gmx_bool bRmod_fd(double a, double b, double c, gmx_bool bDouble);
-/* Returns TRUE when (a - b) MOD c = 0, using a margin which is slightly
- * larger than the float/double precision.
- */
-
-#ifdef GMX_DOUBLE
-#define bRmod(a, b, c) bRmod_fd(a, b, c, TRUE)
-#else
-#define bRmod(a, b, c) bRmod_fd(a, b, c, FALSE)
-#endif
-
-int check_times2(real t, real t0, gmx_bool bDouble);
-/* This routine checkes if the read-in time is correct or not;
- * returns -1 if t<tbegin or t MOD dt = t0,
- *          0 if tbegin <= t <=tend+margin,
- *          1 if t>tend
- * where margin is 0.1*min(t-tp,tp-tpp), if this positive, 0 otherwise.
- * tp and tpp should be the time of the previous frame and the one before.
- * The mod is done with single or double precision accuracy depending
- * on the value of bDouble.
- */
-
-int check_times(real t);
-/* This routine checkes if the read-in time is correct or not;
- * returns -1 if t<tbegin,
- *          0 if tbegin <= t <=tend,
- *          1 if t>tend
- */
-
-
-
-
-
-/* For trxframe.flags, used in trxframe read routines.
- * When a READ flag is set, the field will be read when present,
- * but a frame might be returned which does not contain the field.
- * When a NEED flag is set, frames not containing the field will be skipped.
- */
-#define TRX_READ_X    (1<<0)
-#define TRX_NEED_X    (1<<1)
-#define TRX_READ_V    (1<<2)
-#define TRX_NEED_V    (1<<3)
-#define TRX_READ_F    (1<<4)
-#define TRX_NEED_F    (1<<5)
-/* Useful for reading natoms from a trajectory without skipping */
-#define TRX_DONT_SKIP (1<<6)
-
-/* For trxframe.not_ok */
-#define HEADER_NOT_OK (1<<0)
-#define DATA_NOT_OK   (1<<1)
-#define FRAME_NOT_OK  (HEADER_NOT_OK | DATA_NOT_OK)
-
-int read_first_frame(const output_env_t oenv, t_trxstatus **status,
-                     const char *fn, t_trxframe *fr, int flags);
-/* Read the first frame which is in accordance with flags, which are
- * defined further up in this file.
- * Returns natoms when succeeded, 0 otherwise.
- * Memory will be allocated for flagged entries.
- * The flags are copied to fr for subsequent calls to read_next_frame.
- * Returns TRUE when succeeded, FALSE otherwise.
- */
-
-gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status,
-                         t_trxframe *fr);
-/* Reads the next frame which is in accordance with fr->flags.
- * Returns TRUE when succeeded, FALSE otherwise.
- */
-
-int read_first_x(const output_env_t oenv, t_trxstatus **status,
-                 const char *fn, real *t, rvec **x, matrix box);
-/* These routines read first coordinates and box, and allocates
- * memory for the coordinates, for a trajectory file.
- * The routine returns the number of atoms, or 0 when something is wrong.
- * The integer in status should be passed to calls of read_next_x
- */
-
-gmx_bool read_next_x(const output_env_t oenv, t_trxstatus *status, real *t, rvec x[], matrix box);
-/* Read coordinates and box from a trajectory file. Return TRUE when all well,
- * or FALSE when end of file (or last frame requested by user).
- * status is the integer set in read_first_x.
- */
-
-void close_trj(t_trxstatus *status);
-/* Close trj file as opened with read_first_x, read_frist_frame
- * or open_trx. Identical to close_trx.
- */
-
-void rewind_trj(t_trxstatus *status);
-/* Rewind trj file as opened with read_first_x */
-
-t_topology *read_top(const char *fn, int *ePBC);
-/* Extract a topology data structure from a topology file.
- * If ePBC!=NULL *ePBC gives the pbc type.
- */
-
 /*****************************************************
  *         Some command line parsing routines
  *****************************************************/