* 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.
#ifndef GMX_FILEIO_PDBIO_H
#define GMX_FILEIO_PDBIO_H
-#include "../legacyheaders/sysstuff.h"
-#include "../legacyheaders/typedefs.h"
-#include "../legacyheaders/symtab.h"
-#include "../legacyheaders/atomprop.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/simple.h"
#ifdef __cplusplus
extern "C" {
#endif
-typedef struct gmx_conect_t *gmx_conect;
+struct gmx_atomprop;
+struct t_atoms;
+struct t_topology;
-/* THE pdb format (for ATOM/HETATOM lines) */
-const char* get_pdbformat(void);
-const char* get_pdbformat4(void);
+typedef struct gmx_conect_t *gmx_conect;
/* Enumerated type for pdb records. The other entries are ignored
* when reading a pdb file
*/
-enum {
+enum PDB_record {
epdbATOM, epdbHETATM, epdbANISOU, epdbCRYST1, epdbCOMPND,
epdbMODEL, epdbENDMDL, epdbTER, epdbHEADER, epdbTITLE, epdbREMARK,
epdbCONECT, epdbNR
};
+/* Write a PDB line with an ATOM or HETATM record directly to a file pointer.
+ *
+ * Returns the number of characters printed.
+ */
+int
+gmx_fprintf_pdb_atomline(FILE * fp,
+ enum PDB_record record,
+ int atom_seq_number,
+ const char * atom_name,
+ char alternate_location,
+ const char * res_name,
+ char chain_id,
+ int res_seq_number,
+ char res_insertion_code,
+ real x,
+ real y,
+ real z,
+ real occupancy,
+ real b_factor,
+ const char * element);
+
/* Enumerated value for indexing an uij entry (anisotropic temperature factors) */
enum {
U11, U22, U33, U12, U13, U23
};
-void set_pdb_wide_format(gmx_bool bSet);
-/* If bSet, use wider format for occupancy and bfactor */
-
void pdb_use_ter(gmx_bool bSet);
/* set read_pdbatoms to read upto 'TER' or 'ENDMDL' (default, bSet=FALSE).
This function is fundamentally broken as far as thread-safety is concerned.*/
* This function is fundamentally broken as far as thread-safety is concerned.
*/
-void write_pdbfile_indexed(FILE *out, const char *title, t_atoms *atoms,
+void write_pdbfile_indexed(FILE *out, const char *title, struct t_atoms *atoms,
rvec x[], int ePBC, matrix box, char chain,
int model_nr, atom_id nindex, const atom_id index[],
gmx_conect conect, gmx_bool bTerSepChains);
/* REALLY low level */
-void write_pdbfile(FILE *out, const char *title, t_atoms *atoms,
+void write_pdbfile(FILE *out, const char *title, struct t_atoms *atoms,
rvec x[], int ePBC, matrix box, char chain,
int model_nr, gmx_conect conect, gmx_bool bTerSepChains);
/* Low level pdb file writing routine.
* which may be useful for visualization purposes.
*/
-void get_pdb_atomnumber(t_atoms *atoms, gmx_atomprop_t aps);
+void get_pdb_atomnumber(struct t_atoms *atoms, struct gmx_atomprop *aps);
/* Routine to extract atomic numbers from the atom names */
int read_pdbfile(FILE *in, char *title, int *model_nr,
- t_atoms *atoms, rvec x[], int *ePBC, matrix box,
+ struct t_atoms *atoms, rvec x[], int *ePBC, matrix box,
gmx_bool bChange, gmx_conect conect);
/* Function returns number of atoms found.
* ePBC and gmx_conect structure may be NULL.
*/
void read_pdb_conf(const char *infile, char *title,
- t_atoms *atoms, rvec x[], int *ePBC, matrix box,
+ struct t_atoms *atoms, rvec x[], int *ePBC, matrix box,
gmx_bool bChange, gmx_conect conect);
/* Read a pdb file and extract ATOM and HETATM fields.
* Read a box from the CRYST1 line, return 0 box when no CRYST1 is found.
void gmx_conect_add(gmx_conect conect, int ai, int aj);
/* Add a connection between ai and aj (numbered from 0 to natom-1) */
-gmx_conect gmx_conect_generate(t_topology *top);
+gmx_conect gmx_conect_generate(struct t_topology *top);
/* Generate a conect structure from a topology */
gmx_conect gmx_conect_init(void);