Dashboard > Appistry EAF v3.8 > ... > C FAM API Linux > fabric_map.h
Log In   View a printable version of the current page.  
  fabric_map.h

fab_map_new

fab_map* fab_map_new()

This function allocates memory for a map.

Return Value
fab_map* pointer to new fab_map object

fab_map_free

void fab_map_free(fab_map* m)

This function frees the memory that was allocated for the map.

Parameters
fab_map* pointer to fab_map passed to function

fab_map_copy

void fab_map_copy(fab_map* dest,
                  fab_map* src)

This function creates a copy of an existing map into the specified map.

Parameters
fab_map* new fab_map
fab_map* existing fab_map

fab_map_key_count

size_t fab_map_key_count(fab_map* m)

This function returns the number of elements in the map.

Parameters
fab_map* pointer to fab_map passed to function
Return Value
size_t number of elements in the map

fab_map_key_exists

int fab_map_key_exists(fab_map* m,
                       const char* key)

This function verifies the existence of the key in a map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
int 0 if successful; a message code if unsuccessful, refer to Messages for more information

fab_map_erase_key

void fab_map_erase_key(fab_map* m,
                       const char* key)

This function deletes the key and associated data element from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
int 0 if successful; a message code if unsuccessful, refer to Messages for more information

fab_map_erase_all_keys

void fab_map_erase_all_keys(fab_map* m)

This function deletes all keys and associated data elements from the map.

Parameters
fab_map* pointer to fab_map passed to function
int 0 if successful; a message code if unsuccessful, refer to Messages for more information

fab_map_it_new

fab_map_iterator* fab_map_it_new(fab_map* m)

This function creates a new map iterator for this map.

Parameters
fab_map* pointer to fab_map passed to function
Return Value
fab_map_iterator* pointer to fab_map_iterator object

fab_map_it_free

void fab_map_it_free(fab_map_iterator* it)

This functions releases the memory allocated to the map iterator.

Parameters
fab_map_iterator* pointer to fab_map_iterator object

fab_map_it_valid

int fab_map_it_valid(fab_map_iterator* it)

This function verifies the map iterator is valid.

Parameters
fab_map_iterator* pointer to fab_map_iterator object
Return Value
int 0 if successful; a message code if unsuccessful, refer to Messages for more information

fab_map_it_has_next

int fab_map_it_has_next(fab_map_iterator* it)

This function indicates if the iterator has another key/value pair.

Parameters
fab_map_iterator* pointer to fab_map_iterator object
Return Value
int 1 equals TRUE, another element is in the list; 0 equals FALSE, this is the last element in the list

fab_map_it_increment

int fab_map_it_increment(fab_map_iterator* it)

This function moves the iterator pointer to the next key/value pair.

Parameters
fab_map_iterator* pointer to fab_map_iterator object
Return Value
int 0 if successful; a message code if unsuccessful, refer to Messages for more information

fab_map_it_reset

void fab_map_it_reset(fab_map_iterator* it)

This function resets the map iterator to the first key/value pair.

Parameters
fab_map_iterator* pointer to fab_map_iterator object

fab_map_it_key

const char* fab_map_it_key(fab_map_iterator* it)

This function returns the key of the element currently referenced by the iterator.

Parameters
fab_map_iterator* pointer to fab_map_iterator object
Return Value
const char* key to map value

fab_map_it_value

fab_value* fab_map_it_value(fab_map_iterator* it)

This function returns the value of the element currently referenced by the iterator.

Parameters
fab_map_iterator* pointer to fab_map_iterator object
Return Value
fab_value* pointer to fab_value object

fab_map_it_erase_key

void fab_map_it_erase_key(fab_map_iterator* it)

This function removes the key/value pair referenced by the iterator, and increments the iterator to point to the next key/value pair.

Parameters
fab_map_iterator* pointer to fab_map_iterator object

fab_map_set_value

void fab_map_set_value(fab_map* m,
                       const char* key,
                       const fab_value* value)

This function makes a copy of the value and copies it into the map.

Parameters
fab_map* fab_map struct
const char* key to map value
fab_value* pointer to fab_value object

fab_map_acquire_value

fab_value* fab_map_acquire_value(fab_map* m,
                                 const char* key)

This function returns the value associated with the specified key. If the value does not exist, a new value is created.
Note. The map owns the memory for this value. Do not use the fab_value_free function to release the memory.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_value* pointer to fab_value object

fab_map_get_value

fab_value* fab_map_get_value(fab_map* m,
                             const char* key)

This function returns the value's key or null if the value does not exist.
Note. The map owns the memory for this value. Do not use the fab_value_free function to release the memory.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_value* pointer to fab_value object or null if the values does not exist

fab_map_set_string

void fab_map_set_string(fab_map* m,
                        const char* key,
                        const char* value)

This function sets the value and its key into the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
const char* string value

fab_map_get_string

const char* fab_map_get_string(fab_map* m,
                               const char* key)

This function returns the string value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
const char* string value

fab_map_set_int

void fab_map_set_int(fab_map* m,
                     const char* key,
                     int value)

This function sets the 32-bit integer value and its key in the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
int 32-bit integer value

fab_map_get_int

int fab_map_get_int(fab_map* m,
                    const char* key)

This function returns the 32-bit integer value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
int 32-bit integer value

fab_map_set_uint

void fab_map_set_uint(fab_map* m,
                      const char* key,
                      unsigned int value)

This function sets the unsigned 32-bit integer value and its key in the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
unsigned int unsigned 32-bit integer value

fab_map_get_uint

unsigned int fab_map_get_uint(fab_map* m,
                              const char* key)

This function returns the unsigned 32-bit integer value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
unsigned int unsigned 32-bit integer value

fab_map_set_int64

void fab_map_set_int64(fab_map* m,
                       const char* key,
                       fab_int64 value)

This function sets the 64-bit integer value and its key in the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
fab_int64 64-bit integer value

fab_map_get_int64

fab_int64 fab_map_get_int64(fab_map* m,
                            const char* key)

This function returns the 64-bit integer value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_int64 64-bit integer value

fab_map_set_uint64

void fab_map_set_uint64(fab_map* m,
                        const char* key,
                        fab_uint64 value)

This function sets the unsigned 64-bit integer value and its key in the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
fab_uint64 unsigned 64-bit integer value

fab_map_get_uint64

fab_uint64 fab_map_get_uint64(fab_map* m,
                              const char* key)

This function returns the unsigned 64-bit integer value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_uint64 unsigned 64-bit integer value

fab_map_set_float

void fab_map_set_float(fab_map* m,
                       const char* key,
                       float f)

This function sets a floating-point value and its key in the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
float floating-point value

fab_map_get_float

float fab_map_get_float(fab_map* m,
                        const char* key)

This function returns a floating-point value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
float floating-point value

fab_map_set_double

void fab_map_set_double(fab_map* m,
                        const char* key,
                        double d)

This function sets a double precision value and its key in the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
double double precision value

fab_map_get_double

double fab_map_get_double(fab_map* m,
                          const char* key)

This function returns a double precision value for the key from the map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
double double precision value

fab_map_set_binary

void fab_map_set_binary(fab_map* m,
                        const char* key,
                        const void* data,
                        size_t data_len)

This function sets the buffer for a binary value.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
const void* const void pointer to data buffer
size_t buffer size

fab_map_get_binary

size_t fab_map_get_binary(fab_map* m,
                          const char* key,
                          size_t max_buf_size,
                          void* buf)

This function gets a binary value for the key from the map and into the buffer, and returns the size of the buffer.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
size_t maximum buffer size
void* void pointer to data buffer
Return Value
size_t buffer size

fab_map_set_map

void fab_map_set_map(fab_map* m,
                     const char* key,
                     fab_map* mp)

This function sets the map and its key into the main map.

Parameters
fab_map* pointer to main fab_map
const char* key to map value
fab_map* pointer to fab_map to set into main map

fab_map_get_map

fab_map* fab_map_get_map(fab_map* m,
                         const char* key)

This function returns the map object for the key from the main map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_map* pointer to fab_map

fab_map_acquire_map

fab_map* fab_map_acquire_map(fab_map* m,
                             const char* key)

This function returns the map. If it does not exist, a new map is created.
Note. The map owns the memory for this value. Do not use the fab_value_free function to release the memory.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_map* pointer to fab_map

fab_map_set_array

void fab_map_set_array(fab_map* m,
                       const char* key,
                       fab_array* a)

This function sets an array and its key in a map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value

fab_map_get_array

fab_array* fab_map_get_array(fab_map* m,
                             const char* key)

This function returns an array object for the key from a map.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_array* fab array

fab_map_aquire_array

fab_array* fab_map_aquire_array(fab_map* m,
                                const char* key)

This function returns the array. If it does not exist, a new array is created.
Note. The map owns the memory for this value. Do not use the fab_value_free function to release the memory.

Parameters
fab_map* pointer to fab_map passed to function
const char* key to map value
Return Value
fab_array* fab array