diff options
author | Thomas White <taw@physics.org> | 2021-07-16 09:09:00 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-07-16 09:09:00 +0200 |
commit | 194f2aa345e738bc7e92ab6fc34a0ea185ad23d5 (patch) | |
tree | 58c41ffd45e877a027731bdfd39adbd360e1161d /libcrystfel/src | |
parent | db1f4d304c45482a6985d19df99a920c48248cfb (diff) |
Rename DST_* to DATA_SOURCE_TYPE_*
On some systems, this conflicts with DST_NONE in sys/time.h.
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/image.c | 32 | ||||
-rw-r--r-- | libcrystfel/src/image.h | 12 | ||||
-rw-r--r-- | libcrystfel/src/stream.c | 2 |
3 files changed, 23 insertions, 23 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index a71c0b97..74e6d8d3 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -371,19 +371,19 @@ static int read_header_to_cache(struct image *image, const char *from) { switch ( image->data_source_type ) { - case DST_NONE: + case DATA_SOURCE_TYPE_NONE: ERROR("No data source for %s %s - not loading header\n", image->filename, image->ev); return 1; - case DST_HDF5: + case DATA_SOURCE_TYPE_HDF5: return image_hdf5_read_header_to_cache(image, from); - case DST_CBF: - case DST_CBFGZ: + case DATA_SOURCE_TYPE_CBF: + case DATA_SOURCE_TYPE_CBFGZ: return image_cbf_read_header_to_cache(image, from); - case DST_MSGPACK: + case DATA_SOURCE_TYPE_MSGPACK: return image_msgpack_read_header_to_cache(image, from); default: @@ -454,21 +454,21 @@ static DataSourceType file_type(const char *filename) { if ( !file_exists(filename) ) { ERROR("File not found: %s (file_type)\n", filename); - return DST_NONE; + return DATA_SOURCE_TYPE_NONE; } if ( is_hdf5_file(filename) ) { - return DST_HDF5; + return DATA_SOURCE_TYPE_HDF5; } else if ( is_cbf_file(filename) ) { - return DST_CBF; + return DATA_SOURCE_TYPE_CBF; } else if ( is_cbfgz_file(filename) ) { - return DST_CBFGZ; + return DATA_SOURCE_TYPE_CBFGZ; } else { ERROR("Unrecognised file type: %s (file_type)\n", filename); - return DST_UNKNOWN; + return DATA_SOURCE_TYPE_UNKNOWN; } } @@ -767,26 +767,26 @@ static int image_read_image_data(struct image *image, switch ( image->data_source_type ) { - case DST_NONE: + case DATA_SOURCE_TYPE_NONE: STATUS("No data source for %s %s - not loading.\n", image->filename, image->ev); return 1; - case DST_HDF5: + case DATA_SOURCE_TYPE_HDF5: return image_hdf5_read(image, dtempl, image->filename, image->ev); - case DST_CBF: + case DATA_SOURCE_TYPE_CBF: return image_cbf_read(image, dtempl, image->filename, image->ev, 0); - case DST_CBFGZ: + case DATA_SOURCE_TYPE_CBFGZ: return image_cbf_read(image, dtempl, image->filename, image->ev, 1); - case DST_MSGPACK: + case DATA_SOURCE_TYPE_MSGPACK: return image_msgpack_read(image, dtempl, image->data_block, image->data_block_size); @@ -1406,7 +1406,7 @@ struct image *image_new() image->ev = NULL; image->data_block = NULL; image->data_block_size = 0; - image->data_source_type = DST_UNKNOWN; + image->data_source_type = DATA_SOURCE_TYPE_UNKNOWN; image->n_cached_headers = 0; image->id = 0; diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index 1aabeccc..43d0ed45 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -98,12 +98,12 @@ struct header_cache_entry { typedef enum { - DST_UNKNOWN, - DST_NONE, - DST_HDF5, - DST_CBF, - DST_CBFGZ, - DST_MSGPACK + DATA_SOURCE_TYPE_UNKNOWN, + DATA_SOURCE_TYPE_NONE, + DATA_SOURCE_TYPE_HDF5, + DATA_SOURCE_TYPE_CBF, + DATA_SOURCE_TYPE_CBFGZ, + DATA_SOURCE_TYPE_MSGPACK } DataSourceType; diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 09a505a7..cd64a485 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -985,7 +985,7 @@ struct image *stream_read_chunk(Stream *st, StreamFlags srf) image = image_new(); if ( image == NULL ) return NULL; - image->data_source_type = DST_NONE; + image->data_source_type = DATA_SOURCE_TYPE_NONE; do { int ser; |