File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed
Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -1522,9 +1522,7 @@ static ds3_bulk_object _ds3_bulk_object_from_file(const char* file_name) {
15221522
15231523ds3_bulk_object_list * ds3_convert_file_list (const char * * file_list , uint64_t num_files ) {
15241524 uint64_t i ;
1525- ds3_bulk_object_list * obj_list = g_new0 (ds3_bulk_object_list , 1 );
1526- obj_list -> size = num_files ;
1527- obj_list -> list = g_new0 (ds3_bulk_object , num_files );
1525+ ds3_bulk_object_list * obj_list = ds3_init_bulk_object_list (num_files );
15281526
15291527 for (i = 0 ; i < num_files ; i ++ ) {
15301528 obj_list -> list [i ] = _ds3_bulk_object_from_file (file_list [i ]);
@@ -1533,6 +1531,14 @@ ds3_bulk_object_list* ds3_convert_file_list(const char** file_list, uint64_t num
15331531 return obj_list ;
15341532}
15351533
1534+ ds3_bulk_object_list * ds3_init_bulk_object_list (uint64_t num_files ) {
1535+ ds3_bulk_object_list * obj_list = g_new0 (ds3_bulk_object_list , 1 );
1536+ obj_list -> size = num_files ;
1537+ obj_list -> list = g_new0 (ds3_bulk_object , num_files );
1538+
1539+ return obj_list ;
1540+ }
1541+
15361542void ds3_free_bulk_object_list (ds3_bulk_object_list * object_list ) {
15371543 uint64_t i , count ;
15381544 if (object_list == NULL ) {
Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ typedef struct{
6969 size_t size ;
7070}ds3_str ;
7171
72- ds3_str * ds3_str_init (const char * string );
73- char * ds3_str_value (const ds3_str * string );
74- size_t ds3_str_size (const ds3_str * string );
75- void ds3_str_free (ds3_str * string );
72+ LIBRARY_API ds3_str * ds3_str_init (const char * string );
73+ LIBRARY_API char * ds3_str_value (const ds3_str * string );
74+ LIBRARY_API size_t ds3_str_size (const ds3_str * string );
75+ LIBRARY_API void ds3_str_free (ds3_str * string );
7676
7777typedef struct {
7878 ds3_str * access_id ;
@@ -223,7 +223,8 @@ LIBRARY_API void ds3_print_request(const ds3_request* request);
223223LIBRARY_API size_t ds3_write_to_file (void * buffer , size_t size , size_t nmemb , void * user_data );
224224LIBRARY_API size_t ds3_read_from_file (void * buffer , size_t size , size_t nmemb , void * user_data );
225225
226- LIBRARY_API ds3_bulk_object_list * ds3_convert_file_list (const char * * file_list , uint64_t num_files );
226+ LIBRARY_API ds3_bulk_object_list * ds3_convert_file_list (const char * * file_list , uint64_t num_files );
227+ LIBRARY_API ds3_bulk_object_list * ds3_init_bulk_object_list (uint64_t num_files );
227228LIBRARY_API void ds3_free_bulk_object_list (ds3_bulk_object_list * object_list );
228229
229230#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments