]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/m_delete.c
Create new mh-format function %(ordinal)
[nmh] / docs / historical / mh-jun-1982 / subs / m_delete.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "../mh.h"
9
10 m_delete(key)
11 char *key;
12 {
13 register struct node *np, *npprev;
14
15 m_getdefs();
16 for(np = (struct node *) &m_defs; npprev = np; ) {
17 if((np = np->n_next) == 0)
18 break;
19 if(uleq(np->n_name, key)) {
20 npprev->n_next = np->n_next;
21 cndfree(np->n_name);
22 cndfree(np->n_field);
23 free((char *)np);
24 def_flags |= DEFMOD;
25 return(0);
26 }
27 }
28 return(1);
29 }