#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/iconv.h>
#include "iconv_converter_if.h"
Go to the source code of this file.
|
| __FBSDID ("$BSDSUniX$") |
|
static uint32_t | utf8_to_ucs4 (const char *src, size_t *utf8width, size_t srclen) |
|
static u_char * | ucs4_to_utf8 (uint32_t ucs4, char *dst, size_t *utf8width, size_t dstlen) |
|
static uint32_t | encode_surrogate (uint32_t code) |
|
static uint32_t | decode_surrogate (const u_char *ucs) |
|
static int | iconv_ucs_open (struct iconv_converter_class *dcp, struct iconv_cspair *csp, struct iconv_cspair *cspf, void **dpp) |
|
static int | iconv_ucs_close (void *data) |
|
static int | iconv_ucs_conv (void *d2p, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft, int convchar, int casetype) |
|
static int | iconv_ucs_init (struct iconv_converter_class *dcp) |
|
static int | iconv_ucs_done (struct iconv_converter_class *dcp) |
|
static const char * | iconv_ucs_name (struct iconv_converter_class *dcp) |
|
| KICONV_CONVERTER (ucs, sizeof(struct iconv_ucs)) |
|
static uint32_t | encode_surrogate (register uint32_t code) |
|
static uint32_t | decode_surrogate (register const u_char *ucs) |
|
#define ENCODING_UTF16 "UTF-16BE" |
#define ENCODING_UTF8 "UTF-8" |
#define KICONV_UCS_COMBINE 0x1 |
#define KICONV_UCS_FROM_LE 0x8 |
#define KICONV_UCS_FROM_UTF16 0x20 |
#define KICONV_UCS_FROM_UTF8 0x2 |
#define KICONV_UCS_TO_LE 0x10 |
#define KICONV_UCS_TO_UTF16 0x40 |
#define KICONV_UCS_TO_UTF8 0x4 |
#define KICONV_UCS_UCS4 0x80 |
__FBSDID |
( |
"$BSDSUniX$" |
| ) |
|
static uint32_t decode_surrogate |
( |
const u_char * |
ucs | ) |
|
|
static |
static uint32_t decode_surrogate |
( |
register const u_char * |
ucs | ) |
|
|
static |
static uint32_t encode_surrogate |
( |
uint32_t |
code | ) |
|
|
static |
static uint32_t encode_surrogate |
( |
register uint32_t |
code | ) |
|
|
static |
static int iconv_ucs_close |
( |
void * |
data | ) |
|
|
static |
Definition at line 146 of file iconv_ucs.c.
References iconv_ucs::convtype, iconv_ucs::ctype, iconv_ucs::d_csp, iconv_ucs::d_cspf, iconv_ucs::f_ctp, iconv_close(), KICONV_UCS_FROM_LE, KICONV_UCS_FROM_UTF8, KICONV_UCS_TO_LE, KICONV_UCS_TO_UTF8, and iconv_ucs::t_ctp.
static int iconv_ucs_conv |
( |
void * |
d2p, |
|
|
const char ** |
inbuf, |
|
|
size_t * |
inbytesleft, |
|
|
char ** |
outbuf, |
|
|
size_t * |
outbytesleft, |
|
|
int |
convchar, |
|
|
int |
casetype |
|
) |
| |
|
static |
Definition at line 167 of file iconv_ucs.c.
References iconv_ucs::convtype, iconv_ucs::ctype, decode_surrogate(), encode_surrogate(), iconv_ucs::f_ctp, iconv_convchr_case(), inbuf, inbytesleft, KICONV_UCS_COMBINE, KICONV_UCS_FROM_LE, KICONV_UCS_FROM_UTF16, KICONV_UCS_FROM_UTF8, KICONV_UCS_TO_LE, KICONV_UCS_TO_UTF16, KICONV_UCS_TO_UTF8, KICONV_UCS_UCS4, outbuf, outbytesleft, iconv_ucs::t_ctp, towlower(), towupper(), ucs4_to_utf8(), and utf8_to_ucs4().
static int iconv_ucs_done |
( |
struct iconv_converter_class * |
dcp | ) |
|
|
static |
static int iconv_ucs_init |
( |
struct iconv_converter_class * |
dcp | ) |
|
|
static |
static const char* iconv_ucs_name |
( |
struct iconv_converter_class * |
dcp | ) |
|
|
static |
static int iconv_ucs_open |
( |
struct iconv_converter_class * |
dcp, |
|
|
struct iconv_cspair * |
csp, |
|
|
struct iconv_cspair * |
cspf, |
|
|
void ** |
dpp |
|
) |
| |
|
static |
Definition at line 89 of file iconv_ucs.c.
References iconv_ucs::convtype, iconv_ucs::ctype, iconv_ucs::d_csp, iconv_ucs::d_cspf, ENCODING_UTF16, ENCODING_UTF8, iconv_ucs::f_ctp, iconv_open(), KICONV_UCS_COMBINE, KICONV_UCS_FROM_LE, KICONV_UCS_FROM_UTF8, KICONV_UCS_TO_LE, KICONV_UCS_TO_UTF8, KICONV_UCS_UCS4, name, strcasecmp(), strcmp(), iconv_ucs::t_ctp, and unicode_family.
KICONV_CONVERTER |
( |
ucs |
, |
|
|
sizeof(struct iconv_ucs) |
|
|
) |
| |
static u_char * ucs4_to_utf8 |
( |
uint32_t |
ucs4, |
|
|
char * |
dst, |
|
|
size_t * |
utf8width, |
|
|
size_t |
dstlen |
|
) |
| |
|
static |
static uint32_t utf8_to_ucs4 |
( |
const char * |
src, |
|
|
size_t * |
utf8width, |
|
|
size_t |
srclen |
|
) |
| |
|
static |
kobj_method_t iconv_ucs_methods[] |
|
static |
Initial value:= {
{0, 0}
}
static int iconv_ucs_init(struct iconv_converter_class *dcp)
static int iconv_ucs_conv(void *d2p, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft, int convchar, int casetype)
static int iconv_ucs_close(void *data)
static int iconv_ucs_done(struct iconv_converter_class *dcp)
static int iconv_ucs_open(struct iconv_converter_class *dcp, struct iconv_cspair *csp, struct iconv_cspair *cspf, void **dpp)
static const char * iconv_ucs_name(struct iconv_converter_class *dcp)
Definition at line 399 of file iconv_ucs.c.
struct { ... } unicode_family[] |
Initial value:= {
{ NULL, 0, 0 }
}
#define KICONV_UCS_FROM_UTF16
#define KICONV_UCS_FROM_UTF8
#define KICONV_UCS_FROM_LE
#define KICONV_UCS_TO_UTF16
#define KICONV_UCS_TO_UTF8
Referenced by iconv_ucs_open().