YAZ  5.23.1
Data Structures | Macros | Functions | Variables
iconv_encode_marc8.c File Reference

MARC-8 encoding. More...

#include <assert.h>
#include <errno.h>
#include <string.h>
#include <yaz/xmalloc.h>
#include <yaz/snprintf.h>
#include "iconv-p.h"

Go to the source code of this file.

Data Structures

struct  encoder_data
 

Macros

#define ESC   "\033"
 

Functions

static void init_marc8 (yaz_iconv_encoder_t w)
 
static size_t yaz_write_marc8_page_chr (yaz_iconv_t cd, struct encoder_data *w, char **outbuf, size_t *outbytesleft, const char *page_chr)
 
static unsigned long lookup_marc8 (yaz_iconv_t cd, unsigned long x, int *comb, const char **page_chr)
 
static size_t flush_combos (yaz_iconv_t cd, struct encoder_data *w, char **outbuf, size_t *outbytesleft)
 
static size_t yaz_write_marc8_2 (yaz_iconv_t cd, struct encoder_data *w, unsigned long x, char **outbuf, size_t *outbytesleft, int loss_mode)
 
static size_t flush_marc8 (yaz_iconv_t cd, yaz_iconv_encoder_t en, char **outbuf, size_t *outbytesleft)
 
static size_t yaz_write_marc8_generic (yaz_iconv_t cd, struct encoder_data *w, unsigned long x, char **outbuf, size_t *outbytesleft, int loss_mode)
 
static size_t write_marc8_normal (yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
 
static size_t write_marc8_lossy (yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
 
static size_t write_marc8_lossless (yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
 
static size_t write_marc8_control (yaz_iconv_t cd, yaz_iconv_encoder_t e, unsigned long x, char **outbuf, size_t *outbytesleft)
 
static void destroy_marc8 (yaz_iconv_encoder_t e)
 
yaz_iconv_encoder_t yaz_marc8_encoder (const char *tocode, yaz_iconv_encoder_t e)
 

Variables

yaz_conv_func_t yaz_marc8r_42_conv
 
yaz_conv_func_t yaz_marc8r_45_conv
 
yaz_conv_func_t yaz_marc8r_67_conv
 
yaz_conv_func_t yaz_marc8r_62_conv
 
yaz_conv_func_t yaz_marc8r_70_conv
 
yaz_conv_func_t yaz_marc8r_32_conv
 
yaz_conv_func_t yaz_marc8r_4E_conv
 
yaz_conv_func_t yaz_marc8r_51_conv
 
yaz_conv_func_t yaz_marc8r_33_conv
 
yaz_conv_func_t yaz_marc8r_34_conv
 
yaz_conv_func_t yaz_marc8r_53_conv
 
yaz_conv_func_t yaz_marc8r_31_conv
 

Detailed Description

MARC-8 encoding.

MARC-8 reference: http://www.loc.gov/marc/specifications/speccharmarc8.html

Definition in file iconv_encode_marc8.c.

Macro Definition Documentation

#define ESC   "\033"

Function Documentation

static void destroy_marc8 ( yaz_iconv_encoder_t  e)
static

Definition at line 420 of file iconv_encode_marc8.c.

References yaz_iconv_encoder_s::data, and xfree.

Referenced by yaz_marc8_encoder().

static size_t flush_combos ( yaz_iconv_t  cd,
struct encoder_data w,
char **  outbuf,
size_t *  outbytesleft 
)
static
static size_t flush_marc8 ( yaz_iconv_t  cd,
yaz_iconv_encoder_t  en,
char **  outbuf,
size_t *  outbytesleft 
)
static
static void init_marc8 ( yaz_iconv_encoder_t  w)
static
static unsigned long lookup_marc8 ( yaz_iconv_t  cd,
unsigned long  x,
int *  comb,
const char **  page_chr 
)
static
static size_t write_marc8_control ( yaz_iconv_t  cd,
yaz_iconv_encoder_t  e,
unsigned long  x,
char **  outbuf,
size_t *  outbytesleft 
)
static

Definition at line 412 of file iconv_encode_marc8.c.

References yaz_iconv_encoder_s::data, and yaz_write_marc8_generic().

Referenced by yaz_marc8_encoder().

static size_t write_marc8_lossless ( yaz_iconv_t  cd,
yaz_iconv_encoder_t  e,
unsigned long  x,
char **  outbuf,
size_t *  outbytesleft 
)
static

Definition at line 404 of file iconv_encode_marc8.c.

References yaz_iconv_encoder_s::data, and yaz_write_marc8_generic().

Referenced by yaz_marc8_encoder().

static size_t write_marc8_lossy ( yaz_iconv_t  cd,
yaz_iconv_encoder_t  e,
unsigned long  x,
char **  outbuf,
size_t *  outbytesleft 
)
static

Definition at line 396 of file iconv_encode_marc8.c.

References yaz_iconv_encoder_s::data, and yaz_write_marc8_generic().

Referenced by yaz_marc8_encoder().

static size_t write_marc8_normal ( yaz_iconv_t  cd,
yaz_iconv_encoder_t  e,
unsigned long  x,
char **  outbuf,
size_t *  outbytesleft 
)
static

Definition at line 388 of file iconv_encode_marc8.c.

References yaz_iconv_encoder_s::data, and yaz_write_marc8_generic().

Referenced by yaz_marc8_encoder().

yaz_iconv_encoder_t yaz_marc8_encoder ( const char *  tocode,
yaz_iconv_encoder_t  e 
)
static size_t yaz_write_marc8_2 ( yaz_iconv_t  cd,
struct encoder_data w,
unsigned long  x,
char **  outbuf,
size_t *  outbytesleft,
int  loss_mode 
)
static
static size_t yaz_write_marc8_generic ( yaz_iconv_t  cd,
struct encoder_data w,
unsigned long  x,
char **  outbuf,
size_t *  outbytesleft,
int  loss_mode 
)
static
static size_t yaz_write_marc8_page_chr ( yaz_iconv_t  cd,
struct encoder_data w,
char **  outbuf,
size_t *  outbytesleft,
const char *  page_chr 
)
static

Variable Documentation

yaz_conv_func_t yaz_marc8r_31_conv

Definition at line 36 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_32_conv

Definition at line 30 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_33_conv

Definition at line 33 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_34_conv

Definition at line 34 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_42_conv

Definition at line 25 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_45_conv

Definition at line 26 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_4E_conv

Definition at line 31 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_51_conv

Definition at line 32 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_53_conv

Definition at line 35 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_62_conv

Definition at line 28 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().

yaz_conv_func_t yaz_marc8r_67_conv

Definition at line 27 of file iconv_encode_marc8.c.

yaz_conv_func_t yaz_marc8r_70_conv

Definition at line 29 of file iconv_encode_marc8.c.

Referenced by lookup_marc8().