#include <stddef.h>
#include <yaz/yconfig.h>
Go to the source code of this file.
Defines | |
| #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 | |
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 | |
| int | yaz_matchstr (const char *s1, const char *s2) |
| match strings - independent of case and '-' | |
| int | yaz_strcmp_del (const char *a, const char *b, const char *b_del) |
| unsigned long | yaz_read_UTF8_char (unsigned char *inp, size_t inbytesleft, size_t *no_read, int *error) |
| decodes UTF-8 sequence | |
| size_t | yaz_write_UTF8_char (unsigned long x, char **outbuf, size_t *outbytesleft, int *error) |
| encodes UTF-8 sequence | |
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 yaz_iconv(), 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 yaz_iconv(), 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 yaz_iconv(), 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().
| typedef struct yaz_iconv_struct* yaz_iconv_t |
| 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 147 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 odr_iconv_string(), odr_reset(), and wrbuf_iconv_reset().
| int yaz_iconv_close | ( | yaz_iconv_t | cd | ) |
just like iconv_close(3)
Definition at line 285 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 odr_destroy(), odr_set_charset(), yaz_iconv_open(), and yaz_record_conv_opac_record().
| int yaz_iconv_error | ( | yaz_iconv_t | cd | ) |
returns last error - like errno for iconv(3)
Definition at line 280 of file siconv.c.
References yaz_iconv_struct::my_errno.
| int yaz_iconv_isbuiltin | ( | yaz_iconv_t | cd | ) |
tests whether conversion is handled by YAZ' iconv or system iconv
Definition at line 52 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 96 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, yaz_iconv_decoder_s::read_handle, yaz_iconv_encoder_s::write_handle, xmalloc, yaz_iconv_close(), and YAZ_ICONV_UNKNOWN.
Referenced by odr_set_charset(), and yaz_record_conv_opac_record().
| int yaz_matchstr | ( | const char * | s1, | |
| const char * | s2 | |||
| ) |
match strings - independent of case and '-'
| s1 | first string | |
| s2 | second string (May include wildcard ? and .) |
| 0 | strings are similar | |
| !=0 | strings are different |
Definition at line 21 of file matchstr.c.
Referenced by yaz_advancegreek_decoder(), yaz_advancegreek_encoder(), yaz_init_opt_encode(), yaz_iso_5428_decoder(), yaz_iso_5428_encoder(), yaz_iso_8859_1_decoder(), yaz_iso_8859_1_encoder(), yaz_marc8_decoder(), yaz_marc8_encoder(), yaz_srw_str_to_pack(), yaz_string_to_oid(), yaz_ucs4_decoder(), yaz_ucs4_encoder(), yaz_utf8_decoder(), yaz_utf8_encoder(), yaz_wchar_decoder(), yaz_wchar_encoder(), z_HTTP_header_lookup(), ztest_scan(), and ztest_search().
| unsigned long yaz_read_UTF8_char | ( | unsigned char * | inp, | |
| size_t | inbytesleft, | |||
| size_t * | no_read, | |||
| int * | error | |||
| ) |
decodes UTF-8 sequence
| inp | input buffer with UTF-8 bytes | |
| inbytesleft | length of input buffer | |
| no_read | holds number of bytes read if conversion is successful | |
| error | pointer to error code if error occurs |
| 0 | if error | |
| >0 | if conversion is successful |
Definition at line 42 of file utf8.c.
References YAZ_ICONV_EILSEQ, and YAZ_ICONV_EINVAL.
| int yaz_strcmp_del | ( | const char * | a, | |
| const char * | b, | |||
| const char * | b_del | |||
| ) |
Definition at line 51 of file matchstr.c.
Referenced by yaz_sru_decode(), yaz_srw_check_content_type(), and yaz_srw_decode().
| 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 160 of file utf8.c.
References YAZ_ICONV_E2BIG.
1.5.6