IDZEBRA  2.1.2
Data Structures | Macros | Functions
d1_absyn.c File Reference
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <yaz/log.h>
#include <yaz/oid_db.h>
#include <idzebra/data1.h>
#include <idzebra/recctrl.h>
#include <zebra_xpath.h>
#include <d1_absyn.h>

Go to the source code of this file.

Data Structures

struct  data1_hash_table
 
struct  data1_hash_entry
 
struct  data1_systag
 
struct  data1_absyn_cache_info
 
struct  data1_attset_cache_info
 

Macros

#define D1_MAX_NESTING   128
 
#define DATA1_GETELEMENTBYTAGNAME_VERSION   1
 
#define l_isspace(c)   ((c) == '\t' || (c) == ' ' || (c) == '\n' || (c) == '\r')
 

Functions

unsigned data1_hash_calc (struct data1_hash_table *ht, const char *str)
 
struct data1_hash_tabledata1_hash_open (int size, NMEM nmem)
 
void data1_hash_insert (struct data1_hash_table *ht, const char *str, void *clientData, int copy)
 
void * data1_hash_lookup (struct data1_hash_table *ht, const char *str)
 
data1_elementdata1_mk_element (data1_handle dh)
 
data1_absyndata1_absyn_search (data1_handle dh, const char *name)
 
void data1_absyn_destroy (data1_handle dh)
 
void data1_absyn_trav (data1_handle dh, void *handle, void(*fh)(data1_handle dh, void *h, data1_absyn *a))
 
static data1_absyndata1_read_absyn (data1_handle dh, const char *file, enum DATA1_XPATH_INDEXING en)
 
static data1_absyndata1_absyn_add (data1_handle dh, const char *name, enum DATA1_XPATH_INDEXING en)
 
data1_absyndata1_get_absyn (data1_handle dh, const char *name, enum DATA1_XPATH_INDEXING en)
 
data1_attsetdata1_attset_search_name (data1_handle dh, const char *name)
 
data1_attsetdata1_attset_search_id (data1_handle dh, const Odr_oid *oid)
 
data1_attsetdata1_attset_add (data1_handle dh, const char *name)
 
data1_attsetdata1_get_attset (data1_handle dh, const char *name)
 
data1_esetnamedata1_getesetbyname (data1_handle dh, data1_absyn *a, const char *name)
 
data1_elementdata1_getelementbytagname (data1_handle dh, data1_absyn *abs, data1_element *parent, const char *tagname)
 
data1_elementdata1_getelementbyname (data1_handle dh, data1_absyn *absyn, const char *name)
 
void fix_element_ref (data1_handle dh, data1_absyn *absyn, data1_element *e)
 
static const char * mk_xpath_regexp (data1_handle dh, const char *expr)
 
static int parse_termlists (data1_handle dh, data1_termlist ***tpp, char *cp, const char *file, int lineno, const char *element_name, data1_absyn *res, int xpelement, data1_attset *attset)
 
static int melm2xpath (char *melm, char *buf)
 
const char * data1_systag_lookup (data1_absyn *absyn, const char *tag, const char *default_value)
 
int read_absyn_line (FILE *f, int *lineno, char *line, int len, char *argv[], int num)
 
data1_marctabdata1_absyn_getmarctab (data1_handle dh, data1_node *root)
 
data1_elementdata1_absyn_getelements (data1_handle dh, data1_node *root)
 

Macro Definition Documentation

#define D1_MAX_NESTING   128

Definition at line 35 of file d1_absyn.c.

Referenced by data1_read_absyn().

#define DATA1_GETELEMENTBYTAGNAME_VERSION   1

Definition at line 309 of file d1_absyn.c.

#define l_isspace (   c)    ((c) == '\t' || (c) == ' ' || (c) == '\n' || (c) == '\r')

Definition at line 621 of file d1_absyn.c.

Referenced by read_absyn_line().

Function Documentation

static data1_absyn* data1_absyn_add ( data1_handle  dh,
const char *  name,
enum DATA1_XPATH_INDEXING  en 
)
static
void data1_absyn_destroy ( data1_handle  dh)
data1_element* data1_absyn_getelements ( data1_handle  dh,
data1_node root 
)

Definition at line 669 of file d1_absyn.c.

References data1_node::root, and data1_node::u.

Referenced by grs_read_marc(), and grs_read_marcxml().

data1_marctab* data1_absyn_getmarctab ( data1_handle  dh,
data1_node root 
)

Definition at line 662 of file d1_absyn.c.

References data1_node::root, and data1_node::u.

Referenced by grs_read_iso2709(), and parse_data1_tree().

data1_absyn* data1_absyn_search ( data1_handle  dh,
const char *  name 
)
void data1_absyn_trav ( data1_handle  dh,
void *  handle,
void(*)(data1_handle dh, void *h, data1_absyn *a)  fh 
)
data1_attset* data1_attset_add ( data1_handle  dh,
const char *  name 
)
data1_attset* data1_attset_search_id ( data1_handle  dh,
const Odr_oid *  oid 
)
data1_attset* data1_attset_search_name ( data1_handle  dh,
const char *  name 
)
data1_absyn* data1_get_absyn ( data1_handle  dh,
const char *  name,
enum DATA1_XPATH_INDEXING  en 
)
data1_attset* data1_get_attset ( data1_handle  dh,
const char *  name 
)

Definition at line 288 of file d1_absyn.c.

References data1_attset_add(), and data1_attset_search_name().

Referenced by att_loadset(), data1_read_absyn(), and data1_read_attset().

data1_element* data1_getelementbyname ( data1_handle  dh,
data1_absyn absyn,
const char *  name 
)
data1_element* data1_getelementbytagname ( data1_handle  dh,
data1_absyn abs,
data1_element parent,
const char *  tagname 
)
data1_esetname* data1_getesetbyname ( data1_handle  dh,
data1_absyn a,
const char *  name 
)

Definition at line 297 of file d1_absyn.c.

References data1_matchstr, data1_absyn::esetnames, data1_esetname::name, and data1_esetname::next.

Referenced by process_comp().

unsigned data1_hash_calc ( struct data1_hash_table ht,
const char *  str 
)

Definition at line 49 of file d1_absyn.c.

References data1_hash_table::size.

Referenced by data1_hash_insert(), and data1_hash_lookup().

void data1_hash_insert ( struct data1_hash_table ht,
const char *  str,
void *  clientData,
int  copy 
)
void* data1_hash_lookup ( struct data1_hash_table ht,
const char *  str 
)
struct data1_hash_table* data1_hash_open ( int  size,
NMEM  nmem 
)
data1_element* data1_mk_element ( data1_handle  dh)
static data1_absyn * data1_read_absyn ( data1_handle  dh,
const char *  file,
enum DATA1_XPATH_INDEXING  en 
)
static

Definition at line 677 of file d1_absyn.c.

References data1_attset_child::child, data1_attset::children, data1_element::children, D1_MAX_NESTING, data1_empty_attset(), data1_get_attset(), data1_gettagbynum(), data1_mk_element(), data1_nmem_get(), data1_path_fopen(), data1_read_espec1(), data1_read_maptab(), data1_read_marctab(), data1_read_tagset(), data1_read_varset(), DATA1_XPATH_INDEXING_DISABLE, DATA1_XPATH_INDEXING_ENABLE, DATA1K_string, DATA1T_string, dfa_delete(), dfa_init(), dfa_mkstate(), dfa_parse(), data1_sub_elements::elements, data1_absyn::encoding, data1_absyn::esetnames, fix_element_ref(), data1_tag::kind, data1_absyn::main_elements, data1_absyn::maptabs, data1_absyn::marc, data1_xpelement::match_next, melm2xpath(), mk_xpath_regexp(), data1_absyn::name, data1_name::name, data1_systag::name, data1_esetname::name, data1_element::name, data1_sub_elements::name, data1_tag::names, data1_xpelement::next, data1_attset_child::next, data1_attset::next, data1_maptab::next, data1_name::next, data1_systag::next, data1_marctab::next, data1_esetname::next, data1_tag::next, data1_tagset::next, data1_element::next, data1_sub_elements::next, data1_absyn::oid, parse_termlists(), read_absyn_line(), data1_xpelement::regexp, data1_tag::string, data1_absyn::sub_elements, data1_element::sub_name, data1_absyn::systags, data1_element::tag, data1_absyn::tagset, data1_tag::tagset, data1_element::termlists, data1_systag::value, data1_tag::value, data1_absyn::varset, data1_tag::which, data1_absyn::xp_elements, data1_absyn::xpath_indexing, XPATH_STEP_COUNT, and zebra_parse_xpath_str().

Referenced by data1_absyn_add(), and data1_absyn_trav().

const char* data1_systag_lookup ( data1_absyn absyn,
const char *  tag,
const char *  default_value 
)
void fix_element_ref ( data1_handle  dh,
data1_absyn absyn,
data1_element e 
)
static int melm2xpath ( char *  melm,
char *  buf 
)
static

Definition at line 587 of file d1_absyn.c.

Referenced by data1_read_absyn().

static const char* mk_xpath_regexp ( data1_handle  dh,
const char *  expr 
)
static

Definition at line 422 of file d1_absyn.c.

References data1_nmem_get().

Referenced by data1_read_absyn().

static int parse_termlists ( data1_handle  dh,
data1_termlist ***  tpp,
char *  cp,
const char *  file,
int  lineno,
const char *  element_name,
data1_absyn res,
int  xpelement,
data1_attset attset 
)
static

Definition at line 492 of file d1_absyn.c.

References data1_getattbyname(), data1_nmem_get(), data1_termlist::next, and ZEBRA_XPATH_CDATA.

Referenced by data1_read_absyn().

int read_absyn_line ( FILE *  f,
int *  lineno,
char *  line,
int  len,
char *  argv[],
int  num 
)

Definition at line 623 of file d1_absyn.c.

References l_isspace.

Referenced by data1_read_absyn().