/* Used to register your mechanism to load and store non-volative data. This should typical be called during the enable function for your feature.  */
inv_error_t inv_register_load_store(inv_error_t(*load_func)(const unsigned char *data), inv_error_t(*save_func)(unsigned char *data), size_t size, unsigned int key)
/* Used to register your mechanism to load and store non-volative data. This should typical be called during the enable function for your feature.  */
inv_error_t inv_register_load_store(inv_error_t(*load_func)(const unsigned char *data), inv_error_t(*save_func)(unsigned char *data), size_t size, unsigned int key)
{
    int kk;
    for (kk=0; kk<ds.num; ++kk) {
        if (key == ds.hd[kk].key) {
            return INV_ERROR_INVALID_PARAMETER;
        }
    }
    if (ds.num >= NUM_STORAGE_BOXES) {
        return INV_ERROR_INVALID_PARAMETER;
    }
    ds.hd[ds.num].key = key;
    ds.hd[ds.num].size = size;
    ds.load[ds.num] = load_func;
    ds.save[ds.num] = save_func;
    ds.total_size += size + sizeof(struct data_header_t);
    ds.num++;
    return INV_SUCCESS;
}