freebsd-nq/usr.bin/getconf/limits.gperf
2017-01-28 16:31:23 +00:00

119 lines
3.1 KiB
Plaintext

%{
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD$
*/
#include <sys/types.h>
#include <string.h>
#include <limits.h>
#include "getconf.h"
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str);
%}
struct map { const char *name; intmax_t value; int valid; };
%%
_POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN
_POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX
_POSIX_AIO_MAX, _POSIX_AIO_MAX
_POSIX_ARG_MAX, _POSIX_ARG_MAX
_POSIX_CHILD_MAX, _POSIX_CHILD_MAX
_POSIX_DELAYTIMER_MAX, _POSIX_DELAYTIMER_MAX
_POSIX_HOST_NAME_MAX, _POSIX_HOST_NAME_MAX
_POSIX_LINK_MAX, _POSIX_LINK_MAX
_POSIX_LOGIN_NAME_MAX, _POSIX_LOGIN_NAME_MAX
_POSIX_MAX_CANON, _POSIX_MAX_CANON
_POSIX_MAX_INPUT, _POSIX_MAX_INPUT
_POSIX_MQ_OPEN_MAX, _POSIX_MQ_OPEN_MAX
_POSIX_MQ_PRIO_MAX, _POSIX_MQ_PRIO_MAX
_POSIX_NAME_MAX, _POSIX_NAME_MAX
_POSIX_NGROUPS_MAX, _POSIX_NGROUPS_MAX
_POSIX_OPEN_MAX, _POSIX_OPEN_MAX
_POSIX_PATH_MAX, _POSIX_PATH_MAX
_POSIX_PIPE_BUF, __POSIX_PIPE_BUF
_POSIX_RE_DUP_MAX, _POSIX_RE_DUP_MAX
_POSIX_RTSIG_MAX, _POSIX_RTSIG_MAX
_POSIX_SEM_NSEMS_MAX, _POSIX_SEM_NSEMS_MAX
_POSIX_SEM_VALUE_MAX, _POSIX_SEM_VALUE_MAX
_POSIX_SIGQUEUE_MAX, _POSIX_SIGQUEUE_MAX
_POSIX_SSIZE_MAX, _POSIX_SSIZE_MAX
_POSIX_STREAM_MAX, _POSIX_STREAM_MAX
_POSIX_SS_REPL_MAX, _POSIX_SS_REPL_MAX
_POSIX_SYMLINK_MAX, _POSIX_SYMLINK_MAX
_POSIX_SYMLOOP_MAX, _POSIX_SYMLOOP_MAX
_POSIX_THREAD_DESTRUCTOR_ITERATIONS, _POSIX_THREAD_DESTRUCTOR_ITERATIONS
_POSIX_THREAD_KEYS_MAX, _POSIX_THREAD_KEYS_MAX
_POSIX_THREAD_THREADS_MAX, _POSIX_THREAD_THREADS_MAX
_POSIX_TIMER_MAX, _POSIX_TIMER_MAX
_POSIX_TRACE_EVENT_NAME_MAX, _POSIX_TRACE_EVENT_NAME_MAX
_POSIX_TRACE_NAME_MAX, _POSIX_TRACE_NAME_MAX
_POSIX_TRACE_SYS_MAX, _POSIX_TRACE_SYS_MAX
_POSIX_TRACE_USER_EVENT_MAX, _POSIX_TRACE_USER_EVENT_MAX
_POSIX_TTY_NAME_MAX, _POSIX_TTY_NAME_MAX
_POSIX_TZNAME_MAX, _POSIX_TZNAME_MAX
_POSIX2_BC_BASE_MAX, _POSIX2_BC_BASE_MAX
_POSIX2_BC_DIM_MAX, _POSIX2_BC_DIM_MAX
_POSIX2_BC_SCALE_MAX, _POSIX2_BC_SCALE_MAX
_POSIX2_BC_STRING_MAX, _POSIX2_BC_STRING_MAX
_POSIX2_CHARCLASS_NAME_MAX, _POSIX2_CHARCLASS_NAME_MAX
_POSIX2_COLL_WEIGHTS_MAX, _POSIX2_COLL_WEIGHTS_MAX
_POSIX2_EXPR_NEXT_MAX, _POSIX2_EXPR_NEST_MAX
_POSIX2_LINE_MAX, _POSIX2_LINE_MAX
_POSIX2_RE_DUP_MAX, _POSIX2_RE_DUP_MAX
_XOPEN_IOV_MAX, _XOPEN_IOV_MAX
_XOPEN_NAME_MAX, _XOPEN_NAME_MAX
_XOPEN_PATH_MAX, _XOPEN_PATH_MAX
CHAR_BIT, CHAR_BIT
CHAR_MAX, CHAR_MAX
CHAR_MIN, CHAR_MIN
INT_MAX, INT_MAX
INT_MIN, INT_MIN
LLONG_MIN, LLONG_MIN
LLONG_MAX, LLONG_MAX
LONG_BIT, LONG_BIT
LONG_MAX, LONG_MAX
LONG_MIN, LONG_MIN
MB_LEN_MAX, MB_LEN_MAX
SCHAR_MAX, SCHAR_MAX
SCHAR_MIN, SCHAR_MIN
SHRT_MAX, SHRT_MAX
SHRT_MIN, SHRT_MIN
SSIZE_MAX, SSIZE_MAX
UCHAR_MAX, UCHAR_MAX
UINT_MAX, UINT_MAX
ULLONG_MAX, ULLONG_MAX
ULONG_MAX, ULONG_MAX
USHRT_MAX, USHRT_MAX
WORD_BIT, WORD_BIT
CHARCLASS_NAME_MAX, CHARCLASS_NAME_MAX
NL_ARGMAX, NL_ARGMAX
ML_LANGMAX, NL_LANGMAX
NL_MSGMAX, NL_MSGMAX
NL_NMAX, NL_NMAX
NL_SETMAX, NL_SETMAX
NL_TEXTMAX, NL_TEXTMAX
NZERO, NZERO
%%
int
find_limit(const char *name, intmax_t *value)
{
const struct map *rv;
rv = in_word_set(name);
if (rv != NULL) {
if (rv->valid) {
*value = rv->value;
return 1;
}
return -1;
}
return 0;
}