-/* $Id: zebraapi.c,v 1.215 2006-05-03 09:31:26 marc Exp $
+/* $Id: zebraapi.c,v 1.216 2006-05-05 07:34:25 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
zh->path_root = res_get (zh->global_res, "root");
zh->nmem = nmem_create();
zh->record_classes = recTypeClass_create (zh->global_res, zh->nmem);
+
+ if (1)
+ {
+ const char *module_path = res_get(res, "modulePath");
+ if (module_path)
+ recTypeClass_load_modules(&zh->record_classes, zh->nmem,
+ module_path);
+ }
return zh;
}
return 0;
-/* $Id: recctrl.c,v 1.23 2006-04-26 11:12:31 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: recctrl.c,v 1.24 2006-05-05 07:34:26 adam Exp $
+ Copyright (C) 1995-2006
Index Data ApS
This file is part of the Zebra server.
static void recTypeClass_add (struct recTypeClass **rts, RecType *rt,
NMEM nmem, void *module_handle);
+
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
{
struct recTypeClass *rts = 0;
-#if HAVE_DLFCN_H
- const char *module_path = res_get_def(res, "modulePath",
- DEFAULT_MODULE_PATH);
-#endif
#ifdef IDZEBRA_STATIC_GRS_SGML
if (1)
recTypeClass_add (&rts, idzebra_filter_grs_sgml, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_TEXT
if (1)
{
recTypeClass_add (&rts, idzebra_filter_text, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_GRS_XML
#if HAVE_EXPAT_H
if (1)
}
#endif
#endif
+
#ifdef IDZEBRA_STATIC_GRS_REGX
if (1)
{
recTypeClass_add (&rts, idzebra_filter_grs_regx, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_GRS_MARC
if (1)
{
recTypeClass_add (&rts, idzebra_filter_grs_marc, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_GRS_CSV
if (1)
{
recTypeClass_add (&rts, idzebra_filter_grs_csv, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_GRS_DANBIB
if (1)
{
recTypeClass_add (&rts, idzebra_filter_grs_danbib, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_SAFARI
if (1)
{
recTypeClass_add (&rts, idzebra_filter_safari, nmem, 0);
}
#endif
+
#ifdef IDZEBRA_STATIC_ALVIS
#if HAVE_XSLT
if (1)
}
#endif
#endif
+
#ifdef IDZEBRA_STATIC_XSLT
#if HAVE_XSLT
if (1)
}
#endif
#endif
+ return rts;
+}
+void recTypeClass_load_modules(RecTypeClass *rts, NMEM nmem,
+ const char *module_path)
+{
#if HAVE_DLFCN_H
if (module_path)
{
if (mod_p && (fl = dlsym(mod_p, "idzebra_filter")))
{
yaz_log(YLOG_LOG, "Loaded filter module %s", fname);
- recTypeClass_add(&rts, fl, nmem, mod_p);
+ recTypeClass_add(rts, fl, nmem, mod_p);
}
else if (mod_p)
{
}
}
#endif
- return rts;
}
-static void recTypeClass_add (struct recTypeClass **rts, RecType *rt,
- NMEM nmem, void *module_handle)
+static void recTypeClass_add(struct recTypeClass **rts, RecType *rt,
+ NMEM nmem, void *module_handle)
{
while (*rt)
{