IDZEBRA  2.1.2
Data Structures | Macros | Functions | Variables
mod_alvis.c File Reference
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <yaz/diagbib1.h>
#include <yaz/tpath.h>
#include <yaz/oid_db.h>
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlIO.h>
#include <libxml/xmlreader.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
#include <idzebra/util.h>
#include <idzebra/recctrl.h>

Go to the source code of this file.

Data Structures

struct  filter_schema
 
struct  filter_info
 

Macros

#define ZEBRA_SCHEMA_XSLT_NS   "http://indexdata.dk/zebra/xslt/1"
 
#define XML_STRCMP(a, b)   strcmp((char*)a, b)
 
#define XML_STRLEN(a)   strlen((char*)a)
 
#define ENABLE_INPUT_CALLBACK   0
 

Functions

static void set_param_str (const char **params, const char *name, const char *value, ODR odr)
 
static void set_param_int (const char **params, const char *name, zint value, ODR odr)
 
static void * filter_init (Res res, RecType recType)
 
static int attr_content (struct _xmlAttr *attr, const char *name, const char **dst_content)
 
static void destroy_schemas (struct filter_info *tinfo)
 
static ZEBRA_RES create_schemas (struct filter_info *tinfo, const char *fname)
 
static struct filter_schemalookup_schema (struct filter_info *tinfo, const char *est)
 
static ZEBRA_RES filter_config (void *clientData, Res res, const char *args)
 
static void filter_destroy (void *clientData)
 
static int ioread_ex (void *context, char *buffer, int len)
 
static int ioclose_ex (void *context)
 
static void index_cdata (struct filter_info *tinfo, struct recExtractCtrl *ctrl, xmlNodePtr ptr, RecWord *recWord)
 
static void index_node (struct filter_info *tinfo, struct recExtractCtrl *ctrl, xmlNodePtr ptr, RecWord *recWord)
 
static void index_record (struct filter_info *tinfo, struct recExtractCtrl *ctrl, xmlNodePtr ptr, RecWord *recWord)
 
static int extract_doc (struct filter_info *tinfo, struct recExtractCtrl *p, xmlDocPtr doc)
 
static int extract_split (struct filter_info *tinfo, struct recExtractCtrl *p)
 
static int extract_full (struct filter_info *tinfo, struct recExtractCtrl *p)
 
static int filter_extract (void *clientData, struct recExtractCtrl *p)
 
static int ioread_ret (void *context, char *buffer, int len)
 
static int ioclose_ret (void *context)
 
static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p)
 

Variables

static const char * zebra_xslt_ns = ZEBRA_SCHEMA_XSLT_NS
 
static struct recType filter_type
 
RecType idzebra_filter []
 

Macro Definition Documentation

#define ENABLE_INPUT_CALLBACK   0

Definition at line 99 of file mod_alvis.c.

#define XML_STRCMP (   a,
 
)    strcmp((char*)a, b)

Definition at line 70 of file mod_alvis.c.

Referenced by attr_content(), create_schemas(), index_node(), and index_record().

#define XML_STRLEN (   a)    strlen((char*)a)

Definition at line 71 of file mod_alvis.c.

Referenced by index_cdata().

#define ZEBRA_SCHEMA_XSLT_NS   "http://indexdata.dk/zebra/xslt/1"

Definition at line 68 of file mod_alvis.c.

Function Documentation

static int attr_content ( struct _xmlAttr *  attr,
const char *  name,
const char **  dst_content 
)
static

Definition at line 151 of file mod_alvis.c.

References XML_STRCMP.

Referenced by create_schemas(), index_node(), and index_record().

static ZEBRA_RES create_schemas ( struct filter_info tinfo,
const char *  fname 
)
static
static void destroy_schemas ( struct filter_info tinfo)
static
static int extract_doc ( struct filter_info tinfo,
struct recExtractCtrl p,
xmlDocPtr  doc 
)
static
static int extract_full ( struct filter_info tinfo,
struct recExtractCtrl p 
)
static
static int extract_split ( struct filter_info tinfo,
struct recExtractCtrl p 
)
static
static ZEBRA_RES filter_config ( void *  clientData,
Res  res,
const char *  args 
)
static
static void filter_destroy ( void *  clientData)
static
static int filter_extract ( void *  clientData,
struct recExtractCtrl p 
)
static
static void* filter_init ( Res  res,
RecType  recType 
)
static
static int filter_retrieve ( void *  clientData,
struct recRetrieveCtrl p 
)
static
static void index_cdata ( struct filter_info tinfo,
struct recExtractCtrl ctrl,
xmlNodePtr  ptr,
RecWord recWord 
)
static

Definition at line 354 of file mod_alvis.c.

References RecWord::term_buf, RecWord::term_len, recExtractCtrl::tokenAdd, and XML_STRLEN.

Referenced by index_node().

static void index_node ( struct filter_info tinfo,
struct recExtractCtrl ctrl,
xmlNodePtr  ptr,
RecWord recWord 
)
static
static void index_record ( struct filter_info tinfo,
struct recExtractCtrl ctrl,
xmlNodePtr  ptr,
RecWord recWord 
)
static
static int ioclose_ex ( void *  context)
static

Definition at line 349 of file mod_alvis.c.

Referenced by extract_full(), and extract_split().

static int ioclose_ret ( void *  context)
static

Definition at line 579 of file mod_alvis.c.

Referenced by filter_retrieve().

static int ioread_ex ( void *  context,
char *  buffer,
int  len 
)
static

Definition at line 343 of file mod_alvis.c.

References ZebraRecStream::readf, and recExtractCtrl::stream.

Referenced by extract_full(), and extract_split().

static int ioread_ret ( void *  context,
char *  buffer,
int  len 
)
static

Definition at line 573 of file mod_alvis.c.

References ZebraRecStream::readf, and recRetrieveCtrl::stream.

Referenced by filter_retrieve().

static struct filter_schema* lookup_schema ( struct filter_info tinfo,
const char *  est 
)
static
static void set_param_int ( const char **  params,
const char *  name,
zint  value,
ODR  odr 
)
static

Definition at line 87 of file mod_alvis.c.

References filter_schema::name, and ZINT_FORMAT.

Referenced by filter_retrieve().

static void set_param_str ( const char **  params,
const char *  name,
const char *  value,
ODR  odr 
)
static

Definition at line 75 of file mod_alvis.c.

References filter_schema::name.

Referenced by extract_doc(), and filter_retrieve().

Variable Documentation

struct recType filter_type
static
Initial value:
= {
0,
"alvis",
}
static void * filter_init(Res res, RecType recType)
Definition: mod_alvis.c:124
static void filter_destroy(void *clientData)
Definition: mod_alvis.c:332
static int filter_extract(void *clientData, struct recExtractCtrl *p)
Definition: mod_alvis.c:562
static ZEBRA_RES filter_config(void *clientData, Res res, const char *args)
Definition: mod_alvis.c:313

Definition at line 704 of file mod_alvis.c.

RecType idzebra_filter[]
Initial value:
= {
0,
}
static struct recType filter_type
Definition: mod_alvis.c:704

Definition at line 721 of file mod_alvis.c.

const char* zebra_xslt_ns = ZEBRA_SCHEMA_XSLT_NS
static

Definition at line 73 of file mod_alvis.c.

Referenced by extract_doc(), index_node(), and index_record().