X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fsgmlread.c;h=96a5450546ba109f70f6f59c3fe000c73f006806;hb=9b9f570a2960c2c8a7026b2faee943794b08ce49;hp=1bcce37dd3e2a64a76737a55e6c71899f0b7365f;hpb=e150e51a7e20a902e9fd2f11f00811f94f67d529;p=idzebra-moved-to-github.git diff --git a/recctrl/sgmlread.c b/recctrl/sgmlread.c index 1bcce37..96a5450 100644 --- a/recctrl/sgmlread.c +++ b/recctrl/sgmlread.c @@ -1,46 +1,30 @@ -/* - * Copyright (C) 1994-1999, Index Data - * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: sgmlread.c,v $ - * Revision 1.10 1999-11-30 13:48:04 adam - * Improved installation. Updated for inclusion of YAZ header files. - * - * Revision 1.9 1999/07/14 10:56:16 adam - * Filter handles multiple records in one file. - * - * Revision 1.8 1999/06/25 13:47:25 adam - * Minor change that prevents MSVC warning. - * - * Revision 1.7 1999/05/21 12:00:17 adam - * Better diagnostics for extraction process. - * - * Revision 1.6 1999/05/20 12:57:18 adam - * Implemented TCL filter. Updated recctrl system. - * - * Revision 1.5 1999/02/02 14:51:31 adam - * Updated WIN32 code specific sections. Changed header. - * - * Revision 1.4 1997/09/17 12:19:22 adam - * Zebra version corresponds to YAZ version 1.4. - * Changed Zebra server so that it doesn't depend on global common_resource. - * - * Revision 1.3 1997/09/04 13:54:41 adam - * Added MARC filter - type grs.marc. where syntax refers - * to abstract syntax. New method tellf in retrieve/extract method. - * - * Revision 1.2 1997/04/30 08:56:08 quinn - * null - * - * Revision 1.1 1996/10/11 10:57:32 adam - * New module recctrl. Used to manage records (extract/retrieval). - * - */ +/* $Id: sgmlread.c,v 1.17 2005-03-31 12:42:07 adam Exp $ + Copyright (C) 1995-2005 + Index Data ApS + +This file is part of the Zebra server. + +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 +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Zebra; see the file LICENSE.zebra. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +*/ + + #include #include -#include "grsread.h" +#include struct sgml_getc_info { char *buf; @@ -96,7 +80,7 @@ static data1_node *grs_read_sgml (struct grs_read_info *p) return node; } -static void *grs_init_sgml(void) +static void *grs_init_sgml(Res res, RecType recType) { struct sgml_getc_info *p = (struct sgml_getc_info *) xmalloc (sizeof(*p)); p->buf_size = 512; @@ -105,6 +89,11 @@ static void *grs_init_sgml(void) return p; } +static void grs_config_sgml(void *clientData, Res res, const char *args) +{ + +} + static void grs_destroy_sgml(void *clientData) { struct sgml_getc_info *p = (struct sgml_getc_info *) clientData; @@ -114,12 +103,35 @@ static void grs_destroy_sgml(void *clientData) xfree (p); } -static struct recTypeGrs sgml_type = { - "sgml", +static int grs_extract_sgml(void *clientData, struct recExtractCtrl *ctrl) +{ + return zebra_grs_extract(clientData, ctrl, grs_read_sgml); +} + +static int grs_retrieve_sgml(void *clientData, struct recRetrieveCtrl *ctrl) +{ + return zebra_grs_retrieve(clientData, ctrl, grs_read_sgml); +} + +static struct recType grs_type_sgml = +{ + 0, + "grs.sgml", grs_init_sgml, + grs_config_sgml, grs_destroy_sgml, - grs_read_sgml + grs_extract_sgml, + grs_retrieve_sgml }; -RecTypeGrs recTypeGrs_sgml = &sgml_type; +RecType +#ifdef IDZEBRA_STATIC_GRS_SGML +idzebra_filter_grs_sgml +#else +idzebra_filter +#endif +[] = { + &grs_type_sgml, + 0, +};