IDZEBRA  2.1.4
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


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)


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

void mc_destroy_field ( mc_field p)

◆ mc_destroy_subfield()

void mc_destroy_subfield ( mc_subfield p)

◆ mc_destroy_subfields_recursive()

void mc_destroy_subfields_recursive ( mc_subfield p)

◆ 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 

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_field* mc_getfield ( mc_context c)

◆ mc_getinterval()

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

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

mc_subfield* mc_getsubfields ( mc_context c,
mc_subfield parent 

◆ mc_gettoken()

mc_token mc_gettoken ( mc_context c)

◆ mc_getval()

int mc_getval ( mc_context c)

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  )

◆ mc_mk_subfield()

mc_subfield * mc_mk_subfield ( mc_subfield parent)

◆ mc_ungettoken()

void mc_ungettoken ( mc_context c)

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[]
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