Imported Upstream version 2.15.2
tony mancill
11 years ago
0 | |
#define VERSION "2.15.1"
|
1 | |
#define YEARS "1996-2009"
|
|
0 |
#define VERSION "2.15.2"
|
|
1 |
#define YEARS "1996-2010"
|
111 | 111 |
" yodlverbinsert [strip]: only build `yodlverbinsert'\n"
|
112 | 112 |
" yodlstriproff: only build `yodlstriproff\n"
|
113 | 113 |
" yodl2whatever: only build `yodl2whatever\n"
|
114 | |
" man [path]: build the man-pages\n"
|
115 | |
" manual [path]: build the manual\n"
|
|
114 |
" man [path]: build the man-pages, optionally specify: path\n"
|
|
115 |
" manual [path]: build the manual, optionally specify: path\n"
|
116 | 116 |
" macros: build the standard yodl macros\n"
|
117 | 117 |
" install programs WHERE: install the programs under WHERE\n"
|
118 | 118 |
" install yodl WHERE: install yodl under WHERE\n"
|
|
0 |
yodl (2.15.2)
|
|
1 |
|
|
2 |
* Added macro cellsline to set multiple horizontal lines in one table row.
|
|
3 |
|
|
4 |
* Bug fix in yodlverbinsert (confused markers provided as command-line
|
|
5 |
argument with markers to which additional characters were appended
|
|
6 |
appearing in scanned files).
|
|
7 |
|
|
8 |
-- Frank B. Brokken <f.b.brokken@rug.nl> Fri, 12 Mar 2010 10:50:13 +0100
|
|
9 |
|
0 | 10 |
yodl (2.15.1)
|
1 | 11 |
|
2 | 12 |
* Added a chartable translation to macros/yodl/chartables/man.tables.yo: in
|
|
0 |
<STARTDOC>
|
|
1 |
macro(cellsline(from)(count))
|
|
2 |
(Sets a horizontal line starting at column number tt(from) over tt(count)
|
|
3 |
columns in a row. If tt(from) is less then the number of columns already added
|
|
4 |
to a row then it is ignored. This macro must be embedded in a tt(row) macro
|
|
5 |
defining a table row. To put a line across the table's full width use
|
|
6 |
tt(rowline). To set horizontal lines across columns 1
|
|
7 |
until 2 and columns 4 until 5 table of a table use:
|
|
8 |
verb(
|
|
9 |
row(cellsline(1)(2)cellsline(4)(2))
|
|
10 |
)
|
|
11 |
Combining tt(cellsline) and tt(cell) or tt(cells) calls in one row produces
|
|
12 |
undefined results.
|
|
13 |
)
|
|
14 |
<>
|
|
15 |
DEFINEMACRO(cellsline)(2)(\
|
|
16 |
PUSHCOUNTER(XXone)(ARG1)\
|
|
17 |
ADDTOCOUNTER(XXone)(-1)\
|
|
18 |
EVAL(NOTRANS(ADDTOCOUNTER(XXone))(NOTRANS(-)COUNTERVALUE(XXcellnr)))\
|
|
19 |
IFGREATER(XXone)(-1)(\
|
|
20 |
ADDTOCOUNTER(XXcellnr)(XXone)\
|
|
21 |
ADDTOCOUNTER(XXcellnr)(ARG2)\
|
|
22 |
<html xml>
|
|
23 |
XXifnzero(XXone)(\
|
|
24 |
NOTRANS(<td cellspan=)COUNTERVALUE(XXone)NOTRANS(></td>))\
|
|
25 |
NOTRANS(<td cellspan=ARG2><hr></td>)\
|
|
26 |
<latex>
|
|
27 |
NOTRANS( \cline{)\
|
|
28 |
SETCOUNTER(XXone)(ARG1)\
|
|
29 |
ADDTOCOUNTER(XXone)(ARG2)\
|
|
30 |
ADDTOCOUNTER(XXone)(-1)\
|
|
31 |
ARG1-COUNTERVALUE(XXone)\
|
|
32 |
+CHAR(})\
|
|
33 |
<man ms>
|
|
34 |
SETCOUNTER(XXsawcellsline)(1)\
|
|
35 |
SETCOUNTER(XXsawalign)(1)\
|
|
36 |
XXifnzero(XXone)(\
|
|
37 |
EVAL(\
|
|
38 |
NOTRANS(addntosymbol(XXtablealign))(COUNTERVALUE(XXone))(\
|
|
39 |
NOTRANS(c))\
|
|
40 |
)\
|
|
41 |
)\
|
|
42 |
addntosymbol(XXtablealign)(ARG2)(+NOTRANS(-))\
|
|
43 |
<else>
|
|
44 |
XXnl()\
|
|
45 |
<>
|
|
46 |
)()\
|
|
47 |
POPCOUNTER(XXone)\
|
|
48 |
)
|
7 | 7 |
verb(
|
8 | 8 |
1 <= from <= to <= ncolumns
|
9 | 9 |
)
|
|
10 |
bf(Note): this macro cannot be used if multiple lines must be set in one
|
|
11 |
row. In those cases the macro tt(colsline) should be used.
|
10 | 12 |
)
|
11 | 13 |
<>
|
12 | 14 |
|
7 | 7 |
tt(cells()) is used, tt(setmanalign()) should have been used too. In this
|
8 | 8 |
macro call only the tt(cell()), tt(cells()) and tt(setmanalign()) macros
|
9 | 9 |
should be called. Any other macro call may produce unexpected results.
|
|
10 |
|
|
11 |
The tt(row) macro defines a counter tt(XXcellnr) that can be inspected and is
|
|
12 |
incremented by predefined macros adding columns to a row. The counter is
|
|
13 |
initially 0. Predefined macros adding columns to a row add the number of
|
|
14 |
columns they add to the row inserting the contents of those columns. These
|
|
15 |
macros rely on the correct value of this counter and any user-defined macros
|
|
16 |
adding columns to table rows should correctly update tt(XXcellnr).
|
10 | 17 |
)
|
11 | 18 |
<>
|
12 | 19 |
DEFINEMACRO(row)(1)(\
|
|
27 | 34 |
<man ms>
|
28 | 35 |
PUSHCOUNTER(XXsawalign)(0)\
|
29 | 36 |
PUSHCOUNTER(XXsawcells)(0)\
|
|
37 |
PUSHCOUNTER(XXsawcellsline)(0)\
|
30 | 38 |
ARG1\
|
|
39 |
+IFZERO(XXsawcellsline)()(\
|
|
40 |
ADDTOSYMBOL(XXtablealign)(+XXnl())\
|
|
41 |
ADDTOSYMBOL(XXroffcontents)(~)\
|
|
42 |
)\
|
|
43 |
POPCOUNTER(XXsawcellsline)\
|
31 | 44 |
ADDTOSYMBOL(XXroffcontents)(XXnl())\
|
32 | 45 |
+IFZERO(XXsawalign)(\
|
33 | 46 |
ADDTOSYMBOL(XXtablealign)(+SYMBOLVALUE(XXroffalign)XXnl())\
|
44 | 44 |
The argument tt(marker) must start in tt(file)'s first column en must
|
45 | 45 |
either start as a standard bf(C) or bf(C++) comment: tt(//) or tt(/*) must be
|
46 | 46 |
used. Following that, the remainder of the argument is used as a label, e.g.,
|
47 | |
tt(//label), tt(/*LABEL*/). The label may contain non-alpha characters as
|
48 | |
well. Except for the first two characters and their locations no special
|
49 | |
restrictions imposed upon the label texts. A labeled section ends at the next
|
50 | |
tt(//=) (when the label started with tt(//)) or at the next tt(/**/) (when the
|
51 | |
label started with tt(/*)). Like the labels, the end-markers must also start
|
52 | |
in the file's first column.
|
|
47 |
tt(//label), tt(/*LABEL*/). Except for the first two characters and their
|
|
48 |
locations no special restrictions are imposed upon the markers. A labeled
|
|
49 |
section ends at the next tt(//=) (when the label started with tt(//)) or at
|
|
50 |
the next tt(/**/) (when the label started with tt(/*)). Like the markers, the
|
|
51 |
end-markers must also start in the file's first column.
|
53 | 52 |
it() tt(file)nl()
|
54 | 53 |
The argument tt(file) must be an existing file.
|
55 | 54 |
)
|
5 | 5 |
#include <string.h>
|
6 | 6 |
#include <unistd.h>
|
7 | 7 |
#include <stdlib.h>
|
|
8 |
#include <ctype.h>
|
8 | 9 |
|
9 | 10 |
/* tailored getline() after the Debian Linux manpage about getline() */
|
10 | 11 |
/* tailored in the sense that no tests for str and n being NULL are */
|
|
62 | 63 |
int endLabelFound = 0;
|
63 | 64 |
int labelFound = 0;
|
64 | 65 |
int verbOpened = 0;
|
|
66 |
size_t labelsize = 0;
|
65 | 67 |
size_t spaces = 0;
|
66 | 68 |
size_t tabs = 0;
|
67 | 69 |
size_t verbspaces = 8;
|
|
120 | 122 |
|
121 | 123 |
label = argv[0];
|
122 | 124 |
endlabel = label[1] == '/' ? "//=" : "/**/";
|
|
125 |
labelsize = strlen(label);
|
123 | 126 |
|
124 | 127 |
input = fopen(argv[1], "r");
|
125 | 128 |
|
|
148 | 151 |
if (y_getline(&line, &nchars, input) < 0)
|
149 | 152 |
break;
|
150 | 153 |
|
151 | |
if (strstr(line, label) == line) /* matching (end)label */
|
|
154 |
if
|
|
155 |
(
|
|
156 |
strstr(line, label) == line /* matching (end)label */
|
|
157 |
&&
|
|
158 |
isspace((unsigned char)line[labelsize])
|
|
159 |
)
|
152 | 160 |
{
|
153 | 161 |
if (label == endlabel) /* when endlabel: done */
|
154 | 162 |
{
|
|
158 | 166 |
|
159 | 167 |
labelFound = 1;
|
160 | 168 |
label = endlabel; /* now search endlabel */
|
|
169 |
labelsize = strlen(endlabel);
|
161 | 170 |
continue;
|
162 | 171 |
}
|
163 | 172 |
|