Description
Thisfunction initializes the 5800 system API and must be called before calling any of the other
functionsin this API. It downloads a copy of the schema for a particular host or port. The
schemais used to validate the name-value-type tuples that are added to metadata records.
Boththe synchronous and the nonsynchronous C APIs are fully thread-safe and can be used
simultaneouslyin 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
betweenthreads.
Note– hc_init should be called once per process before any thread calls
hc_session_create_ez.Ifhc_session_create_eziscalled before hc_init, an implicit call is
madeto 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erentthan the application’s version of malloc and free. Itis strongly recommended that all
applicationscall hc_init once per process with their own allocator and deallocator.
Formore 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.
ReturnCodes
HCERR_OK
HCERR_BAD_REQUEST
HCERR_OOM
HCERR_ILLEGAL_ARGUMENT
SynchronousCAPI Functions
SunStorageTek5800 System Client API Reference Manual • June 200854