Sun Microsystems 5800 Computer Drive User Manual


 
To Use the API for Storing Name-Value Records
Call hc_init once per process.
Call
hc_session_create_ez”onpage 53 to initializethe session and download theschema.
Createthe metadata record with
hc_nvr_create”onpage 65.
Fillthe new metadata pieceby piece with hc_nvr_add_metadata_* functions (see
“Building
Name-Value Records”onpage 66
) foreach 5800 system type.
Call either
hc_store_metadata_ez”onpage 88 or hc_store_both_ez”on page 87 to store
the new metadata record.
When you are done, freethe metadata record bycalling
hc_nvr_free”onpage 66.
When the sessionis nished, call
hc_session_free”onpage 55 to freethe session data
structures.
When all threads arecompleted, call hc_cleanup to release theglobal 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 anhc_nvr_t”on page 48record or atable 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”onpage 48 structure, callhc_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
SynchronousCAPI Functions
SunStorageTek 5800SystemClientAPIReferenceManual June 200864