summaryrefslogtreecommitdiff
path: root/src/lib/tng_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/tng_io.h')
-rw-r--r--src/lib/tng_io.h106
1 files changed, 37 insertions, 69 deletions
diff --git a/src/lib/tng_io.h b/src/lib/tng_io.h
index cfb95d5..59b8265 100644
--- a/src/lib/tng_io.h
+++ b/src/lib/tng_io.h
@@ -352,25 +352,25 @@ struct tng_trajectory {
*tng_data is a pointer to pre-allocated memory.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_init_trajectory(tng_trajectory_t tng_data);
+tng_function_status tng_trajectory_init(tng_trajectory_t tng_data);
/* Clean up a trajectory data container.
*tng_data is a pointer to pre-allocated memory containing trajectory data.
All allocated memory in the data structure is freed.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_destroy_trajectory(tng_trajectory_t tng_data);
+tng_function_status tng_trajectory_destroy(tng_trajectory_t tng_data);
/* Set the name of the input file.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_input_file(tng_trajectory_t tng_data,
+tng_function_status tng_input_file_set(tng_trajectory_t tng_data,
const char *file_name);
/* Set the name of the output file.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_output_file(tng_trajectory_t tng_data,
+tng_function_status tng_output_file_set(tng_trajectory_t tng_data,
const char *file_name);
/* Set the program name used when creating the trajectory.
@@ -378,7 +378,7 @@ tng_function_status tng_set_output_file(tng_trajectory_t tng_data,
*new_name is a pointer to the string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_program_name(tng_trajectory_t tng_data,
+tng_function_status tng_program_name_set(tng_trajectory_t tng_data,
const char *new_name);
/* Set the name of the forcefield used in the trajectory.
@@ -386,7 +386,7 @@ tng_function_status tng_set_program_name(tng_trajectory_t tng_data,
*new_name is a pointer to the string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_forcefield_name(tng_trajectory_t tng_data,
+tng_function_status tng_forcefield_name_set(tng_trajectory_t tng_data,
const char *new_name);
/* Set the name of the user creating the trajectory.
@@ -394,7 +394,7 @@ tng_function_status tng_set_forcefield_name(tng_trajectory_t tng_data,
*new_name is a pointer to the string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_user_name(tng_trajectory_t tng_data,
+tng_function_status tng_user_name_set(tng_trajectory_t tng_data,
const char *new_name);
/* Set the name of the computer used when creating the trajectory.
@@ -402,7 +402,7 @@ tng_function_status tng_set_user_name(tng_trajectory_t tng_data,
*new_name is a pointer to the string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_computer_name(tng_trajectory_t tng_data,
+tng_function_status tng_computer_name_set(tng_trajectory_t tng_data,
const char *new_name);
/* Set the pgp_signature of the trajectory.
@@ -410,34 +410,34 @@ tng_function_status tng_set_computer_name(tng_trajectory_t tng_data,
*signature is a pointer to the string containing the pgp_signature.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_signature(tng_trajectory_t tng_data,
+tng_function_status tng_signature_set(tng_trajectory_t tng_data,
const char *signature);
/* Setup a molecule container.
*molecule is a pointer to pre-allocated memory.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_init_molecule(tng_molecule_t molecule);
+tng_function_status tng_molecule_init(tng_molecule_t molecule);
/* Clean up a molecule container.
*molecule is a pointer to pre-allocated memory containing a molecule.
All allocated memory in the data structure is freed.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_destroy_molecule(tng_molecule_t molecule);
+tng_function_status tng_molecule_destroy(tng_molecule_t molecule);
/* Setup a data block.
*block is a pointer to pre-allocated memory.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_init_block(struct tng_gen_block *block);
+tng_function_status tng_block_init(struct tng_gen_block *block);
/* Clean up a data block.
*block is a pointer to pre-allocated memory.
All allocated memory in the data structure is freed.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_destroy_block(struct tng_gen_block *block);
+tng_function_status tng_block_destroy(struct tng_gen_block *block);
/* Set the name of a data block.
tng_data is the trajectory data container containing the block..
@@ -445,7 +445,7 @@ tng_function_status tng_destroy_block(struct tng_gen_block *block);
*new_name is a string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_block_name(tng_trajectory_t tng_data,
+tng_function_status tng_block_name_set(tng_trajectory_t tng_data,
struct tng_gen_block *block,
const char *new_name);
@@ -455,7 +455,7 @@ tng_function_status tng_set_block_name(tng_trajectory_t tng_data,
**molecule is a pointer to a pointer to the newly created molecule.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_add_molecule(tng_trajectory_t tng_data,
+tng_function_status tng_molecule_add(tng_trajectory_t tng_data,
const char *name,
tng_molecule_t *molecule);
@@ -465,7 +465,7 @@ tng_function_status tng_add_molecule(tng_trajectory_t tng_data,
*new_name is a string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_molecule_name(tng_trajectory_t tng_data,
+tng_function_status tng_molecule_name_set(tng_trajectory_t tng_data,
tng_molecule_t molecule,
const char *new_name);
@@ -475,7 +475,7 @@ tng_function_status tng_set_molecule_name(tng_trajectory_t tng_data,
*cnt is a pointer to the variable to be populated with the count.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_get_molecule_cnt(tng_trajectory_t tng_data,
+tng_function_status tng_molecule_cnt_get(tng_trajectory_t tng_data,
tng_molecule_t molecule,
int64_t *cnt);
@@ -485,7 +485,7 @@ tng_function_status tng_get_molecule_cnt(tng_trajectory_t tng_data,
cnt is the number of instances of this molecule.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_molecule_cnt(tng_trajectory_t tng_data,
+tng_function_status tng_molecule_cnt_set(tng_trajectory_t tng_data,
tng_molecule_t molecule,
int64_t cnt);
@@ -496,7 +496,7 @@ tng_function_status tng_set_molecule_cnt(tng_trajectory_t tng_data,
**chain is a pointer to a pointer to the newly created chain.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_add_chain_to_molecule(tng_trajectory_t tng_data,
+tng_function_status tng_molecule_chain_add(tng_trajectory_t tng_data,
tng_molecule_t molecule,
const char *name,
tng_chain_t *chain);
@@ -507,7 +507,7 @@ tng_function_status tng_add_chain_to_molecule(tng_trajectory_t tng_data,
*new_name is a string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_chain_name(tng_trajectory_t tng_data,
+tng_function_status tng_chain_name_set(tng_trajectory_t tng_data,
tng_chain_t chain,
const char *new_name);
@@ -518,7 +518,7 @@ tng_function_status tng_set_chain_name(tng_trajectory_t tng_data,
**residue is a pointer to a pointer to the newly created residue.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_add_residue_to_chain(tng_trajectory_t tng_data,
+tng_function_status tng_chain_residue_add(tng_trajectory_t tng_data,
tng_chain_t chain,
const char *name,
tng_residue_t *residue);
@@ -529,7 +529,7 @@ tng_function_status tng_add_residue_to_chain(tng_trajectory_t tng_data,
*new_name is a string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_residue_name(tng_trajectory_t tng_data,
+tng_function_status tng_residue_name_set(tng_trajectory_t tng_data,
tng_residue_t residue,
const char *new_name);
@@ -541,7 +541,7 @@ tng_function_status tng_set_residue_name(tng_trajectory_t tng_data,
**atom is a pointer to a pointer to the newly created atom.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_add_atom_to_residue(tng_trajectory_t tng_data,
+tng_function_status tng_residue_atom_add(tng_trajectory_t tng_data,
tng_residue_t residue,
const char *atom_name,
const char *atom_type,
@@ -553,7 +553,7 @@ tng_function_status tng_add_atom_to_residue(tng_trajectory_t tng_data,
*new_name is a string containing the wanted name.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_atom_name(tng_trajectory_t tng_data,
+tng_function_status tng_atom_name_set(tng_trajectory_t tng_data,
tng_atom_t atom,
const char *new_name);
@@ -563,7 +563,7 @@ tng_function_status tng_set_atom_name(tng_trajectory_t tng_data,
*new_name is a string containing the atom type.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_set_atom_type(tng_trajectory_t tng_data,
+tng_function_status tng_atom_type_set(tng_trajectory_t tng_data,
tng_atom_t atom,
const char *new_type);
@@ -576,7 +576,7 @@ tng_function_status tng_set_atom_type(tng_trajectory_t tng_data,
compared to the md5 hash of the read contents to ensure valid data.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_file_headers(tng_trajectory_t tng_data,
+tng_function_status tng_file_headers_read(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode);
/* Write the header blocks to the output_file of tng_data.
@@ -587,7 +587,7 @@ tng_function_status tng_read_file_headers(tng_trajectory_t tng_data,
If hash_mode == TNG_USE_HASH an md5 hash for each header block will be generated.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_write_file_headers(tng_trajectory_t tng_data,
+tng_function_status tng_file_headers_write(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode);
@@ -601,7 +601,7 @@ tng_function_status tng_write_file_headers(tng_trajectory_t tng_data,
compared to the md5 hash of the read contents to ensure valid data.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor
error has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_next_block(tng_trajectory_t tng_data,
+tng_function_status tng_block_read_next(tng_trajectory_t tng_data,
struct tng_gen_block *block_data,
const tng_hash_mode hash_mode);
@@ -614,7 +614,7 @@ tng_function_status tng_read_next_block(tng_trajectory_t tng_data,
compared to the md5 hash of the read contents to ensure valid data.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_next_frame_set(tng_trajectory_t tng_data,
+tng_function_status tng_frame_set_read_next(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode);
/* Write one frame set, including toc, mapping and related data blocks
@@ -624,14 +624,14 @@ tng_function_status tng_read_next_frame_set(tng_trajectory_t tng_data,
If hash_mode == TNG_USE_HASH an md5 hash for each block will be generated.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_write_frame_set(tng_trajectory_t tng_data,
+tng_function_status tng_frame_set_write(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode);
-tng_function_status tng_new_frame_set(tng_trajectory_t tng_data,
+tng_function_status tng_frame_set_new(tng_trajectory_t tng_data,
const int64_t first_frame,
const int64_t n_frames);
-tng_function_status tng_add_particle_data_block(tng_trajectory_t tng_data,
+tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
const int64_t id,
const char *block_name,
const char datatype,
@@ -644,27 +644,13 @@ tng_function_status tng_add_particle_data_block(tng_trajectory_t tng_data,
void *new_data);
-/* Read one (the next) trajectory block from the input_file of tng_data.
- tng_data is a trajectory data container. tng_data->input_file_path specifies which
- file to read from. If the file (input_file) is not open it will be opened.
- Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
- has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_next_traj_block(tng_trajectory_t tng_data);
-
-/* Write one trajectory block to the output_file of tng_data.
- tng_data is a trajectory data container. tng_data->output_file_path specifies which
- file to write to. If the file (output_file) is not open it will be opened.
- Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
- has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_write_next_traj_block(tng_trajectory_t tng_data);
-
/* Read one trajectory block from the input_file of tng_data.
tng_data is a trajectory data container. tng_data->input_file_path specifies which
file to read from. If the file (input_file) is not open it will be opened.
block_id is the ID of the block to read.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_traj_block(tng_trajectory_t tng_data,
+tng_function_status tng_traj_block_read(tng_trajectory_t tng_data,
int64_t block_id);
/* Write one trajectory block to the output_file of tng_data.
@@ -673,7 +659,7 @@ tng_function_status tng_read_traj_block(tng_trajectory_t tng_data,
block_id is the ID of the block to write.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_write_traj_block(tng_trajectory_t tng_data,
+tng_function_status tng_traj_block_write(tng_trajectory_t tng_data,
int64_t block_id);
/* Read a requested frame set.
@@ -682,27 +668,9 @@ tng_function_status tng_write_traj_block(tng_trajectory_t tng_data,
frame_set_nr is the number of the frame set to return (starting from 0).
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_frame_set_nr(tng_trajectory_t tng_data,
+tng_function_status tng_frame_set_read_nr(tng_trajectory_t tng_data,
int64_t frame_set_nr);
-/* Read one trajectory frame from the input_file of tng_data.
- tng_data is a trajectory data container. tng_data->input_file_path specifies which
- file to read from. If the file (input_file) is not open it will be opened.
- frame_nr is the index number of the frame to read.
- Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
- has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_frame_nr(tng_trajectory_t tng_data,
- int64_t frame_nr);
-
-/* Write one trajectory frame to the output_file of tng_data.
- tng_data is a trajectory data container. tng_data->output_file_path specifies which
- file to write to. If the file (output_file) is not open it will be opened.
- frame_nr is the index number of the frame to write.
- Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
- has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_write_frame_nr(tng_trajectory_t tng_data,
- int64_t frame_nr);
-
/* Read a number of consecutive trajectory frames from the input_file of tng_data.
tng_data is a trajectory data container. tng_data->input_file_path specifies which
file to read from. If the file (input_file) is not open it will be opened.
@@ -710,7 +678,7 @@ tng_function_status tng_write_frame_nr(tng_trajectory_t tng_data,
end_frame_nr is the index number of the last frame to read.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_read_frame_nrs(tng_trajectory_t tng_data,
+tng_function_status tng_frame_read_interval(tng_trajectory_t tng_data,
int64_t start_frame_nr,
int64_t end_frame_nr);
@@ -721,7 +689,7 @@ tng_function_status tng_read_frame_nrs(tng_trajectory_t tng_data,
end_frame_nr is the index number of the last frame to write.
Returns TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
has occurred or TNG_CRITICAL (2) if a major error has occured. */
-tng_function_status tng_write_frame_nrs(tng_trajectory_t tng_data,
+tng_function_status tng_frame_write_interval(tng_trajectory_t tng_data,
int64_t start_frame_nr,
int64_t end_frame_nr);
contact: Jan Huwald // Impressum