pathconf.gperf (106016) | pathconf.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/pathconf.gperf 106016 2002-10-27 04:10:34Z wollman $ | 5 * $FreeBSD: head/usr.bin/getconf/pathconf.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%} | 19 20%} |
22struct map { char *name; int key; int valid; }; | 21struct map { const char *name; int key; int valid; }; |
23%% 24FILESIZEBITS, _PC_FILESIZEBITS 25LINK_MAX, _PC_LINK_MAX 26MAX_CANON, _PC_MAX_CANON 27MAX_INPUT, _PC_MAX_INPUT 28NAME_MAX, _PC_NAME_MAX 29PATH_MAX, _PC_PATH_MAX 30PIPE_BUF, _PC_PIPE_BUF --- 15 unchanged lines hidden (view full) --- 46_POSIX_PRIO_IO, _PC_PRIO_IO 47_POSIX_SYNC_IO, _PC_SYNC_IO 48%% 49int 50find_pathconf(const char *name, int *key) 51{ 52 const struct map *rv; 53 | 22%% 23FILESIZEBITS, _PC_FILESIZEBITS 24LINK_MAX, _PC_LINK_MAX 25MAX_CANON, _PC_MAX_CANON 26MAX_INPUT, _PC_MAX_INPUT 27NAME_MAX, _PC_NAME_MAX 28PATH_MAX, _PC_PATH_MAX 29PIPE_BUF, _PC_PIPE_BUF --- 15 unchanged lines hidden (view full) --- 45_POSIX_PRIO_IO, _PC_PRIO_IO 46_POSIX_SYNC_IO, _PC_SYNC_IO 47%% 48int 49find_pathconf(const char *name, int *key) 50{ 51 const struct map *rv; 52 |
54 rv = in_word_set(name, strlen(name)); | 53 rv = in_word_set(name); |
55 if (rv != NULL) { 56 if (rv->valid) { 57 *key = rv->key; 58 return 1; 59 } 60 return -1; 61 } 62 return 0; 63} | 54 if (rv != NULL) { 55 if (rv->valid) { 56 *key = rv->key; 57 return 1; 58 } 59 return -1; 60 } 61 return 0; 62} |