2 * AnthyÆâÉô¤Ç»È¤¦Ê¸»úÎó
3 * Æä˼ÂÁõ¤ò±£Ê䷤褦¤È¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï̵¤¤¤Î¤Ç¡¢
4 * ¤³¤³¤Ë¤¢¤ë´Ø¿ô¤Î»ÈÍѤ϶¯À©¤·¤Ê¤¤¡£
6 #ifndef _xstr_h_included_
7 #define _xstr_h_included_
14 * xstr¤Ëtypedef¤µ¤ì¤Æ¤¤¤ë
16 typedef struct xstr_ {
17 /** ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ */
23 /* ¥Ç¥Ð¥Ã¥°ÍѤνÐÎÏ´Ø¿ô */
24 void anthy_putxchar(xchar );
25 void anthy_putxstr(xstr *);
26 void anthy_putxstrln(xstr *);
28 /* C¤Îʸ»úÎó¤Ø¤Î½ñ¤½Ð¤· */
29 int anthy_sputxchar(char *, xchar , int encoding);
30 int anthy_sputxstr(char *, xstr *, int encoding);
31 int anthy_snputxstr(char *, int , xstr *, int encoding);
33 /* xstr¤Èstr¶¦¤Ëmalloc¤µ¤ì¤ë¡¢free¤ÇξÊý²òÊü¤¹¤ë¤«anthy_free_xstr¤Ç²òÊü¤¹¤ë */
34 xstr *anthy_cstr_to_xstr(const char *, int );
35 /* ·ë²Ì¤Ïmalloc¤Ç³ÎÊݤµ¤ì¤ë */
36 char *anthy_xstr_to_cstr(xstr *, int);
38 /* xstr¤Èstr¶¦¤Ëmalloc¤µ¤ì¤ë */
39 xstr *anthy_xstr_dup(xstr *);
40 void anthy_free_xstr(xstr *);
42 /* ·ë²Ì¤Ïmalloc¤Ç³ÎÊݤµ¤ì¤ë */
43 xchar *anthy_xstr_dup_str(xstr *);
44 void anthy_free_xstr_str(xstr *);
46 /* ʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë */
47 xstr* anthy_xstrcpy(xstr *, xstr *);
48 /* ʸ»úÎó¤òÈæ³Ó¤¹¤ë¡£strcmp¤ÈƱÅù¤ÎÆ°ºî(ÊÖ¤êÃͤÎÉä¹æ¤Ë°ÕÌ£¤¬¤¢¤ë) */
49 int anthy_xstrcmp(xstr *, xstr *);
50 /* nʸ»úÌܤޤÇʸ»úÎó¤òÈæ³Ó¤¹¤ë¡£strncmp¤ÈƱÅù¤ÎÆ°ºî(ÊÖ¤êÃͤÎÉä¹æ¤Ë°ÕÌ£¤¬¤¢¤ë) */
51 int anthy_xstrncmp(xstr *, xstr *, int);
52 /* s->str¤òrealloc¤¹¤ë */
53 xstr *anthy_xstrcat(xstr *s, xstr *d);
54 /* xs->str¤òrealloc¤¹¤ë */
55 xstr *anthy_xstrappend(xstr *xs, xchar c);
58 long long anthy_xstrtoll(xstr *);
59 /* Á´³Ñ¿ô»ú¤«¤éȾ³Ñ¿ô»ú¤Ø¤ÎÊÑ´¹ */
60 xstr *anthy_xstr_wide_num_to_num(xstr *);
61 /* ¤Ò¤é¤¬¤Ê¤«¤é¥«¥¿¥«¥Ê¤Ø¤ÎÊÑ´¹ */
62 xstr *anthy_xstr_hira_to_kata(xstr *);
64 xstr *anthy_xstr_hira_to_half_kata(xstr *);
65 xstr *anthy_conv_half_wide(xstr *xs);
68 #define XCT_ALL 0xffffffff
74 #define XCT_WIDENUM 16
77 /* ľÁ°¤Îʸ»ú¤Î°ìÉô */
82 #define XCT_SYMBOL 1024
84 #define XCT_KANJI 2048
86 #define XCT_PUNCTUATION 4096
88 /** XCT_*¤¬Ê֤äƤ¯¤ë */
89 int anthy_get_xchar_type(const xchar );
90 /** Á´¤Æ¤Îʸ»ú¤ËÂФ·¤ÆXCT_*¤ÎÏÀÍýÀѤò¤È¤Ã¤¿¤â¤Î */
91 int anthy_get_xstr_type(const xstr *);
94 int anthy_xstr_hash(xstr *);
97 int anthy_init_xstr(void);
98 void anthy_quit_xstr(void);
99 void anthy_xstr_set_print_encoding(int );
101 int anthy_euc_to_ucs(int ec);
102 int anthy_ucs_to_euc(int uc);
104 const char *anthy_utf8_to_ucs4_xchar(const char *s, xchar *res);
106 char *anthy_conv_euc_to_utf8(const char *s);
107 char *anthy_conv_utf8_to_euc(const char *s);