]> diplodocus.org Git - nmh/blob - sbr/context_find.c
Bring these changes over from the branch.
[nmh] / sbr / context_find.c
1
2 /*
3 * context_find.c -- find an entry in the context/profile list
4 *
5 * $Id$
6 *
7 * This code is Copyright (c) 2002, by the authors of nmh. See the
8 * COPYRIGHT file in the root directory of the nmh distribution for
9 * complete copyright information.
10 */
11
12 #include <h/mh.h>
13
14
15 char *
16 context_find (char *str)
17 {
18 struct node *np;
19
20 /* sanity check - check that context has been read */
21 if (defpath == NULL)
22 adios (NULL, "oops, context hasn't been read yet");
23
24 for (np = m_defs; np; np = np->n_next)
25 if (!strcasecmp (np->n_name, str))
26 return (np->n_field);
27
28 return NULL;
29 }