]>
git.cameronkatri.com Git - mandoc.git/blob - arch.c
1 /* $Id: arch.c,v 1.15 2019/05/21 07:52:00 schwarze Exp $ */
3 * Copyright (c) 2017, 2019 Ingo Schwarze <schwarze@openbsd.org>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 arch_valid(const char *arch
, enum mandoc_os os
)
26 const char *openbsd_arch
[] = {
27 "alpha", "amd64", "arm64", "armv7", "hppa", "i386",
28 "landisk", "loongson", "luna88k", "macppc", "mips64",
29 "octeon", "sgi", "sparc64", NULL
31 const char *netbsd_arch
[] = {
32 "acorn26", "acorn32", "algor", "alpha", "amiga",
34 "bebox", "cats", "cesfic", "cobalt", "dreamcast",
35 "emips", "evbarm", "evbmips", "evbppc", "evbsh3", "evbsh5",
36 "hp300", "hpcarm", "hpcmips", "hpcsh", "hppa",
37 "i386", "ibmnws", "luna68k",
38 "mac68k", "macppc", "mipsco", "mmeye", "mvme68k", "mvmeppc",
39 "netwinder", "news68k", "newsmips", "next68k",
40 "pc532", "playstation2", "pmax", "pmppc", "prep",
41 "sandpoint", "sbmips", "sgimips", "shark",
42 "sparc", "sparc64", "sun2", "sun3",
43 "vax", "walnut", "x68k", "x86", "x86_64", "xen", NULL
45 const char **arches
[] = { NULL
, netbsd_arch
, openbsd_arch
};
48 if ((arch_p
= arches
[os
]) == NULL
)
50 for (; *arch_p
!= NULL
; arch_p
++)
51 if (strcmp(*arch_p
, arch
) == 0)