Sun Java System Access Manager 7.1 C API Reference

<am_string_set.h>

<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:

String Data Types

The string data type defined in <am_string_set.h> is am_string_set_t. The type holds a set of strings.

Details

am_string_set_allocate() and am_string_set_destroy() are used to allocate and free space for this type.

Syntax

#include "am_string_set.h"
typedef struct {
    int size;
    char **strings;
} am_string_set_t;

Members

am_string_set_t has the following members:

size

Number of strings

strings

Pointer to a pointer to a list of strings.

String Functions

The string functions defined in <am_string_set.h> are:

am_string_set_allocate()

Allocates memory and initializes the string set size.

Syntax

#include "am_string_set.h"
AM_EXPORT am_string_set_t *
am_string_set_allocate(int size);

Parameters

This function takes the following parameter:

size

Number of strings in the set.

Returns

This function returns the allocated am_string_set_t, or NULL if size is less than zero.

am_string_set_destroy()

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.

Syntax

#include "am_string_set.h"
AM_EXPORT void 
am_string_set_destroy(am_string_set_t *string_set);

Parameters

This function takes the following parameter:

string_set

Pointer to the specified string set object.

Returns

This function returns no values.