X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Frecctrl.h;h=f134e3ddec8b093483c5acd6677de30da9fbbad1;hb=a5a9ab496df5831c54837888292e7132b3172579;hp=3f345a95cae0201b56e1560571eeaceb3d57bc20;hpb=519fefb91135ad52134b9fc4e82b3874f5525a2b;p=idzebra-moved-to-github.git diff --git a/include/recctrl.h b/include/recctrl.h index 3f345a9..f134e3d 100644 --- a/include/recctrl.h +++ b/include/recctrl.h @@ -1,5 +1,5 @@ -/* $Id: recctrl.h,v 1.40 2002-10-22 12:51:08 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: recctrl.h,v 1.42 2004-09-27 10:44:48 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps This file is part of the Zebra server. @@ -28,6 +28,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include +#include #include #include @@ -55,7 +56,6 @@ struct recExtractCtrl { off_t (*tellf)(void *fh); /* tell function */ void (*endf)(void *fh, off_t offset); /* end of record position */ off_t offset; /* start offset */ - char *subType; void (*init)(struct recExtractCtrl *p, RecWord *w); void *clientData; void (*tokenAdd)(RecWord *w); @@ -79,11 +79,10 @@ struct recRetrieveCtrl { oid_value input_format; /* Preferred record syntax */ Z_RecordComposition *comp; /* formatting instructions */ char *encoding; /* preferred character encoding */ - int localno; /* local id of record */ + zint localno; /* local id of record */ int score; /* score 0-1000 or -1 if none */ int recordSize; /* size of record in bytes */ char *fname; /* name of file (or NULL if internal) */ - char *subType; data1_handle dh; /* response */ @@ -99,7 +98,8 @@ typedef struct recType *RecType; struct recType { char *name; /* Name of record type */ - void *(*init)(RecType recType); /* Init function - called once */ + void *(*init)(Res res, RecType recType); /* Init function - called once */ + void (*config)(void *clientData, Res res, const char *args); /* Config */ void (*destroy)(void *clientData); /* Destroy function */ int (*extract)(void *clientData, struct recExtractCtrl *ctrl); /* Extract proc */ @@ -112,14 +112,21 @@ struct recType #define RECCTRL_EXTRACT_ERROR_GENERIC 2 #define RECCTRL_EXTRACT_ERROR_NO_SUCH_FILTER 3 +typedef struct recTypeClass *RecTypeClass; typedef struct recTypes *RecTypes; -RecTypes recTypes_init (data1_handle dh); -void recTypes_destroy (RecTypes recTypes); -void recTypes_default_handlers (RecTypes recTypes); +RecTypeClass recTypeClass_create (Res res, NMEM nmem); +void recTypeClass_destroy(RecTypeClass rtc); +void recTypeClass_info(RecTypeClass rtc, void *cd, + void (*cb)(void *cd, const char *s)); + +RecTypes recTypes_init(RecTypeClass rtc, data1_handle dh); +void recTypes_destroy(RecTypes recTypes); +void recTypes_default_handlers(RecTypes recTypes, Res res); + +RecType recType_byName(RecTypes rts, Res res, const char *name, + void **clientDataP); -RecType recType_byName (RecTypes rts, const char *name, char *subType, - void **clientDataP); int grs_extract_tree(struct recExtractCtrl *p, data1_node *n);