diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-26 09:41:17 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-26 09:41:17 (GMT) |
commit | 5ea15b21f5d497df39c021b4af854bf73db2e4b9 (patch) | |
tree | 05280a35cef757221684d65f178a77250c381d12 /include/tng_io.h | |
parent | 9c6b8ad67d2fa8c7a0a47e1449e0c59828206a24 (diff) |
Added functions tng_molecule_alloc() and tng_molecule_free()
Diffstat (limited to 'include/tng_io.h')
-rw-r--r-- | include/tng_io.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/tng_io.h b/include/tng_io.h index 7028bdc..4d456bb 100644 --- a/include/tng_io.h +++ b/include/tng_io.h @@ -1358,6 +1358,28 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_frame_range_get int64_t *last_frame); /** + * @brief Allocate memory for and setup a molecule container. + * @param tng_data is a trajectory data container. + * @param molecule_p is a pointer to molecule to allocate and initialise. + * @return TNG_SUCCESS (0) if successful or TNG_CRITICAL (2) if a major + * error has occured. + */ +tng_function_status DECLSPECDLLEXPORT tng_molecule_alloc(const tng_trajectory_t tng_data, + tng_molecule_t *molecule_p); + +/** + * @brief Clean up a molecule container and free its allocated memory. + * @param tng_data is a trajectory data container. + * @param molecule_p is the molecule to destroy. + * @details All allocated memory in the data structure is freed and also the memory + * of the molecule itself. + * @return TNG_SUCCESS (0) if successful or TNG_CRITICAL (2) if a major + * error has occured. + */ +tng_function_status DECLSPECDLLEXPORT tng_molecule_free(const tng_trajectory_t tng_data, + tng_molecule_t *molecule_p); + +/** * @brief Setup a molecule container. * @param tng_data is a trajectory data container. * @param molecule is the molecule to initialise. Memory must be preallocated. |