libstoragemgmt_hash.h File Reference
#include "libstoragemgmt_common.h"
Go to the source code of this file.
Function Documentation
lsm_hash LSM_DLL_EXPORT* lsm_hash_alloc |
( |
void |
|
) |
|
Simple hash table which only stores character strings. Allocate storage for hash.
- Returns:
- Allocated record or NULL on memory allocation failure
Does a copy of an lsm_hash
- Parameters:
-
- Returns:
- NULL on error/memory allocation failure, else copy
int LSM_DLL_EXPORT lsm_hash_free |
( |
lsm_hash * |
op |
) |
|
Free a lsm hash
- Parameters:
-
- Returns:
- LSM_ERR_OK on success, else error reason.
Get the list of 'keys' available in the hash
- Parameters:
-
[in] | op | Valid optional data pointer |
[out] | l | String list pointer |
- Returns:
- LSM_ERR_OK on success, else error reason
const char LSM_DLL_EXPORT* lsm_hash_string_get |
( |
lsm_hash * |
op, |
|
|
const char * |
key | |
|
) |
| | |
Get the value of a key (string)
- Parameters:
-
[in] | op | Valid optional data pointer |
[in] | key | Key to retrieve value for |
- Returns:
- Pointer to value, pointer valid until optional data memory gets released.
int LSM_DLL_EXPORT lsm_hash_string_set |
( |
lsm_hash * |
op, |
|
|
const char * |
key, |
|
|
const char * |
value | |
|
) |
| | |
Set the value of a key. Note: If key exists, it is replaced with new one.
- Parameters:
-
[in] | op | Valid optional data pointer |
[in] | key | Key to set value for (key is duped) |
[in] | value | Value of new key (string is duped) |
- Returns:
- LSM_ERR_OK on success, else error reason