hcerr_t hc_init(allocator_t,
deallocator_t,
reallocator_t);
Thisfunction must be called once per process to initialize the memory functions used in the
5800system C API. It also initializes global session properties.
Aglobal session is initialized once per process, regardless of how many threads in that process
areusing the C API.
Note– hc_init shouldbe called once per process before any thread calls
hc_session_create_ez”on page 53.Ifhc_session_create_ez”on page 53 is called before
hc_init,an implicit call is made to hc_init fromthat thread. But that call to hc_init isnot
interlockedwith 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 andfree. Itis strongly
recommendedthat all applications call hc_init onceper process with their own allocator and
deallocator.
Note– For more information on hc_session_create_ez” on page 53 , see
hc_session_create_ez”on page 53.
Terminatinga Global Session
Thefollowing function terminates a global session:
void hc_cleanup();
SystemRecord
All5800 system store operationsreturn a system record, which encapsulates information
aboutthe stored object. In particular, the system record contains the OID, which can be used to
retrievethe stored object data or metadata.
typedef struct hc_system_record_ {
char is_indexed;
hc_oid oid;
hc_digest_algo digest_algo;
hc_digest data_digest;
hc_long_t size;
hc_long_t creation_time;
hc_long_t deleted_time;
char shredMode;
} hc_system_record_t;
Aboutthe elds:
Overviewof the 5800 System C Client API
SunStorageTek5800 System Client API Reference Manual June 200842