confstr.gperf (103591) | confstr.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/confstr.gperf 103591 2002-09-19 03:39:03Z wollman $ | 5 * $FreeBSD: head/usr.bin/getconf/confstr.gperf 119312 2003-08-22 17:32:07Z markm $ |
6 */ 7 8#include <sys/types.h> 9 10#include <string.h> 11#include <unistd.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 <unistd.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/* 21 * The Standard seems a bit ambiguous over whether the POSIX_V6_* 22 * are specified with or without a leading underscore, so we just 23 * use both. 24 */ 25%} 26struct map { const char *name; int key; int valid; }; --- 26 unchanged lines hidden (view full) --- 53_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 54_POSIX_V6_WIDTH_RESTRICTED_ENVS, _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 55%% 56int 57find_confstr(const char *name, int *key) 58{ 59 const struct map *rv; 60 | 19 20/* 21 * The Standard seems a bit ambiguous over whether the POSIX_V6_* 22 * are specified with or without a leading underscore, so we just 23 * use both. 24 */ 25%} 26struct map { const char *name; int key; int valid; }; --- 26 unchanged lines hidden (view full) --- 53_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 54_POSIX_V6_WIDTH_RESTRICTED_ENVS, _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 55%% 56int 57find_confstr(const char *name, int *key) 58{ 59 const struct map *rv; 60 |
61 rv = in_word_set(name, strlen(name)); | 61 rv = in_word_set(name); |
62 if (rv != NULL) { 63 if (rv->valid) { 64 *key = rv->key; 65 return 1; 66 } 67 return -1; 68 } 69 return 0; 70} | 62 if (rv != NULL) { 63 if (rv->valid) { 64 *key = rv->key; 65 return 1; 66 } 67 return -1; 68 } 69 return 0; 70} |