]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/getconf/pathconf.gperf
This commit was generated by cvs2svn to compensate for changes in r66963,
[FreeBSD/FreeBSD.git] / usr.bin / getconf / pathconf.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 <limits.h>
11 #include <string.h>
12 #include <unistd.h>
13
14 #include "getconf.h"
15
16 /*
17  * Stuff that isn't defined right now -- we want this file to work
18  * unmodified once it is defined.
19  */
20 #ifndef _PC_FILESIZEBITS
21 #define _PC_FILESIZEBITS        -1
22 #endif
23
24 /*
25  * Override gperf's built-in external scope.
26  */
27 static const struct map *in_word_set(const char *str, unsigned int len);
28
29 %}
30 struct map { char *name; int key; };
31 %%
32 FILESIZEBITS, _PC_FILESIZEBITS
33 LINK_MAX, _PC_LINK_MAX
34 MAX_CANON, _PC_MAX_CANON
35 MAX_INPUT, _PC_MAX_INPUT
36 NAME_MAX, _PC_NAME_MAX
37 PATH_MAX, _PC_PATH_MAX
38 PIPE_BUF, _PC_PIPE_BUF
39 _POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED
40 _POSIX_NO_TRUNC, _PC_NO_TRUNC
41 _POSIX_VDISABLE, _PC_VDISABLE
42 _POSIX_ASYNC_IO, _PC_ASYNC_IO
43 _POSIX_PRIO_IO, _PC_PRIO_IO
44 _POSIX_SYNC_IO, _PC_SYNC_IO
45 %%
46 int
47 find_pathconf(const char *name)
48 {
49         const struct map *rv;
50
51         rv = in_word_set(name, strlen(name));
52         if (rv != 0)
53                 return rv->key;
54         else
55                 return -1;
56 }