]>
diplodocus.org Git - nmh/blob - uip/mhparam.c
3 * mhparam.c -- print mh_profile values
5 * Originally contributed by
6 * Jeffrey C Honig <Jeffrey_C_Honig@cornell.edu>
13 extern char *mhlibdir
;
14 extern char *mhetcdir
;
16 char *sbackup
= BACKUP_PREFIX
;
19 static struct swit switches
[] = {
23 { "nocomponents", 0 },
40 static struct proc procs
[] = {
41 { "context", &context
},
42 { "mh-sequences", &mh_seq
},
43 { "buildmimeproc", &buildmimeproc
},
44 { "faceproc", &faceproc
},
45 { "fileproc", &fileproc
},
46 { "foldprot", &foldprot
},
47 { "incproc", &incproc
},
48 { "installproc", &installproc
},
50 { "mailproc", &mailproc
},
51 { "mhlproc", &mhlproc
},
52 { "moreproc", &moreproc
},
53 { "msgprot", &msgprot
},
54 { "mshproc", &mshproc
},
55 { "packproc", &packproc
},
56 { "postproc", &postproc
},
57 { "rmfproc", &rmfproc
},
58 { "rmmproc", &rmmproc
},
59 { "sendproc", &sendproc
},
60 { "showmimeproc", &showmimeproc
},
61 { "showproc", &showproc
},
62 { "version", &version_num
},
63 { "vmhproc", &vmhproc
},
64 { "whatnowproc", &whatnowproc
},
65 { "whomproc", &whomproc
},
66 { "etcdir", &mhetcdir
},
67 { "libdir", &mhlibdir
},
68 { "sbackup", &sbackup
},
77 static char *p_find(char *);
81 main(int argc
, char **argv
)
83 int i
, compp
= 0, missed
= 0;
84 int all
= 0, debug
= 0;
86 char *cp
, buf
[BUFSIZ
], **argp
;
87 char **arguments
, *comps
[MAXARGS
];
89 invo_name
= r1bindex (argv
[0], '/');
91 /* read user profile/context */
94 arguments
= getarguments (invo_name
, argc
, argv
, 1);
97 while ((cp
= *argp
++)) {
99 switch (smatch (++cp
, switches
)) {
101 ambigsw (cp
, switches
);
104 adios (NULL
, "-%s unknown", cp
);
107 snprintf (buf
, sizeof(buf
), "%s [profile-components] [switches]",
109 print_help (buf
, switches
, 1);
112 print_version(invo_name
);
139 advise(NULL
, "profile-components ignored with -all");
142 advise(NULL
, "-%scomponents ignored with -all",
143 components
? "" : "no");
145 /* print all entries in context/profile list */
146 for (np
= m_defs
; np
; np
= np
->n_next
)
147 printf("%s: %s\n", np
->n_name
, np
->n_field
);
153 * Print the current value of everything in
154 * procs array. This will show their current
155 * value (as determined after context is read).
157 for (ps
= procs
; ps
->p_name
; ps
++)
158 printf ("%s: %s\n", ps
->p_name
, *ps
->p_field
? *ps
->p_field
: "");
162 components
= compp
> 1;
164 for (i
= 0; i
< compp
; i
++) {
165 register char *value
;
167 value
= context_find (comps
[i
]);
169 value
= p_find (comps
[i
]);
172 printf("%s: ", comps
[i
]);
174 printf("%s\n", value
);
180 return done (missed
);
189 for (ps
= procs
; ps
->p_name
; ps
++)
190 if (!strcasecmp (ps
->p_name
, str
))
191 return (*ps
->p_field
);