0da05adfcf
wheel^H^H^H^H^HPOSIX.2 and X/Open utility, and rather more complicated than necessary.
36 lines
514 B
Plaintext
36 lines
514 B
Plaintext
%{
|
|
/*
|
|
* Copyright is disclaimed as to the contents of this file.
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include "getconf.h"
|
|
|
|
/*
|
|
* Override gperf's built-in external scope.
|
|
*/
|
|
static const struct map *in_word_set(const char *str, unsigned int len);
|
|
|
|
%}
|
|
struct map { char *name; int key; };
|
|
%%
|
|
PATH, _CS_PATH
|
|
%%
|
|
int
|
|
find_confstr(const char *name)
|
|
{
|
|
const struct map *rv;
|
|
|
|
rv = in_word_set(name, strlen(name));
|
|
if (rv != 0)
|
|
return rv->key;
|
|
else
|
|
return -1;
|
|
}
|