sysconf.gperf (106016) | sysconf.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/sysconf.gperf 106016 2002-10-27 04:10:34Z wollman $ | 5 * $FreeBSD: head/usr.bin/getconf/sysconf.gperf 119312 2003-08-22 17:32:07Z markm $ |
6 */ 7 8#include <sys/types.h> 9 | 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 * Override gperf's built-in external scope. 18 */ | 10#include <string.h> 11#include <unistd.h> 12 13#include "getconf.h" 14 15/* 16 * Override gperf's built-in external scope. 17 */ |
19static const struct map *in_word_set(const char *str, unsigned int len); | 18static const struct map *in_word_set(const char *str); |
20 21%} 22struct map { const char *name; int key; int valid; }; 23%% 24AIO_LISTIO_MAX, _SC_AIO_LISTIO_MAX 25AIO_MAX, _SC_AIO_MAX 26AIO_PRIO_DELTA_MAX, _SC_AIO_PRIO_DELTA_MAX 27ARG_MAX, _SC_ARG_MAX --- 105 unchanged lines hidden (view full) --- 133_XOPEN_VERSION, _SC_XOPEN_VERSION 134_XOPEN_XCU_VERSION, _SC_XCU_VERSION 135%% 136int 137find_sysconf(const char *name, int *key) 138{ 139 const struct map *rv; 140 | 19 20%} 21struct map { const char *name; int key; int valid; }; 22%% 23AIO_LISTIO_MAX, _SC_AIO_LISTIO_MAX 24AIO_MAX, _SC_AIO_MAX 25AIO_PRIO_DELTA_MAX, _SC_AIO_PRIO_DELTA_MAX 26ARG_MAX, _SC_ARG_MAX --- 105 unchanged lines hidden (view full) --- 132_XOPEN_VERSION, _SC_XOPEN_VERSION 133_XOPEN_XCU_VERSION, _SC_XCU_VERSION 134%% 135int 136find_sysconf(const char *name, int *key) 137{ 138 const struct map *rv; 139 |
141 rv = in_word_set(name, strlen(name)); | 140 rv = in_word_set(name); |
142 if (rv != NULL) { 143 if (rv->valid) { 144 *key = rv->key; 145 return 1; 146 } 147 return -1; 148 } 149 return 0; 150} | 141 if (rv != NULL) { 142 if (rv->valid) { 143 *key = rv->key; 144 return 1; 145 } 146 return -1; 147 } 148 return 0; 149} |