limits.gperf (103591) | limits.gperf (119312) |
---|---|
1%{ 2/* 3 * Copyright is disclaimed as to the contents of this file. 4 * | 1%{ 2/* 3 * Copyright is disclaimed as to the contents of this file. 4 * |
5 * $FreeBSD: head/usr.bin/getconf/limits.gperf 103591 2002-09-19 03:39:03Z wollman $ | 5 * $FreeBSD: head/usr.bin/getconf/limits.gperf 119312 2003-08-22 17:32:07Z markm $ |
6 */ 7 8#include <sys/types.h> 9 10#include <string.h> 11#include <limits.h> 12 13#include "getconf.h" 14 15/* 16 * Override gperf's built-in external scope. 17 */ | 6 */ 7 8#include <sys/types.h> 9 10#include <string.h> 11#include <limits.h> 12 13#include "getconf.h" 14 15/* 16 * Override gperf's built-in external scope. 17 */ |
18static const struct map *in_word_set(const char *str, unsigned int len); | 18static const struct map *in_word_set(const char *str); |
19 20%} 21struct map { const char *name; intmax_t value; int valid; }; 22%% 23_POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN 24_POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX 25_POSIX_AIO_MAX, _POSIX_AIO_MAX 26_POSIX_ARG_MAX, _POSIX_ARG_MAX --- 74 unchanged lines hidden (view full) --- 101NL_TEXTMAX, NL_TEXTMAX 102NZERO, NZERO 103%% 104int 105find_limit(const char *name, intmax_t *value) 106{ 107 const struct map *rv; 108 | 19 20%} 21struct map { const char *name; intmax_t value; int valid; }; 22%% 23_POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN 24_POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX 25_POSIX_AIO_MAX, _POSIX_AIO_MAX 26_POSIX_ARG_MAX, _POSIX_ARG_MAX --- 74 unchanged lines hidden (view full) --- 101NL_TEXTMAX, NL_TEXTMAX 102NZERO, NZERO 103%% 104int 105find_limit(const char *name, intmax_t *value) 106{ 107 const struct map *rv; 108 |
109 rv = in_word_set(name, strlen(name)); | 109 rv = in_word_set(name); |
110 if (rv != NULL) { 111 if (rv->valid) { 112 *value = rv->value; 113 return 1; 114 } 115 return -1; 116 } 117 return 0; 118} | 110 if (rv != NULL) { 111 if (rv->valid) { 112 *value = rv->value; 113 return 1; 114 } 115 return -1; 116 } 117 return 0; 118} |