1%{ 2/* 3 * Copyright is disclaimed as to the contents of this file. 4 * 5 * $FreeBSD$ 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); 19 20%} 21struct map { char *name; int key; }; 22%% 23PATH, _CS_PATH 24%% 25int 26find_confstr(const char *name) 27{ 28 const struct map *rv; 29 30 rv = in_word_set(name, strlen(name)); 31 if (rv != 0) 32 return rv->key; 33 else 34 return -1; 35} 36