DS3 C SDK  3.0.0
Provides access to the Spectra S3 API with C
ds3_string_multimap.h
Go to the documentation of this file.
1 /*
2  * ******************************************************************************
3  * Copyright 2014-2015 Spectra Logic Corporation. All Rights Reserved.
4  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5  * this file except in compliance with the License. A copy of the License is located at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * or in the "license" file accompanying this file.
10  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11  * CONDITIONS OF ANY KIND, either express or implied. See the License for the
12  * specific language governing permissions and limitations under the License.
13  * ****************************************************************************
14  */
15 
16 #ifndef __DS3_STRING_MULTIMAP__
17 #define __DS3_STRING_MULTIMAP__
18 
19 #include "ds3_string.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
27 
28 
29 //opertions for manipulating a hash map as a ds3_str multi map
31 void ds3_string_multimap_insert(ds3_string_multimap* map, const ds3_str* key, const ds3_str* value);
32 void ds3_string_multimap_insert_entry(ds3_string_multimap* map, const ds3_string_multimap_entry* entry); // caller frees all passed in values
35 
36 
37 //opertions for manipulating a ds3_string_multi_map_entry
45 
46 
47 /*
48 // TODO implement this as a future refactor
49 // operations for multimaps
50 typedef struct _ds3_multi_map ds3_multi_map;
51 
52 typedef unsigned int (*ds3_hash_func)(void* pointer);
53 typedef int (*ds3_equal_func)(void* pointer);
54 
55 LIBRARY_API ds3_multi_map* ds3_multi_map_init(ds3_hash_func hash, ds3_equal_func equal);
56 LIBRARY_API void ds3_multi_map_put(void* key, void* data);
57 LIBRARY_API void* ds3_multi_map_get(void* key);
58 LIBRARY_API void ds3_multi_map_free(ds3_multi_map* map);
59 */
60 #ifdef __cplusplus
61 }
62 #endif
63 #endif
ds3_str * key
ds3_string_multimap_entry * ds3_string_multimap_lookup(ds3_string_multimap *map, const ds3_str *key)
ds3_string_multimap_entry * ds3_string_multimap_entry_dup(const ds3_string_multimap_entry *entry)
ds3_str * ds3_string_multimap_entry_get_key(const ds3_string_multimap_entry *entry)
void ds3_string_multimap_entry_add_value(ds3_string_multimap_entry *entry, const ds3_str *value)
void ds3_string_multimap_entry_free(ds3_string_multimap_entry *entry)
ds3_string_multimap_entry * ds3_string_multimap_entry_init(const ds3_str *key)
void ds3_string_multimap_insert_entry(ds3_string_multimap *map, const ds3_string_multimap_entry *entry)
void ds3_string_multimap_free(ds3_string_multimap *map)
void ds3_string_multimap_insert(ds3_string_multimap *map, const ds3_str *key, const ds3_str *value)
ds3_str * ds3_string_multimap_entry_get_value_by_index(const ds3_string_multimap_entry *entry, int index)
unsigned int ds3_string_multimap_entry_get_num_values(const ds3_string_multimap_entry *map_entry)
ds3_string_multimap * ds3_string_multimap_init(void)