1 /* m_readefs.c - read a profile/context file */
3 static char ident[] = "@(#)$Id: m_readefs.c,v 1.2 1994/04/29 04:58:00 jromine Exp $";
14 { "context", &context },
17 { "faceproc", &faceproc },
18 { "fileproc", &fileproc },
19 { "incproc", &incproc },
20 { "installproc",&installproc },
22 { "mailproc", &mailproc },
23 { "mhlproc", &mhlproc },
24 { "moreproc", &moreproc },
25 { "mshproc", &mshproc },
26 { "packproc", &packproc },
27 { "postproc", &postproc },
28 { "rmfproc", &rmfproc },
29 { "rmmproc", &rmmproc },
30 { "sendproc", &sendproc },
31 { "showproc", &showproc },
32 { "slocalproc", &slocalproc },
33 { "vmhproc", &vmhproc },
36 { "whomproc", &whomproc },
40 static struct node **opp = NULL;
43 void m_readefs (npp, ib, file, ctx)
44 register struct node **npp;
53 register struct node *np;
54 register struct procs *ps;
56 if (npp == NULL && (npp = opp) == NULL) {
57 admonish (NULLCP, "bug: m_readefs called but pump not primed");
62 switch (state = m_getfld (state, name, field, sizeof field, ib)) {
66 np = (struct node *) malloc (sizeof *np);
68 adios (NULLCP, "unable to allocate profile storage");
70 *(npp = &np -> n_next) = NULL;
71 np -> n_name = getcpy (name);
72 if (state == FLDPLUS) {
74 while (state == FLDPLUS) {
76 (state, name, field, sizeof field, ib);
79 np -> n_field = trimcpy (cp);
83 np -> n_field = trimcpy (field);
84 np -> n_context = ctx;
85 for (ps = procs; ps -> procname; ps++)
86 if (strcmp (np -> n_name, ps -> procname) == 0) {
87 *ps -> procnaddr = np -> n_field;
96 adios (NULLCP, "no blank lines are permitted in %s", file);
102 adios (NULLCP, "%s is poorly formatted", file);