aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-06-24 17:51:19 +0200
committerThomas White <taw@physics.org>2016-07-01 10:19:33 +0200
commitfbad6335492cd93a43be194e2a979518ffd57194 (patch)
tree5975332dc2b54cabcb64a5cd5dd9dc7ed3c15369
parent541c05ac1979404e10e514653836cc29adfe7d02 (diff)
Store all "=" fields from stream, not just HDF5 ones
-rw-r--r--libcrystfel/src/stream.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 0d67bf8c..ba49ebb0 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1089,7 +1089,7 @@ static void read_crystal(Stream *st, struct image *image, StreamReadFlags srf)
}
-static int read_and_store_hdf5_field(struct image *image, const char *line)
+static int read_and_store_field(struct image *image, const char *line)
{
char **new_fields;
char *nf;
@@ -1098,7 +1098,7 @@ static int read_and_store_hdf5_field(struct image *image, const char *line)
image->stuff_from_stream =
malloc(sizeof(struct stuff_from_stream));
if ( image->stuff_from_stream == NULL) {
- ERROR("Failed reading hdf5 entries from stream\n");
+ ERROR("Failed reading entries from stream\n");
return 1;
}
image->stuff_from_stream->fields = NULL;
@@ -1109,14 +1109,14 @@ static int read_and_store_hdf5_field(struct image *image, const char *line)
(1+image->stuff_from_stream->n_fields)*
sizeof(char *));
if ( new_fields == NULL ) {
- ERROR("Failed reading hdf5 entries from stream\n");
+ 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 HDF5 field from stream\n");
+ ERROR("Failed to allocate field from stream\n");
return 1;
}
image->stuff_from_stream->fields[image->stuff_from_stream->n_fields] = nf;
@@ -1226,13 +1226,13 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf)
}
}
- if ( strncmp(line, "hdf5", 3) == 0 ) {
+ if ( strstr(line, " = ") != NULL ) {
int fail;
- fail = read_and_store_hdf5_field(image, line);
+ fail = read_and_store_field(image, line);
if ( fail ) {
- ERROR("Failed to read hd5 fields from stream.\n");
+ ERROR("Failed to read fields from stream.\n");
return 1;
}
}