-
Notifications
You must be signed in to change notification settings - Fork 14
CSDK-268: 4.1 API #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSDK-268: 4.1 API #218
Conversation
src/ds3_uint64_string_map.c
Outdated
| return g_hash_table_insert(map->hash, key_cpy, value_cpy); | ||
| } | ||
|
|
||
| gboolean ds3_uint64_string_map_contains(ds3_uint64_string_map* map, uint64_t* key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this method is called publically, it should not return a gboolean, but a ds3_bool instead.
src/ds3_uint64_string_map.c
Outdated
| } | ||
|
|
||
| // Inserts a safe copy of the key-value pair into the map. Returns true if the key did not exist yet. | ||
| gboolean ds3_uint64_string_map_insert(ds3_uint64_string_map* map, const uint64_t* key, const ds3_str* value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this method is called publically, it should not return a gboolean, but a ds3_bool instead.
src/ds3_uint64_string_map.c
Outdated
| return ds3_str_dup((ds3_str*)value); | ||
| } | ||
|
|
||
| guint ds3_uint64_string_map_size(ds3_uint64_string_map* map) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this method is called publically, it should not return a guint, but a uint64 type instead
src/ds3_uint64_string_map.h
Outdated
| #define __DS3_UINT64_T_STRING_MAP__ | ||
|
|
||
| #include <stdlib.h> | ||
| #include <glib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this file gets included by ds3.h we are leaking the fact that we're using glib. This and other glib reference should be removed from this header.
src/ds3_uint64_string_map.h
Outdated
| LIBRARY_API guint ds3_uint64_string_map_size(ds3_uint64_string_map* map); | ||
|
|
||
| // Used to iterate through a ds3_uint64_string_map | ||
| struct _ds3_uint64_string_map_iter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several of these can be defined in the .c file which will remove the glib references.
src/ds3_response_header_utils.c
Outdated
|
|
||
| // Converts a ds3_str* containing a checksum value into a ds3_checksum_type*. | ||
| // If conversion is not possible, then NULL is returned. | ||
| ds3_checksum_type* _convert_str_to_checksum_type(const ds3_log* log, const ds3_str* checksum_str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this method is only used in this file it should be declared static
src/ds3_response_header_utils.c
Outdated
| } | ||
|
|
||
| // Retrieves the offset value at the end of a blob checksum header | ||
| uint64_t* _get_offset_from_key(const ds3_str* key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about maybe needing to be static.
Changes
ds3_uint64_string_mapfor mapping offsets to checksums in Head Object header parsing.ds3_response_header_utilswhich contains utils for:ds3-blob-checksum-offset-Xinto a blob checksum map of blob offset to blob checksum.ds3-blob-checksum-typeheader for determining blob checksum type.ds3_head_object_responsewhich contains the new blob checksum map and metadata.Created free function fords3_head_object_response`.Tests