Commit 36b43633 authored by Thomas White's avatar Thomas White
Browse files

Write stream header in stream.c

parent a11e066b
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment