summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-12-05 16:20:53 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-12-05 16:20:53 (GMT)
commit4c75bb0f7f7bc465fe8fc01113a44fea3fe92a0a (patch)
tree15e2bcf917992411fa5a1f41c5381d3db665d8f8 /src/lib
parentc6443b9491b17a09e82a9972c26418d52e187514 (diff)
Added function tng_util_prepare_append_after_frame()
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/tng_io.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 57744e8..33d58ba 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -18306,3 +18306,29 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
return(TNG_SUCCESS);
}
+
+tng_function_status DECLSPECDLLEXPORT tng_util_prepare_append_after_frame
+ (tng_trajectory_t tng_data,
+ const int64_t prev_frame)
+{
+ tng_function_status stat;
+ FILE *temp = tng_data->input_file;
+
+ TNG_ASSERT(tng_data, "TNG library: Trajectory container not properly setup.");
+ TNG_ASSERT(prev_frame >= 0, "TNG library: The previous frame must not be negative.");
+
+ tng_data->input_file = tng_data->output_file;
+
+ stat = tng_frame_set_of_frame_find(tng_data, prev_frame);
+ if(stat != TNG_SUCCESS)
+ {
+ return(stat);
+ }
+
+ tng_data->current_trajectory_frame_set_output_file_pos =
+ tng_data->current_trajectory_frame_set_input_file_pos;
+
+ tng_data->input_file = temp;
+
+ return(TNG_SUCCESS);
+}
contact: Jan Huwald // Impressum