<am_string_set.h> contains public data types and functions intended to manipulate strings. The sample sources (located in the /AccessManager-base/SUNWam/samples/csdk directory) demonstrate basic usage of the string set API. This chapter contains the following sections:
The string data type defined in <am_string_set.h> is am_string_set_t. The type holds a set of strings.
am_string_set_allocate() and am_string_set_destroy() are used to allocate and free space for this type.
#include "am_string_set.h" typedef struct { int size; char **strings; } am_string_set_t;
am_string_set_t has the following members:
Number of strings
Pointer to a pointer to a list of strings.
The string functions defined in <am_string_set.h> are:
Allocates memory and initializes the string set size.
#include "am_string_set.h" AM_EXPORT am_string_set_t * am_string_set_allocate(int size);
This function takes the following parameter:
Number of strings in the set.
This function returns the allocated am_string_set_t, or NULL if size is less than zero.
Releases memory in the specified string set object by freeing each string in the set, then freeing the associated pointers, and finally, the structure itself.
#include "am_string_set.h" AM_EXPORT void am_string_set_destroy(am_string_set_t *string_set);
This function takes the following parameter:
Pointer to the specified string set object.
This function returns no values.