IDZEBRA  2.1.2
Data Structures | Functions | Variables
marcomp.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <yaz/yaz-util.h>
#include "marcomp.h"

Go to the source code of this file.

Data Structures

struct  mc_errmsg
 

Functions

static mc_token mc_gettoken (mc_context *c)
 
static void mc_ungettoken (mc_context *c)
 
static int mc_getval (mc_context *c)
 
static int mc_getdata (mc_context *c, char *s, int sz)
 
static void mc_getinterval (mc_context *c, int *start, int *end)
 
static mc_subfieldmc_mk_subfield (mc_subfield *parent)
 
static mc_fieldmc_mk_field (void)
 
mc_errcode mc_errno (mc_context *c)
 
const char * mc_error (mc_errcode no)
 
mc_contextmc_mk_context (const char *s)
 
void mc_destroy_context (mc_context *c)
 
void mc_destroy_field (mc_field *p)
 
mc_fieldmc_getfield (mc_context *c)
 
void mc_destroy_subfield (mc_subfield *p)
 
void mc_destroy_subfields_recursive (mc_subfield *p)
 
mc_subfieldmc_getsubfields (mc_context *c, mc_subfield *parent)
 

Variables

static struct mc_errmsg mc_errmsg []
 

Function Documentation

void mc_destroy_context ( mc_context c)

Definition at line 86 of file marcomp.c.

Referenced by parse_data1_tree().

void mc_destroy_field ( mc_field p)
void mc_destroy_subfield ( mc_subfield p)
void mc_destroy_subfields_recursive ( mc_subfield p)
mc_errcode mc_errno ( mc_context c)

Definition at line 55 of file marcomp.c.

References mc_context::errcode.

const char* mc_error ( mc_errcode  no)

Definition at line 59 of file marcomp.c.

References EMCEND, EMCOK, and mc_errmsg::msg.

int mc_getdata ( mc_context c,
char *  s,
int  sz 
)
static

Definition at line 136 of file marcomp.c.

References mc_gettoken(), mc_getval(), mc_ungettoken(), and REGULAR.

Referenced by mc_getfield(), and mc_getsubfields().

mc_field* mc_getfield ( mc_context c)
void mc_getinterval ( mc_context c,
int *  start,
int *  end 
)
static

Definition at line 153 of file marcomp.c.

References LINTERVAL, mc_gettoken(), mc_getval(), NOP, and RINTERVAL.

Referenced by mc_getfield(), and mc_getsubfields().

mc_subfield* mc_getsubfields ( mc_context c,
mc_subfield parent 
)
mc_token mc_gettoken ( mc_context c)
static
int mc_getval ( mc_context c)
static

Definition at line 132 of file marcomp.c.

References mc_context::crrval.

Referenced by mc_getdata(), and mc_getinterval().

mc_context* mc_mk_context ( const char *  s)

Definition at line 66 of file marcomp.c.

References mc_context::crrtok, mc_context::data, EMCOK, mc_context::errcode, mc_context::len, and NOP.

Referenced by parse_data1_tree().

mc_field * mc_mk_field ( void  )
static
mc_subfield * mc_mk_subfield ( mc_subfield parent)
static
void mc_ungettoken ( mc_context c)
static

Definition at line 127 of file marcomp.c.

References mc_context::offset.

Referenced by mc_getdata(), mc_getfield(), and mc_getsubfields().

Variable Documentation

struct mc_errmsg mc_errmsg[]
static
Initial value:
= {
{EMCOK, "OK"},
{EMCNOMEM, "NO mem"},
{EMCF, "not complete field"},
{EMCSF, "not complete subfield"},
{EMCSFGROUP, "not closed GROUP"},
{EMCSFVAR, "not closed VARIANT"},
{EMCSFINLINE, "not closed IN-LINE"},
{EMCEND, "not correct errno"}
}
Definition: marcomp.h:85
Definition: marcomp.h:84
Definition: marcomp.h:82
Definition: marcomp.h:89