projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Read-only sets uses common no write handler
[idzebra-moved-to-github.git]
/
index
/
recctrl.c
diff --git
a/index/recctrl.c
b/index/recctrl.c
index
de2e8fc
..
873f9af
100644
(file)
--- a/
index/recctrl.c
+++ b/
index/recctrl.c
@@
-1,8
+1,5
@@
-/* $Id: recctrl.c,v 1.6 2007-02-07 12:08:54 adam Exp $
- Copyright (C) 1995-2007
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 2004-2013 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-21,6
+18,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@@
-58,7
+58,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
{
struct recTypeClass *rts = 0;
{
struct recTypeClass *rts = 0;
-#ifdef IDZEBRA_STATIC_GRS_SGML
+#if IDZEBRA_STATIC_GRS_SGML
if (1)
{
extern RecType idzebra_filter_grs_sgml[];
if (1)
{
extern RecType idzebra_filter_grs_sgml[];
@@
-66,7
+66,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
}
#endif
}
#endif
-#ifdef IDZEBRA_STATIC_TEXT
+#if IDZEBRA_STATIC_TEXT
if (1)
{
extern RecType idzebra_filter_text[];
if (1)
{
extern RecType idzebra_filter_text[];
@@
-74,7
+74,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
}
#endif
}
#endif
-#ifdef IDZEBRA_STATIC_GRS_XML
+#if IDZEBRA_STATIC_GRS_XML
#if HAVE_EXPAT_H
if (1)
{
#if HAVE_EXPAT_H
if (1)
{
@@
-84,7
+84,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
#endif
#endif
#endif
#endif
-#ifdef IDZEBRA_STATIC_GRS_REGX
+#if IDZEBRA_STATIC_GRS_REGX
if (1)
{
extern RecType idzebra_filter_grs_regx[];
if (1)
{
extern RecType idzebra_filter_grs_regx[];
@@
-92,7
+92,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
}
#endif
}
#endif
-#ifdef IDZEBRA_STATIC_GRS_MARC
+#if IDZEBRA_STATIC_GRS_MARC
if (1)
{
extern RecType idzebra_filter_grs_marc[];
if (1)
{
extern RecType idzebra_filter_grs_marc[];
@@
-100,7
+100,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
}
#endif
}
#endif
-#ifdef IDZEBRA_STATIC_SAFARI
+#if IDZEBRA_STATIC_SAFARI
if (1)
{
extern RecType idzebra_filter_safari[];
if (1)
{
extern RecType idzebra_filter_safari[];
@@
-108,7
+108,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
}
#endif
}
#endif
-#ifdef IDZEBRA_STATIC_ALVIS
+#if IDZEBRA_STATIC_ALVIS
if (1)
{
extern RecType idzebra_filter_alvis[];
if (1)
{
extern RecType idzebra_filter_alvis[];
@@
-116,7
+116,7
@@
RecTypeClass recTypeClass_create (Res res, NMEM nmem)
}
#endif
}
#endif
-#ifdef IDZEBRA_STATIC_DOM
+#if IDZEBRA_STATIC_DOM
if (1)
{
extern RecType idzebra_filter_dom[];
if (1)
{
extern RecType idzebra_filter_dom[];
@@
-134,7
+134,7
@@
static void load_from_dir(RecTypeClass *rts, NMEM nmem, const char *dirname)
if (dir)
{
struct dirent *de;
if (dir)
{
struct dirent *de;
-
+
while ((de = readdir(dir)))
{
size_t dlen = strlen(de->d_name);
while ((de = readdir(dir)))
{
size_t dlen = strlen(de->d_name);
@@
-165,7
+165,7
@@
static void load_from_dir(RecTypeClass *rts, NMEM nmem, const char *dirname)
const char *err = dlerror();
yaz_log(YLOG_WARN, "dlopen failed %s %s",
fname, err ? err : "none");
const char *err = dlerror();
yaz_log(YLOG_WARN, "dlopen failed %s %s",
fname, err ? err : "none");
-
+
}
}
}
}
}
}
@@
-182,11
+182,11
@@
void recTypeClass_load_modules(RecTypeClass *rts, NMEM nmem,
const char *comp_ptr;
char comp[FILENAME_MAX+1];
size_t len;
const char *comp_ptr;
char comp[FILENAME_MAX+1];
size_t len;
-
+
len = yaz_filepath_comp(&module_path, &comp_ptr);
if (!len || len >= FILENAME_MAX)
break;
len = yaz_filepath_comp(&module_path, &comp_ptr);
if (!len || len >= FILENAME_MAX)
break;
-
+
memcpy(comp, comp_ptr, len);
comp[len] = '\0';
memcpy(comp, comp_ptr, len);
comp[len] = '\0';
@@
-201,7
+201,7
@@
static void recTypeClass_add(struct recTypeClass **rts, RecType *rt,
{
struct recTypeClass *r = (struct recTypeClass *)
nmem_malloc (nmem, sizeof(*r));
{
struct recTypeClass *r = (struct recTypeClass *)
nmem_malloc (nmem, sizeof(*r));
-
+
r->next = *rts;
*rts = r;
r->next = *rts;
*rts = r;
@@
-236,7
+236,7
@@
RecTypes recTypes_init(RecTypeClass rtc, data1_handle dh)
RecTypes rts = (RecTypes) nmem_malloc(data1_nmem_get(dh), sizeof(*rts));
struct recTypeInstance **rti = &rts->entries;
RecTypes rts = (RecTypes) nmem_malloc(data1_nmem_get(dh), sizeof(*rts));
struct recTypeInstance **rti = &rts->entries;
-
+
rts->dh = dh;
for (; rtc; rtc = rtc->next)
rts->dh = dh;
for (; rtc; rtc = rtc->next)
@@
-297,6
+297,7
@@
RecType recType_byName (RecTypes rts, Res res, const char *name,
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab