aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-04-13 17:12:00 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:24 +0100
commit36b436334514124e444fc5ccb42e1dc1d1bb25bc (patch)
tree94e896292bb31e3eb170d81524b1a50eae8b107f
parenta11e066ba46a4ef51f5fa831a900a7db3678c717 (diff)
Write stream header in stream.c
-rw-r--r--src/indexamajig.c10
-rw-r--r--src/stream.c14
-rw-r--r--src/stream.h2
3 files changed, 17 insertions, 9 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 7f9a1f56..a7565d01 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -494,7 +494,6 @@ int main(int argc, char *argv[])
int cellr;
int peaks;
int nthreads = 1;
- int i;
pthread_mutex_t output_mutex = PTHREAD_MUTEX_INITIALIZER;
char *prepare_line;
char prepare_filename[1024];
@@ -798,14 +797,7 @@ int main(int argc, char *argv[])
}
free(pdb);
- /* Start by writing the entire command line to stdout */
- fprintf(ofh, "CrystFEL stream format 2.0\n");
- fprintf(ofh, "Command line:");
- for ( i=0; i<argc; i++ ) {
- fprintf(ofh, " %s", argv[i]);
- }
- fprintf(ofh, "\n");
- fflush(ofh);
+ write_stream_header(ofh, argc, argv);
if ( beam != NULL ) {
nominal_photon_energy = beam->photon_energy;
diff --git a/src/stream.c b/src/stream.c
index 2ca8e3f3..4157e34e 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -415,6 +415,20 @@ int read_chunk(FILE *fh, struct image *image)
}
+void write_stream_header(FILE *ofh, int argc, char *argv[])
+{
+ int i;
+
+ fprintf(ofh, "CrystFEL stream format 2.0\n");
+ fprintf(ofh, "Command line:");
+ for ( i=0; i<argc; i++ ) {
+ fprintf(ofh, " %s", argv[i]);
+ }
+ fprintf(ofh, "\n");
+ fflush(ofh);
+}
+
+
int skip_some_files(FILE *fh, int n)
{
char *rval = NULL;
diff --git a/src/stream.h b/src/stream.h
index df02b1fb..02a01c48 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -33,6 +33,8 @@ enum
extern int count_patterns(FILE *fh);
+extern void write_stream_header(FILE *ofh, int argc, char *argv[]);
+
extern void write_chunk(FILE *ofh, struct image *image, int flags);
extern int parse_stream_flags(const char *a);