Deleted Added
full compact
1%{
2/*
3 * Copyright is disclaimed as to the contents of this file.
4 *
5 * $FreeBSD: head/usr.bin/getconf/pathconf.gperf 59632 2000-04-26 02:36:54Z wollman $
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 */
27static const struct map *in_word_set(const char *str, unsigned int len);
28
29%}
30struct map { char *name; int key; };
31%%
32FILESIZEBITS, _PC_FILESIZEBITS
33LINK_MAX, _PC_LINK_MAX
34MAX_CANON, _PC_MAX_CANON
35MAX_INPUT, _PC_MAX_INPUT
36NAME_MAX, _PC_NAME_MAX
37PATH_MAX, _PC_PATH_MAX
38PIPE_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%%
46int
47find_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}