Codebase list yodl / f3d8194
Imported Upstream version 2.15.2 tony mancill 11 years ago
9 changed file(s) with 93 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
0 #define VERSION "2.15.1"
1 #define YEARS "1996-2009"
0 #define VERSION "2.15.2"
1 #define YEARS "1996-2010"
111111 " yodlverbinsert [strip]: only build `yodlverbinsert'\n"
112112 " yodlstriproff: only build `yodlstriproff\n"
113113 " 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"
116116 " macros: build the standard yodl macros\n"
117117 " install programs WHERE: install the programs under WHERE\n"
118118 " 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
010 yodl (2.15.1)
111
212 * 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 )
77 verb(
88 1 <= from <= to <= ncolumns
99 )
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.
1012 )
1113 <>
1214
77 tt(cells()) is used, tt(setmanalign()) should have been used too. In this
88 macro call only the tt(cell()), tt(cells()) and tt(setmanalign()) macros
99 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).
1017 )
1118 <>
1219 DEFINEMACRO(row)(1)(\
2734 <man ms>
2835 PUSHCOUNTER(XXsawalign)(0)\
2936 PUSHCOUNTER(XXsawcells)(0)\
37 PUSHCOUNTER(XXsawcellsline)(0)\
3038 ARG1\
39 +IFZERO(XXsawcellsline)()(\
40 ADDTOSYMBOL(XXtablealign)(+XXnl())\
41 ADDTOSYMBOL(XXroffcontents)(~)\
42 )\
43 POPCOUNTER(XXsawcellsline)\
3144 ADDTOSYMBOL(XXroffcontents)(XXnl())\
3245 +IFZERO(XXsawalign)(\
3346 ADDTOSYMBOL(XXtablealign)(+SYMBOLVALUE(XXroffalign)XXnl())\
4444 The argument tt(marker) must start in tt(file)'s first column en must
4545 either start as a standard bf(C) or bf(C++) comment: tt(//) or tt(/*) must be
4646 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.
5352 it() tt(file)nl()
5453 The argument tt(file) must be an existing file.
5554 )
Binary diff not shown
55 #include <string.h>
66 #include <unistd.h>
77 #include <stdlib.h>
8 #include <ctype.h>
89
910 /* tailored getline() after the Debian Linux manpage about getline() */
1011 /* tailored in the sense that no tests for str and n being NULL are */
6263 int endLabelFound = 0;
6364 int labelFound = 0;
6465 int verbOpened = 0;
66 size_t labelsize = 0;
6567 size_t spaces = 0;
6668 size_t tabs = 0;
6769 size_t verbspaces = 8;
120122
121123 label = argv[0];
122124 endlabel = label[1] == '/' ? "//=" : "/**/";
125 labelsize = strlen(label);
123126
124127 input = fopen(argv[1], "r");
125128
148151 if (y_getline(&line, &nchars, input) < 0)
149152 break;
150153
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 )
152160 {
153161 if (label == endlabel) /* when endlabel: done */
154162 {
158166
159167 labelFound = 1;
160168 label = endlabel; /* now search endlabel */
169 labelsize = strlen(endlabel);
161170 continue;
162171 }
163172