Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committing clang-format changes
Browse files Browse the repository at this point in the history
github-actions[bot] committed Oct 10, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent ce1170c commit c218ffa
Showing 3 changed files with 43 additions and 37 deletions.
46 changes: 24 additions & 22 deletions src/rest_vol.c
Original file line number Diff line number Diff line change
@@ -1575,7 +1575,7 @@ H5_rest_url_encode_path(const char *_path)
FUNC_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "path was NULL");

/* Silence compiler const warnings */
memcpy(&path, &_path, sizeof(char*));
memcpy(&path, &_path, sizeof(char *));

/* Retrieve the length of the possible path prefix, which could be something like '/', '.', etc. */
cur_pos = path;
@@ -2299,10 +2299,10 @@ RV_find_object_by_path(RV_object_t *parent_obj, const char *obj_path, H5I_type_t

get_link_val_out get_link_val_args;
get_link_val_args.in_buf_size = &link_val_len;
get_link_val_args.buf = NULL;
get_link_val_args.buf = NULL;

if (RV_parse_response(response_buffer.buffer, NULL, &get_link_val_args, RV_get_link_val_callback) <
0)
if (RV_parse_response(response_buffer.buffer, NULL, &get_link_val_args,
RV_get_link_val_callback) < 0)
FUNC_GOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve size of link's value");

if (NULL == (tmp_link_val = RV_malloc(link_val_len)))
@@ -2590,14 +2590,14 @@ RV_copy_object_loc_info_callback(char *HTTP_response, const void *callback_data_
herr_t
RV_copy_link_name_by_index(char *HTTP_response, const void *callback_data_in, void *callback_data_out)
{
yajl_val parse_tree = NULL, key_obj = NULL, link_obj = NULL;
const char *parsed_link_name = NULL;
char *parsed_link_buffer = NULL;
yajl_val parse_tree = NULL, key_obj = NULL, link_obj = NULL;
const char *parsed_link_name = NULL;
char *parsed_link_buffer = NULL;
const H5VL_loc_by_idx_t *idx_params = (const H5VL_loc_by_idx_t *)callback_data_in;
hsize_t index = 0;
char **link_name = (char **)callback_data_out;
const char *curr_key = NULL;
herr_t ret_value = SUCCEED;
hsize_t index = 0;
char **link_name = (char **)callback_data_out;
const char *curr_key = NULL;
herr_t ret_value = SUCCEED;

if (!idx_params)
FUNC_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "given index params ptr was NULL");
@@ -2686,13 +2686,13 @@ RV_copy_link_name_by_index(char *HTTP_response, const void *callback_data_in, vo
herr_t
RV_copy_attribute_name_by_index(char *HTTP_response, const void *callback_data_in, void *callback_data_out)
{
yajl_val parse_tree = NULL, key_obj;
const char *parsed_string = NULL;
char *parsed_string_buffer = NULL;
yajl_val parse_tree = NULL, key_obj;
const char *parsed_string = NULL;
char *parsed_string_buffer = NULL;
const H5VL_loc_by_idx_t *idx_params = (const H5VL_loc_by_idx_t *)callback_data_in;
hsize_t index = 0;
char **attr_name = (char **)callback_data_out;
herr_t ret_value = SUCCEED;
hsize_t index = 0;
char **attr_name = (char **)callback_data_out;
herr_t ret_value = SUCCEED;

if (!attr_name)
FUNC_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "given attr_name was NULL");
@@ -3661,14 +3661,16 @@ RV_curl_multi_perform(CURL *curl_multi_handle, dataset_transfer_info *transfer_i
&handle_index) < 0)
FUNC_GOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
"can't get handle information for retry");

switch (transfer_info[handle_index].transfer_type) {
case (READ):
if (RV_dataset_read_cb(transfer_info[handle_index].mem_type_id, transfer_info[handle_index].mem_space_id,
transfer_info[handle_index].file_space_id, transfer_info[handle_index].u.read_info.buf,
transfer_info[handle_index].resp_buffer) < 0)
if (RV_dataset_read_cb(transfer_info[handle_index].mem_type_id,
transfer_info[handle_index].mem_space_id,
transfer_info[handle_index].file_space_id,
transfer_info[handle_index].u.read_info.buf,
transfer_info[handle_index].resp_buffer) < 0)
FUNC_GOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
"failed to post-process data read from dataset");
"failed to post-process data read from dataset");
break;
case (WRITE):
/* No post-processing necessary */
24 changes: 14 additions & 10 deletions src/rest_vol.h
Original file line number Diff line number Diff line change
@@ -557,13 +557,13 @@ typedef struct dataset_write_info {
char *base64_encoded_values;
curl_off_t write_len;
upload_info uinfo;
const void *buf;
const void *buf;
} dataset_write_info;

typedef struct dataset_read_info {
H5S_sel_type sel_type;
curl_off_t post_len;
void *buf;
void *buf;
} dataset_read_info;

typedef enum transfer_type_t { UNINIT = 0, READ = 1, WRITE = 2 } transfer_type_t;
@@ -646,7 +646,7 @@ typedef struct loc_info {

typedef struct get_link_val_out {
size_t *in_buf_size;
void *buf;
void *buf;
} get_link_val_out;
/****************************
* *
@@ -672,13 +672,16 @@ herr_t RV_parse_response(char *HTTP_response, const void *callback_data_in, void
herr_t (*parse_callback)(char *, const void *, void *));

/* Callback for RV_parse_response() to capture an object's URI */
herr_t RV_copy_object_URI_callback(char *HTTP_response, const void *callback_data_in, void *callback_data_out);
herr_t RV_copy_object_URI_callback(char *HTTP_response, const void *callback_data_in,
void *callback_data_out);

/* Callback for RV_parse_response() to capture an object's creation properties */
herr_t RV_copy_object_loc_info_callback(char *HTTP_response, const void *callback_data_in, void *callback_data_out);
herr_t RV_copy_object_loc_info_callback(char *HTTP_response, const void *callback_data_in,
void *callback_data_out);

/* Callback for RV_parse_response() to access the name of the n-th returned attribute */
herr_t RV_copy_attribute_name_by_index(char *HTTP_response, const void *callback_data_in, void *callback_data_out);
herr_t RV_copy_attribute_name_by_index(char *HTTP_response, const void *callback_data_in,
void *callback_data_out);

/* Callback for RV_parse_response() to access the name of the n-th returned link */
herr_t RV_copy_link_name_by_index(char *HTTP_response, const void *callback_data_in, void *callback_data_out);
@@ -689,8 +692,8 @@ herr_t RV_parse_server_version(char *HTTP_response, const void *callback_data_in
/* Helper function to find an object given a starting object to search from and a path */

htri_t RV_find_object_by_path(RV_object_t *parent_obj, const char *obj_path, H5I_type_t *target_object_type,
herr_t (*obj_found_callback)(char *, const void *, void *), void *callback_data_in,
void *callback_data_out);
herr_t (*obj_found_callback)(char *, const void *, void *),
void *callback_data_in, void *callback_data_out);

/* Helper function to parse a JSON string representing an HDF5 Dataspace and
* setup an hid_t for the Dataspace */
@@ -715,7 +718,8 @@ size_t H5_rest_curl_write_data_callback_no_global(char *buffer, size_t size, siz
herr_t RV_set_object_type_header(H5I_type_t parent_obj_type, const char **parent_obj_type_header);

/* Helper function to parse an object's allocated size from server response */
herr_t RV_parse_allocated_size_callback(char *HTTP_response, const void *callback_data_in, void *callback_data_out);
herr_t RV_parse_allocated_size_callback(char *HTTP_response, const void *callback_data_in,
void *callback_data_out);

void RV_free_visited_link_hash_table_key(rv_hash_table_key_t value);

@@ -725,7 +729,7 @@ herr_t RV_curl_multi_perform(CURL *curl_multi_ptr, dataset_transfer_info *transf

/* Callbacks used for post-processing after a curl request succeeds */
herr_t RV_dataset_read_cb(hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, void *buf,
struct response_buffer resp_buffer);
struct response_buffer resp_buffer);

#define SERVER_VERSION_MATCHES_OR_EXCEEDS(version, major_needed, minor_needed, patch_needed) \
(version.major > major_needed) || (version.major == major_needed && version.minor > minor_needed) || \
10 changes: 5 additions & 5 deletions src/rest_vol_link.c
Original file line number Diff line number Diff line change
@@ -1358,11 +1358,11 @@ RV_get_link_val_callback(char *HTTP_response, const void *callback_data_in, void
{
yajl_val parse_tree = NULL, key_obj;
get_link_val_out *get_link_val_args = (get_link_val_out *)callback_data_out;
size_t *in_buf_size = get_link_val_args->in_buf_size;
char *link_path;
char *link_class;
char *out_buf = get_link_val_args->buf;
herr_t ret_value = SUCCEED;
size_t *in_buf_size = get_link_val_args->in_buf_size;
char *link_path;
char *link_class;
char *out_buf = get_link_val_args->buf;
herr_t ret_value = SUCCEED;

#ifdef RV_CONNECTOR_DEBUG
printf("-> Retrieving link's value from server's HTTP response\n\n");

0 comments on commit c218ffa

Please sign in to comment.