1%{ 2/* 3 * Copyright is disclaimed as to the contents of this file. 4 * 5 * $FreeBSD: head/usr.bin/getconf/pathconf.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 */ 18static const struct map *in_word_set(const char *str); 19 20%} 21struct map { const char *name; int key; int valid; }; 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 30POSIX2_SYMLINKS, _PC_2_SYMLINKS 31POSIX_ALLOC_SIZE_MIN, _PC_ALLOC_SIZE_MIN 32POSIX_REC_INCR_XFER_SIZE, _PC_REC_INCR_XFER_SIZE 33POSIX_REC_MAX_XFER_SIZE, _PC_REC_MAX_XFER_SIZE 34POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFER_SIZE 35POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN 36SYMLINK_MAX, _PC_SYMLINK_MAX 37TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED 38TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX 39TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT 40TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT 41TRUSTEDBSD_MAC_PRESENT, _PC_MAC_PRESENT 42_POSIX_ASYNC_IO, _PC_ASYNC_IO 43_POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED 44_POSIX_NO_TRUNC, _PC_NO_TRUNC 45_POSIX_PRIO_IO, _PC_PRIO_IO 46_POSIX_SYNC_IO, _PC_SYNC_IO 47_POSIX_VDISABLE, _PC_VDISABLE 48%% 49int 50find_pathconf(const char *name, int *key) 51{ 52 const struct map *rv; 53 54 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} 64