head 1.9; access; symbols; locks; strict; comment @ * @; 1.9 date 93.09.01.23.00.59; author jromine; state Exp; branches; next 1.8; 1.8 date 93.09.01.22.50.54; author jromine; state Exp; branches; next 1.7; 1.7 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.6; 1.6 date 92.11.16.22.26.50; author jromine; state Exp; branches; next 1.5; 1.5 date 92.10.27.16.44.07; author jromine; state Exp; branches; next 1.4; 1.4 date 92.05.19.21.06.11; author jromine; state Exp; branches; next 1.3; 1.3 date 92.02.09.22.28.58; author jromine; state Exp; branches; next 1.2; 1.2 date 92.02.06.17.12.41; author jromine; state Exp; branches; next 1.1; 1.1 date 92.02.06.17.11.53; author jromine; state Exp; branches; next ; desc @contributed by Jeffrey C Honig @ 1.9 log @add sbackup (SBACKUP=",") link (LINK="@@") @ text @/* mhparam.c - print mh_profile values */ #ifndef lint static char ident[] = "@@(#)$Id: mhparam.c,v 1.8 1993/09/01 22:50:54 jromine Exp jromine $"; #endif /* lint */ /* contributed by Jeffrey C Honig */ #include "../h/mh.h" #include extern char *mhlibdir; /* NB: this will change soon */ char *sbackup = SBACKUP; char *slink = LINK; /* */ static struct swit switches[] = { #define COMPSW 0 "components", 0, #define NCOMPSW 1 "nocomponents", 0, #define ALLSW 2 "all", 0, #define HELPSW 3 "help", 4, NULL, 0 }; static char *p_find(); /* */ /* ARGSUSED */ main(argc, argv) int argc; char *argv[]; { int i, all = 0, compp = 0, components = -1, missed = 0; char *cp, buf[100], **ap, **argp, *arguments[MAXARGS], *comps[MAXARGS]; invo_name = r1bindex (argv[0], '/'); if ((cp = m_find (invo_name)) != NULL) { ap = brkstring (cp = getcpy (cp), " ", "\n"); ap = copyip (ap, arguments); } else ap = arguments; (void) copyip (argv + 1, ap); argp = arguments; /* */ while (cp = *argp++) { if (*cp == '-') switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULLCP, "-%s unknown", cp); case HELPSW: (void) sprintf (buf, "%s [profile-components] [switches]", invo_name); help (buf, switches); done (1); case COMPSW: components = 1; break; case NCOMPSW: components = 0; break; case ALLSW: all = 1; break; } else comps[compp++] = cp; } /* */ if (all) { register struct node *np; if (compp) advise(NULLCP, "profile-components ignored with -all"); if (components >= 0) advise(NULLCP, "-%scomponents ignored with -all", components ? "" : "no"); m_getdefs (); for (np = m_defs; np; np = np -> n_next) printf("%s:\t%s\n", np -> n_name, np -> n_field); } else { if (components < 0) components = compp > 1; for (i = 0; i < compp; i++) { register char *value = m_find(comps[i]); if (!value) value = p_find(comps[i]); if (value) { if (components) printf("%s:\t", comps[i]); printf("%s\n", value); } else missed++; } } done (missed); } static struct procs { char *p_name; char **p_field; } procs [] = { { "context", &context }, { "faceproc", &faceproc }, { "fileproc", &fileproc }, { "foldprot", &foldprot }, { "incproc", &incproc }, { "installproc", &installproc }, { "lproc", &lproc }, { "mailproc", &mailproc }, { "mhlproc", &mhlproc }, { "moreproc", &moreproc }, { "msgprot", &msgprot }, { "mshproc", &mshproc }, { "packproc", &packproc }, { "postproc", &postproc }, { "rmfproc", &rmfproc }, { "rmmproc", &rmmproc }, { "sendproc", &sendproc }, { "showproc", &showproc }, { "slocalproc", &slocalproc }, { "version", &version }, { "vmhproc", &vmhproc }, { "whatnowproc", &whatnowproc }, { "whomproc", &whomproc }, { "libdir", &mhlibdir }, { "sbackup", &sbackup }, { "link", &slink }, { NULL, NULL }, }; static char *p_find(str) register char *str; { register struct procs *ps; for (ps = procs; ps->p_name; ps++) if (uleq (ps -> p_name, str)) return (*ps -> p_field); return NULL; } @ 1.8 log @add "libdir" -- note: this is subject to change @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: mhparam.c,v 1.7 1992/12/15 00:20:22 jromine Exp jromine $"; d11 2 d159 3 @ 1.7 log @endif sugar @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: mhparam.c,v 1.6 1992/11/16 22:26:50 jromine Exp jromine $"; d10 2 d156 1 @ 1.6 log @lookup "procs" as well as profile-components @ text @d3 2 a4 2 static char ident[] = "@@(#)$Id: mhparam.c,v 1.5 1992/10/27 16:44:07 jromine Exp jromine $"; #endif lint @ 1.5 log @change jch e-mail address @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: mhparam.c,v 1.4 1992/05/19 21:06:11 jromine Exp jromine $"; d25 2 d111 3 d125 42 @ 1.4 log @AIX @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: mhparam.c,v 1.3 1992/02/09 22:28:58 jromine Exp jromine $"; d5 1 a5 1 /* contributed by Jeffrey C Honig */ @ 1.3 log @re-order switches @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: mhparam.c,v 1.2 1992/02/06 17:12:41 jromine Exp jromine $"; d22 1 a22 1 NULL, NULL @ 1.2 log @add by-line @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: mhparam.c,v 1.1 1992/02/06 17:11:53 jromine Exp jromine $"; d13 1 a13 4 #define HELPSW 0 "help", 4, #define COMPSW 1 d15 1 a15 1 #define NCOMPSW 2 d17 1 a17 2 #define ALLSW 3 d19 2 @ 1.1 log @Initial revision @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: scan.c,v 1.13 1992/02/05 22:50:17 jromine Exp jromine $"; d5 1 @