IDZEBRA  2.1.2
Functions
d1_read.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <yaz/yaz-util.h>
#include <d1_absyn.h>

Go to the source code of this file.

Functions

data1_nodedata1_get_root_tag (data1_handle dh, data1_node *n)
 
data1_nodeget_parent_tag (data1_handle dh, data1_node *n)
 
data1_nodedata1_mk_node (data1_handle dh, NMEM m)
 
data1_nodedata1_mk_node_type (data1_handle dh, NMEM m, int type)
 
static void data1_init_node (data1_handle dh, data1_node *r, int type)
 
data1_nodedata1_append_node (data1_handle dh, NMEM m, int type, data1_node *parent)
 
data1_nodedata1_mk_node2 (data1_handle dh, NMEM m, int type, data1_node *parent)
 
data1_nodedata1_insert_node (data1_handle dh, NMEM m, int type, data1_node *parent)
 
data1_nodedata1_mk_root (data1_handle dh, NMEM nmem, const char *name)
 
void data1_set_root (data1_handle dh, data1_node *res, NMEM nmem, const char *name)
 
void data1_add_attrs (data1_handle dh, NMEM nmem, const char **attr, data1_xattr **p)
 
data1_nodedata1_mk_preprocess (data1_handle dh, NMEM nmem, const char *target, const char **attr, data1_node *at)
 
data1_nodedata1_mk_preprocess_n (data1_handle dh, NMEM nmem, const char *target, size_t len, const char **attr, data1_node *at)
 
data1_nodedata1_insert_preprocess (data1_handle dh, NMEM nmem, const char *target, const char **attr, data1_node *at)
 
data1_nodedata1_insert_preprocess_n (data1_handle dh, NMEM nmem, const char *target, size_t len, const char **attr, data1_node *at)
 
data1_nodedata1_mk_tag_n (data1_handle dh, NMEM nmem, const char *tag, size_t len, const char **attr, data1_node *at)
 
void data1_tag_add_attr (data1_handle dh, NMEM nmem, data1_node *res, const char **attr)
 
data1_nodedata1_mk_tag (data1_handle dh, NMEM nmem, const char *tag, const char **attr, data1_node *at)
 
data1_nodedata1_search_tag (data1_handle dh, data1_node *n, const char *tag)
 
data1_nodedata1_mk_tag_uni (data1_handle dh, NMEM nmem, const char *tag, data1_node *at)
 
data1_nodedata1_mk_text_n (data1_handle dh, NMEM mem, const char *buf, size_t len, data1_node *parent)
 
data1_nodedata1_mk_text_nf (data1_handle dh, NMEM mem, const char *buf, size_t len, data1_node *parent)
 
data1_nodedata1_mk_text (data1_handle dh, NMEM mem, const char *buf, data1_node *parent)
 
data1_nodedata1_mk_comment_n (data1_handle dh, NMEM mem, const char *buf, size_t len, data1_node *parent)
 
data1_nodedata1_mk_comment (data1_handle dh, NMEM mem, const char *buf, data1_node *parent)
 
char * data1_insert_string_n (data1_handle dh, data1_node *res, NMEM m, const char *str, size_t len)
 
char * data1_insert_string (data1_handle dh, data1_node *res, NMEM m, const char *str)
 
static data1_nodedata1_add_insert_taggeddata (data1_handle dh, data1_node *at, const char *tagname, NMEM m, int local_allowed, int insert_mode)
 
data1_nodedata1_mk_tag_data (data1_handle dh, data1_node *at, const char *tagname, NMEM m)
 
data1_nodedata1_mk_tag_data_wd (data1_handle dh, data1_node *at, const char *tagname, NMEM m)
 
data1_nodedata1_insert_taggeddata (data1_handle dh, data1_node *root, data1_node *at, const char *tagname, NMEM m)
 
data1_nodedata1_add_taggeddata (data1_handle dh, data1_node *root, data1_node *at, const char *tagname, NMEM m)
 
data1_nodedata1_mk_tag_data_zint (data1_handle dh, data1_node *at, const char *tag, zint num, NMEM nmem)
 
data1_nodedata1_mk_tag_data_int (data1_handle dh, data1_node *at, const char *tag, int num, NMEM nmem)
 
data1_nodedata1_mk_tag_data_oid (data1_handle dh, data1_node *at, const char *tag, Odr_oid *oid, NMEM nmem)
 
data1_nodedata1_mk_tag_data_text (data1_handle dh, data1_node *at, const char *tag, const char *str, NMEM nmem)
 
data1_nodedata1_mk_tag_data_text_uni (data1_handle dh, data1_node *at, const char *tag, const char *str, NMEM nmem)
 
static int ampr (int(*get_byte)(void *fh), void *fh, int *amp)
 
data1_xattrdata1_read_xattr (data1_handle dh, NMEM m, int(*get_byte)(void *fh), void *fh, WRBUF wrbuf, int *ch, int *amp)
 
data1_nodedata1_read_nodex (data1_handle dh, NMEM m, int(*get_byte)(void *fh), void *fh, WRBUF wrbuf)
 
int getc_mem (void *fh)
 
data1_nodedata1_read_node (data1_handle dh, const char **buf, NMEM m)
 
data1_nodedata1_read_record (data1_handle dh, int(*rf)(void *, char *, size_t), void *fh, NMEM m)
 
data1_nodedata1_read_sgml (data1_handle dh, NMEM m, const char *buf)
 
static int conv_item (NMEM m, yaz_iconv_t t, WRBUF wrbuf, char *inbuf, size_t inlen)
 
static void data1_iconv_s (data1_handle dh, NMEM m, data1_node *n, yaz_iconv_t t, WRBUF wrbuf, const char *tocode)
 
const char * data1_get_encoding (data1_handle dh, data1_node *n)
 
int data1_iconv (data1_handle dh, NMEM m, data1_node *n, const char *tocode, const char *fromcode)
 
void data1_chop_text (data1_handle dh, NMEM m, data1_node *n)
 
void data1_concat_text (data1_handle dh, NMEM m, data1_node *n)
 

Function Documentation

static int ampr ( int(*)(void *fh)  get_byte,
void *  fh,
int *  amp 
)
static

Definition at line 541 of file d1_read.c.

References d1_isspace, and ent.

Referenced by data1_read_nodex(), and data1_read_xattr().

static int conv_item ( NMEM  m,
yaz_iconv_t  t,
WRBUF  wrbuf,
char *  inbuf,
size_t  inlen 
)
static

Definition at line 1007 of file d1_read.c.

Referenced by data1_iconv_s().

void data1_add_attrs ( data1_handle  dh,
NMEM  nmem,
const char **  attr,
data1_xattr **  p 
)
static data1_node* data1_add_insert_taggeddata ( data1_handle  dh,
data1_node at,
const char *  tagname,
NMEM  m,
int  local_allowed,
int  insert_mode 
)
static
data1_node* data1_add_taggeddata ( data1_handle  dh,
data1_node root,
data1_node at,
const char *  tagname,
NMEM  m 
)

Definition at line 450 of file d1_read.c.

References data1_add_insert_taggeddata().

data1_node* data1_append_node ( data1_handle  dh,
NMEM  m,
int  type,
data1_node parent 
)
void data1_chop_text ( data1_handle  dh,
NMEM  m,
data1_node n 
)
void data1_concat_text ( data1_handle  dh,
NMEM  m,
data1_node n 
)
const char* data1_get_encoding ( data1_handle  dh,
data1_node n 
)
data1_node* data1_get_root_tag ( data1_handle  dh,
data1_node n 
)
int data1_iconv ( data1_handle  dh,
NMEM  m,
data1_node n,
const char *  tocode,
const char *  fromcode 
)

Definition at line 1088 of file d1_read.c.

References data1_iconv_s().

Referenced by grs_extract_sub(), and zebra_grs_retrieve().

static void data1_iconv_s ( data1_handle  dh,
NMEM  m,
data1_node n,
yaz_iconv_t  t,
WRBUF  wrbuf,
const char *  tocode 
)
static
static void data1_init_node ( data1_handle  dh,
data1_node r,
int  type 
)
static
data1_node* data1_insert_node ( data1_handle  dh,
NMEM  m,
int  type,
data1_node parent 
)
data1_node* data1_insert_preprocess ( data1_handle  dh,
NMEM  nmem,
const char *  target,
const char **  attr,
data1_node at 
)

Definition at line 238 of file d1_read.c.

References data1_insert_preprocess_n().

data1_node* data1_insert_preprocess_n ( data1_handle  dh,
NMEM  nmem,
const char *  target,
size_t  len,
const char **  attr,
data1_node at 
)
char* data1_insert_string ( data1_handle  dh,
data1_node res,
NMEM  m,
const char *  str 
)
char* data1_insert_string_n ( data1_handle  dh,
data1_node res,
NMEM  m,
const char *  str,
size_t  len 
)
data1_node* data1_insert_taggeddata ( data1_handle  dh,
data1_node root,
data1_node at,
const char *  tagname,
NMEM  m 
)

Definition at line 443 of file d1_read.c.

References data1_add_insert_taggeddata().

data1_node* data1_mk_comment ( data1_handle  dh,
NMEM  mem,
const char *  buf,
data1_node parent 
)

Definition at line 367 of file d1_read.c.

References data1_mk_comment_n().

data1_node* data1_mk_comment_n ( data1_handle  dh,
NMEM  mem,
const char *  buf,
size_t  len,
data1_node parent 
)
data1_node* data1_mk_node ( data1_handle  dh,
NMEM  m 
)

Definition at line 70 of file d1_read.c.

References data1_mk_node2(), and DATA1N_root.

data1_node* data1_mk_node2 ( data1_handle  dh,
NMEM  m,
int  type,
data1_node parent 
)
data1_node* data1_mk_node_type ( data1_handle  dh,
NMEM  m,
int  type 
)

Definition at line 75 of file d1_read.c.

References data1_mk_node2().

data1_node* data1_mk_preprocess ( data1_handle  dh,
NMEM  nmem,
const char *  target,
const char **  attr,
data1_node at 
)

Definition at line 218 of file d1_read.c.

References data1_mk_preprocess_n().

data1_node* data1_mk_preprocess_n ( data1_handle  dh,
NMEM  nmem,
const char *  target,
size_t  len,
const char **  attr,
data1_node at 
)
data1_node* data1_mk_root ( data1_handle  dh,
NMEM  nmem,
const char *  name 
)
data1_node* data1_mk_tag ( data1_handle  dh,
NMEM  nmem,
const char *  tag,
const char **  attr,
data1_node at 
)
data1_node* data1_mk_tag_data ( data1_handle  dh,
data1_node at,
const char *  tagname,
NMEM  m 
)
data1_node* data1_mk_tag_data_int ( data1_handle  dh,
data1_node at,
const char *  tag,
int  num,
NMEM  nmem 
)
data1_node* data1_mk_tag_data_oid ( data1_handle  dh,
data1_node at,
const char *  tag,
Odr_oid *  oid,
NMEM  nmem 
)
data1_node* data1_mk_tag_data_text ( data1_handle  dh,
data1_node at,
const char *  tag,
const char *  str,
NMEM  nmem 
)
data1_node* data1_mk_tag_data_text_uni ( data1_handle  dh,
data1_node at,
const char *  tag,
const char *  str,
NMEM  nmem 
)
data1_node* data1_mk_tag_data_wd ( data1_handle  dh,
data1_node at,
const char *  tagname,
NMEM  m 
)

Definition at line 437 of file d1_read.c.

References data1_add_insert_taggeddata().

Referenced by zebra_grs_retrieve().

data1_node* data1_mk_tag_data_zint ( data1_handle  dh,
data1_node at,
const char *  tag,
zint  num,
NMEM  nmem 
)
data1_node* data1_mk_tag_n ( data1_handle  dh,
NMEM  nmem,
const char *  tag,
size_t  len,
const char **  attr,
data1_node at 
)
data1_node* data1_mk_tag_uni ( data1_handle  dh,
NMEM  nmem,
const char *  tag,
data1_node at 
)
data1_node* data1_mk_text ( data1_handle  dh,
NMEM  mem,
const char *  buf,
data1_node parent 
)

Definition at line 349 of file d1_read.c.

References data1_mk_text_n().

Referenced by zebra_xml_metadata().

data1_node* data1_mk_text_n ( data1_handle  dh,
NMEM  mem,
const char *  buf,
size_t  len,
data1_node parent 
)
data1_node* data1_mk_text_nf ( data1_handle  dh,
NMEM  mem,
const char *  buf,
size_t  len,
data1_node parent 
)

Definition at line 341 of file d1_read.c.

References data1_node::data, data1_mk_text_n(), and data1_node::u.

data1_node* data1_read_node ( data1_handle  dh,
const char **  buf,
NMEM  m 
)

Definition at line 956 of file d1_read.c.

References data1_read_nodex(), and getc_mem().

Referenced by data1_read_record(), and data1_read_sgml().

data1_node* data1_read_nodex ( data1_handle  dh,
NMEM  m,
int(*)(void *fh)  get_byte,
void *  fh,
WRBUF  wrbuf 
)
data1_node* data1_read_record ( data1_handle  dh,
int(*)(void *, char *, size_t)  rf,
void *  fh,
NMEM  m 
)

Definition at line 969 of file d1_read.c.

References data1_get_read_buf(), and data1_read_node().

data1_node* data1_read_sgml ( data1_handle  dh,
NMEM  m,
const char *  buf 
)
data1_xattr* data1_read_xattr ( data1_handle  dh,
NMEM  m,
int(*)(void *fh)  get_byte,
void *  fh,
WRBUF  wrbuf,
int *  ch,
int *  amp 
)
data1_node* data1_search_tag ( data1_handle  dh,
data1_node n,
const char *  tag 
)
void data1_set_root ( data1_handle  dh,
data1_node res,
NMEM  nmem,
const char *  name 
)
void data1_tag_add_attr ( data1_handle  dh,
NMEM  nmem,
data1_node res,
const char **  attr 
)

Definition at line 285 of file d1_read.c.

References data1_add_attrs(), DATA1N_tag, data1_node::tag, data1_node::u, and data1_node::which.

Referenced by grs_read_iso2709().

data1_node* get_parent_tag ( data1_handle  dh,
data1_node n 
)
int getc_mem ( void *  fh)

Definition at line 948 of file d1_read.c.

Referenced by data1_read_node().