]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/getconf/confstr.gperf
This commit was generated by cvs2svn to compensate for changes in r94880,
[FreeBSD/FreeBSD.git] / usr.bin / getconf / confstr.gperf
1 %{
2 /*
3  * Copyright is disclaimed as to the contents of this file.
4  *
5  * $FreeBSD$
6  */
7
8 #include <sys/types.h>
9
10 #include <string.h>
11 #include <unistd.h>
12
13 #include "getconf.h"
14
15 /*
16  * Override gperf's built-in external scope.
17  */
18 static const struct map *in_word_set(const char *str, unsigned int len);
19
20 %}
21 struct map { char *name; int key; };
22 %%
23 PATH, _CS_PATH
24 %%
25 int
26 find_confstr(const char *name)
27 {
28         const struct map *rv;
29
30         rv = in_word_set(name, strlen(name));
31         if (rv != 0)
32                 return rv->key;
33         else
34                 return -1;
35 }