Sun Microsystems 5800 Computer Drive User Manual


 
Description
This function initializes the 5800 system API and must be called before calling any of the other
functions in this API. It downloads a copy of the schema for a particular host or port. The
schema is used to validate the name-value-type tuples that are added to metadata records.
Both the synchronous and the nonsynchronous C APIs are fully thread-safe and can be used
simultaneously in multiple threads from the same process. Each thread must call
hc_session_create_ez” on page 53 to create its own session. Sessions must not be shared
between threads.
Note hc_init should be called once per process before any thread calls
hc_session_create_ez.Ifhc_session_create_ez is called before hc_init, an implicit call is
made to hc_init from that thread. But that call to hc_init is not interlocked with other
threads, and it uses the C API shared library’s version of malloc and free, which might be
dierent than the application’s version of malloc and free. It is strongly recommended that all
applications call hc_init once per process with their own allocator and deallocator.
For more information on hc_init, see
“Initializing a Global Session” on page 41
Parameters
host
IN: The name or IP address of a 5800 system server.
port
IN: The port number of the 5800 system server (normally 8080).
sessionp
OUT: Updated to point to a session object.
Return Codes
HCERR_OK
HCERR_BAD_REQUEST
HCERR_OOM
HCERR_ILLEGAL_ARGUMENT
SynchronousCAPI Functions
SunStorageTek 5800SystemClientAPIReferenceManual June 200854