diff options
author | Thomas White <taw@physics.org> | 2020-05-25 15:01:58 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:42:57 +0200 |
commit | aab8403884c4731f7365796de8f53315f4a61616 (patch) | |
tree | 6a7bc45b52c7943220c71de07caba9c681b2567d /libcrystfel/src/stream.c | |
parent | 23ea67dc03ac19f7a1457ecfdc8d5ee9cac68632 (diff) |
Get rid of imagefile_field_list and stuff_from_stream
The only place this is used is in geoptimiser, to get the
average_camera_length, itself a very bad solution.
Diffstat (limited to 'libcrystfel/src/stream.c')
-rw-r--r-- | libcrystfel/src/stream.c | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 8255a711..419acd36 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -1144,55 +1144,6 @@ static void read_crystal(Stream *st, struct image *image, StreamReadFlags srf) } -void free_stuff_from_stream(struct stuff_from_stream *sfs) -{ - int i; - if ( sfs == NULL ) return; - for ( i=0; i<sfs->n_fields; i++ ) { - free(sfs->fields[i]); - } - free(sfs->fields); - free(sfs); -} - - -static int read_and_store_field(struct image *image, const char *line) -{ - char **new_fields; - char *nf; - - if ( image->stuff_from_stream == NULL ) { - image->stuff_from_stream = - malloc(sizeof(struct stuff_from_stream)); - if ( image->stuff_from_stream == NULL) { - ERROR("Failed reading entries from stream\n"); - return 1; - } - image->stuff_from_stream->fields = NULL; - image->stuff_from_stream->n_fields = 0; - } - - new_fields = realloc(image->stuff_from_stream->fields, - (1+image->stuff_from_stream->n_fields)* - sizeof(char *)); - if ( new_fields == NULL ) { - ERROR("Failed reading entries from stream\n"); - return 1; - } - image->stuff_from_stream->fields = new_fields; - - nf = strdup(line); - if ( nf == NULL ) { - ERROR("Failed to allocate field from stream\n"); - return 1; - } - image->stuff_from_stream->fields[image->stuff_from_stream->n_fields] = nf; - image->stuff_from_stream->n_fields++; - - return 0; -} - - /** * Read the next chunk from a stream and fill in 'image' */ @@ -1210,7 +1161,7 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf) image->crystals = NULL; image->n_crystals = 0; image->ev = NULL; - image->stuff_from_stream = NULL; + image->copied_headers = NULL; if ( (srf & STREAM_READ_REFLECTIONS) || (srf & STREAM_READ_UNITCELL) ) { srf |= STREAM_READ_CRYSTALS; @@ -1291,17 +1242,6 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf) } } - if ( strstr(line, " = ") != NULL ) { - - int fail; - - fail = read_and_store_field(image, line); - if ( fail ) { - ERROR("Failed to read fields from stream.\n"); - return 1; - } - } - if ( (srf & STREAM_READ_PEAKS) && strcmp(line, PEAK_LIST_START_MARKER) == 0 ) { |