9 date 94.04.29.04.58.00; author jromine; state Exp;
14 date 94.04.29.04.45.25; author jromine; state Exp;
28 @/* m_readefs.c - read a profile/context file */
30 static char ident[] = "@@(#)$Id:$";
41 { "context", &context },
44 { "faceproc", &faceproc },
45 { "fileproc", &fileproc },
46 { "incproc", &incproc },
47 { "installproc",&installproc },
49 { "mailproc", &mailproc },
50 { "mhlproc", &mhlproc },
51 { "moreproc", &moreproc },
52 { "mshproc", &mshproc },
53 { "packproc", &packproc },
54 { "postproc", &postproc },
55 { "rmfproc", &rmfproc },
56 { "rmmproc", &rmmproc },
57 { "sendproc", &sendproc },
58 { "showproc", &showproc },
59 { "slocalproc", &slocalproc },
60 { "vmhproc", &vmhproc },
63 { "whomproc", &whomproc },
67 static struct node **opp = NULL;
70 void m_readefs (npp, ib, file, ctx)
71 register struct node **npp;
80 register struct node *np;
81 register struct procs *ps;
83 if (npp == NULL && (npp = opp) == NULL) {
84 admonish (NULLCP, "bug: m_readefs called but pump not primed");
89 switch (state = m_getfld (state, name, field, sizeof field, ib)) {
93 np = (struct node *) malloc (sizeof *np);
95 adios (NULLCP, "unable to allocate profile storage");
97 *(npp = &np -> n_next) = NULL;
98 np -> n_name = getcpy (name);
99 if (state == FLDPLUS) {
101 while (state == FLDPLUS) {
103 (state, name, field, sizeof field, ib);
104 cp = add (field, cp);
106 np -> n_field = trimcpy (cp);
110 np -> n_field = trimcpy (field);
111 np -> n_context = ctx;
112 for (ps = procs; ps -> procname; ps++)
113 if (strcmp (np -> n_name, ps -> procname) == 0) {
114 *ps -> procnaddr = np -> n_field;
123 adios (NULLCP, "no blank lines are permitted in %s", file);
129 adios (NULLCP, "%s is poorly formatted", file);