IDZEBRA
2.2.7
|
character conversions (.chr) More...
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <charmap.h>
#include <yaz/yaz-util.h>
Go to the source code of this file.
Data Structures | |
struct | chrmaptab_info |
struct | chr_t_entry |
struct | chrwork |
struct | chr_equiv_work |
Macros | |
#define | CHR_MAXSTR 1024 |
#define | CHR_MAXEQUIV 32 |
Typedefs | |
typedef unsigned | ucs4_t |
typedef struct chrwork | chrwork |
Functions | |
static chr_t_entry * | set_map_string (chr_t_entry *root, NMEM nmem, const char *from, int len, char *to, const char *from_0) |
static chr_t_entry * | find_entry_x (chr_t_entry *t, const char **from, int *len, int first) |
const char ** | chr_map_input_x (chrmaptab maptab, const char **from, int *len, int first) |
const char ** | chr_map_input (chrmaptab maptab, const char **from, int len, int first) |
const char ** | chr_map_q_input (chrmaptab maptab, const char **from, int len, int first) |
const char * | chr_map_output (chrmaptab maptab, const char **from, int len) |
static int | zebra_ucs4_strlen (ucs4_t *s) |
ucs4_t | zebra_prim_w (ucs4_t **s) |
static void | fun_addentry (const char *s, void *data, int num) |
static void | fun_addspace (const char *s, void *data, int num) |
static void | fun_addcut (const char *s, void *data, int num) |
static void | fun_mkstring (const char *s, void *data, int num) |
static void | fun_add_equivalent_string (const char *s, void *data, int num) |
static void | fun_add_map (const char *s, void *data, int num) |
static int | scan_to_utf8 (yaz_iconv_t t, ucs4_t *from, size_t inlen, char *outbuf, size_t outbytesleft) |
static int | scan_string (char *s_native, yaz_iconv_t t_unicode, yaz_iconv_t t_utf8, void(*fun)(const char *c, void *data, int num), void *data, int *num) |
chrmaptab | chrmaptab_create (const char *tabpath, const char *name, const char *tabroot) |
void | chrmaptab_destroy (chrmaptab tab) |
Variables | |
const unsigned char | CHR_FIELD_BEGIN = '^' |
const char * | CHR_UNKNOWN = "\001" |
const char * | CHR_SPACE = "\002" |
const char * | CHR_CUT = "\003" |
const char * | CHR_BASE = "\005" |
character conversions (.chr)
Support module to handle character-conversions into and out of the Zebra dictionary.
Definition in file charmap.c.
const char** chr_map_input | ( | chrmaptab | maptab, |
const char ** | from, | ||
int | len, | ||
int | first | ||
) |
Definition at line 194 of file charmap.c.
References find_entry_x(), chrmaptab_info::input, and chr_t_entry::target.
Referenced by fun_mkstring(), zebra_maps_input(), and zebra_maps_search().
const char** chr_map_input_x | ( | chrmaptab | maptab, |
const char ** | from, | ||
int * | len, | ||
int | first | ||
) |
Definition at line 184 of file charmap.c.
References find_entry_x(), chrmaptab_info::input, and chr_t_entry::target.
Referenced by tst_string().
const char* chr_map_output | ( | chrmaptab | maptab, |
const char ** | from, | ||
int | len | ||
) |
Definition at line 221 of file charmap.c.
References chrmaptab_info::output.
Referenced by zebra_maps_output().
const char** chr_map_q_input | ( | chrmaptab | maptab, |
const char ** | from, | ||
int | len, | ||
int | first | ||
) |
Definition at line 207 of file charmap.c.
References find_entry_x(), chrmaptab_info::q_input, and chr_t_entry::target.
Referenced by zebra_maps_search().
chrmaptab chrmaptab_create | ( | const char * | tabpath, |
const char * | name, | ||
const char * | tabroot | ||
) |
Definition at line 513 of file charmap.c.
References chrmaptab_info::base_uppercase, chr_t_entry::children, CHR_BASE, CHR_SPACE, CHR_UNKNOWN, chrmaptab_destroy(), chr_equiv_work::eq, fun_add_equivalent_string(), fun_add_map(), fun_addcut(), fun_addentry(), fun_addspace(), fun_mkstring(), chrmaptab_info::input, chrwork::map, chrmaptab_info::nmem, chr_equiv_work::nmem, chr_equiv_work::no_eq, chrmaptab_info::output, chrmaptab_info::q_input, scan_string(), set_map_string(), chrwork::string, and chr_t_entry::target.
Referenced by tst2(), tst3(), tst_latin1(), tst_utf8(), and zebra_charmap_get().
void chrmaptab_destroy | ( | chrmaptab | tab | ) |
Definition at line 748 of file charmap.c.
References chrmaptab_info::nmem.
Referenced by chrmaptab_create(), tst2(), tst3(), tst_latin1(), tst_utf8(), and zebra_maps_close().
|
static |
Definition at line 141 of file charmap.c.
References chr_t_entry::children, CHR_FIELD_BEGIN, and chr_t_entry::target.
Referenced by chr_map_input(), chr_map_input_x(), and chr_map_q_input().
|
static |
Definition at line 369 of file charmap.c.
References CHR_MAXEQUIV, chr_equiv_work::eq, chr_equiv_work::nmem, and chr_equiv_work::no_eq.
Referenced by chrmaptab_create().
|
static |
Definition at line 381 of file charmap.c.
References chrmaptab_info::input, chrwork::map, chrmaptab_info::nmem, set_map_string(), and chrwork::string.
Referenced by chrmaptab_create().
|
static |
Definition at line 344 of file charmap.c.
References CHR_CUT, chrmaptab_info::input, chrmaptab_info::nmem, and set_map_string().
Referenced by chrmaptab_create().
|
static |
Definition at line 318 of file charmap.c.
References chrmaptab_info::base_uppercase, chrmaptab_info::input, chrmaptab_info::nmem, chrmaptab_info::output, and set_map_string().
Referenced by chrmaptab_create().
|
static |
Definition at line 333 of file charmap.c.
References CHR_SPACE, chrmaptab_info::input, chrmaptab_info::nmem, and set_map_string().
Referenced by chrmaptab_create().
|
static |
Definition at line 354 of file charmap.c.
References chr_map_input(), CHR_MAXSTR, CHR_UNKNOWN, chrwork::map, and chrwork::string.
Referenced by chrmaptab_create().
|
static |
Definition at line 421 of file charmap.c.
References begin(), end(), scan_to_utf8(), zebra_prim_w(), and zebra_ucs4_strlen().
Referenced by chrmaptab_create().
|
static |
Definition at line 393 of file charmap.c.
Referenced by scan_string().
|
static |
Definition at line 92 of file charmap.c.
References chr_t_entry::children, CHR_UNKNOWN, and chr_t_entry::target.
Referenced by chrmaptab_create(), fun_add_map(), fun_addcut(), fun_addentry(), and fun_addspace().
Definition at line 239 of file charmap.c.
References zebra_ucs4_strlen().
Referenced by scan_string().
|
static |
Definition at line 231 of file charmap.c.
Referenced by scan_string(), and zebra_prim_w().
const char* CHR_BASE = "\005" |
Definition at line 51 of file charmap.c.
Referenced by chrmaptab_create().
const char* CHR_CUT = "\003" |
Definition at line 50 of file charmap.c.
Referenced by fun_addcut(), and parse_complete_field().
const unsigned char CHR_FIELD_BEGIN = '^' |
Definition at line 46 of file charmap.c.
Referenced by find_entry_x().
const char* CHR_SPACE = "\002" |
Definition at line 49 of file charmap.c.
Referenced by chrmaptab_create(), extract_add_incomplete_field(), fun_addspace(), parse_complete_field(), snippet_add_incomplete_field(), term_100(), term_101(), term_103(), term_104(), term_105(), term_pre(), trans_scan_term(), and zebra_it_key_str_dump().
const char* CHR_UNKNOWN = "\001" |
Definition at line 48 of file charmap.c.
Referenced by chrmaptab_create(), fun_mkstring(), set_map_string(), and zebra_it_key_str_dump().