Skip to content

Commit

Permalink
Use native VOL enum type for optional file ops
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Apr 10, 2024
1 parent abef114 commit f30770b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/rest_vol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
8 changes: 4 additions & 4 deletions src/rest_vol_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)";
Expand Down
2 changes: 1 addition & 1 deletion src/rest_vol_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/rest_vol_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 */
Expand Down

0 comments on commit f30770b

Please sign in to comment.