DS3 C SDK  4.1.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-2017 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 
25 // For windows DLL symbol exports.
26 #ifdef _WIN32
27 # ifdef LIBRARY_EXPORTS
28 # define LIBRARY_API __declspec(dllexport)
29 # else
30 # define LIBRARY_API __declspec(dllimport)
31 # endif
32 #else
33 # define LIBRARY_API
34 #endif
35 
38 
39 
40 //opertions for manipulating a hash map as a ds3_str multi map
43 LIBRARY_API void ds3_string_multimap_insert_entry(ds3_string_multimap* map, const ds3_string_multimap_entry* entry); // caller frees all passed in values
46 
47 
48 //opertions for manipulating a ds3_string_multi_map_entry
56 
57 
58 /*
59 // TODO implement this as a future refactor
60 // operations for multimaps
61 typedef struct _ds3_multi_map ds3_multi_map;
62 
63 typedef unsigned int (*ds3_hash_func)(void* pointer);
64 typedef int (*ds3_equal_func)(void* pointer);
65 
66 LIBRARY_API ds3_multi_map* ds3_multi_map_init(ds3_hash_func hash, ds3_equal_func equal);
67 LIBRARY_API void ds3_multi_map_put(void* key, void* data);
68 LIBRARY_API void* ds3_multi_map_get(void* key);
69 LIBRARY_API void ds3_multi_map_free(ds3_multi_map* map);
70 */
71 #ifdef __cplusplus
72 }
73 #endif
74 #endif
ds3_str * key
LIBRARY_API void ds3_string_multimap_entry_free(ds3_string_multimap_entry *entry)
LIBRARY_API void ds3_string_multimap_insert(ds3_string_multimap *map, const ds3_str *key, const ds3_str *value)
LIBRARY_API ds3_string_multimap_entry * ds3_string_multimap_lookup(ds3_string_multimap *map, const ds3_str *key)
LIBRARY_API void ds3_string_multimap_insert_entry(ds3_string_multimap *map, const ds3_string_multimap_entry *entry)
LIBRARY_API ds3_string_multimap * ds3_string_multimap_init(void)
LIBRARY_API void ds3_string_multimap_free(ds3_string_multimap *map)
LIBRARY_API ds3_string_multimap_entry * ds3_string_multimap_entry_init(const ds3_str *key)
LIBRARY_API void ds3_string_multimap_entry_add_value(ds3_string_multimap_entry *entry, const ds3_str *value)
LIBRARY_API ds3_str * ds3_string_multimap_entry_get_key(const ds3_string_multimap_entry *entry)
LIBRARY_API ds3_string_multimap_entry * ds3_string_multimap_entry_dup(const ds3_string_multimap_entry *entry)
#define LIBRARY_API
LIBRARY_API ds3_str * ds3_string_multimap_entry_get_value_by_index(const ds3_string_multimap_entry *entry, unsigned int index)
LIBRARY_API unsigned int ds3_string_multimap_entry_get_num_values(const ds3_string_multimap_entry *map_entry)