-
-/*
- * This is just OpenBSD's strtol(3) suggestion.
- * I use it instead of strtonum(3) for portability's sake.
- */
-static int
-atou(const char *buf, unsigned *v)
-{
- char *ep;
- long lval;
-
- errno = 0;
- lval = strtol(buf, &ep, 10);
- if (buf[0] == '\0' || *ep != '\0')
- return(0);
- if ((errno == ERANGE && (lval == LONG_MAX ||
- lval == LONG_MIN)) ||
- (lval > UINT_MAX || lval < 0))
- return(0);
-
- *v = (unsigned int)lval;
- return(1);
-}
+static const char *const sec_names[] = {
+ "All Sections",
+ "1 - General Commands",
+ "2 - System Calls",
+ "3 - Subroutines",
+ "3p - Perl Subroutines",
+ "4 - Special Files",
+ "5 - File Formats",
+ "6 - Games",
+ "7 - Macros and Conventions",
+ "8 - Maintenance Commands",
+ "9 - Kernel Interface"
+};
+static const int sec_MAX = sizeof(sec_names) / sizeof(char *);
+
+static const char *const arch_names[] = {
+ "amd64", "alpha", "armish", "armv7",
+ "aviion", "hppa", "hppa64", "i386",
+ "ia64", "landisk", "loongson", "luna88k",
+ "macppc", "mips64", "octeon", "sgi",
+ "socppc", "solbourne", "sparc", "sparc64",
+ "vax", "zaurus",
+ "amiga", "arc", "arm32", "atari",
+ "beagle", "cats", "hp300", "mac68k",
+ "mvme68k", "mvme88k", "mvmeppc", "palm",
+ "pc532", "pegasos", "pmax", "powerpc",
+ "sun3", "wgrisc", "x68k"
+};
+static const int arch_MAX = sizeof(arch_names) / sizeof(char *);