Register Client Library with HDF5 Error API Code Example
Author: Quincey Koziol

### Client Library Desires to Register with the HDF5 Error API Code Example:

(Register Client Library Use Case Scenario)

    /* Client error class ID */
    hid_t CLIENT_ERROR;

    /* Major error code IDs */
    hid_t CLIENT_ERR_MAJOR_IO;		/* Errors on I/O */
    hid_t CLIENT_ERR_MAJOR_FILE;	/* Errors on file access */
       .
       .
       .

    /* Minor error code IDs */
    hid_t CLIENT_ERR_MINOR_PERM;	/* Invalid permissions */
    hid_t CLIENT_ERR_MINOR_HDF5;	/* Error in HDF5 */
       .
       .
       .

    int Client_register_error
    {
            ssize_t         name_len, mesg_len;
            char            class_name[32], mesg[32];
            H5E_mesg_t      mesg_type;

    	/* Register the error class for all client errors */
    	CLIENT_ERROR=H5Eregister_class("Client Library", "A_CLIENT", "1.0");

            /* Query class name */
            name_len = H5Eget_class_name(CLIENT_ERROR, class_name, 32);

    	/* Register major error codes */
    	CLIENT_ERR_MAJOR_IO=H5Ecreate_mesg(CLIENT_ERROR, H5E_MAJOR, "Errors on I/O");
    	CLIENT_ERR_MAJOR_FILE=H5Ecreate_mesg(CLIENT_ERROR, H5E_MAJOR, "Errors on file access");

            /* Query error message */
            mesg_len = H5Eget_mesg(CLIENT_ERR_MAJOR_IO, mesg_type, mesg);
    		.
    		.
    		.

    	/* Register minor error codes */
    	CLIENT_ERR_MINOR_PERM=H5Ecreate_mesg(CLIENT_ERROR, H5E_MINOR, "Invalid Permissions");
    	CLIENT_ERR_MINOR_HDF5=H5Ecreate_mesg(CLIENT_ERROR, H5E_MINOR, "Error in HDF5");
    		.
    		.
    		.
    }