aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/stream.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-12-22 11:46:09 +0100
committerThomas White <taw@physics.org>2024-01-30 10:35:03 +0100
commit9cb19d72dffdb5c1b802ba14c971a21e8ca2982d (patch)
treeddf08e889bc0bad61f8b0666f1eebc24f11e5e87 /libcrystfel/src/stream.c
parentc572a2cabca0339e633eb6ca98fbf0a3bed53497 (diff)
Add data_template_write_to_fh and stream_write_data_template
Diffstat (limited to 'libcrystfel/src/stream.c')
-rw-r--r--libcrystfel/src/stream.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 0273c69b..e767b59f 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1253,8 +1253,26 @@ void stream_write_indexing_methods(Stream *st, const char *indm_str)
* \param st A \ref Stream
* \param geom_filename geomtry file name
*
- * Writes the content of the geometry file to \p st. This should usually be
- * called immediately after \ref write_command.
+ * Writes the content of the geometry file to \p st. This (or
+ * \ref stream_write_geometry_file) should usually be called immediately after
+ * \ref write_command.
+ */
+void stream_write_data_template(Stream *st, const DataTemplate *dtempl)
+{
+ fprintf(st->fh, STREAM_GEOM_START_MARKER"\n");
+ data_template_write_to_fh(dtempl, st->fh);
+ fprintf(st->fh, STREAM_GEOM_END_MARKER"\n");
+ fflush(st->fh);
+}
+
+
+/**
+ * \param st A \ref Stream
+ * \param geom_filename geomtry file name
+ *
+ * Writes the content of the geometry file to \p st. This (or
+ * \ref stream_write_data_template) should usually be called immediately after
+ * \ref write_command.
*/
void stream_write_geometry_file(Stream *st, const char *geom_filename)
{