|
YAZ 5.37.0
|
Header for YAZ iconv interface. More...
Go to the source code of this file.
Macros | |
| #define | YAZ_ICONV_UNKNOWN 1 |
| error code: unknown | |
| #define | YAZ_ICONV_E2BIG 2 |
| error code: Not sufficient room for output buffer | |
| #define | YAZ_ICONV_EILSEQ 3 |
| error code: Invalid sequence | |
| #define | YAZ_ICONV_EINVAL 4 |
| error code: An incomplete multibyte sequence is in input buffer | |
| #define | yaz_isdigit(x) |
| #define | yaz_isspace(x) |
| #define | yaz_toupper(x) |
| #define | yaz_isupper(x) |
| #define | yaz_tolower(x) |
| #define | yaz_islower(x) |
Typedefs | |
| typedef struct yaz_iconv_struct * | yaz_iconv_t |
| yaz_iconv handle (similar to iconv_t) | |
Functions | |
| yaz_iconv_t | yaz_iconv_open (const char *tocode, const char *fromcode) |
| just like iconv_open(3) | |
| size_t | yaz_iconv (yaz_iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) |
| just like iconv(3) | |
| int | yaz_iconv_error (yaz_iconv_t cd) |
| returns last error - like errno for iconv(3) | |
| int | yaz_iconv_close (yaz_iconv_t cd) |
| just like iconv_close(3) | |
| int | yaz_iconv_isbuiltin (yaz_iconv_t cd) |
| tests whether conversion is handled by YAZ' iconv or system iconv | |
| unsigned long | yaz_read_UTF8_char (const unsigned char *inp, size_t inbytesleft, size_t *no_read, int *error) |
| size_t | yaz_write_UTF8_char (unsigned long x, char **outbuf, size_t *outbytesleft, int *error) |
| encodes UTF-8 sequence | |
| int | yaz_utf8_check (const char *cstr) |
| check whether string apppers to be UTF-8 encoded | |
Header for YAZ iconv interface.
Definition in file yaz-iconv.h.
| #define YAZ_ICONV_E2BIG 2 |
error code: Not sufficient room for output buffer
Definition at line 47 of file yaz-iconv.h.
Referenced by flush_combos(), flush_iso_8859_1(), wrbuf_iconv_write2(), write1(), write_advancegreek(), write_iso_5428_1984(), write_iso_8859_1(), write_UCS4(), write_UCS4LE(), yaz_iconv(), yaz_write_marc8_2(), yaz_write_marc8_generic(), yaz_write_marc8_page_chr(), and yaz_write_UTF8_char().
| #define YAZ_ICONV_EILSEQ 3 |
error code: Invalid sequence
Definition at line 49 of file yaz-iconv.h.
Referenced by lookup_marc8(), write1(), write_advancegreek(), write_iso_5428_1984(), write_iso_8859_1(), yaz_iconv(), yaz_read_iso5426_comb(), yaz_read_marc8_comb(), and yaz_read_UTF8_char().
| #define YAZ_ICONV_EINVAL 4 |
error code: An incomplete multibyte sequence is in input buffer
Definition at line 51 of file yaz-iconv.h.
Referenced by init_utf8(), read_advancegreek(), read_danmarc(), read_iso5426(), read_iso_5428_1984(), read_marc8(), read_UCS4(), read_UCS4LE(), read_useq(), yaz_iconv(), yaz_read_iso5426_comb(), yaz_read_marc8_comb(), and yaz_read_UTF8_char().
| #define YAZ_ICONV_UNKNOWN 1 |
error code: unknown
Definition at line 45 of file yaz-iconv.h.
Referenced by yaz_iconv(), and yaz_iconv_open().
| #define yaz_isdigit | ( | x | ) |
Definition at line 86 of file yaz-iconv.h.
Referenced by atoi_n(), atoi_n_check(), ccl_parser_tokenize(), ccl_pquery_complex(), cql_transform_parse_tok_line(), cs_complete_http(), cs_read_chunk(), decode_headers_content(), emit_term(), oid_dotstring_to_oid(), process_http_request(), query_token(), yaz_log_mask_str_x(), and yaz_marc_read_iso2709().
| #define yaz_islower | ( | x | ) |
Definition at line 91 of file yaz-iconv.h.
Referenced by ccli_toupper(), cs_read_chunk(), decode_headers_content(), and ztest_scan().
| #define yaz_isspace | ( | x | ) |
Definition at line 87 of file yaz-iconv.h.
Referenced by nmem_dup_xml_content(), read_grs1(), and yylex().
| #define yaz_isupper | ( | x | ) |
Definition at line 89 of file yaz-iconv.h.
Referenced by cs_read_chunk(), decode_headers_content(), yaz_matchstr(), and yaz_strncasecmp().
| #define yaz_tolower | ( | x | ) |
Definition at line 90 of file yaz-iconv.h.
Referenced by yaz_matchstr(), and yaz_strncasecmp().
| #define yaz_toupper | ( | x | ) |
Definition at line 88 of file yaz-iconv.h.
Referenced by ccli_toupper(), and ztest_scan().
| typedef struct yaz_iconv_struct* yaz_iconv_t |
yaz_iconv handle (similar to iconv_t)
Definition at line 42 of file yaz-iconv.h.
| size_t yaz_iconv | ( | yaz_iconv_t | cd, |
| char ** | inbuf, | ||
| size_t * | inbytesleft, | ||
| char ** | outbuf, | ||
| size_t * | outbytesleft ) |
just like iconv(3)
Definition at line 146 of file siconv.c.
References yaz_iconv_struct::decoder, yaz_iconv_struct::encoder, yaz_iconv_encoder_s::flush_handle, yaz_iconv_struct::init_flag, yaz_iconv_decoder_s::init_handle, yaz_iconv_encoder_s::init_handle, yaz_iconv_struct::my_errno, yaz_iconv_struct::no_read_x, yaz_iconv_decoder_s::read_handle, yaz_iconv_struct::unget_x, yaz_iconv_encoder_s::write_handle, yaz_errno(), YAZ_ICONV_E2BIG, YAZ_ICONV_EILSEQ, YAZ_ICONV_EINVAL, and YAZ_ICONV_UNKNOWN.
Referenced by cdata_one_character(), odr_iconv_string(), odr_reset(), wrbuf_iconv_reset(), and wrbuf_iconv_write2().
| int yaz_iconv_close | ( | yaz_iconv_t | cd | ) |
just like iconv_close(3)
Definition at line 284 of file siconv.c.
References yaz_iconv_struct::decoder, yaz_iconv_decoder_s::destroy_handle, yaz_iconv_encoder_s::destroy_handle, yaz_iconv_struct::encoder, and xfree.
Referenced by construct_marc(), convert_marc(), odr_destroy(), odr_set_charset(), process_searchRequest(), return_marc_record(), return_opac_record(), return_string_record(), yaz_iconv_open(), yaz_record_conv_opac_record(), Z3950_send_search(), and ZOOM_connection_Z3950_send_scan().
| int yaz_iconv_error | ( | yaz_iconv_t | cd | ) |
returns last error - like errno for iconv(3)
Definition at line 279 of file siconv.c.
References yaz_iconv_struct::my_errno.
Referenced by wrbuf_iconv_write2(), and yaz_write_marc8_generic().
| int yaz_iconv_isbuiltin | ( | yaz_iconv_t | cd | ) |
tests whether conversion is handled by YAZ' iconv or system iconv
Definition at line 45 of file siconv.c.
References yaz_iconv_struct::decoder, yaz_iconv_struct::encoder, yaz_iconv_decoder_s::read_handle, and yaz_iconv_encoder_s::write_handle.
| yaz_iconv_t yaz_iconv_open | ( | const char * | tocode, |
| const char * | fromcode ) |
just like iconv_open(3)
Definition at line 95 of file siconv.c.
References yaz_iconv_decoder_s::data, yaz_iconv_encoder_s::data, yaz_iconv_struct::decoder, yaz_iconv_decoder_s::destroy_handle, yaz_iconv_encoder_s::destroy_handle, yaz_iconv_struct::encoder, yaz_iconv_encoder_s::flush_handle, yaz_iconv_struct::init_flag, yaz_iconv_decoder_s::init_handle, yaz_iconv_encoder_s::init_handle, yaz_iconv_struct::my_errno, prepare_decoders(), prepare_encoders(), yaz_iconv_decoder_s::read_handle, yaz_iconv_encoder_s::write_handle, xmalloc, yaz_iconv_close(), and YAZ_ICONV_UNKNOWN.
Referenced by construct_marc(), convert_marc(), iconv_create_charset(), odr_set_charset(), process_searchRequest(), retrieve_fetch(), yaz_record_conv_opac_record(), Z3950_send_search(), and ZOOM_connection_Z3950_send_scan().
| unsigned long yaz_read_UTF8_char | ( | const unsigned char * | inp, |
| size_t | inbytesleft, | ||
| size_t * | no_read, | ||
| int * | error ) |
Definition at line 41 of file utf8.c.
References YAZ_ICONV_EILSEQ, and YAZ_ICONV_EINVAL.
Referenced by cdata_one_character(), read_utf8(), and yaz_utf8_check().
| int yaz_utf8_check | ( | const char * | cstr | ) |
check whether string apppers to be UTF-8 encoded
| cstr | string to check |
| 1 | OK (appears to be UTF-8) |
| 0 | definitely not UTF-8 |
Definition at line 243 of file utf8.c.
References yaz_read_UTF8_char().
| size_t yaz_write_UTF8_char | ( | unsigned long | x, |
| char ** | outbuf, | ||
| size_t * | outbytesleft, | ||
| int * | error ) |
encodes UTF-8 sequence
| x | the UNICODE value |
| outbuf | output buffer pointer, updated if conversion is successful |
| outbytesleft | length of buffer, updated if conversino is successful |
| error | pointer to error code if error occurs |
| 0 | if successful |
| -1 | for error |
Definition at line 159 of file utf8.c.
References YAZ_ICONV_E2BIG.
Referenced by json_one_char(), lookup_marc8(), and write_UTF8().