OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
shash.h
Go to the documentation of this file.
1 
5 #ifndef __SHASH_H__
6 #define __SHASH_H__
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <stdint.h>
13 
14 #ifndef SHASH_API_VERSION
15 
16 #define SHASH_API_VERSION 1002000
17 
18 #define SHASH_API_VERSION_STR "1.2.0"
19 #endif
20 
22 typedef struct shash shash;
23 
30 shash *shash_create(uint32_t options);
31 
38 int shash_destroy(shash *h);
39 
48 int shash_set(shash *h, const char *key, const char *value);
49 
59 const char *shash_get(shash *h, const char *key);
60 
68 int shash_remove(shash *h, const char *key);
69 
76 int shash_rewind(shash *h);
77 
93 int shash_next(shash *h, const char **key, const char **value);
94 
99 int shash_size(shash *h);
100 
105 const char *shash_version();
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif // __SHASH_H__
int shash_size(shash *h)
Retrieves the number of key-value pairs in the hash object.
Definition: shash.c:320
int shash_set(shash *h, const char *key, const char *value)
Add or overwrite a pointer, associating it with the given key.
Definition: shash.c:224
int32 value
Definition: Granule.c:1235
const char * shash_get(shash *h, const char *key)
Find a pointer associated with the given string.
Definition: shash.c:205
int shash_rewind(shash *h)
Rewind iterator for traversing all the keys and values.
Definition: shash.c:277
const char * shash_version()
Returns the source code version and the implemented API version.
Definition: shash.c:324
float h[MODELMAX]
Definition: atrem_corl1.h:131
int shash_remove(shash *h, const char *key)
Remove a pointer associated with the given string.
Definition: shash.c:146
Implementation-specific, generic type to store the shash object.
Definition: shash.c:40
int shash_next(shash *h, const char **key, const char **value)
Retrieves the next key-value pair in the shash. The order in which the pointers are returned shall be...
Definition: shash.c:283
shash * shash_create(uint32_t options)
Initialize a shash object.
Definition: shash.c:105
int shash_destroy(shash *h)
Destroy a shash object, free'ing the memory used.
Definition: shash.c:136