Call hc_init once per process.
Call hc_session_create_ez to initialize the session and download the schema.
Create the metadata record with hc_nvr_create.
Fill the new metadata piece by piece with hc_nvr_add_metadata_* functions (see Building Name-Value Records) for each 5800 system type.
Call either hc_store_metadata_ez or hc_store_both_ez to store the new metadata record.
When you are done, free the metadata record by calling hc_nvr_free.
When the session is finished, call hc_session_free to free the session data structures.
When all threads are completed, call hc_cleanup to release the global session.