]>
diplodocus.org Git - nmh/blob - sbr/context_del.c
3 * context_del.c -- delete an entry from the context/profile list
11 * Delete a key/value pair from the context/profile list.
12 * Return 0 if key is found, else return 1.
16 context_del (char *key
)
18 register struct node
*np
, *pp
;
20 /* sanity check - check that context has been read */
22 adios (NULL
, "oops, context hasn't been read yet");
24 for (np
= m_defs
, pp
= NULL
; np
; pp
= np
, np
= np
->n_next
) {
25 if (!strcasecmp (np
->n_name
, key
)) {
27 admonish (NULL
, "bug: context_del(key=\"%s\")", np
->n_name
);
29 pp
->n_next
= np
->n_next
;