3 * Copyright is disclaimed as to the contents of this file.
5 * $FreeBSD: src/usr.bin/getconf/limits.gperf,v 1.2 2003/08/22 17:32:07 markm Exp $
12 #ifdef APPLE_GETCONF_UNDERSCORE
14 #endif /* APPLE_GETCONF_UNDERSCORE */
19 * Override gperf's built-in external scope.
21 static const struct map *in_word_set(const char *str);
24 struct map { const char *name; intmax_t value; int valid; };
26 _POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX
27 _POSIX_AIO_MAX, _POSIX_AIO_MAX
28 _POSIX_ARG_MAX, _POSIX_ARG_MAX
29 _POSIX_CHILD_MAX, _POSIX_CHILD_MAX
30 _POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN
31 _POSIX_DELAYTIMER_MAX, _POSIX_DELAYTIMER_MAX
32 _POSIX_HOST_NAME_MAX, _POSIX_HOST_NAME_MAX
33 _POSIX_LINK_MAX, _POSIX_LINK_MAX
34 _POSIX_LOGIN_NAME_MAX, _POSIX_LOGIN_NAME_MAX
35 _POSIX_MAX_CANON, _POSIX_MAX_CANON
36 _POSIX_MAX_INPUT, _POSIX_MAX_INPUT
37 _POSIX_MQ_OPEN_MAX, _POSIX_MQ_OPEN_MAX
38 _POSIX_MQ_PRIO_MAX, _POSIX_MQ_PRIO_MAX
39 _POSIX_NAME_MAX, _POSIX_NAME_MAX
40 _POSIX_NGROUPS_MAX, _POSIX_NGROUPS_MAX
41 _POSIX_OPEN_MAX, _POSIX_OPEN_MAX
42 _POSIX_PATH_MAX, _POSIX_PATH_MAX
43 _POSIX_PIPE_BUF, __POSIX_PIPE_BUF
44 _POSIX_RE_DUP_MAX, _POSIX_RE_DUP_MAX
45 _POSIX_RTSIG_MAX, _POSIX_RTSIG_MAX
46 _POSIX_SEM_NSEMS_MAX, _POSIX_SEM_NSEMS_MAX
47 _POSIX_SEM_VALUE_MAX, _POSIX_SEM_VALUE_MAX
48 _POSIX_SIGQUEUE_MAX, _POSIX_SIGQUEUE_MAX
49 _POSIX_SSIZE_MAX, _POSIX_SSIZE_MAX
50 _POSIX_STREAM_MAX, _POSIX_STREAM_MAX
51 _POSIX_SS_REPL_MAX, _POSIX_SS_REPL_MAX
52 _POSIX_SYMLINK_MAX, _POSIX_SYMLINK_MAX
53 _POSIX_SYMLOOP_MAX, _POSIX_SYMLOOP_MAX
54 _POSIX_THREAD_DESTRUCTOR_ITERATIONS, _POSIX_THREAD_DESTRUCTOR_ITERATIONS
55 _POSIX_THREAD_KEYS_MAX, _POSIX_THREAD_KEYS_MAX
56 _POSIX_THREAD_THREADS_MAX, _POSIX_THREAD_THREADS_MAX
57 _POSIX_TIMER_MAX, _POSIX_TIMER_MAX
58 _POSIX_TRACE_EVENT_NAME_MAX, _POSIX_TRACE_EVENT_NAME_MAX
59 _POSIX_TRACE_NAME_MAX, _POSIX_TRACE_NAME_MAX
60 _POSIX_TRACE_SYS_MAX, _POSIX_TRACE_SYS_MAX
61 _POSIX_TRACE_USER_EVENT_MAX, _POSIX_TRACE_USER_EVENT_MAX
62 _POSIX_TTY_NAME_MAX, _POSIX_TTY_NAME_MAX
63 _POSIX_TZNAME_MAX, _POSIX_TZNAME_MAX
64 _POSIX2_BC_BASE_MAX, _POSIX2_BC_BASE_MAX
65 _POSIX2_BC_DIM_MAX, _POSIX2_BC_DIM_MAX
66 _POSIX2_BC_SCALE_MAX, _POSIX2_BC_SCALE_MAX
67 _POSIX2_BC_STRING_MAX, _POSIX2_BC_STRING_MAX
68 _POSIX2_CHARCLASS_NAME_MAX, _POSIX2_CHARCLASS_NAME_MAX
69 _POSIX2_COLL_WEIGHTS_MAX, _POSIX2_COLL_WEIGHTS_MAX
70 _POSIX2_EXPR_NEST_MAX, _POSIX2_EXPR_NEST_MAX
71 _POSIX2_LINE_MAX, _POSIX2_LINE_MAX
72 _POSIX2_RE_DUP_MAX, _POSIX2_RE_DUP_MAX
73 _XOPEN_IOV_MAX, _XOPEN_IOV_MAX
74 _XOPEN_NAME_MAX, _XOPEN_NAME_MAX
75 _XOPEN_PATH_MAX, _XOPEN_PATH_MAX
86 MB_LEN_MAX, MB_LEN_MAX
94 ULLONG_MAX, ULLONG_MAX
98 CHARCLASS_NAME_MAX, CHARCLASS_NAME_MAX
100 ML_LANGMAX, NL_LANGMAX
104 NL_TEXTMAX, NL_TEXTMAX
108 find_limit(const char *name, intmax_t *value)
110 const struct map *rv;
111 #ifdef APPLE_GETCONF_UNDERSCORE
113 #endif /* APPLE_GETCONF_UNDERSCORE */
115 rv = in_word_set(name);
123 #ifdef APPLE_GETCONF_UNDERSCORE
125 alt = (char *)name + 1;
127 if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
130 strcpy(alt + 1, name);
132 rv = in_word_set(alt);
140 #endif /* APPLE_GETCONF_UNDERSCORE */