diff options
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | arch.c | 37 | ||||
-rw-r--r-- | arch.in | 112 | ||||
-rw-r--r-- | mandoc.1 | 6 | ||||
-rw-r--r-- | mandoc.h | 1 | ||||
-rw-r--r-- | mdoc.7 | 7 | ||||
-rw-r--r-- | mdoc_validate.c | 19 | ||||
-rw-r--r-- | read.c | 1 |
8 files changed, 9 insertions, 181 deletions
@@ -35,8 +35,7 @@ TESTSRCS = test-dirent-namlen.c \ test-strsep.c \ test-wchar.c -SRCS = arch.c \ - att.c \ +SRCS = att.c \ cgi.c \ chars.c \ compat_fgetln.c \ @@ -103,7 +102,6 @@ DISTFILES = INSTALL \ NEWS \ TODO \ apropos.1 \ - arch.in \ att.in \ cgi.h.example \ chars.in \ @@ -160,8 +158,7 @@ LIBMAN_OBJS = man.o \ man_macro.o \ man_validate.o -LIBMDOC_OBJS = arch.o \ - att.o \ +LIBMDOC_OBJS = att.o \ lib.o \ mdoc.o \ mdoc_argv.o \ diff --git a/arch.c b/arch.c deleted file mode 100644 index 8454cbc6..00000000 --- a/arch.c +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ */ -/* - * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "config.h" - -#include <sys/types.h> - -#include <string.h> - -#include "mdoc.h" -#include "libmdoc.h" - -#define LINE(x, y) \ - if (0 == strcmp(p, x)) return(y); - - -const char * -mdoc_a2arch(const char *p) -{ - -#include "arch.in" - - return(NULL); -} diff --git a/arch.in b/arch.in deleted file mode 100644 index cc47ca9a..00000000 --- a/arch.in +++ /dev/null @@ -1,112 +0,0 @@ -/* $Id$ */ -/* - * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file defines the architecture token of the .Dt prologue macro. - * All architectures that your system supports (or the manuals of your - * system) should be included here. The right-hand-side is the - * formatted output. - * - * Be sure to escape strings. - * - * REMEMBER TO ADD NEW ARCHITECTURES TO MDOC.7! - */ - -LINE("acorn26", "Acorn26") -LINE("acorn32", "Acorn32") -LINE("algor", "Algor") -LINE("alpha", "Alpha") -LINE("amd64", "AMD64") -LINE("amiga", "Amiga") -LINE("amigappc", "AmigaPPC") -LINE("arc", "ARC") -LINE("arm", "ARM") -LINE("arm26", "ARM26") -LINE("arm32", "ARM32") -LINE("armish", "ARMISH") -LINE("armv7", "ARMv7") -LINE("aviion", "AViiON") -LINE("atari", "ATARI") -LINE("bebox", "BeBox") -LINE("cats", "cats") -LINE("cesfic", "CESFIC") -LINE("cobalt", "Cobalt") -LINE("dreamcast", "Dreamcast") -LINE("emips", "EMIPS") -LINE("evbarm", "evbARM") -LINE("evbmips", "evbMIPS") -LINE("evbppc", "evbPPC") -LINE("evbsh3", "evbSH3") -LINE("ews4800mips", "EWS4800MIPS") -LINE("hp300", "HP300") -LINE("hp700", "HP700") -LINE("hpcarm", "HPCARM") -LINE("hpcmips", "HPCMIPS") -LINE("hpcsh", "HPCSH") -LINE("hppa", "HPPA") -LINE("hppa64", "HPPA64") -LINE("ia64", "ia64") -LINE("i386", "i386") -LINE("ibmnws", "IBMNWS") -LINE("iyonix", "Iyonix") -LINE("landisk", "LANDISK") -LINE("loongson", "Loongson") -LINE("luna68k", "LUNA68K") -LINE("luna88k", "LUNA88K") -LINE("m68k", "m68k") -LINE("mac68k", "Mac68k") -LINE("macppc", "MacPPC") -LINE("mips", "MIPS") -LINE("mips64", "MIPS64") -LINE("mipsco", "MIPSCo") -LINE("mmeye", "mmEye") -LINE("mvme68k", "MVME68k") -LINE("mvme88k", "MVME88k") -LINE("mvmeppc", "MVMEPPC") -LINE("netwinder", "NetWinder") -LINE("news68k", "NeWS68k") -LINE("newsmips", "NeWSMIPS") -LINE("next68k", "NeXT68k") -LINE("octeon", "OCTEON") -LINE("ofppc", "OFPPC") -LINE("palm", "Palm") -LINE("pc532", "PC532") -LINE("playstation2", "PlayStation2") -LINE("pmax", "PMAX") -LINE("pmppc", "pmPPC") -LINE("powerpc", "PowerPC") -LINE("prep", "PReP") -LINE("rs6000", "RS6000") -LINE("sandpoint", "Sandpoint") -LINE("sbmips", "SBMIPS") -LINE("sgi", "SGI") -LINE("sgimips", "SGIMIPS") -LINE("sh3", "SH3") -LINE("shark", "Shark") -LINE("socppc", "SOCPPC") -LINE("solbourne", "Solbourne") -LINE("sparc", "SPARC") -LINE("sparc64", "SPARC64") -LINE("sun2", "Sun2") -LINE("sun3", "Sun3") -LINE("tahoe", "Tahoe") -LINE("vax", "VAX") -LINE("x68k", "X68k") -LINE("x86", "x86") -LINE("x86_64", "x86_64") -LINE("xen", "Xen") -LINE("zaurus", "Zaurus") @@ -665,12 +665,6 @@ macro lacks the mandatory section argument. The section number in a .Ic \&Dt line is invalid, but still used. -.It Sy "unknown manual volume or arch" -.Pq mdoc -The volume name in a -.Ic \&Dt -line is invalid, but still used. -The manual is assumed to be architecture-independent. .It Sy "missing date, using today's date" .Pq mdoc, man The document was parsed as @@ -54,7 +54,6 @@ enum mandocerr { MANDOCERR_TITLE_CASE, /* lower case character in document title */ MANDOCERR_MSEC_MISSING, /* missing manual section, using "": macro */ MANDOCERR_MSEC_BAD, /* unknown manual section: Dt ... section */ - MANDOCERR_ARCH_BAD, /* unknown manual volume or arch: Dt ... volume */ MANDOCERR_DATE_MISSING, /* missing date, using today's date */ MANDOCERR_DATE_BAD, /* cannot parse date, using it verbatim: date */ MANDOCERR_OS_MISSING, /* missing Os macro, using "" */ @@ -1385,12 +1385,7 @@ where relevant, for example .Cm i386 , or .Cm sparc64 . -The list of supported architectures varies by operating system. -For the full list of all architectures recognized by -.Xr mandoc 1 , -see the file -.Pa arch.in -in the source distribution. +The list of valid architectures varies by operating system. .El .Pp Examples: diff --git a/mdoc_validate.c b/mdoc_validate.c index 4692edab..adba1204 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -2283,11 +2283,9 @@ post_dt(POST_ARGS) if (NULL == (nn = nn->next)) goto out; - /* Handles: `.Dt TITLE SEC VOL' - * title = TITLE, - * volume = VOL is vol ? format(VOL) : - * VOL is arch ? format(arch) : - * VOL + /* + * If the third argument is a volume name, format is, + * otherwise assume it's an architecture. */ cp = mdoc_a2vol(nn->string); @@ -2295,14 +2293,9 @@ post_dt(POST_ARGS) free(mdoc->meta.vol); mdoc->meta.vol = mandoc_strdup(cp); } else { - cp = mdoc_a2arch(nn->string); - if (NULL == cp) { - mandoc_vmsg(MANDOCERR_ARCH_BAD, mdoc->parse, - nn->line, nn->pos, "Dt ... %s", nn->string); - free(mdoc->meta.vol); - mdoc->meta.vol = mandoc_strdup(nn->string); - } else - mdoc->meta.arch = mandoc_strdup(cp); + for (p = nn->string; *p; p++) + *p = tolower((unsigned char)*p); + mdoc->meta.arch = mandoc_strdup(nn->string); } /* Ignore any subsequent parameters... */ @@ -97,7 +97,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "lower case character in document title", "missing manual section, using \"\"", "unknown manual section", - "unknown manual volume or arch", "missing date, using today's date", "cannot parse date, using it verbatim", "missing Os macro, using \"\"", |