Index: src/Makefile.am =================================================================== --- src/Makefile.am (Revision 1476) +++ src/Makefile.am (Arbeitskopie) @@ -18,5 +18,5 @@ trackerapplet_dir = tracker-applet endif -SUBDIRS = libstemmer xdgmime $(qdbm_dir) text-filters libtracker-common trackerd libtracker tracker-extract tracker-thumbnailer $(libtrackergtk_dir) $(tracker_gui_dir) $(trackerapplet_dir) $(tracker_preferences_dir) +SUBDIRS = libstemmer xdgmime $(qdbm_dir) libtracker-common trackerd libtracker tracker-extract tracker-thumbnailer $(libtrackergtk_dir) $(tracker_gui_dir) $(trackerapplet_dir) $(tracker_preferences_dir) Index: src/text-filters/ooo_converter/utf8tolatin1.c =================================================================== --- src/text-filters/ooo_converter/utf8tolatin1.c (Revision 1476) +++ src/text-filters/ooo_converter/utf8tolatin1.c (Arbeitskopie) @@ -1,152 +0,0 @@ -/* - Copyright (C) 2002 Ulric Eriksson - - 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. - */ - -#include - -int main(void) -{ - unsigned long ucs4; - int c, state, octets; - - ucs4 = 0; - state = 0; - octets = 0; - - while ((c = getchar()) != EOF) { - switch (state) { - case 0: /* start of utf8 char */ - ucs4 = 0; /* reset ucs4 char */ - if ((c & 0xfe) == 0xfc) { /* 6 octets */ - ucs4 = (c & 0x01) << 30; - octets = 6; - state = 5; /* look for 5 more */ - } else if ((c & 0xfc) == 0xf8) { /* 5 octets */ - ucs4 = (c & 0x03) << 24; - octets = 5; - state = 4; - } else if ((c & 0xf8) == 0xf0) { /* 4 octets */ - ucs4 = (c & 0x07) << 18; - octets = 4; - state = 3; - } else if ((c & 0xf0) == 0xe0) { /* 3 octets */ - ucs4 = (c & 0x0f) << 12; - octets = 3; - state = 2; - } else if ((c & 0xe0) == 0xc0) { /* 2 octets */ - ucs4 = (c & 0x1f) << 6; - octets = 2; - state = 1; /* look for 1 more */ - } else if ((c & 0x80) == 0x00) { /* 1 octet */ - ucs4 = (c & 0x7f); - octets = 1; - state = 0; /* we have a result */ - } else { /* error */ - ; - } - break; - case 1: - if ((c & 0xc0) == 0x80) { - ucs4 = ucs4 | (c & 0x3f); - if (ucs4 < 0x80 || ucs4 > 0x7ff) { - ucs4 = 0xffffffff; - } - } else { - ucs4 = 0xffffffff; - } - state = 0; /* we're done and have a result */ - break; - case 2: - if ((c & 0xc0) == 0x80) { - ucs4 = ucs4 | ((c & 0x3f) << 6); - state = 1; - } else { - ucs4 = 0xffffffff; - state = 0; - } - break; - case 3: - if ((c & 0xc0) == 0x80) { - ucs4 = ucs4 | ((c & 0x3f) << 12); - state = 2; - } else { - ucs4 = 0xffffffff; - state = 0; - } - break; - case 4: - if ((c & 0xc0) == 0x80) { - ucs4 = ucs4 | ((c & 0x3f) << 18); - state = 3; - } else { - ucs4 = 0xffffffff; - state = 0; - } - break; - case 5: - if ((c & 0xc0) == 0x80) { - ucs4 = ucs4 | ((c & 0x3f) << 24); - state = 4; - } else { - ucs4 = 0xffffffff; - state = 0; - } - break; - default: /* error, can't happen */ - ucs4 = 0xffffffff; - state = 0; - break; - } - if (state == 0) { - switch (octets) { - case 1: - if (ucs4 < 0x0 || ucs4 > 0x7f) - ucs4 = 0xffffffff; - break; - case 2: - if (ucs4 < 0x80 || ucs4 > 0x7ff) - ucs4 = 0xffffffff; - break; - case 3: - if (ucs4 < 0x800 || ucs4 > 0xffff) - ucs4 = 0xffffffff; - break; - case 4: - if (ucs4 < 0x10000 || ucs4 > 0x1fffff) - ucs4 = 0xffffffff; - break; - case 5: - if (ucs4 < 0x200000 || ucs4 > 0x3ffffff) - ucs4 = 0xffffffff; - break; - case 6: - if (ucs4 < 0x4000000 || ucs4 > 0x7fffffff) - ucs4 = 0xffffffff; - break; - default: - ucs4 = 0xffffffff; - break; - } - if (ucs4 != 0xffffffff) { - printf("%c", (int)ucs4); - } - } - } - return 0; -} - Index: src/text-filters/ooo_converter/o3totxt.1 =================================================================== --- src/text-filters/ooo_converter/o3totxt.1 (Revision 1476) +++ src/text-filters/ooo_converter/o3totxt.1 (Arbeitskopie) @@ -1 +0,0 @@ -.so man1/o3read.1 Index: src/text-filters/ooo_converter/ChangeLog =================================================================== --- src/text-filters/ooo_converter/ChangeLog (Revision 1476) +++ src/text-filters/ooo_converter/ChangeLog (Arbeitskopie) @@ -1,32 +0,0 @@ -080310 Fixed compiler warnings. - -050107 Added range check to parse_html(). - -021126 Added "strip" target to the Makefile. - o3tohtml puts sheet names in

...

when converting - scalc files. - Released 0.0.3. - -021125 o3read: parse_html understands . - o3tohtml: translate tables as used by scalc. - -021123 get_value didn't handle null p. Spotted by David Rudder. - o3tohtml: many tags added, including lists, headers and - hyperlinks. - -021121 o3tohtml: added output tags for

, , , . - Removed unused code from o3totxt and o3tohtml. - Wrote manpages for o3read, o3tohtml, o3totxt and utf8tolatin1. - Added a copy of the GPL. - Released 0.0.2. - -021117 Output module for plain text in o3totxt.c. - Rudimentary html module in o3tohtml.c. - Added the utility utf8tolatin1. - Released 0.0.1. - -021113 Modded the parser to understand tags that look like . - -021112 Started project. Took the HTML parser from myhtml and made - minimal changes to make it grok O3's XML. - Index: src/text-filters/ooo_converter/o3tohtml.c =================================================================== --- src/text-filters/ooo_converter/o3tohtml.c (Revision 1476) +++ src/text-filters/ooo_converter/o3tohtml.c (Arbeitskopie) @@ -1,357 +0,0 @@ -/* - Copyright (C) 2002 Ulric Eriksson - - 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. - */ - -#include -#include -#include -#include - -#include "o3read.h" - -enum {LIST_NONE=0, LIST_UL, LIST_OL, LIST_DL}; - -typedef struct style { - char *name; - char bold; - char italic; - char underline; -} style; - -typedef struct hstate { - int pre; /* preformatted, default 0 = false */ - int list; /* list mode, default LIST_NONE */ - int ll; /* list level, starts with 1 */ - int indent; /* indentation level, default 0 */ -} hstate; - -static style *styles = NULL; -static int nstyles = 0; - -static int href; /* links, default 0 */ -static char **hrefs; - -static void tag_style_properties(hnode *, hstate *); -static void tag_style_style(hnode *, hstate *); -static void tag_table_table(hnode *, hstate *); -static void tag_table_row(hnode *, hstate *); -static void tag_table_cell(hnode *, hstate *); -static void tag_text_a(hnode *, hstate *); -static void tag_text_h(hnode *, hstate *); -static void tag_text_list_item(hnode *, hstate *); -static void tag_text_ordered_list(hnode *, hstate *); -static void tag_text_p(hnode *, hstate *); -static void tag_text_s(hnode *, hstate *); -static void tag_text_span(hnode *, hstate *); -static void tag_text_tab_stop(hnode *, hstate *); -static void tag_text_unordered_list(hnode *, hstate *); -static void tag_unknown(hnode *, hstate *); -static void text(hnode *, hstate *); - -static struct { - char *name; - void (*action)(hnode *, hstate *); -} tag[] = { - {"STYLE:STYLE", tag_style_style}, - {"STYLE:PROPERTIES", tag_style_properties}, - {"TABLE:TABLE", tag_table_table}, - {"TABLE:TABLE-CELL", tag_table_cell}, - {"TABLE:TABLE-ROW", tag_table_row}, - {"TEXT:A", tag_text_a}, - {"TEXT:H", tag_text_h}, - {"TEXT:LIST-ITEM", tag_text_list_item}, - {"TEXT:ORDERED-LIST", tag_text_ordered_list}, - {"TEXT:P", tag_text_p}, - {"TEXT:S", tag_text_s}, - {"TEXT:SPAN", tag_text_span}, - {"TEXT:TAB-STOP", tag_text_tab_stop}, - {"TEXT:UNORDERED-LIST", tag_text_unordered_list}, - {NULL, tag_unknown} -}; - -static hstate *new_hstate(void) -{ - hstate *s = cmalloc(sizeof *s); - s->pre = 0; - s->indent = 0; - s->list = LIST_NONE; - s->ll = 0; - return s; -} - -static void free_hstate(hstate *s) -{ - free(s); -} - -static void newline(hstate *s) -{ - int i; - - putchar('\n'); - for (i = 0; i < s->indent; i++) - putchar(' '); -} - -static void tree(hnode *h, hstate *s) -{ - void (*action)(hnode *, hstate *); - int i; - - if (h == NULL) return; - if (h->tag == NULL) { - text(h, s); - } else { - for (i = 0; tag[i].name; i++) { - if (!strcmp(tag[i].name, h->tag)) break; - } - action = tag[i].action; - (*action)(h, s); - } -} - -/* tag handlers are in alphabetical order so I can find them... */ - -static void tag_style_properties(hnode *h, hstate *s) -{ - char b[1024], *p; - p = get_value("FO:FONT-STYLE", h->text, b); - if (p && !strcmp(p, "italic")) styles[nstyles].italic = 1; - p = get_value("FO:FONT-WEIGHT", h->text, b); - if (p && !strcmp(p, "bold")) styles[nstyles].bold = 1; - p = get_value("STYLE:TEXT-UNDERLINE", h->text, b); - if (p && !strcmp(p, "single")) styles[nstyles].underline = 1; - tree(h->child, s); - tree(h->next, s); -} - -/* Begin a new style definition */ -static void tag_style_style(hnode *h, hstate *s) -{ - char b[1024], *p; - p = get_value("STYLE:NAME", h->text, b); - if (p) strcpy(b, p); - else strcpy(b, "unknown style"); - styles = crealloc(styles, (nstyles+1)*sizeof *styles); - styles[nstyles].name = cstrdup(b); - styles[nstyles].bold = 0; - styles[nstyles].italic = 0; - styles[nstyles].underline = 0; - tree(h->child, s); - nstyles++; - tree(h->next, s); -} - -static void tag_table_table(hnode *h, hstate *s) -{ - char b[1024], *p; - p = get_value("TABLE:NAME", h->text, b); - if (p) printf("

%s

\n", p); - printf("\n"); - tree(h->child, s); - printf("
\n"); - tree(h->next, s); -} - -static void tag_table_cell(hnode *h, hstate *s) -{ - printf(""); - tree(h->child, s); - printf(""); - tree(h->next, s); -} - -static void tag_table_row(hnode *h, hstate *s) -{ - printf(""); - tree(h->child, s); - printf(""); - tree(h->next, s); -} - -static void tag_text_a(hnode *h, hstate *s) -{ - char b[1024], *p; - - p = get_value("XLINK:HREF", h->text, b); - if (p) printf("", p); - tree(h->child, s); - if (p) printf(""); - tree(h->next, s); -} - -/* Heading */ -static void tag_text_h(hnode *h, hstate *s) -{ - char b[1024], *p; - int level = 1; - - newline(s); - - p = get_value("TEXT:LEVEL", h->text, b); - if (p) { - level = atoi(p); - } - if (level < 1) level = 1; - if (level > 6) level = 6; - printf("", level); - tree(h->child, s); - printf("\n", level); - tree(h->next, s); -} - -static void tag_text_list_item(hnode *h, hstate *s) -{ - printf("
  • "); - tree(h->child, s); - tree(h->next, s); -} - -static void tag_text_ordered_list(hnode *h, hstate *s) -{ - printf("
      \n"); - tree(h->child, s); - printf("
    \n"); - tree(h->next, s); -} - -/* Paragraph break */ -static void tag_text_p(hnode *h, hstate *s) -{ - char b[1024], *p, *t = "p"; - - newline(s); - - p = get_value("TEXT:STYLE-NAME", h->text, b); - if (p) { - if (!strcmp(p, "Heading")) t = "h1"; - } - printf("<%s>", t); - tree(h->child, s); - printf("\n", t); - tree(h->next, s); -} - -static void tag_text_s(hnode *h, hstate *s) -{ - printf(" "); /* what do I know */ - tree(h->child, s); - tree(h->next, s); -} - -static void tag_text_span(hnode *h, hstate *s) -{ - int i; - char b[1024], *p = get_value("TEXT:STYLE-NAME", h->text, b); - if (p == NULL) p = "xxx"; - for (i = 0; i < nstyles; i++) if (!strcmp(p, styles[i].name)) break; - if (i < nstyles) { - if (styles[i].bold) printf(""); - if (styles[i].italic) printf(""); - if (styles[i].underline) printf(""); - } - tree(h->child, s); - if (i < nstyles) { - if (styles[i].underline) printf(""); - if (styles[i].italic) printf(""); - if (styles[i].bold) printf(""); - } - tree(h->next, s); -} - -static void tag_text_tab_stop(hnode *h, hstate *s) -{ - printf(" "); /* for lack of better */ - tree(h->child, s); - tree(h->next, s); -} - -static void tag_text_unordered_list(hnode *h, hstate *s) -{ - printf("
      \n"); - tree(h->child, s); - printf("
    \n"); - tree(h->next, s); -} - -/* Handles tags we don't have handlers for. Ignore the tag, do children */ -static void tag_unknown(hnode *h, hstate *s) -{ - /* ignore the tag */ - tree(h->child, s); - tree(h->next, s); -} - -/* Copy text onto screen. Treats whitespace differently if this - is "preformatted". -*/ -static void text(hnode *h, hstate *s) -{ - int i; - for (i = 0; h->text[i]; i++) { - switch (h->text[i]) { - case '<': - printf("<"); - break; - case '>': - printf(">"); - break; - default: - putchar(h->text[i]); - } - } - /* can't have children */ - tree(h->next, s); -} - -static int nextc(void *closure) -{ - FILE *fp = closure; - int c = getc(fp); - if (c == EOF) return '\0'; - return c; -} - -static void usage(void) -{ - printf("usage: lmb url\n"); - exit(0); -} - -int main(int argc, char **argv) -{ - hnode *h; - hstate *s; - - href = 0; - hrefs = NULL; - - h = parse_html(nextc, stdin); - if (h == NULL) usage(); - - s = new_hstate(); - printf("HTML by o3tohtml\n"); - tree(h, s); - newline(s); - printf("\n"); - - free_html(h); - free_hstate(s); - return 0; -} - Index: src/text-filters/ooo_converter/readme =================================================================== --- src/text-filters/ooo_converter/readme (Revision 1476) +++ src/text-filters/ooo_converter/readme (Arbeitskopie) @@ -1,15 +0,0 @@ - -This is a standalone converter for the OpenOffice.org swriter (.sxw) -and scalc (.sxc) formats. It doesn't depend on Open Office or any -other external tools or libraries. - -Example: unzip -p filformat.sxw content.xml | o3read | utf8tolatin1 - -There are three output modules: - - - o3read displays a dump of the parse tree - - o3totxt creates plain text - - o3tohtml creates html code - -The utility utftolatin1 converts from utf8 to 8859-1. - Index: src/text-filters/ooo_converter/o3read.c =================================================================== --- src/text-filters/ooo_converter/o3read.c (Revision 1476) +++ src/text-filters/ooo_converter/o3read.c (Arbeitskopie) @@ -1,435 +0,0 @@ -/* - Copyright (C) 2002-2005 Ulric Eriksson - - 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. - */ - -#include -#include -#include -#include - -#include "o3read.h" - -enum {START, TAG, CHAR, COMMENT1, COMMENT2, COMMENT3, COMMENT4, COMMENT5, END}; - -static hnode *h, *ch; - -static char *b = NULL; - -static int n, nmax = 0; - -static struct { - char *name; - int value; -} cchar[] = { - {"quot", '"'}, {"amp", '&'}, {"lt", '<'}, {"gt", '>'}, - {"nbsp", 160}, {"iexcl", 161}, {"cent", 162}, {"pound", 163}, - {"curren", 164}, {"yen", 165}, {"brvbar", 166}, {"sect", 167}, - {"uml", 168}, {"copy", 169}, {"ordf", 170}, {"laquo", 171}, - {"not", 172}, {"shy", 173}, {"reg", 174}, {"macr", 175}, - {"deg", 176}, {"plusmn", 177}, {"sup2", 178}, {"sup3", 179}, - {"acute", 180}, {"micro", 181}, {"para", 182}, {"middot", 183}, - {"cedil", 184}, {"sup1", 185}, {"ordm", 186}, {"raquo", 187}, - {"frac14", 188}, {"frac12", 189}, {"frac34", 190}, {"iquest", 191}, - {"Agrave", 192}, {"Aacute", 193}, {"Acirc", 194}, {"Atilde", 195}, - {"Auml", 196}, {"Aring", 197}, {"AElig", 198}, {"Ccedil", 199}, - {"Egrave", 200}, {"Eacute", 201}, {"Ecirc", 202}, {"Euml", 203}, - {"Igrave", 204}, {"Iacute", 205}, {"Icirc", 206}, {"Euml", 207}, - {"ETH", 208}, {"Ntilde", 209}, {"Ograve", 210}, {"Oacute", 211}, - {"Ocirc", 212}, {"Otilde", 213}, {"Ouml", 214}, {"times", 215}, - {"Oslash", 216}, {"Ugrave", 217}, {"Uacute", 218}, {"Ucirc", 219}, - {"Uuml", 220}, {"Yacute", 221}, {"THORN", 222}, {"szlig", 223}, - {"agrave", 224}, {"aacute", 225}, {"acirc", 226}, {"atilde", 227}, - {"auml", 228}, {"aring", 229}, {"aelig", 230}, {"ccedil", 231}, - {"egrave", 232}, {"eacute", 233}, {"ecirc", 234}, {"euml", 235}, - {"igrave", 236}, {"iacute", 237}, {"icirc", 238}, {"iuml", 239}, - {"eth", 240}, {"ntilde", 241}, {"ograve", 242}, {"oacute", 243}, - {"ocirc", 244}, {"otilde", 245}, {"ouml", 246}, {"divide", 247}, - {"slash", 248}, {"ugrave", 249}, {"uacute", 250}, {"ucirc", 251}, - {"uuml", 252}, {"yacute", 253}, {"thorn", 254}, {"yuml", 255}, - {NULL, 0} -}; - -/* convert Auml to Ä and #33 to ! */ -static int from_cchar(char *from) -{ - int i; - - if (from[0] == '#') { - i = atoi(from+1); - if (i >= ' ' && i <= 255) return i; - return -1; - } - for (i = 0; cchar[i].name; i++) { - if (!strcmp(cchar[i].name, from)) return cchar[i].value; - } - return -1; -} - -static hnode *new_hnode(void) -{ - hnode *h = cmalloc(sizeof *h); - h->tag = NULL; - h->text = NULL; - h->parent = NULL; - h->next = NULL; - h->child = NULL; - return h; -} - -static void indent(int i) -{ - int j; - - for (j = 0; j < i; j++) putchar(' '); -} - -void free_html(hnode *h) -{ - if (h == NULL) return; - if (h->tag) free(h->tag); - if (h->text) free(h->text); - free_html(h->next); - free_html(h->child); -} - -void dump_html(hnode *h, int i) -{ - if (h == NULL) return; - if (h->tag == NULL) { - indent(i); - printf("Text: '%s'\n", h->text); - } else { - indent(i); - printf("Tag: '%s'\n", h->tag); - if (h->text) { - indent(i+4); - printf("Value: '%s'\n", h->text); - } - } - dump_html(h->child, i+2); - dump_html(h->next, i); -} - -static void growb(int n) -{ - if (n >= nmax) { - nmax = n+1000; - b = crealloc(b, nmax+1); - } -} - -static void clearb(void) -{ - n = 0; - growb(n+1); - b[n] = '\0'; -} - -static hnode *last_node(hnode *h) -{ - if (h == NULL) return NULL; - if (h->next == NULL) return h; - return last_node(h->next); -} - -/* -When we enter ins_node, ch points to the most recently inserted node. -The new node is inserted as a child to this node. When we are done, -ch points to the newly inserted node. - -Special case: If tree is empty, ch is NULL. In that case, the new -node becomes the root of the tree. -*/ - -static void ins_node(hnode *n) -{ - hnode *ph; - - if (ch == NULL) { - h = n; - } else if ((ph = last_node(ch->child)) == NULL) { - ch->child = n; - } else { - ph->next = n; - } - n->parent = ch; - ch = n; -} - -static hnode *match_tag(char *p) -{ - hnode *h; - - for (h = ch; h; h = h->parent) { - if (h->tag && !strcmp(h->tag, p)) break; - } - return h; -} - -static void tag_cb(char *p) -{ - hnode *h; - char *q; - char b[1024]; - int n, closer = 0; - - if (p == NULL) return; /* should never happen */ - q = p; - while (isspace(*q)) q++; - if (q[0] == '\0') return; /* ignore empty tag */ - - n = strlen(q); - if (n && q[n-1] == '/') { - q[n-1] = '\0'; - closer = 1; - } - - n = 0; - while (*q && !isspace(*q)) b[n++] = toupper(*q++); - b[n] = '\0'; - while (*q && isspace(*q)) q++; /* skip past white space */ - if (p[0] == '\0') return; - if (p[0] == '/') { - /* closing tag */ - h = match_tag(b+1); - if (h == NULL) { - fprintf(stderr, "Warning: bogus closer '%s'\n", p); - } else { - ch = h->parent; - } - } else { - h = new_hnode(); - h->tag = cstrdup(b); - if (*q) h->text = cstrdup(q); - ins_node(h); - if (closer) ch = ch->parent; - } -} - -static int extchar(char *p) -{ - int c = from_cchar(p); - if (c == -1) c = '?'; - return c; -} - -static void text_cb(char *p) -{ - hnode *h; - - if (p == NULL || p[0] == '\0') return; - h = new_hnode(); - h->text = cstrdup(p); - ins_node(h); - ch = ch->parent; -} - -static void char_cb(int c) -{ - growb(n+1); - b[n++] = c; - b[n] = '\0'; -} - -hnode *parse_html(int (*getc_cb)(void *), void *closure) -{ - int state = 0, error = 0; - int c; - char t[1024]; - int m = 0; - - ch = h = NULL; - n = 0; - while (state != END) { - c = getc_cb(closure); - switch (state) { - case START: - if (c == '<') { - text_cb(b); - clearb(); - state = TAG; - } else if (c == '&') { - m = 0; - state = CHAR; - } else if (c == '\0') { - text_cb(b); - state = END; - } else { - char_cb(c); - } - break; - case TAG: - if (c == '>') { - tag_cb(b); - clearb(); - state = START; - } else if (c == '!') { - state = COMMENT1; - } else if (c == '\0') { - error = 1; - state = END; - } else { - char_cb(c); - } - break; - case COMMENT1: - if (c == '-') { - state = COMMENT2; - } else if (c == '\0') { - error = 1; - state = END; - } else { - char_cb('!'); - char_cb(c); - state = TAG; - } - break; - case COMMENT2: - if (c == '-') { - state = COMMENT3; - } else if (c == '\0') { - error = 1; - state = END; - } else { - char_cb('!'); - char_cb('-'); - char_cb(c); - state = TAG; - } - break; - case COMMENT3: - if (c == '-') { - state = COMMENT4; - } else if (c == '\0') { - error = 1; - state = END; - } - break; - case COMMENT4: - if (c == '-') { - state = COMMENT5; - } else if (c == '\0') { - error = 1; - state = END; - } else { - state = COMMENT3; - } - break; - case COMMENT5: - if (c == '>') { - clearb(); - state = START; - } else if (c == '\0') { - error = 1; - state = END; - } else { - state = COMMENT3; - } - break; - case CHAR: - if (c == ';') { - t[m] = '\0'; - char_cb(extchar(t)); - state = START; - } else if (c == '\0') { - error = 1; - state = END; - } else { - if (m+1 < (int) sizeof t) t[m++] = c; - } - break; - default: - error = 1; - state = END; - } - } - if (error) { - fprintf(stderr, "Error\n"); - } - return h; -} - -/* p looks like this: key=value key2="value 2". Keys are not case - sensitive. Everything not in quotes is converted to upper case. - Returns value if found, otherwise NULL. -*/ -char *get_value(char *k, char *p, char *b) -{ - char *q = p; - int n = strlen(k); - int i; - - if (q == NULL) return NULL; -Again: - while (*q && isspace(*q)) q++; /* skip leading space */ - if (!cstrncasecmp(k, q, n) && q[n] == '=') { /* gotcha */ - n++; - i = 0; - if (q[n] == '"') { - n++; - while (q[n] && q[n] != '"') b[i++] = q[n++]; - } else { - while (q[n] && !isspace(q[n])) b[i++] = q[n++]; - } - b[i] = '\0'; - return b; - } - while (*q && !isspace(*q)) q++; - if (*q) goto Again; - return NULL; -} - -static void malloc_error(size_t n) -{ - fprintf(stderr, "Error allocating %ld bytes\n", (long)n); - exit(EXIT_FAILURE); -} - -void *cmalloc(size_t n) -{ - void *q = malloc(n); - if (q == NULL) malloc_error(n); - return q; -} - -void *crealloc(void *p, size_t n) -{ - void *q = realloc(p, n); - if (q == NULL) malloc_error(n); - return q; -} - -char *cstrdup(const char *p) -{ - int n = strlen(p); - char *q = cmalloc(n+1); - strcpy(q, p); - return q; -} - -int cstrncasecmp(const char *p, const char *q, size_t n) -{ - size_t i; - int c = 0; - - for (i = 0; i < n && p[i]; i++) { - if ((c = toupper(p[i])-toupper(q[i]))) break; - } - return c; -} - Index: src/text-filters/ooo_converter/utf8tolatin1.1 =================================================================== --- src/text-filters/ooo_converter/utf8tolatin1.1 (Revision 1476) +++ src/text-filters/ooo_converter/utf8tolatin1.1 (Arbeitskopie) @@ -1,32 +0,0 @@ -.TH UTF8TOLATIN1 1 LOCAL - -.SH NAME -utf8tolatin1 - -.SH SYNOPSIS -.B utf8tolatin1 -< infile > outfile - -.SH DESCRIPTION -.I Utf8tolatin1 -reads utf-8 encoded text on stdin and writes latin1 (iso8859-1) encoded -text on stdout. - -.SH AUTHOR -Copyright (C) 2002 Ulric Eriksson - -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 2, 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, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. - Index: src/text-filters/ooo_converter/o3read.h =================================================================== --- src/text-filters/ooo_converter/o3read.h (Revision 1476) +++ src/text-filters/ooo_converter/o3read.h (Arbeitskopie) @@ -1,36 +0,0 @@ -/* - Copyright (C) 2002 Ulric Eriksson - - 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. - */ - -typedef struct hnode { - char *tag; /* tag name */ - char *text; /* text */ - struct hnode *parent; /* parent */ - struct hnode *next; /* next sibling */ - struct hnode *child; /* first child */ -} hnode; - -extern void dump_html(hnode *h, int i); -extern void free_html(hnode *h); -extern hnode *parse_html(int (*getc_cb)(void *), void *); -extern char *get_value(char *, char *, char *); - -extern void *crealloc(void *, size_t); -extern void *cmalloc(size_t); -extern char *cstrdup(const char *); -extern int cstrncasecmp(const char *, const char *, size_t); Index: src/text-filters/ooo_converter/xMakefile =================================================================== --- src/text-filters/ooo_converter/xMakefile (Revision 1476) +++ src/text-filters/ooo_converter/xMakefile (Arbeitskopie) @@ -1,86 +0,0 @@ - -PACKAGE = o3read -VERSION = 0.0.4 - -CC = gcc -CFLAGS = -Wall -ansi -pedantic -O -g -PREFIX = /usr/local -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/man/man1 -DOCS = COPYING INSTALL README TODO ChangeLog filformat.sxw -BINS = o3read o3totxt o3tohtml utf8tolatin1 -SRCS = o3read.h main.c o3read.c o3totxt.c o3tohtml.c utf8tolatin1.c -MANS = o3read.1 o3tohtml.1 o3totxt.1 utf8tolatin1.1 -ARCH=`uname -s`-`uname -m` -BINDISTDIR=/usr/local - -all: $(BINS) - -utf8tolatin1: utf8tolatin1.o - $(CC) -o utf8tolatin1 utf8tolatin1.o - -o3totxt: o3totxt.o o3read.o - $(CC) -o o3totxt o3totxt.o o3read.o - -o3tohtml: o3tohtml.o o3read.o - $(CC) -o o3tohtml o3tohtml.o o3read.o - -o3tosiag: o3tosiag.o o3read.o - $(CC) -o o3tosiag o3tosiag.o o3read.o - -o3read: main.o o3read.o - $(CC) -o o3read main.o o3read.o - -dist: - rm -rf $(PACKAGE)-$(VERSION) - mkdir $(PACKAGE)-$(VERSION) - cp Makefile $(DOCS) $(MANS) $(SRCS) $(PACKAGE)-$(VERSION) - tar cf - $(PACKAGE)-$(VERSION) | gzip > $(PACKAGE)-$(VERSION).tar.gz - rm -rf $(PACKAGE)-$(VERSION) - -strip: $(BINS) - strip $(BINS) - -install: $(BINS) - mkdir -p $(BINDIR) $(MANDIR) - cp $(BINS) $(BINDIR) - cp $(MANS) $(MANDIR) - -uninstall: - cd $(BINDIR) && rm -f $(BINS) - cd $(MANDIR) && rm -f $(MANS) - -clean: - rm -f *.o $(BINS) *~ - -nstest: - unzip -p filformat.sxw content.xml|./o3tohtml|./utf8tolatin1>x.html - netscape ./x.html - -lytest: - unzip -p filformat.sxw content.xml|./o3tohtml|./utf8tolatin1>x.html - lynx ./x.html - -binaries: - rm -rf tmpinst - make clean strip install PREFIX=`cd . && pwd`/tmpinst$(BINDISTDIR) - (cd tmpinst && tar cf - .) | gzip > $(PACKAGE)-$(ARCH)-$(VERSION).tar.gz - rm -rf tmpinst - -tgz: - rm -rf tmpinst - make clean strip install PREFIX=`cd . && pwd`/tmpinst$(BINDISTDIR) - cd tmpinst && makepkg ../$(PACKAGE)-$(ARCH)-$(VERSION).tgz - -tgz2: binaries - rm -rf builddir - mkdir -p builddir - mkdir builddir/install - cp doinst.sh builddir/install - (cd builddir; \ - tar zxf ../$(PACKAGE)-$(ARCH)-$(VERSION).tar.gz; \ - tar zcf ../$(PACKAGE)-$(ARCH)-$(VERSION).tgz) - rm -rf builddir - -rpm: tgz - alien -r $(PACKAGE)-$(ARCH)-$(VERSION).tgz Index: src/text-filters/ooo_converter/main.c =================================================================== --- src/text-filters/ooo_converter/main.c (Revision 1476) +++ src/text-filters/ooo_converter/main.c (Arbeitskopie) @@ -1,50 +0,0 @@ - -#include -#include -#include -#include - -#include "o3read.h" - -enum {LIST_NONE=0, LIST_UL, LIST_OL, LIST_DL}; - -typedef struct hstate { - int pre; /* preformatted, default 0 = false */ - int list; /* list mode, default LIST_NONE */ - int ll; /* list level, starts with 1 */ - int indent; /* indentation level, default 0 */ -} hstate; - -static int href; /* links, default 0 */ -static char **hrefs; - -static int nextc(void *closure) -{ - FILE *fp = closure; - int c = getc(fp); - if (c == EOF) return '\0'; - return c; -} - -static void usage(void) -{ - printf("usage: lmb url\n"); - exit(0); -} - -int main(int argc, char **argv) -{ - hnode *h; - - href = 0; - hrefs = NULL; - - h = parse_html(nextc, stdin); - if (h == NULL) usage(); - - dump_html(h, 0); - - free_html(h); - return 0; -} - Index: src/text-filters/ooo_converter/o3totxt.c =================================================================== --- src/text-filters/ooo_converter/o3totxt.c (Revision 1476) +++ src/text-filters/ooo_converter/o3totxt.c (Arbeitskopie) @@ -1,156 +0,0 @@ -/* - Copyright (C) 2002 Ulric Eriksson - - 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. - */ - -#include -#include -#include -#include - -#include "o3read.h" - -enum {LIST_NONE=0, LIST_UL, LIST_OL, LIST_DL}; - -typedef struct hstate { - int pre; /* preformatted, default 0 = false */ - int list; /* list mode, default LIST_NONE */ - int ll; /* list level, starts with 1 */ - int indent; /* indentation level, default 0 */ -} hstate; - -static int href; /* links, default 0 */ -static char **hrefs; - -static void tag_text_p(hnode *, hstate *); -static void tag_unknown(hnode *, hstate *); -static void text(hnode *, hstate *); - -static struct { - char *name; - void (*action)(hnode *, hstate *); -} tag[] = { - {"TEXT:P", tag_text_p}, - {NULL, tag_unknown} -}; - -static hstate *new_hstate(void) -{ - hstate *s = cmalloc(sizeof *s); - s->pre = 0; - s->indent = 0; - s->list = LIST_NONE; - s->ll = 0; - return s; -} - -static void free_hstate(hstate *s) -{ - free(s); -} - -static void newline(hstate *s) -{ - int i; - - putchar('\n'); - for (i = 0; i < s->indent; i++) - putchar(' '); -} - -static void tree(hnode *h, hstate *s) -{ - void (*action)(hnode *, hstate *); - int i; - - if (h == NULL) return; - if (h->tag == NULL) { - text(h, s); - } else { - for (i = 0; tag[i].name; i++) { - if (!strcmp(tag[i].name, h->tag)) break; - } - action = tag[i].action; - (*action)(h, s); - } -} - -/* tag handlers are in alphabetical order so I can find them... */ - -/* Paragraph break */ -static void tag_text_p(hnode *h, hstate *s) -{ - newline(s); - tree(h->child, s); - tree(h->next, s); -} - -/* Handles tags we don't have handlers for. Ignore the tag, do children */ -static void tag_unknown(hnode *h, hstate *s) -{ - /* ignore the tag */ - tree(h->child, s); - tree(h->next, s); -} - -/* Copy text onto screen. Treats whitespace differently if this - is "preformatted". -*/ -static void text(hnode *h, hstate *s) -{ - int i; - for (i = 0; h->text[i]; i++) { - putchar(h->text[i]); - } - /* can't have children */ - tree(h->next, s); -} - -static int nextc(void *closure) -{ - FILE *fp = closure; - int c = getc(fp); - if (c == EOF) return '\0'; - return c; -} - -static void usage(void) -{ - printf("usage: lmb url\n"); - exit(0); -} - -int main(int argc, char **argv) -{ - hnode *h; - hstate *s; - - href = 0; - hrefs = NULL; - - h = parse_html(nextc, stdin); - if (h == NULL) usage(); - - s = new_hstate(); - tree(h, s); - newline(s); - - free_html(h); - free_hstate(s); - return 0; -} - Index: src/text-filters/ooo_converter/todo =================================================================== --- src/text-filters/ooo_converter/todo (Revision 1476) +++ src/text-filters/ooo_converter/todo (Arbeitskopie) @@ -1,5 +0,0 @@ - -Write a small program that can load the entire document including -all style and meta information and dump out the result. - -Once that works, make it create a sxw file from its internal representation. Index: src/text-filters/ooo_converter/install =================================================================== --- src/text-filters/ooo_converter/install (Revision 1476) +++ src/text-filters/ooo_converter/install (Arbeitskopie) @@ -1,19 +0,0 @@ - -This is all written in portable ANSI C with no additional -required libraries or dependencies. Thus, no configuration -is necessary and installing is as simple as: - -make install - -Or, to save a few kb on the already small binaries: - -make strip install - -And to uninstall: - -make uninstall - -To put the files somewhere other than /usr/local, change the PREFIX: - -make install PREFIX=/opt - Index: src/text-filters/ooo_converter/copying =================================================================== --- src/text-filters/ooo_converter/copying (Revision 1476) +++ src/text-filters/ooo_converter/copying (Arbeitskopie) @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - 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 2 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, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Index: src/text-filters/ooo_converter/o3tohtml.1 =================================================================== --- src/text-filters/ooo_converter/o3tohtml.1 (Revision 1476) +++ src/text-filters/ooo_converter/o3tohtml.1 (Arbeitskopie) @@ -1 +0,0 @@ -.so man1/o3read.1 Index: src/text-filters/ooo_converter/Makefile.am =================================================================== --- src/text-filters/ooo_converter/Makefile.am (Revision 1476) +++ src/text-filters/ooo_converter/Makefile.am (Arbeitskopie) @@ -1,4 +0,0 @@ -bin_PROGRAMS = o3totxt - -o3totxt_SOURCES = o3read.c o3totxt.c o3read.h - Index: src/text-filters/ooo_converter/o3read.1 =================================================================== --- src/text-filters/ooo_converter/o3read.1 (Revision 1476) +++ src/text-filters/ooo_converter/o3read.1 (Arbeitskopie) @@ -1,44 +0,0 @@ -.TH O3READ 1 LOCAL - -.SH NAME -o3read, o3tohtml, o3totxt \- convert files in OpenOffice.org format. - -.SH SYNOPSIS -.B o3read -< infile > outfile - -.B o3tohtml -< infile > outfile - -.B o3totxt -< infile > outfile - -.SH DESCRIPTION -.I o3read -is a collection of tools to convert files in OpenOffice.org format -into other formats such as html or plain text. - -.SH EXAMPLE -unzip -p file.sxw content.xml | o3tohtml | utf8tolatin1 > file.html - -.SH SEE ALSO -utf8tolatin1 - -.SH AUTHOR -Copyright (C) 2002-2005 Ulric Eriksson - -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 2, 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, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. - Index: src/text-filters/Makefile.am =================================================================== --- src/text-filters/Makefile.am (Revision 1476) +++ src/text-filters/Makefile.am (Arbeitskopie) @@ -1 +0,0 @@ -SUBDIRS = ooo_converter Index: README =================================================================== --- README (Revision 1476) +++ README (Arbeitskopie) @@ -171,6 +171,7 @@ * w3m * wv 1.0.2 * poppler (pdftotext) + * odt2txt (indexing OpenOffice documents) * libvorbis * libpng * libexif Index: configure.ac =================================================================== --- configure.ac (Revision 1476) +++ configure.ac (Arbeitskopie) @@ -811,8 +811,6 @@ src/Makefile src/libstemmer/Makefile src/qdbm/Makefile - src/text-filters/Makefile - src/text-filters/ooo_converter/Makefile src/tracker-extract/Makefile src/tracker-thumbnailer/Makefile src/libtracker-common/Makefile Index: filters/application/vnd.sun.xml.impress_filter =================================================================== --- filters/application/vnd.sun.xml.impress_filter (Revision 1476) +++ filters/application/vnd.sun.xml.impress_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.oasis.opendocument.presentation_filter =================================================================== --- filters/application/vnd.oasis.opendocument.presentation_filter (Revision 1476) +++ filters/application/vnd.oasis.opendocument.presentation_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.stardivision.writer_filter =================================================================== --- filters/application/vnd.stardivision.writer_filter (Revision 1476) +++ filters/application/vnd.stardivision.writer_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.sun.xml.writer.template_filter =================================================================== --- filters/application/vnd.sun.xml.writer.template_filter (Revision 1476) +++ filters/application/vnd.sun.xml.writer.template_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.oasis.opendocument.spreadsheet-template_filter =================================================================== --- filters/application/vnd.oasis.opendocument.spreadsheet-template_filter (Revision 1476) +++ filters/application/vnd.oasis.opendocument.spreadsheet-template_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.sun.xml.impress.template_filter =================================================================== --- filters/application/vnd.sun.xml.impress.template_filter (Revision 1476) +++ filters/application/vnd.sun.xml.impress.template_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.oasis.opendocument.presentation-template_filter =================================================================== --- filters/application/vnd.oasis.opendocument.presentation-template_filter (Revision 1476) +++ filters/application/vnd.oasis.opendocument.presentation-template_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.oasis.opendocument.text_filter =================================================================== --- filters/application/vnd.oasis.opendocument.text_filter (Revision 1476) +++ filters/application/vnd.oasis.opendocument.text_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.sun.xml.draw_filter =================================================================== --- filters/application/vnd.sun.xml.draw_filter (Revision 1476) +++ filters/application/vnd.sun.xml.draw_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.sun.xml.calc_filter =================================================================== --- filters/application/vnd.sun.xml.calc_filter (Revision 1476) +++ filters/application/vnd.sun.xml.calc_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.oasis.opendocument.text-template_filter =================================================================== --- filters/application/vnd.oasis.opendocument.text-template_filter (Revision 1476) +++ filters/application/vnd.oasis.opendocument.text-template_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.sun.xml.writer_filter =================================================================== --- filters/application/vnd.sun.xml.writer_filter (Revision 1476) +++ filters/application/vnd.sun.xml.writer_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.sun.xml.calc.template_filter =================================================================== --- filters/application/vnd.sun.xml.calc.template_filter (Revision 1476) +++ filters/application/vnd.sun.xml.calc.template_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2" Index: filters/application/vnd.oasis.opendocument.spreadsheet_filter =================================================================== --- filters/application/vnd.oasis.opendocument.spreadsheet_filter (Revision 1476) +++ filters/application/vnd.oasis.opendocument.spreadsheet_filter (Arbeitskopie) @@ -1,3 +1,3 @@ #!/bin/sh -nice -n19 unzip -p "$1" content.xml | o3totxt > "$2" +nice -n19 odt2txt "$1" > "$2"