aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/stream.c18
-rw-r--r--libcrystfel/src/stream.h6
2 files changed, 21 insertions, 3 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 877a1824..a9e6a441 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -557,6 +557,24 @@ int is_stream(const char *filename)
}
+void write_line(Stream *st, const char *line)
+{
+ fprintf(st->fh, "%s\n", line);
+}
+
+
+void write_command(Stream *st, int argc, char *argv[])
+{
+ int i;
+
+ for ( i=0; i<argc; i++ ) {
+ if ( i > 0 ) fprintf(st->fh, " ");
+ fprintf(st->fh, "%s", argv[i]);
+ }
+ fprintf(st->fh, "\n");
+}
+
+
/**
* rewind_stream:
* @st: A %Stream
diff --git a/libcrystfel/src/stream.h b/libcrystfel/src/stream.h
index cdce0ea2..08e680bc 100644
--- a/libcrystfel/src/stream.h
+++ b/libcrystfel/src/stream.h
@@ -53,16 +53,16 @@ typedef struct _stream Stream;
extern Stream *open_stream_for_read(const char *filename);
extern Stream *open_stream_for_write(const char *filename);
extern Stream *open_stream_fd_for_write(int fd);
-
extern void close_stream(Stream *st);
+extern int read_chunk(Stream *st, struct image *image);
extern void write_chunk(Stream *st, struct image *image, struct hdfile *hdfile,
int include_peaks, int include_reflections);
-extern int read_chunk(Stream *st, struct image *image);
+extern void write_line(Stream *st, const char *line);
+extern void write_command(Stream *st, int argc, char *argv[]);
extern int rewind_stream(Stream *st);
-
extern int is_stream(const char *filename);
#endif /* STREAM_H */