beautypg.com

To use the api for storing name-value records, Using returned name-value records, To use returned name-value records – Sun Microsystems Sun StorageTek 5800 User Manual

Page 64

background image

To Use the API for Storing Name-Value Records

Call hc_init once per process.

Call

hc_session_create_ez”on page 53

to initialize the session and download the schema.

Create the metadata record with

hc_nvr_create”on page 65

.

Fill the new metadata piece by piece with hc_nvr_add_metadata_* functions (see

“Building

Name-Value Records”on page 66

) for each 5800 system type.

Call either

hc_store_metadata_ez”on page 88

or

hc_store_both_ez”on page 87

to store

the new metadata record.

When you are done, free the metadata record by calling

hc_nvr_free”on page 66

.

When the session is finished, call

hc_session_free”on page 55

to free the session data

structures.

When all threads are completed, call hc_cleanup to release the global session.

Using Returned Name-Value Records

Name-value records are also returned as the result of queries that return metadata information,
such as

“hc_retrieve_metadata_ez” on page 92

.

To Use Returned Name-Value Records

Run the query to create an

hc_nvr_t”on page 48

record or a table of

hc_nvr_t”on page 48

structures.

Use either name-based access (for example, hc_nvr_get_*) or index-based access (for example,

“hc_nvr_get_count” on page 76

and

“hc_nvr_get_value_at_index” on page 77

).

To free the

hc_nvr_t”on page 48

structure, call

hc_nvr_free”on page 66

.

Note –

Structures created by hc_nvr_create can also be freed by calling hc_nvr_free.

1

2

3

4

5

6

7

8

1

2

Synchronous C API Functions

Sun StorageTek 5800 System Client API Reference Manual • June 2008

64