1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
#ifndef UNICODE__JAPANESE_H__
#define UNICODE__JAPANESE_H__
/* $Id: Japanese.h 41491 2008-02-15 07:21:13Z hio $ */
#if !defined(__cplusplus) && !defined(bool)
#define bool char
#define true 1
#define false 0
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "mediate.h"
#ifndef assert
#include <assert.h>
#endif
#include "str.h"
#ifdef TEST
/* ``TEST'' is defined by devel.PL */
#include "test.h"
#define ONTEST(cmd) cmd
#else
#define ONTEST(cmd)
#endif
#ifndef EXTERN_C
# ifdef __cplusplus
# define EXTERN_C extern "C"
# else
# define EXTERN_C
# endif
#endif
/* misc. */
#define new_SV_UNDEF() newSVsv(&PL_sv_undef)
/* -------------------------------------------------------------------
* XS methods.
*/
#ifdef __cplusplus
extern "C"
{
#endif
/* sjis <=> utf8 (conv.cpp) */
SV* xs_sjis_utf8(SV* sv_str);
SV* xs_utf8_sjis(SV* sv_str);
/* getcode (getcode.cpp) */
SV* xs_getcode(SV* sv_str);
int xs_getcode_list(SV* sv_str);
/* utf-8 validation (utf8.c) */
SV* xs_validate_utf8(SV* sv_str);
/* sjis<=>eucjp, sjis<=>jis */
SV* xs_sjis_eucjp(SV* sv_str);
SV* xs_eucjp_sjis(SV* sv_str);
SV* xs_sjis_jis(SV* sv_str);
SV* xs_jis_sjis(SV* sv_str);
/* sjis(i-mode)<=>utf8 */
SV* xs_sjis_imode1_utf8(SV* sv_str);
SV* xs_sjis_imode2_utf8(SV* sv_str);
SV* xs_utf8_sjis_imode1(SV* sv_str);
SV* xs_utf8_sjis_imode2(SV* sv_str);
/* sjis(j-sky)<=>utf8 */
SV* xs_sjis_jsky1_utf8(SV* sv_str);
SV* xs_sjis_jsky2_utf8(SV* sv_str);
SV* xs_utf8_sjis_jsky1(SV* sv_str);
SV* xs_utf8_sjis_jsky2(SV* sv_str);
/* sjis(dot-i)<=>utf8 */
SV* xs_sjis_doti_utf8(SV* sv_str);
SV* xs_utf8_sjis_doti(SV* sv_str);
/* ucs2<=>utf-8 */
SV* xs_ucs2_utf8(SV* sv_str);
SV* xs_utf8_ucs2(SV* sv_str);
/* ucs4<=>utf-8 */
SV* xs_ucs4_utf8(SV* sv_str);
SV* xs_utf8_ucs4(SV* sv_str);
/* utf-16<=>utf8 */
SV* xs_utf16_utf8(SV* sv_str);
SV* xs_utf8_utf16(SV* sv_str);
/* init/cleanup memoey map. */
/* (ja:) ޥåץեϢ */
extern void do_memmap(void);
extern void do_memunmap(void);
/* SJIS <=> UTF8 mapping table */
/* (ja:) SJIS <=> UTF8 Ѵơ֥ */
/* index is in 0..0xffff */
extern UJ_UINT8 const* g_u2s_table;
extern UJ_UINT8 const* g_s2u_table;
/* i-mode/j-sky/dot-i emoji <=> UTF8 mapping table */
/* (ja:) i-mode/j-sky/dot-i ʸ <=> UTF8 Ѵơ֥ */
extern UJ_UINT32 const* g_ei2u1_table;
extern UJ_UINT32 const* g_ei2u2_table;
extern UJ_UINT16 const* g_eu2i1_table;
extern UJ_UINT16 const* g_eu2i2_table;
extern UJ_UINT32 const* g_ej2u1_table;
extern UJ_UINT32 const* g_ej2u2_table;
extern UJ_UINT8 const* g_eu2j1_table; /* char [][5] */
extern UJ_UINT8 const* g_eu2j2_table; /* char [][5] */
extern UJ_UINT32 const* g_ed2u_table;
extern UJ_UINT16 const* g_eu2d_table;
/* i-mode/j-sky/dot-iʸ <=> UTF8 Ѵơ֥ǿ */
/* ХȿǤʤǿ */
extern int g_ei2u1_size;
extern int g_ei2u2_size;
extern int g_eu2i1_size;
extern int g_eu2i2_size;
extern int g_ej2u1_size;
extern int g_ej2u2_size;
extern int g_eu2j1_size;
extern int g_eu2j2_size;
extern int g_ed2u_size;
extern int g_eu2d_size;
#ifdef __cplusplus
}
#endif
#ifdef UNIJP__PERL_OLDER_THAN_5_006
/* above symbol is defined by Makefile.PL:sub configure. */
#define aTHX_
#define pTHX_
#define dTHX_
#define get_av(var_name,create_flag) perl_get_av(var_name,create_flag);
#ifndef newSVpvn
#define newSVpvn(str,len) newSVpv(str,len)
#endif
#endif /* UNIJP__PERL_OLDER_THAN_5_006 */
#ifdef UNIJP__PERL_OLDER_THAN_5_005
/* above symbol is defined by Makefile.PL:sub configure. */
#ifndef PL_sv_undef
#define PL_sv_undef sv_undef
#endif
#endif /* UNIJP__PERL_OLDER_THAN_5_005 */
/* for 5.005_xx */
#ifndef call_pv
#define call_pv perl_call_pv
#endif
#ifndef eval_pv
#define eval_pv perl_eval_pv
#endif
#ifndef get_sv
#define get_sv perl_get_sv
#endif
/* for 5.004_xx */
#ifndef PL_na
#define PL_na UNIJP_PL_na
static STRLEN UNIJP_PL_na;
#endif
#endif /* UNICODE__JAPANESE_H__ */
|