3 * Copyright is disclaimed as to the contents of this file.
5 * $FreeBSD: src/usr.bin/getconf/progenv.gperf,v 1.1.2.1 2002/10/27 04:18:40 wollman Exp $
6 * $DragonFly: src/usr.bin/getconf/progenv.gperf,v 1.3 2006/08/25 22:37:09 swildner Exp $
17 * Override gperf's built-in external scope.
19 static const struct map *in_word_set(const char *str, unsigned int len);
22 * The Standard seems a bit ambiguous over whether the POSIX_V6_*
23 * are specified with or without a leading underscore, so we just
27 * The alt_path member gives the path containing another `getconf'
28 * executable which was compiled using the specified programming
29 * environment. If it is NULL, the current executable is good enough.
30 * If we ever support multiple environments, this table will need to
31 * be updated. (We cheat here and define the supported environments
34 #if defined(__sparc64__)
35 #define have_LP64_OFF64 NULL
38 #if defined(__i386__) || defined(__powerpc__)
39 #define have_ILP32_OFFBIG NULL
43 struct map { const char *name; const char *alt_path; int valid; };
45 POSIX_V6_ILP32_OFF32, notdef
46 POSIX_V6_ILP32_OFFBIG, have_ILP32_OFFBIG
47 POSIX_V6_LP64_OFF64, have_LP64_OFF64
48 POSIX_V6_LPBIG_OFFBIG, notdef
49 _POSIX_V6_ILP32_OFF32, notdef
50 _POSIX_V6_ILP32_OFFBIG, have_ILP32_OFFBIG
51 _POSIX_V6_LP64_OFF64, have_LP64_OFF64
52 _POSIX_V6_LPBIG_OFFBIG, notdef
55 find_progenv(const char *name, const char **alt_path)
59 rv = in_word_set(name, strlen(name));
62 *alt_path = rv->alt_path;