summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-27 11:32:40 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-27 13:41:03 (GMT)
commit28edd851f8b7675fdadb51ebf906ae9cf8494dc8 (patch)
tree060368b3b93101689f5d552ea97dbd8a00e06752 /include
parent4d7a005fd8e797fe2b61792f4c881187f2d6d5a0 (diff)
Fixed opening files for appending (might still not be perfect).
Flush file when writing trajectory frame set.
Diffstat (limited to 'include')
-rw-r--r--include/tng_io.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/tng_io.h b/include/tng_io.h
index 845ad2b..5347101 100644
--- a/include/tng_io.h
+++ b/include/tng_io.h
@@ -654,6 +654,22 @@ tng_function_status DECLSPECDLLEXPORT tng_output_file_set
const char *file_name);
/**
+ * @brief Set the name of the output file for appending. The output file
+ * will not be overwritten.
+ * @param tng_data the trajectory of which to set the output file name.
+ * @param file_name the name of the output file to append to.
+ * @pre \code tng_data != 0 \endcode The trajectory container (tng_data)
+ * must be initialised before using it.
+ * @pre \code file_name != 0 \endcode The pointer to the file name string
+ * must not be a NULL pointer.
+ * @return TNG_SUCCESS (0) if successful or TNG_CRITICAL (2) if a major
+ * error has occured.
+ */
+tng_function_status DECLSPECDLLEXPORT tng_output_append_file_set
+ (tng_trajectory_t tng_data,
+ const char *file_name);
+
+/**
* @brief Get the endianness of the output file.
* @param tng_data the trajectory of which to get the endianness of the current
* output file.
@@ -2195,6 +2211,27 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_write
const char hash_mode);
/**
+ * @brief Write one frame set even if it does not have as many frames as
+ * expected. The function also writes mapping and related data blocks
+ * to the output_file of tng_data.
+ * @param tng_data is a trajectory data container.
+ * @details tng_data->output_file_path specifies
+ * which file to write to. If the file (output_file) is not open it will be
+ * opened.
+ * @param hash_mode is an option to decide whether to use the md5 hash or not.
+ * If hash_mode == TNG_USE_HASH an md5 hash for each header block will be generated.
+ * @pre \code tng_data != 0 \endcode The trajectory container (tng_data)
+ * must be initialised before using it.
+ * @details The number of frames in the frame set is set to the number of
+ * frames of the data blocks before writing it to disk.
+ * @return 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 DECLSPECDLLEXPORT tng_frame_set_premature_write
+ (tng_trajectory_t tng_data,
+ const char hash_mode);
+
+/**
* @brief Create and initialise a frame set.
* @param tng_data is the trajectory data container in which to add the frame
* set.
contact: Jan Huwald // Impressum