-/* $Id: recctrl.h,v 1.39 2002-08-28 12:47:10 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.
#include <yaz/proto.h>
#include <yaz/oid.h>
#include <yaz/odr.h>
-#include <yaz/data1.h>
+#include <idzebra/res.h>
+#include <data1.h>
#include <zebramap.h>
#ifdef __cplusplus
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);
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 */
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 */
#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);