]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/m_update.c
Create new mh-format function %(ordinal)
[nmh] / docs / historical / mh-jun-1982 / subs / m_update.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 #include <stdio.h>
10 #include <signal.h>
11
12 char defpath[];
13
14 m_update()
15 {
16 FILE *out;
17 register struct node *np;
18 int (*save)();
19
20 if(def_flags & DEFMOD) {
21 save = signal(SIGINT, SIG_IGN);
22 if((out = fopen(defpath, "w")) == NULL) {
23 fprintf(stderr, "Can't create %s!!\n", defpath);
24 done(1);
25 }
26 for(np = m_defs; np; np = np->n_next)
27 fprintf(out, "%s: %s\n", np->n_name, np->n_field);
28 VOID fclose(out);
29 VOID signal(SIGINT, save);
30 def_flags &= ~DEFMOD;
31 }
32 }