X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fstructure.c;h=8141feb3db461c60099841db25d3a4954d018dec;hb=8b296a5f4da05a4dcf356f71e1ce4e63d8d282cf;hp=4a49a2c7be0f28789b69e5d9f9ea3183aaff9fc0;hpb=52210ae670b22ce2d187bd2dc943fd8ae3f4a8c0;p=ypp-sc-tools.db-test.git diff --git a/pctb/structure.c b/pctb/structure.c index 4a49a2c..8141feb 100644 --- a/pctb/structure.c +++ b/pctb/structure.c @@ -1,5 +1,29 @@ /* - */ + * Parsing of the structure of the YPP client's displayed image + */ +/* + * This is part of ypp-sc-tools, a set of third-party tools for assisting + * players of Yohoho Puzzle Pirates. + * + * Copyright (C) 2009 Ian Jackson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Yohoho and Puzzle Pirates are probably trademarks of Three Rings and + * are used without permission. This program is not endorsed or + * sponsored by Three Rings. + */ #include "structure.h" @@ -315,7 +339,7 @@ static void find_table_entry(Rect commod, int colno, Rect *cellr) { require_rectangle_r(*cellr, " o"); } -static void ocr_rectangle(Rect r, const OcrCellType ct) { +static void ocr_rectangle(Rect r, const OcrCellType ct, FILE *tsv_output) { OcrResultGlyph *results, *res; int w= r.br.x - r.tl.x + 1; @@ -340,10 +364,10 @@ static void ocr_rectangle(Rect r, const OcrCellType ct) { results= ocr(rd,ct,w,cols); for (res=results; res->s; res++) - printf("%s",res->s); + fputs(res->s,tsv_output); } -void analyse(void) { +void analyse(FILE *tsv_output) { Rect thisr, entryr; int page, tryrect, colno; @@ -362,16 +386,17 @@ void analyse(void) { const char *tab= ""; for (colno=0; colno