diff options
author | Thomas White <taw@physics.org> | 2020-07-01 11:03:18 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:53:44 +0200 |
commit | d2708de6888f6194badf65e2c94f2def1d4b7830 (patch) | |
tree | 663b9f4587ef7fac4555522edbdc8b38360aacff /tests/ev_enum1.c | |
parent | 9ff36c70a7a27fb6fd86068483a47d9efb606245 (diff) |
tests/ev_enum1: Use API function
Diffstat (limited to 'tests/ev_enum1.c')
-rw-r--r-- | tests/ev_enum1.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/ev_enum1.c b/tests/ev_enum1.c index c1a93320..67cccb5b 100644 --- a/tests/ev_enum1.c +++ b/tests/ev_enum1.c @@ -35,26 +35,23 @@ #include <stdarg.h> #include <string.h> #include <stdlib.h> -#include <hdf5.h> -extern char **expand_paths(hid_t fh, char *pattern, int *n_evs); +#include <image.h> int main(int argc, char *argv[]) { - hid_t fh; char **event_ids; int n_event_ids; int i; + DataTemplate *dtempl; - fh = H5Fopen(argv[1], H5F_ACC_RDONLY, H5P_DEFAULT); - if ( fh < 0 ) { - printf("Couldn't open file\n"); + dtempl = data_template_new_from_file(argv[2]); + if ( dtempl == NULL ) { + ERROR("Failed to load data template\n"); return 1; } - event_ids = expand_paths(fh, - "/data/panelA/%/panel_data1t/%/array", - &n_event_ids); + event_ids = image_expand_frames(dtempl, argv[1], &n_event_ids); if ( event_ids == NULL ) { printf("event_ids = NULL\n"); @@ -91,7 +88,7 @@ int main(int argc, char *argv[]) } free(event_ids); - H5Fclose(fh); + data_template_free(dtempl); return 0; } |