/* * pdata.h * * Summary: Force field parameter database, associating atom names with * MD API parameter types. * * Author: David Hardy */ #ifndef H_PDATA #define H_PDATA #include "mdtypes.h" #include "ihash.h" #include "param.h" #ifdef __cplusplus extern "C" { #endif #define PDATA_ERR_NOTFOUND -1 typedef struct Pdata_Tag { Ihash table; char **key; int key_len; int key_num; Pbuf *pbuf; int status; } Pdata; /* * Call to initialize the database. * Pdata object should already be allocated. * * Returns 0 on success, negative error code on failure. */ int pdata_init(Pdata *, Pbuf *pbuf); /* * Examine and clear status flag. */ int pdata_status(Pdata *); void pdata_clear_status(Pdata *); /* * Add a bond to the database that is identified by the string. For * dihedrals and impropers, an array of length m is passed in to handle * multiplicities greater than one. * * Returns 0 on success, negative error code on failure. */ int pdata_add_atom(Pdata *, MD_Atom_Param *x, const char *); int pdata_add_bond(Pdata *, MD_Bond_Param *x, const char *, const char *); int pdata_add_angle(Pdata *, MD_Angle_Param *x, const char *, const char *, const char *); int pdata_add_dihed(Pdata *, MD_Dihed_Param *x, const char *, const char *, const char *, const char *); int pdata_add_impr (Pdata *, MD_Impr_Param *x, const char *, const char *, const char *, const char *); int pdata_add_nbfix(Pdata *, MD_Nbfix_Param *x, const char *, const char *); /* * Find the index for a particular bond type based on the * atom names for the bond that was used when adding the element. * * Returns the index if found or negative error code if not found. */ int pdata_find_atom (Pdata *, const char *); int pdata_find_bond (Pdata *, const char *, const char *); int pdata_find_angle(Pdata *, const char *, const char *, const char *); int pdata_find_dihed(Pdata *, const char *, const char *, const char *, const char *); int pdata_find_impr (Pdata *, const char *, const char *, const char *, const char *); int pdata_find_nbfix(Pdata *, const char *, const char *); /* * Destroy the database by clearing the contents. */ void pdata_destroy(Pdata *); #ifdef __cplusplus } #endif #endif /* H_PDATA */