YAZ
5.34.0
|
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) |
MARC-8 encoding.
MARC-8 reference: http://www.loc.gov/marc/specifications/speccharmarc8.html
Definition in file iconv_encode_marc8.c.
#define ESC "\033" |
Definition at line 38 of file iconv_encode_marc8.c.
|
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 |
Definition at line 162 of file iconv_encode_marc8.c.
References encoder_data::write_marc8_last, encoder_data::write_marc8_lpage, encoder_data::write_marc8_ncr, encoder_data::write_marc8_second_half_char, y, YAZ_ICONV_E2BIG, yaz_iconv_set_errno(), yaz_snprintf(), and yaz_write_marc8_page_chr().
Referenced by flush_marc8(), and yaz_write_marc8_2().
|
static |
Definition at line 341 of file iconv_encode_marc8.c.
References yaz_iconv_encoder_s::data, ESC, flush_combos(), encoder_data::write_marc8_g1, and yaz_write_marc8_page_chr().
Referenced by yaz_marc8_encoder().
|
static |
Definition at line 50 of file iconv_encode_marc8.c.
References yaz_iconv_encoder_s::data, ESC, encoder_data::write_marc8_g0, encoder_data::write_marc8_g1, encoder_data::write_marc8_last, encoder_data::write_marc8_lpage, encoder_data::write_marc8_ncr, and encoder_data::write_marc8_second_half_char.
Referenced by yaz_marc8_encoder().
|
static |
Definition at line 66 of file iconv_encode_marc8.c.
References ESC, YAZ_ICONV_EILSEQ, yaz_iconv_set_errno(), yaz_marc8r_31_conv, yaz_marc8r_32_conv, yaz_marc8r_33_conv, yaz_marc8r_34_conv, yaz_marc8r_42_conv, yaz_marc8r_45_conv, yaz_marc8r_4E_conv, yaz_marc8r_51_conv, yaz_marc8r_53_conv, yaz_marc8r_62_conv, yaz_marc8r_70_conv, and yaz_write_UTF8_char().
Referenced by yaz_write_marc8_2().
|
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 |
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 |
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 |
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 | ||
) |
Definition at line 425 of file iconv_encode_marc8.c.
References yaz_iconv_encoder_s::data, yaz_iconv_encoder_s::destroy_handle, destroy_marc8(), yaz_iconv_encoder_s::flush_handle, flush_marc8(), yaz_iconv_encoder_s::init_handle, init_marc8(), yaz_iconv_encoder_s::write_handle, write_marc8_control(), write_marc8_lossless(), write_marc8_lossy(), write_marc8_normal(), xmalloc, and yaz_matchstr().
Referenced by prepare_encoders().
|
static |
Definition at line 274 of file iconv_encode_marc8.c.
References ESC, flush_combos(), lookup_marc8(), encoder_data::write_marc8_last, encoder_data::write_marc8_lpage, encoder_data::write_marc8_ncr, encoder_data::write_marc8_second_half_char, y, YAZ_ICONV_E2BIG, yaz_iconv_set_errno(), and yaz_write_marc8_page_chr().
Referenced by yaz_write_marc8_generic().
|
static |
Definition at line 352 of file iconv_encode_marc8.c.
References encoder_data::write_marc8_last, encoder_data::write_marc8_lpage, encoder_data::write_marc8_ncr, x1, x2, YAZ_ICONV_E2BIG, yaz_iconv_error(), yaz_iso_8859_1_lookup_y(), and yaz_write_marc8_2().
Referenced by write_marc8_control(), write_marc8_lossless(), write_marc8_lossy(), and write_marc8_normal().
|
static |
Definition at line 222 of file iconv_encode_marc8.c.
References ESC, encoder_data::write_marc8_g0, encoder_data::write_marc8_g1, YAZ_ICONV_E2BIG, and yaz_iconv_set_errno().
Referenced by flush_combos(), flush_marc8(), and yaz_write_marc8_2().
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().