diff --git a/.gitignore b/.gitignore index 16cd01f..b1392b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .DS_STORE *.swp +*.o +Makefile +y.tab.* diff --git a/troff/ext.h b/troff/ext.h index b85338f..bc6b3e8 100644 --- a/troff/ext.h +++ b/troff/ext.h @@ -391,9 +391,7 @@ extern int roman(int, int (*)(tchar)); extern int roman0(int, int (*)(tchar), char *, char *); extern int abc(int, int (*)(tchar)); extern int abc0(int, int (*)(tchar)); -#undef atoi -#define atoi xxatoi -extern int atoi(void); +extern int hatoi(void); #undef atof #define atof xxatof extern float atof(void); diff --git a/troff/n1.c b/troff/n1.c index 3112d78..764a557 100644 --- a/troff/n1.c +++ b/troff/n1.c @@ -2036,7 +2036,7 @@ caself(void) /* set line number and file */ if (skip(1)) return; - n = atoi(); + n = hatoi(); cfline[ifi] = numtab[CD].val = n - 2; if (skip(0)) return; @@ -2169,7 +2169,7 @@ casedb(void) if (skip(1)) return; noscale++; - debug = max(atoi(), 0); + debug = max(hatoi(), 0); noscale = 0; #endif /* DEBUG */ } @@ -2188,7 +2188,7 @@ casexflag(void) gemu = 0; skip(1); noscale++; - i = atoi(); + i = hatoi(); noscale--; if (!nonumb) _xflag = xflag = i & 3; @@ -2204,7 +2204,7 @@ casecp(void) #endif gflag = 1; noscale++; - if (skip(1) || (atoi() && !nonumb)) + if (skip(1) || (hatoi() && !nonumb)) xflag = 1; else xflag = 3; @@ -2222,9 +2222,9 @@ caserecursionlimit(void) { skip(1); noscale++; - max_recursion_depth = atoi(); + max_recursion_depth = hatoi(); skip(0); - max_tail_depth = atoi(); + max_tail_depth = hatoi(); noscale--; } diff --git a/troff/n3.c b/troff/n3.c index 2dbb469..79307b8 100644 --- a/troff/n3.c +++ b/troff/n3.c @@ -1262,7 +1262,7 @@ caseshift(void) i = 1; else { noscale++; - i = atoi(); + i = hatoi(); noscale--; if (nonumb) return; @@ -1511,7 +1511,7 @@ casewatchlength(void) if (!skip(1)) { noscale++; - i = atoi(); + i = hatoi(); noscale--; if (!nonumb) watchlength = i; @@ -1765,9 +1765,9 @@ casesubstring(void) if (skip(1)) return; noscale++; - n1 = atoi(); + n1 = hatoi(); if (skip(0) == 0) - n2 = atoi(); + n2 = hatoi(); noscale--; savip = ip; ip = (filep)contp->mx; diff --git a/troff/n4.c b/troff/n4.c index 995b694..8c81de5 100644 --- a/troff/n4.c +++ b/troff/n4.c @@ -865,7 +865,7 @@ agetch(void) } int -atoi(void) +hatoi(void) { struct acc a; diff --git a/troff/n5.c b/troff/n5.c index 0784712..2e5aed0 100644 --- a/troff/n5.c +++ b/troff/n5.c @@ -153,7 +153,7 @@ casepadj(void) if (skip(0)) padj = 1; else { - n = atoi(); + n = hatoi(); if (!nonumb) padj = n; } @@ -245,7 +245,7 @@ casehy(void) if (skip(0)) return; noscale++; - i = atoi(); + i = hatoi(); noscale = 0; if (nonumb) return; @@ -267,7 +267,7 @@ casehlm(void) if (!skip(0)) { noscale++; - i = atoi(); + i = hatoi(); noscale = 0; if (!nonumb) hlm = i; @@ -315,7 +315,7 @@ casehylen(void) if (skip(0)) hylen = 5; else { - n = atoi(); + n = hatoi(); if (!nonumb) hylen = n; } @@ -444,7 +444,7 @@ cerj(int dorj) noscale++; skip(0); - i = max(atoi(), 0); + i = max(hatoi(), 0); if (nonumb) i = 1; tbreak(); @@ -483,7 +483,7 @@ _brnl(int p) if (skip(0)) n = INT_MAX; else { - n = atoi(); + n = hatoi(); if (nonumb || n < 0) n = p ? brpnl : brpnl; } @@ -737,7 +737,7 @@ casevpt(void) { if (skip(1)) return; - vpt = atoi() != 0; + vpt = hatoi() != 0; } @@ -1200,7 +1200,7 @@ getev(int *nxevp, char **namep) c = cbits(ch); if (xflag == 0 || isdigit(c) || c == '(') { noscale++; - nxev = atoi(); + nxev = hatoi(); noscale = 0; if (nonumb) { flushi(); @@ -1790,7 +1790,7 @@ casecontinue(int _break) struct s *s; noscale++; - if (skip(0) || (i = atoi()) <= 0 || nonumb) + if (skip(0) || (i = hatoi()) <= 0 || nonumb) i = 1; noscale--; j = 0; @@ -2078,7 +2078,7 @@ caseta(void) for (j = 0; j < NTAB - 1 && !nonumb; j++) { if (skip(0)) break; - T[j] = atoi() & TABMASK; + T[j] = hatoi() & TABMASK; if (!nonumb) switch (cbits(ch)) { case 'C': @@ -2183,7 +2183,7 @@ caseul(void) if (skip(0)) i = 1; else - i = atoi(); + i = hatoi(); if (ul && (i == 0)) { font = sfont; ul = cu = 0; @@ -2226,7 +2226,7 @@ caseit(int cflag) it = itc = itmac = 0; noscale++; skip(0); - i = atoi(); + i = hatoi(); skip(0); if (!nonumb && (itmac = getrq(1))) { it = i; @@ -2405,7 +2405,7 @@ casenn(void) { noscale++; skip(0); - nn = max(atoi(), 1); + nn = max(hatoi(), 1); noscale = 0; } diff --git a/troff/n7.c b/troff/n7.c index 55028ed..d63352f 100644 --- a/troff/n7.c +++ b/troff/n7.c @@ -1422,7 +1422,7 @@ getword(int x) } else g1: nexti = GETCH(); j = cbits(i = nexti); - if (gemu && j == FILLER) + if (gemu && (j == FILLER || j == UNPAD)) inword = 0; else if (!ismot(i) && j != ohc) diff --git a/troff/n8.c b/troff/n8.c index 1dc110b..fa8c484 100644 --- a/troff/n8.c +++ b/troff/n8.c @@ -226,7 +226,7 @@ caseht(void) if (skip(0)) return; noscale++; - thresh = atoi(); + thresh = hatoi(); noscale = 0; } diff --git a/troff/n9.c b/troff/n9.c index 355b145..88083a4 100644 --- a/troff/n9.c +++ b/troff/n9.c @@ -126,7 +126,7 @@ setline(void) delim = c; vflag = 0; dfact = EM; - length = quant(atoi(), HOR); + length = quant(hatoi(), HOR); dfact = 1; if (!length) { eat(delim); @@ -288,7 +288,7 @@ setvline(void) delim = c; dfact = lss; vflag++; - i = quant(atoi(), VERT); + i = quant(hatoi(), VERT); dfact = 1; if (!i) { eat(delim); @@ -379,7 +379,7 @@ setdraw (void) /* generate internal cookies for a drawing function */ ch = c; vflag = 0; dfact = type == DRAWTHICKNESS ? 1 : EM; - dx[i] = quant(atoi(), HOR); + dx[i] = quant(hatoi(), HOR); if (dx[i] > MAXMOT) dx[i] = MAXMOT; else if (dx[i] < -MAXMOT) @@ -390,7 +390,7 @@ setdraw (void) /* generate internal cookies for a drawing function */ } vflag = 1; dfact = lss; - dy[i] = quant(atoi(), VERT); + dy[i] = quant(hatoi(), VERT); if (type == DRAWTHICKNESS) dy[i] = 0; else if (dy[i] > MAXMOT) diff --git a/troff/nroff.d/n6.c b/troff/nroff.d/n6.c index 0d51886..d98d9f0 100644 --- a/troff/nroff.d/n6.c +++ b/troff/nroff.d/n6.c @@ -51,6 +51,7 @@ */ #include +#include #ifdef EUC #include #include @@ -158,9 +159,17 @@ setch(int delim) if (s - temp == 1) return temp[0]; else if (s - temp != 2) { + size_t l; *s = '\0'; + l = strlen(temp); if (j != ']') nodelim(']'); + else if (gemu && (l == 6 || (l == 7 + && temp[6] >= '0' && temp[6] <= '9')) + && temp[5] >= '0' && temp[5] <= '9' + && temp[4] >= '0' && temp[4] <= '9' + && !strncmp(temp, "char", 4)) + return atoi(temp + 4) + nchtab + _SPECCHAR_ST; else if ((j = findch(temp)) > 0) return j | chbits; else if (warn & WARN_CHAR) @@ -272,7 +281,7 @@ setps(void) } else if (xflag) { /* \s+[dd], */ k = j == '[' ? ']' : j; /* \s-'dd' */ setcbits(c, k); - atoi(); + hatoi(); if (nonumb) return; if (!issame(getch(), c)) @@ -439,7 +448,7 @@ mot(void) j = HOR; delim = getch(); /*eat delim*/ - if ((n = atoi())) { + if ((n = hatoi())) { if (vflag) j = VERT; i = makem(quant(n, j)); @@ -557,7 +566,7 @@ casebd(void) bd1: skip(0); noscale++; - bdtab[j] = atoi(); + bdtab[j] = hatoi(); noscale = 0; } @@ -608,7 +617,7 @@ xlss(void) getch(); dfact = lss; - i = quant(atoi(), VERT); + i = quant(hatoi(), VERT); dfact = 1; getch(); if (i >= 0) diff --git a/troff/troff.d/t6.c b/troff/troff.d/t6.c index dac0674..c28a4e2 100644 --- a/troff/troff.d/t6.c +++ b/troff/troff.d/t6.c @@ -992,7 +992,7 @@ setps(void) dfact = INCH; dfactd = 72; res = HOR; - j = atoi(); + j = hatoi(); res = dfactd = dfact = 1; if (nonumb) return; @@ -1196,7 +1196,7 @@ tchar mot(void) j = HOR; delim = getch(); /*eat delim*/ - if ((n = atoi())) { + if ((n = hatoi())) { if (vflag) j = VERT; i = makem(quant(n, j)); @@ -1313,7 +1313,7 @@ caselg(void) lg = 1; if (skip(0)) return; - lg = atoi(); + lg = hatoi(); } static void @@ -1564,7 +1564,7 @@ casefp(int spec) lgf++; skip(0); - if ((i = xflag ? atoi() : cbits(getch()) - '0') < 0 || i > 255) + if ((i = xflag ? hatoi() : cbits(getch()) - '0') < 0 || i > 255) bad: errprint("fp: bad font position %d", i); else if (skip(0) || !(j = getrq(3))) errprint("fp: no font name"); @@ -1733,9 +1733,9 @@ casecs(void) if ((i = findft(i, 1)) < 0) goto rtn; skip(0); - cstab[i] = atoi(); + cstab[i] = hatoi(); skip(0); - j = atoi(); + j = hatoi(); if (nonumb) ccstab[i] = 0; else @@ -1770,7 +1770,7 @@ casebd(void) bd1: skip(0); noscale++; - bdtab[j] = atoi(); + bdtab[j] = hatoi(); noscale = 0; } @@ -1806,9 +1806,9 @@ casess(int flg) noscale++; if (skip(flg == 0)) minsps = minspsz = 0; - else if ((i = atoi()) != 0 && !nonumb) { + else if ((i = hatoi()) != 0 && !nonumb) { if (xflag && flg == 0 && !skip(0)) { - j = atoi(); + j = hatoi(); if (!nonumb) { sesspsz = j & 0177; spacesz = sesspsz; @@ -1848,7 +1848,7 @@ caseletadj(void) int s, n, x, l, h; dfact = LAFACT / 100; - if (skip(0) || (n = atoi()) == 0) { + if (skip(0) || (n = hatoi()) == 0) { letspsz = 0; letsps = 0; lspmin = 0; @@ -1860,20 +1860,20 @@ caseletadj(void) if (skip(1)) goto ret; dfact = LAFACT / 100; - l = atoi(); + l = hatoi(); if (skip(1)) goto ret; noscale++; - s = atoi(); + s = hatoi(); noscale--; if (skip(1)) goto ret; dfact = LAFACT / 100; - x = atoi(); + x = hatoi(); if (skip(1)) goto ret; dfact = LAFACT / 100; - h = atoi(); + h = hatoi(); letspsz = s; lspmin = LAFACT - n; lspmax = x - LAFACT; @@ -1907,7 +1907,7 @@ casefspacewidth(void) fontab[f][0] = fontbase[f]->spacewidth; } else { noscale++; - n = atoi(); + n = hatoi(); noscale--; unitsPerEm = 1000; if (n >= 0) @@ -1922,7 +1922,7 @@ void casespacewidth(void) { noscale++; - spacewidth = skip(0) || atoi(); + spacewidth = skip(0) || hatoi(); noscale--; } @@ -1938,7 +1938,7 @@ tchar xlss(void) getch(); dfact = lss; - i = quant(atoi(), VERT); + i = quant(hatoi(), VERT); dfact = 1; getch(); if (i >= 0) @@ -2287,7 +2287,7 @@ getfzoom(void) void casekern(void) { - kern = skip(0) || atoi() ? 1 : 0; + kern = skip(0) || hatoi() ? 1 : 0; } void @@ -2304,7 +2304,7 @@ casefkern(void) if (skip(0)) fontbase[f]->kernfont = 0; else { - j = atoi(); + j = hatoi(); if (!nonumb) fontbase[f]->kernfont = j ? j : -1; } @@ -2365,10 +2365,10 @@ setpapersize(int setmedia) return; c = cbits(ch); if (isdigit(c) || c == '(') { - x = atoi(); + x = hatoi(); if (!nonumb) { skip(1); - y = atoi(); + y = hatoi(); } if (nonumb || x == 0 || y == 0) return; @@ -2521,7 +2521,7 @@ casekernpair(void) if (b == 0 || skip(1)) goto done; noscale++; - n = atoi(); + n = hatoi(); noscale--; unitsPerEm = 1000; n = _unitconv(n); @@ -2579,7 +2579,7 @@ kernsingle(int **tp) if (skip(1)) break; noscale++; - n = atoi(); + n = hatoi(); noscale--; if (tp[f] == NULL) tp[f] = calloc(NCHARS, sizeof *tp); diff --git a/troff/troff.d/tmac.d/Makefile.mk b/troff/troff.d/tmac.d/Makefile.mk index 673edc1..290e012 100644 --- a/troff/troff.d/tmac.d/Makefile.mk +++ b/troff/troff.d/tmac.d/Makefile.mk @@ -3,7 +3,8 @@ MACS = acm.me bib chars.me deltext.me e eqn.me \ ms.cov ms.eqn ms.ref ms.tbl ms.ths ms.toc null.me refer.me \ s sh.me tbl.me thesis.me v vgrind \ tmac.gchar andoc doc doc-common doc-nroff doc-syms \ - pictures color pm srefs ptx safe g padj taa naa + pictures color pm srefs ptx safe g padj taa naa \ + an-ext IMACS = an doc-ditroff OMACS = $(IMACS:%=%.out) diff --git a/troff/troff.d/tmac.d/an b/troff/troff.d/tmac.d/an index 0358f1f..5f3f1de 100644 --- a/troff/troff.d/tmac.d/an +++ b/troff/troff.d/tmac.d/an @@ -65,6 +65,8 @@ . nr )I.def .5i .\} .nr .g 1 +.ds la \(la +.ds ra \(ra .ds lq \(lq .ds rq \(rq ' \" reset the basic page layout @@ -475,4 +477,5 @@ . PP . \} .. +.so @MACDIR@/an-ext .\" vim:set filetype=groff: diff --git a/troff/troff.d/tmac.d/an-ext b/troff/troff.d/tmac.d/an-ext new file mode 100644 index 0000000..e54fb78 --- /dev/null +++ b/troff/troff.d/tmac.d/an-ext @@ -0,0 +1,96 @@ +.\" -*- nroff -*- +.\" +.\" an-ext.tmac +.\" +.\" Copyright (C) 2007-2014 Free Software Foundation, Inc. +.\" +.\" Written by Eric S. Raymond +.\" Werner Lemberg +.\" +.\" You may freely use, modify and/or distribute this file. +.\" +.\" The code below provides extension macros for the `man' macro package. +.\" Care has been taken to make the code portable; groff extensions are +.\" properly hidden so that all troff implementations can use it without +.\" changes. +.\" +.\" With groff, this file is sourced by the `man' macro package itself. +.\" Man page authors who are concerned about portability might add the +.\" used macros directly to the prologue of the man page(s). +. +. +.\" Convention: Auxiliary macros and registers start with `m' followed +.\" by an uppercase letter or digit. +. +. +.\" Changes for Heirloom roff by Carsten Kunze +.\" +.\" The original file can be obtained with: +.\" git clone git://git.savannah.gnu.org/groff.git +.\" The file path is then: +.\" groff/tmac/an-ext.tmac +. +. +.\" Declare start of command synopsis. Sets up hanging indentation. +.de SY +. ie !\\n(mS \{\ +. nr mS 1 +. nr mA \\n(.j +. ad l +. nr mI \\n(.i +. \} +. el \{\ +. br +. ns +. \} +. nr mT \w\fB\\$1\fP\  +. HP \\n(mTu +. B "\\$1 +.. +.\" End of command synopsis. Restores adjustment. +.de YS +. in \\n(mIu +. ad \\n(mA +. nr mS 0 +.. +.\" Declare optional option. +.de OP +. ie \\n(.$>1 .RI "[\fB\\$1\fP" "\ \\$2" "] +. el .RB "[" "\\$1" "] +.. +.\" Start URL. +.de UR +. ds m1 "\\$1 +.. +.\" End URL. +.de UE +. nop \\*(la\\*(m1\\*(ra\\$* +.. +.\" Start email address. +.de MT +. ds m1 "\\$1 +.. +.\" End email address. +.de ME +. nop \\*(la\\*(m1\\*(ra\\$* +.. +.\" Continuation line for .TP header. +.de TQ +. br +. ns +. TP \\$1\" no doublequotes around argument! +.. +.\" Start example. +.de EX +. nr mE \\n(.f +. nf +. nh +. ft CW +.. +.\" End example. +.de EE +. ft \\n(mE +. fi +. hy \\n(HY +.. +.\" vim:set filetype=groff: diff --git a/version.mk b/version.mk index fb35578..c860d9b 100644 --- a/version.mk +++ b/version.mk @@ -1,2 +1,2 @@ -RELEASE = Git snapshot 151209 +RELEASE = Git snapshot 151218 #RELEASE = release 150406