From f30770be84551cba159358905eb8983cbb7092a6 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 9 Apr 2024 17:11:09 -0500 Subject: [PATCH] Use native VOL enum type for optional file ops --- src/rest_vol.h | 3 --- src/rest_vol_debug.c | 8 ++++---- src/rest_vol_debug.h | 2 +- src/rest_vol_file.c | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/rest_vol.h b/src/rest_vol.h index f348c740..fb40652c 100644 --- a/src/rest_vol.h +++ b/src/rest_vol.h @@ -440,9 +440,6 @@ typedef struct RV_type_info { #define H5I_MAX_NUM_TYPES TYPE_MASK extern RV_type_info *RV_type_info_array_g[]; -/* Enum values in RV_file_optional_args_t that specify certain operations */ -#define RV_FILE_GET_SIZE 8 - /************************** * * * Typedefs * diff --git a/src/rest_vol_debug.c b/src/rest_vol_debug.c index ba1d0fdf..6ea75176 100644 --- a/src/rest_vol_debug.c +++ b/src/rest_vol_debug.c @@ -439,7 +439,7 @@ file_specific_type_to_string(H5VL_file_specific_t specific_type) * Function: file_optional_type_to_string * * Purpose: Helper function to convert each member of the - * H5VL_file_optional_t enum into its string representation + * H5VL_native_file_optional_args_t enum into its string representation * * Return: String representation of given object or '(unknown)' if * the function can't determine the type of object it has @@ -449,10 +449,10 @@ file_specific_type_to_string(H5VL_file_specific_t specific_type) * January, 2024 */ const char * -file_optional_type_to_string(H5VL_optional_args_t optional_type) +file_optional_type_to_string(H5VL_file_optional_t optional_type) { - switch (optional_type.op_type) { - case RV_FILE_GET_SIZE: + switch (optional_type) { + case H5VL_NATIVE_FILE_GET_SIZE: return "RV_FILE_GET_FILESIZE"; default: return "(unknown)"; diff --git a/src/rest_vol_debug.h b/src/rest_vol_debug.h index 3d3118f1..7e948ac8 100644 --- a/src/rest_vol_debug.h +++ b/src/rest_vol_debug.h @@ -32,7 +32,7 @@ const char *dataset_specific_type_to_string(H5VL_dataset_specific_t specific_typ const char *file_flags_to_string(unsigned flags); const char *file_get_type_to_string(H5VL_file_get_t get_type); const char *file_specific_type_to_string(H5VL_file_specific_t specific_type); -const char *file_optional_type_to_string(H5VL_optional_args_t optional_type); +const char *file_optional_type_to_string(H5VL_file_optional_t optional_type); const char *group_get_type_to_string(H5VL_group_get_t get_type); const char *link_create_type_to_string(H5VL_link_create_t link_create_type); const char *link_get_type_to_string(H5VL_link_get_t get_type); diff --git a/src/rest_vol_file.c b/src/rest_vol_file.c index 6e02496c..9eabe251 100644 --- a/src/rest_vol_file.c +++ b/src/rest_vol_file.c @@ -712,7 +712,7 @@ RV_file_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **re #ifdef RV_CONNECTOR_DEBUG printf("-> Received file-optional call with following parameters:\n"); printf(" - File-optional call type: %s\n", - file_optional_type_to_string(*((H5VL_optional_args_t *)args))); + file_optional_type_to_string(((H5VL_file_optional_t)args->op_type))); if (file) { printf(" - File's URI: %s\n", file->URI); printf(" - File's pathname: %s\n", file->domain->u.file.filepath_name); @@ -722,7 +722,7 @@ RV_file_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **re switch (args->op_type) { /* H5VL_FILE_GET_FILESIZE */ - case (RV_FILE_GET_SIZE): { + case (H5VL_NATIVE_FILE_GET_SIZE): { RV_file_optional_args_t *opt_args = (RV_file_optional_args_t *)args->args; size_t *size_out = opt_args->get_size.size; /* Setup cURL to make GET request */