/[csv2latex]/csv2latex.c
ViewVC logotype

Contents of /csv2latex.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56 - (show annotations)
Sun Jul 1 19:37:21 2018 UTC (2 years, 1 month ago) by ben
File MIME type: text/plain
File size: 19587 byte(s)
replace interline with baselineskip ratio
1 /*
2 * csv2latex.c, copyright © 2002- Benoît Rouits <brouits@free.fr>
3 *
4 *********************************************************
5 * csv2latex translates a .csv file to a LaTex document. *
6 *********************************************************
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; version 2 only
11 * of the License.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 * see the COPYING file included in the csv2latex package or
24 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
25 *
26 */
27
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <string.h>
31 #include <libgen.h>
32 #include <getopt.h>
33 #include <unistd.h>
34 #include <ctype.h>
35 #include "version.h"
36
37 #define PTOMM(p) (0.3528 * (p)) /* pt to mm */
38 #define HEIGHT PTOMM(592) /* \textheight default in pt */
39 #define SKIPR 1.2 /* default \baselineskip ratio (to multiply with font) */
40
41 typedef struct {
42 char* tab; /* actual escapes */
43 int size; /* escape tab len */
44 } texcape;
45
46 typedef struct {
47 char block; /* CSV delimitor if any */
48 char sep; /* CSV separator */
49 unsigned int cols; /* CSV columns */
50 unsigned int chars; /* CSV max data length */
51 unsigned int rows; /* CSV total number of lines */
52 char pos; /* position in cell (align) */
53 unsigned int lines; /* rows per LaTeX tabular */
54 unsigned int guess; /* guess or not the CSV format */
55 unsigned int header; /* put LaTeX document header or not */
56 unsigned int red; /* table reduction level (from 1 to 4)*/
57 unsigned int longtable; /* use package longtable */
58 unsigned int escape; /* escape TeX control chars or not */
59 unsigned int repeat; /* repeat table headers for each LaTeX table section or not */
60 unsigned int vlines; /* insert vertical lines between columns or not */
61 unsigned int hlines; /* insert horizontal lines between rows or not */
62 unsigned int paper; /* output paper type */
63 unsigned int font; /* expected font size */
64 unsigned int land; /* landscape mode */
65 char* clrrow; /* row graylevel (from 0 to 1) */
66 texcape* tex; /* TeX escapes */
67 } config;
68
69 #define MAXUINT ((unsigned int)(-1))
70
71 void rtfm(char* prog) {
72 printf("%s translates a csv file to a LaTeX file\n", basename(prog));
73 printf("Example: %s january_stats.csv > january_stats.tex\n", basename(prog));
74 printf("Usage: %s [--nohead] (LaTeX) no document header: useful for inclusion\n", basename(prog));
75 printf(" [--longtable] (LaTeX) use package longtable: useful for long input\n");
76 printf(" [--noescape] (LaTeX) do not escape text: useful for mixed CSV/TeX input\n");
77 printf(" [--guess] (CSV) guess separator and block |\n"
78 " [--separator <(c)omma|(s)emicolon|(t)ab|s(p)ace|co(l)on>] (CSV's comma)\n"
79 " [--block <(q)uote|(d)ouble|(n)one>] (CSV) block delimiter (e.g: none)\n");
80 printf(" [--lines n] (LaTeX) rows per table: useful for long tabulars |\n");
81 printf(" [--font n] font size used (in pt)\n");
82 printf(" [--position <l|c|r>] (LaTeX) text align in cells\n");
83 printf(" [--colorrows graylevel] (LaTeX) alternate gray rows (e.g: 0.75)\n");
84 printf(" [--reduce level] (LaTeX) reduce table size (e.g: 1)\n");
85 printf(" [--landscape] (LaTeX) use landscape mode\n");
86 printf(" [--repeatheader] (LaTeX) repeat table header (for long tables)\n");
87 printf(" [--nohlines] (LaTeX) don't put hline between table rows\n");
88 printf(" [--novlines] (LaTeX) don't put vline between columns\n");
89 printf(" csv_file.csv\n");
90 printf("The \"longtable\" option needs the {longtable} LaTeX package\n");
91 printf("The \"colorrows\" option needs the {colortbl} LaTeX package\n");
92 printf("The \"reduce\" option needs the {relsize} LaTeX package\n");
93 return;
94 }
95
96 config* parseOptions (config* conf, int argc, char **argv) {
97 /* thx to <vfebvre@lautre.net> */
98 int opt;
99 int tmp;
100
101 #if defined USE_GETOPT
102 #else
103 int longopt_index = 0;
104 static struct option long_options[] = {
105 {"help", 0, NULL, 'h'},
106 {"guess", 0, NULL, 'g'},
107 {"block", 1, NULL, 'b'},
108 {"lines", 1, NULL, 'l'},
109 {"noescape", 0, NULL, 'x'},
110 {"nohead", 0, NULL, 'n'},
111 {"version", 0, NULL, 'v'},
112 {"position", 1, NULL, 'p'},
113 {"separator", 1, NULL, 's'},
114 {"colorrows", 1, NULL, 'c'},
115 {"reduce", 1, NULL, 'r'},
116 {"longtable", 0, NULL, 't'},
117 {"repeatheader", 0, NULL, 'e'},
118 {"novlines", 0, NULL, 'y'},
119 {"nohlines", 0, NULL, 'z'},
120 {"landscape", 0, NULL, 'a'},
121 {"font", 1, NULL, 'f'},
122 {NULL, 0, NULL, 0} /* marks end-of-list */
123 };
124 #endif
125 #if defined USE_GETOPT
126 while ((opt = getopt (argc, argv, "hvgnxteyza?b:l:p:s:c:r:f:")) != EOF) {
127 #else
128 while ((opt = getopt_long (argc, argv, "hvgnxteyza?b:l:p:s:c:r:f:", long_options, &longopt_index)) > 0) {
129 #endif
130 switch (opt) {
131 case '?':
132 case 'h':
133 rtfm (argv[0]);
134 exit (EXIT_SUCCESS);
135 break;
136 case 'g': /* guess the CSV */
137 conf->guess = 1;
138 break;
139 case 't': /* use package longtable */ /* thx to <Christof.Bodner@infineon.com> */
140 conf->longtable = 1;
141 break;
142 case 'b': /* csv block delimiter */
143 if (optarg[0] == 'q')
144 conf->block = '\'';
145 else if (optarg[0] == 'd')
146 conf->block = '"';
147 else if (optarg[0] == 'n')
148 conf->block = 0; /* no block delimiter */
149 break;
150 case 'l': /* number of lines per TeX tabulars */
151 if (isdigit(optarg[0])) {
152 conf->lines = atoi(optarg);
153 } else {
154 fprintf(stderr,
155 "option \"lines\" need a positive integer value\n");
156 exit(EXIT_FAILURE);
157 }
158 break;
159 case 'n':
160 conf->header = 0;
161 break;
162 case 'x':
163 conf->escape = 0;
164 break;
165 case 'v': /* version */
166 printf ("%s © 2002- Benoît Rouits <brouits@free.fr>\n"
167 "\tVersion %s (%s)\n", PACKAGE, VERSION, RELEASE_DATE);
168 exit (EXIT_SUCCESS);
169 break;
170 case 'p': /* LaTeX position in cell */
171 conf->pos = optarg[0]; /* position char in cell */
172 break;
173 case 's': /* csv block separator */
174 if (optarg[0] == 'c')
175 conf->sep = ',';
176 else if (optarg[0] == 's')
177 conf->sep = ';';
178 else if (optarg[0] == 't')
179 conf->sep = '\t';
180 else if (optarg[0] == 'p')
181 conf->sep = ' ';
182 else if (optarg[0] == 'l')
183 conf->sep = ':';
184 break;
185 case 'c': /* color rows (thx to <jcorso@cse.Buffalo.EDU>) */
186 if (isdigit(optarg[0])) {
187 conf->clrrow = (char*)malloc(strlen(optarg)+1);
188 strcpy(conf->clrrow, optarg);
189 } else {
190 fprintf(stderr,
191 "option \"colorrows\" needs a real value between 0 and 1\n");
192 exit(EXIT_FAILURE);
193 }
194 break;
195 case 'r': /* reduce table size (original idea thx to <boaz.gezer@gmail.com>) */
196 if (isdigit(optarg[0])) {
197 tmp = atoi(optarg);
198 conf->red = (tmp>4) ? 4 : (tmp<0) ? 0 : tmp; /* [1-4] */
199 } else {
200 fprintf(stderr,
201 "option \"reduce\" needs an integer value between 1 and 4\n");
202 exit(EXIT_FAILURE);
203 }
204 break;
205 case 'e': /*repeat table header for each table section*/
206 conf->repeat = 1;
207 break;
208 case 'y': /*don't draw vlines between columns*/
209 conf->vlines = 0;
210 break;
211 case 'z': /*don't draw hlines between rows*/
212 conf->hlines = 0;
213 break;
214 case 'a': /*landscape*/
215 conf->land = 1;
216 break;
217 case 'f': /*output font size*/
218 if (isdigit(optarg[0])) {
219 conf->font = atoi(optarg);
220 } else {
221 fprintf(stderr,
222 "option \"font\" need a positive integer value\n");
223 exit(EXIT_FAILURE);
224 }
225 break;
226 }
227 }
228 return conf;
229 }
230
231 int guessCSV(config* conf, FILE* in) {
232 /* guess the block delimiter and the csv separator */
233 int token;
234
235 token = getc(in); /* first char is block delimiter */
236 if (token == EOF) {
237 fprintf(stderr, "ERROR: empty file ?\n");
238 return -1;
239 } else if (ispunct(token) || token == ' ') {
240 /* found first block delimiter, act this way */
241 conf->block = token;
242 fprintf(stderr, "Guessed '%c' as Block Delimiter\n",
243 conf->block);
244 /* stream file while token is printable data */
245 while ((token = getc(in)) != conf->block &&
246 token != '\n' &&
247 token != EOF)
248 {/* getc has been done */}
249 if (token == conf->block) {
250 /* second delimiter : next is separator */
251 conf->sep = getc(in);
252 fprintf(stderr, "Guessed '%c' as Separator\n",
253 conf->sep);
254 return 0;
255 } else {
256 return -1; /* what else ? */
257 }
258 } else { /* no block delimiter, act this way */
259 conf->block = 0;
260 fprintf(stderr, "Guessed No Block Delimiter\n");
261 /* stream file while input is not a control char */
262 while (!ispunct((token = getc(in))) &&
263 token != '\n' &&
264 token != EOF)
265 {/* getc has been done */}
266 /* guess CSV separator */
267 if (ispunct(token) || token == '\t' || token == ' ') {
268 conf->sep = token;
269 fprintf(stderr, "Guessed %c as Separator\n", conf->sep);
270 return 0;
271 } else { /* did not found any separator */
272 fprintf(stderr, "ERROR: Did not guess any Separator!\n");
273 return -1;
274 }
275 }
276 return 0;
277 }
278
279 void getMaximums(config* conf, FILE* in) {
280 /* gets the number of cols and chars of a csv file assuming a separator */
281 int token = 0;
282 int nosep = 0;
283 unsigned int curcol = 0;
284 unsigned int curchar = 0;
285 unsigned int inblock = 0;
286 /* init */
287 conf->chars = 0;
288 conf->cols = 0;
289 conf->rows = 0;
290
291 while (token != EOF) {
292 token = getc(in);
293
294 /* EOF ? */
295 if (token == EOF) {
296 continue;
297 }
298
299 /* decide the maximums */
300 if (token == '\n') {
301 curcol++;
302 conf->cols = (conf->cols<curcol) ? curcol : conf->cols;
303 conf->chars = (conf->chars<curchar) ? curchar : conf->chars;
304 conf->rows++;
305 curcol = 0;
306 curchar = 0;
307 inblock = 0; /* reset block state */
308 continue;
309 }
310
311 /* check implicit, non-guessed, block */
312 if (token == '\"') {
313 if (nosep == 0)
314 nosep = 1;
315 else
316 nosep = 0;
317 }
318
319 /* enter/quit a block */
320 if (conf->block && token == conf->block) {
321 inblock = !inblock;
322 continue;
323 }
324
325 /* count cols in current line */
326 if (token == conf->sep && ((conf->block && !inblock) || !conf->block) && nosep == 0) {
327 curcol++;
328 continue;
329 }
330
331 /* count chars in current cell */
332 if (token != conf->block && ((conf->block && inblock) || !conf->block)) {
333 curchar++;
334 continue;
335 }
336 }
337 return;
338 }
339
340 unsigned int guessLinesPerPage(unsigned int font, double height) {
341 return height / (PTOMM(SKIPR * font));
342 }
343
344
345 void doTeXsub(config* conf, char newsep, FILE* in, FILE* out) {
346 /* substitutes CSV sep by LaTeX newsep and some TeX code */
347 int token = 0;
348 int max;
349 int numcols;
350 unsigned int lines;
351 int inblock = 0;
352 int csvrows;
353 int firstrow = 1;
354 int nosep = 0;
355 int token1 = 0;
356 int token2 = 0;
357 char headerrow[1000];
358 headerrow[0] = '\0';
359
360 max = numcols = conf->cols;
361 csvrows = conf->rows;
362
363 /* optimize a bit lines per tabular */
364 if (!conf->longtable && !conf->lines) {
365 conf->lines = guessLinesPerPage(conf->font ? conf->font : 10, conf->land ? (HEIGHT / 1.414) : HEIGHT);
366 fprintf(stderr, "guessed %d lines per page\n", conf->lines);
367 }
368
369 /* choose infinity when conf->lines is 0 */
370 lines = (conf->lines) ? conf->lines : MAXUINT;
371
372 while (token != EOF) {
373 token2 = token1; /* second last character, used for detection of quotation marks */
374 token1 = token; /* last character, used for detection of quotation marks */
375 token = getc(in);
376
377 /* EOF ? */
378 if (token == EOF) {
379 continue;
380 }
381
382 /* new line ? */
383 if (token == '\n') {
384 inblock = 0; /* close block if any */
385 /* fill empty cols if any */
386 while (numcols > 1) {
387 putc(newsep, out);
388 numcols--;
389 }
390 if (!(firstrow && (conf->longtable && conf->repeat))) {
391 fprintf(out, "\\\\\n"); /* TeX new line */
392 } else { /* first row and repeat and longtable */
393 fprintf(out, "%s\\\\\n", headerrow);
394 }
395 if (conf->hlines) {
396 fprintf(out, "\\hline\n"); /* TeX draw hline */
397 }
398 if (firstrow && (conf->longtable && conf->repeat)) {
399 fprintf(out, "%s", "\\endhead\n");
400 }
401 if (firstrow && conf->repeat) {
402 char tmp[12];
403 sprintf(tmp, (conf->hlines ? "\\\\\n\\hline" : "\\\\\n"));
404 strcat(headerrow, tmp);
405 }
406 firstrow = 0;
407 numcols = max; /* reset numcols */
408 lines--;
409 csvrows--;
410 /* put a colored row or not (alternate) */
411 if (conf->clrrow && (lines % 2)) {
412 fprintf(out, "\\colorrow ");
413 }
414 /* if the LaTeX tabular is full create a new one, except if no more row or this is a long table */
415 if (!lines && csvrows && !conf->longtable) {
416 fprintf(out, "\\end{tabular}\n");
417 fprintf(out, "\\newline\n");
418 fprintf(out, "\\begin{tabular}{");
419 if (conf->vlines) {
420 putc('|', out);
421 }
422 while (numcols--) {
423 putc(conf->pos, out);
424 if (conf->vlines) {
425 putc('|', out);
426 }
427 }
428 fprintf(out, "}\n");
429 if (conf->hlines) {
430 fprintf(out, "\\hline\n");
431 }
432 if (conf->repeat && !conf->longtable) {
433 fprintf(out, "%s", headerrow);
434 putc('\n', out);
435 }
436 numcols = max;
437 lines = (conf->lines) ? conf->lines : MAXUINT;
438 }
439 /* else end of CSV data */
440 continue;
441 }
442
443 /* if commas in cells */
444 /* thx to <florian@heinze.at> */
445 if (token == '\"') {
446 if (nosep == 0)
447 nosep = 1;
448 else
449 nosep = 0;
450 }
451
452 /* new column ? */
453 if ((token == conf->sep && ((conf->block && !inblock) || !conf->block)) && nosep == 0) {
454 if (!(firstrow && (conf->longtable && conf->repeat)))
455 putc(newsep, out);
456 numcols--;
457 if (firstrow && conf->repeat)
458 {
459 char tmp[2];
460 tmp[0] = newsep;
461 tmp[1] = '\0';
462 strcat(headerrow, tmp);
463 }
464 continue;
465 }
466
467 /* enter/quit a block ? */
468 if (conf->block && token == conf->block) {
469 inblock = !inblock;
470 continue;
471 }
472
473 /* data ? */
474 if ((token != conf->block && ((conf->block && inblock) || !conf->block))
475 && ((token == '\"' && token1 == '\"' && token2 == '\"') || token != '\"')) {
476 /* look for special TeX char to escape */
477 /* FIXME: put all that into a subroutine */
478 int i = 0;
479 if (conf->escape)
480 for (i = 0; i < conf->tex->size; i++) {
481 if (token == conf->tex->tab[i]) {
482 switch (token) {
483 case '\\':
484 fprintf(out, "\\textbackslash{}");
485 if (firstrow && conf->repeat)
486 {
487 char tmp[17];
488 sprintf(tmp, "\\textbackslash{}");
489 strcat(headerrow, tmp);
490 }
491 break;
492 default:
493 fprintf(out, "\\%c", token);
494 if (firstrow && conf->repeat)
495 {
496 char tmp[3];
497 tmp[0] = '\\';
498 tmp[1] = token;
499 tmp[2] = '\0';
500 strcat(headerrow, tmp);
501 }
502 break;
503 }
504 break; /* there was some escaping */
505 }
506 }
507 /* or print raw char */
508 if ((i >= conf->tex->size) || (!conf->escape)) {
509 if (!(firstrow && (conf->longtable && conf->repeat)))
510 putc(token, out); /* do not print the header twice */
511 if (firstrow && conf->repeat)
512 {
513 char tmp[2];
514 tmp[0] = token;
515 tmp[1] = '\0';
516 strcat(headerrow, tmp);
517 }
518 }
519 continue;
520 }
521 /* do nothing if unexpected char: just loop */
522 }
523 return;
524 }
525
526 void doTeXdoc(config* conf, FILE* in, FILE* out) {
527 /* prepares the LaTeX tabular layout */
528 int maxcols;
529 int numcols;
530 char* relsize[5] = {"0", "0.5", "1", "2", "4"}; /* LaTeX relsize good values */
531 char* tabcolsep[5] = {"0", "0.05", "0.1", "0.2", "0.4"}; /* LaTeX tabcolsep good values */
532
533 numcols = maxcols = conf->cols;
534 if (conf->header) {
535 if (conf->land) {
536 if (conf->font)
537 fprintf(out, "\\documentclass[%dpt,a4paper,landscape]{article}\n", conf->font);
538 else {
539 fprintf(out, "\\documentclass[a4paper,landscape]{article}\n");
540 conf->font = 10; /* pt */
541 }
542 } else {
543 if (conf->font)
544 fprintf(out, "\\documentclass[%dpt,a4paper]{article}\n", conf->font);
545 else {
546 fprintf(out, "\\documentclass[a4paper]{article}\n");
547 conf->font = 10; /* pt */
548 }
549 }
550 fprintf(out, "\\usepackage[T1]{fontenc}\n");
551 fprintf(out, "\\usepackage[utf8]{inputenc}\n");
552 if (conf->red) {
553 fprintf(out, "\\usepackage{relsize}\n");
554 }
555 if (conf->clrrow) {
556 fprintf(out, "\\usepackage{colortbl}\n");
557 }
558 if (conf->longtable) {
559 fprintf(out, "\\usepackage{longtable}\n");
560 }
561 fprintf(out, "\\begin{document}\n");
562 }
563 if (conf->clrrow) {
564 fprintf(out, "\\def\\colorrow{\\rowcolor[gray]{%s}}\n",
565 conf->clrrow);
566 }
567 if (conf->red) {
568 fprintf(out, "\\relsize{-%s}\n", relsize[conf->red]);
569 fprintf(out, "\\addtolength\\tabcolsep{-%sem}\n", tabcolsep[conf->red]);
570 }
571 if (conf->longtable)
572 {
573 fprintf(out, "\\begin{longtable}{");
574 if (conf->vlines)
575 putc('|', out);
576 }
577 else
578 {
579 fprintf(out, "\\begin{tabular}{");
580 if (conf->vlines)
581 putc('|', out);
582 }
583 while (numcols--)
584 {
585 fprintf(out, "%c", conf->pos); /* position in cell */
586 if (conf->vlines)
587 putc('|', out);
588 }
589 fprintf(out, "}\n");
590 if (conf->hlines)
591 fprintf(out, "\\hline\n");
592 doTeXsub(conf, '&', in, out); /* & is LaTeX separator */
593 if (conf->longtable) {
594 fprintf(out, "\\end{longtable}\n");
595 } else {
596 fprintf(out, "\\end{tabular}\n");
597 }
598 if (conf->red) {
599 fprintf(out, "\\addtolength\\tabcolsep{+%sem}\n", tabcolsep[conf->red]);
600 fprintf(out, "\\relsize{+%s}\n", relsize[conf->red]);
601 }
602 if (conf->header) {
603 fprintf(out, "\\end{document}\n");
604 }
605 return;
606 }
607
608 int main (int argc, char **argv) {
609 FILE* fp;
610 config* conf;
611
612 extern int optind, opterr, optopt;
613
614 conf = (config*)malloc(sizeof(config));
615 /* defaults (ensure init): */
616 conf->cols = 1; /* CSV: if getMaximums fails */
617 conf->rows = 0; /* CSV: must be 0 */
618 conf->chars = 0; /* CSV: must be 0 */
619 conf->pos = 'l'; /* usual; LaTeX */
620 conf->lines = 40; /* usual; LaTeX */
621 conf->guess = 0; /* usual */
622 conf->sep = ','; /* default; csv */
623 conf->block = 0; /* default; csv */
624 conf->header = 1; /* usual; LaTeX */
625 conf->escape = 1; /* usual; LaTeX */
626 conf->clrrow = NULL; /* default; LaTeX */
627 conf->red = 0; /* default; LaTeX */
628 conf->longtable = 0; /* default; without package longtable */
629 conf->repeat = 0; /* default; do not repeat the header row */
630 conf->vlines = 1; /* default; draw lines between columns */
631 conf->hlines = 1; /* default; draw lines between rows */
632 conf->font = 0; /* default to LaTeX defaults */
633 conf->land = 0; /* default to LaTeX defaults */
634
635 /* TeX charaters to escape */
636 conf->tex = (texcape*)malloc(sizeof(texcape));
637 conf->tex->tab = "\\_#$%^&{}~";
638 conf->tex->size = strlen(conf->tex->tab);
639
640
641 conf = parseOptions(conf, argc, argv);
642
643 if (optind == argc) {
644 /* copy stdin into tmp file */
645 int c;
646 fp = tmpfile();
647 while (EOF != (c = getc(stdin))) {
648 putc(c, fp);
649 }
650 rewind(fp);
651 } else {
652 fp = fopen(argv[optind], "r");
653 }
654
655 if (!fp) {
656 fprintf(stderr, "Can't open file %s\n", argv[optind]);
657 exit(EXIT_FAILURE);
658 }
659
660 if (conf->guess) {
661 if (guessCSV(conf, fp)) {
662 fprintf(stderr, "Please run again by using --delimiter (if any) and --separator\n");
663 fclose(fp);
664 exit(EXIT_FAILURE);
665 }
666 rewind(fp);
667 }
668
669 getMaximums(conf, fp);
670 rewind(fp);
671
672 doTeXdoc(conf, fp, stdout);
673
674 free(conf->tex);
675 if (conf->clrrow)
676 free(conf->clrrow);
677 free(conf);
678 fclose(fp);
679
680 exit(EXIT_SUCCESS);
681 }

  ViewVC Help
Powered by ViewVC 1.1.26