X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Frectext.c;h=c6668164dc8fa7ec154147c0639f5d1f4c1f51cf;hb=03ada04bea71af9a1c6b6bb2cfed660e21775fdb;hp=fd7f38d05d6332294802c1bda755506b21c46b85;hpb=a8b86c35a39ce9eb5279c46dd99ef7e91b83fb7b;p=idzebra-moved-to-github.git diff --git a/recctrl/rectext.c b/recctrl/rectext.c index fd7f38d..c666816 100644 --- a/recctrl/rectext.c +++ b/recctrl/rectext.c @@ -1,4 +1,4 @@ -/* $Id: rectext.c,v 1.19 2004-08-06 12:55:03 adam Exp $ +/* $Id: rectext.c,v 1.22 2004-11-19 10:27:13 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -26,19 +26,24 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#include "rectext.h" +#include struct text_info { char *sep; }; -static void *text_init (RecType recType) +static void *text_init (Res res, RecType recType) { struct text_info *tinfo = (struct text_info *) xmalloc(sizeof(*tinfo)); tinfo->sep = 0; return tinfo; } +static void text_config(void *clientData, Res res, const char *args) +{ + +} + static void text_destroy (void *clientData) { struct text_info *tinfo = clientData; @@ -100,15 +105,11 @@ static int text_extract (void *clientData, struct recExtractCtrl *p) struct buf_info *fi = buf_open (p); #if 0 - yaz_log(LOG_LOG, "text_extract off=%ld", + yaz_log(YLOG_LOG, "text_extract off=%ld", (long) (*fi->p->tellf)(fi->p->fh)); #endif xfree(tinfo->sep); tinfo->sep = 0; - if (p->subType) { - if (!strncmp(p->subType, "sep=", 4)) - tinfo->sep = xstrdup(p->subType+4); - } (*p->init)(p, &recWord); recWord.reg_type = 'w'; do @@ -230,9 +231,20 @@ static int text_retrieve (void *clientData, struct recRetrieveCtrl *p) static struct recType text_type = { "text", text_init, + text_config, text_destroy, text_extract, text_retrieve }; -RecType recTypeText = &text_type; +RecType +#ifdef IDZEBRA_STATIC_TEXT +idzebra_filter_text +#else +idzebra_filter +#endif + +[] = { + &text_type, + 0, +};