IDZEBRA 2.2.11
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_subfield * mc_mk_subfield (mc_subfield *parent)
static mc_field * mc_mk_field (void)
mc_errcode mc_errno (mc_context *c)
const char * mc_error (mc_errcode no)
mc_context * mc_mk_context (const char *s)
void mc_destroy_context (mc_context *c)
void mc_destroy_field (mc_field *p)
mc_field * mc_getfield (mc_context *c)
void mc_destroy_subfield (mc_subfield *p)
void mc_destroy_subfields_recursive (mc_subfield *p)
mc_subfield * mc_getsubfields (mc_context *c, mc_subfield *parent)

Variables

static struct mc_errmsg mc_errmsg []

Function Documentation

◆ mc_destroy_context()

void mc_destroy_context ( mc_context * c)

Definition at line 86 of file marcomp.c.

Referenced by parse_data1_tree().

◆ mc_destroy_field()

◆ mc_destroy_subfield()

◆ mc_destroy_subfields_recursive()

◆ mc_errno()

mc_errcode mc_errno ( mc_context * c)

Definition at line 55 of file marcomp.c.

References mc_context::errcode.

◆ mc_error()

const char * mc_error ( mc_errcode no)

Definition at line 59 of file marcomp.c.

References EMCEND, EMCOK, and mc_errmsg::msg.

◆ mc_getdata()

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_getfield()

◆ mc_getinterval()

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

Definition at line 153 of file marcomp.c.

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

Referenced by mc_getfield(), and mc_getsubfields().

◆ mc_getsubfields()

◆ mc_gettoken()

◆ mc_getval()

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_mk_context()

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_mk_field()

mc_field * mc_mk_field ( void )
static

◆ mc_mk_subfield()

◆ mc_ungettoken()

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

◆ mc_errmsg

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"}
}
@ EMCSFVAR
Definition marcomp.h:87
@ EMCSF
Definition marcomp.h:85
@ EMCSFGROUP
Definition marcomp.h:86
@ EMCSFINLINE
Definition marcomp.h:88
@ EMCEND
Definition marcomp.h:89
@ EMCNOMEM
Definition marcomp.h:83
@ EMCOK
Definition marcomp.h:82
@ EMCF
Definition marcomp.h:84