Esempio n. 1
0
/* Remove a field from the fieldset, based on the field name */
icd_status icd_fieldset__remove_key(icd_fieldset * that, char *key)
{
    assert(that != NULL);
    assert(that->entries != NULL);
    assert(that->state == ICD_FIELDSET_STATE_INITIALIZED);
    assert(key != NULL);

    if (vh_delete(that->entries, key)) {
        return ICD_SUCCESS;
    }
    return ICD_ENOTFOUND;
}
Esempio n. 2
0
/*!
  @brief   Set specific pointer printing function.
  @ingroup print_low
  @param   ptr Pointer being printed.
  @param   func Function.
*/
void
v_print_with(void *ptr, void (*func)(void *ptr, FILE *fp))
{
    char *key, buf[V_HEXSTRING_SIZE];

    if (print_funcs == NULL)
        print_funcs = vh_create();

    key = vh_pkey_buf(ptr, buf);

    if (func != NULL)
        vh_pstore(print_funcs, key, func);
    else
        vh_delete(print_funcs, key);
}