to signal success/failure.
-/* $Id: recctrl.h,v 1.14 2005-08-22 08:19:51 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: recctrl.h,v 1.15 2006-04-26 11:12:31 adam Exp $
+ Copyright (C) 1995-2006
Index Data ApS
This file is part of the Zebra server.
02111-1307, USA.
*/
-#ifndef RECCTRL_H
-#define RECCTRL_H
+#ifndef IDZEBRA_RECCTRL_H
+#define IDZEBRA_RECCTRL_H
#include <sys/types.h>
#include <yaz/proto.h>
int version;
char *name; /* Name of record type */
void *(*init)(Res res, RecType recType); /* Init function - called once */
- void (*config)(void *clientData, Res res, const char *args); /* Config */
+ ZEBRA_RES (*config)(void *clientData, Res res, const char *args); /* Config */
void (*destroy)(void *clientData); /* Destroy function */
int (*extract)(void *clientData,
struct recExtractCtrl *ctrl); /* Extract proc */
-/* $Id: alvis.c,v 1.8 2005-08-24 08:30:37 adam Exp $
+/* $Id: alvis.c,v 1.9 2006-04-26 11:12:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return 0;
}
-static void filter_config(void *clientData, Res res, const char *args)
+static ZEBRA_RES filter_config(void *clientData, Res res, const char *args)
{
struct filter_info *tinfo = clientData;
if (!args || !*args)
- args = "xsltfilter.xml";
+ return ZEBRA_FAIL;
if (tinfo->fname && !strcmp(args, tinfo->fname))
- return;
+ return ZEBRA_OK;
destroy_schemas(tinfo);
create_schemas(tinfo, args);
+ return ZEBRA_OK;
}
static void filter_destroy(void *clientData)
-/* $Id: csvread.c,v 1.3 2005-12-06 15:36:38 adam Exp $
+/* $Id: csvread.c,v 1.4 2006-04-26 11:12:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
};
-static void grs_config_csv(void *clientData, Res res, const char *args)
+static ZEBRA_RES grs_config_csv(void *clientData, Res res, const char *args)
{
int i;
struct csv_t *csvp = (struct csv_t*) clientData;
/* csvp->field_names = 0; */ /*nmem_strdup(csvp->nmem, "a|b|c|d|e");*/
csvp->field_name
- = nmem_malloc(csvp->nmem,
- sizeof(*(csvp->field_name)) * csvp->max_nr_fields);
+ = nmem_malloc(csvp->nmem,
+ sizeof(*(csvp->field_name)) * csvp->max_nr_fields);
for (i = 0; i < csvp->max_nr_fields; i++){
csvp->field_name[i] = 0;
}
*/
yaz_log (YLOG_LOG, "Ended CSV filter grs_config_csv");
+ return ZEBRA_OK;
}
-/* $Id: marcread.c,v 1.32 2005-12-08 11:06:49 adam Exp $
+/* $Id: marcread.c,v 1.33 2006-04-26 11:12:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return p;
}
-static void config_marc(void *clientData, Res res, const char *args)
+static ZEBRA_RES config_marc(void *clientData, Res res, const char *args)
{
struct marc_info *p = (struct marc_info*) clientData;
if (strlen(args) < sizeof(p->type))
strcpy(p->type, args);
+ return ZEBRA_OK;
}
static void destroy_marc(void *clientData)
-/* $Id: recctrl.c,v 1.22 2005-12-05 12:18:41 marc Exp $
+/* $Id: recctrl.c,v 1.23 2006-04-26 11:12:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
slen++; /* skip . */
if (rti->recType->config)
- (*(rti->recType)->config)(rti->clientData, res, name+slen);
+ {
+ if ((*(rti->recType)->config)
+ (rti->clientData, res, name+slen) != ZEBRA_OK)
+ return 0;
+ }
return rti->recType;
}
}
-/* $Id: rectext.c,v 1.29 2005-06-23 06:45:47 adam Exp $
+/* $Id: rectext.c,v 1.30 2006-04-26 11:12:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return tinfo;
}
-static void filter_config(void *clientData, Res res, const char *args)
+static ZEBRA_RES filter_config(void *clientData, Res res, const char *args)
{
struct filter_info *tinfo = (struct filter_info*) clientData;
xfree(tinfo->sep);
tinfo->sep = 0;
if (args && *args)
tinfo->sep = xstrdup(args);
+ return ZEBRA_OK;
}
static void filter_destroy (void *clientData)
-/* $Id: regxread.c,v 1.59 2005-03-31 12:42:07 adam Exp $
+/* $Id: regxread.c,v 1.60 2006-04-26 11:12:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
}
-void grs_config(void *clientData, Res res, const char *args)
+ZEBRA_RES grs_config(void *clientData, Res res, const char *args)
{
struct lexSpecs *specs = (struct lexSpecs *) clientData;
if (strlen(args) < sizeof(specs->type))
strcpy(specs->type, args);
+ return ZEBRA_OK;
}
data1_node *grs_read_regx (struct grs_read_info *p)
-/* $Id: safari.c,v 1.10 2006-03-21 14:36:22 adam Exp $
+/* $Id: safari.c,v 1.11 2006-04-26 11:12:32 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return tinfo;
}
-static void filter_config(void *clientData, Res res, const char *args)
+static ZEBRA_RES filter_config(void *clientData, Res res, const char *args)
{
-
+ return ZEBRA_OK;
}
static void filter_destroy(void *clientData)
-/* $Id: sgmlread.c,v 1.18 2005-11-16 04:33:22 adam Exp $
+/* $Id: sgmlread.c,v 1.19 2006-04-26 11:12:32 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return p;
}
-static void grs_config_sgml(void *clientData, Res res, const char *args)
+static ZEBRA_RES grs_config_sgml(void *clientData, Res res, const char *args)
{
-
+ return ZEBRA_OK;
}
static void grs_destroy_sgml(void *clientData)
-/* $Id: xslt.c,v 1.17 2005-08-24 08:30:37 adam Exp $
+/* $Id: xslt.c,v 1.18 2006-04-26 11:12:32 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return 0;
}
-static void filter_config(void *clientData, Res res, const char *args)
+static ZEBRA_RES filter_config(void *clientData, Res res, const char *args)
{
struct filter_info *tinfo = clientData;
if (!args || !*args)
- args = "xsltfilter.xml";
+ return ZEBRA_FAIL;
if (tinfo->fname && !strcmp(args, tinfo->fname))
- return;
+ return ZEBRA_OK;
destroy_schemas(tinfo);
create_schemas(tinfo, args);
+ return ZEBRA_OK;
}
static void filter_destroy(void *clientData)