X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Frectext.c;h=4c275225c764fbbab606dc2093ba7390c5e45f38;hb=5b4dcfcb99600327a11b58de4fec33003dc4d816;hp=a3177513f77162bf2e6b8509f5bcfae9edbf19a3;hpb=db4634a724c423fc5d2facda6e9e11d959c13617;p=idzebra-moved-to-github.git diff --git a/recctrl/rectext.c b/recctrl/rectext.c index a317751..4c27522 100644 --- a/recctrl/rectext.c +++ b/recctrl/rectext.c @@ -1,10 +1,29 @@ /* - * Copyright (C) 1994-1995, Index Data I/S + * Copyright (C) 1994-1998, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: rectext.c,v $ - * Revision 1.4 1996-11-04 14:09:16 adam + * Revision 1.9 1998-10-16 08:14:38 adam + * Updated record control system. + * + * Revision 1.8 1998/05/20 10:12:27 adam + * Implemented automatic EXPLAIN database maintenance. + * Modified Zebra to work with ASN.1 compiled version of YAZ. + * + * Revision 1.7 1998/03/11 11:19:05 adam + * Changed the way sequence numbers are generated. + * + * Revision 1.6 1998/02/10 12:03:06 adam + * Implemented Sort. + * + * Revision 1.5 1997/10/27 14:33:06 adam + * Moved towards generic character mapping depending on "structure" + * field in abstract syntax file. Fixed a few memory leaks. Fixed + * bug with negative integers when doing searches with relational + * operators. + * + * Revision 1.4 1996/11/04 14:09:16 adam * Minor changes. * * Revision 1.3 1996/11/01 09:00:33 adam @@ -48,7 +67,11 @@ #include #include "rectext.h" -static void text_init (void) +static void text_init (RecType recType) +{ +} + +static void text_destroy (RecType recType) { } @@ -93,32 +116,28 @@ void buf_close (struct buf_info *fi) static int text_extract (struct recExtractCtrl *p) { - char w[256]; + char w[512]; RecWord recWord; - int r, seqno = 1; + int r; struct buf_info *fi = buf_open (p); - (*p->init)(&recWord); - recWord.which = Word_String; + (*p->init)(p, &recWord); + recWord.reg_type = 'w'; do { int i = 0; r = buf_read (fi, w); - while (r > 0 && i < 255 && isalnum(w[i])) + while (r > 0 && i < 511 && w[i] != '\n' && w[i] != '\r') { i++; r = buf_read (fi, w + i); } if (i) { - int j; - for (j = 0; jadd)(&recWord); + recWord.string = w; + recWord.length = i; + (*p->addWord)(&recWord); } } while (r > 0); buf_close (fi); @@ -199,6 +218,7 @@ static int text_retrieve (struct recRetrieveCtrl *p) static struct recType text_type = { "text", text_init, + text_destroy, text_extract, text_retrieve };