summaryrefslogtreecommitdiff
path: root/src/lib/tng_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/tng_io.c')
-rw-r--r--src/lib/tng_io.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 1fcc7d9..364df13 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -7164,6 +7164,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_find
TNG_ASSERT(tng_data, "TNG library: Trajectory container not properly setup.");
TNG_ASSERT(name, "TNG library: name must not be a NULL pointer.");
+ TNG_ASSERT(molecule, "TNG library: molecule must not be a NULL pointer.");
n_molecules = tng_data->n_molecules;
@@ -7184,6 +7185,23 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_find
return(TNG_FAILURE);
}
+tng_function_status DECLSPECDLLEXPORT tng_molecule_of_index_get
+ (tng_trajectory_t tng_data,
+ int64_t index,
+ tng_molecule_t *molecule)
+{
+ TNG_ASSERT(tng_data, "TNG library: Trajectory container not properly setup.");
+ TNG_ASSERT(molecule, "TNG library: molecule must not be a NULL pointer.");
+
+ if(index >= tng_data->n_molecules)
+ {
+ *molecule = 0;
+ return(TNG_FAILURE);
+ }
+ *molecule = &tng_data->molecules[index];
+ return(TNG_SUCCESS);
+}
+
tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find
(tng_trajectory_t tng_data,
tng_molecule_t molecule,
contact: Jan Huwald // Impressum