A common way of storing metadata in the synchronous C API for the 5800 system is to use the name-value record API.
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.
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.