File: unijp_build.h

package info (click to toggle)
libunicode-japanese-perl 0.50-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,376 kB
  • sloc: ansic: 30,821; perl: 5,635; erlang: 224; makefile: 191
file content (66 lines) | stat: -rw-r--r-- 2,565 bytes parent folder | download | duplicates (4)
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
/* ----------------------------------------------------------------------------
 * unijp_build.h
 * ----------------------------------------------------------------------------
 * Mastering programmed by YAMASHINA Hio
 *
 * Copyright 2008 YAMASHINA Hio
 * ----------------------------------------------------------------------------
 * $Id$
 * ------------------------------------------------------------------------- */
#ifndef UNIJP_BUILD_H
#define UNIJP_BUILD_H

#ifdef __cplusplus
extern "C"
{
#endif

#include "unijp.h"
#include "unijp_table.h"

extern void* _uj_alloc(const uj_alloc_t* alloc, uj_size_t size);
extern void* _uj_realloc(const uj_alloc_t* alloc, void* ptr, uj_size_t size);
extern void  _uj_free(const uj_alloc_t* alloc, void* ptr);

struct uj_conv_s
{
  const uj_alloc_t* alloc;
  uj_uint8* buf;       /* never becomes null. */
  uj_size_t buf_len;
  uj_size_t buf_bufsize; /* 0 means buf is contant or owned by other object. */
};
typedef struct uj_conv_s uj_conv_t;
extern void _uj_conv_set_const(uj_conv_t* conv, const uj_alloc_t* alloc, const uj_uint8* str, uj_size_t len);
extern uj_uint8* _uj_conv_own_string(uj_conv_t* conv);
extern void _uj_conv_move_owner(uj_conv_t* dst, uj_conv_t* src);
extern void _uj_conv_free_buffer(uj_conv_t* conv);

extern uj_conv_t* _uj_any_to_utf8(const uj_conv_t* in, uj_conv_t* out, uj_charcode_t icode);
extern uj_conv_t* _uj_validate_utf8(const uj_conv_t* in, uj_conv_t* out);

extern uj_conv_t* _uj_sjis_to_utf8(const uj_conv_t* in, uj_conv_t* out);
extern uj_conv_t* _uj_utf8_to_sjis(const uj_conv_t* in, uj_conv_t* out);

extern uj_conv_t* _uj_utf8_to_eucjp(const uj_conv_t* in, uj_conv_t* out);
extern uj_conv_t* _uj_eucjp_to_utf8(const uj_conv_t* in, uj_conv_t* out);

extern uj_conv_t* _uj_utf8_to_jis(const uj_conv_t* in, uj_conv_t* out);
extern uj_conv_t* _uj_jis_to_utf8(const uj_conv_t* in, uj_conv_t* out);

extern uj_conv_t* _uj_utf8_to_ucs2(const uj_conv_t* in, uj_conv_t* out);
extern uj_conv_t* _uj_ucs2_to_utf8(const uj_conv_t* in, uj_conv_t* out);

extern uj_conv_t* _uj_utf8_to_ucs4(const uj_conv_t* in, uj_conv_t* out);
extern uj_conv_t* _uj_ucs4_to_utf8(const uj_conv_t* in, uj_conv_t* out);

extern uj_conv_t* _uj_utf8_to_utf16(const uj_conv_t* in, uj_conv_t* out);
extern uj_conv_t* _uj_utf16_to_utf8(const uj_conv_t* in, uj_conv_t* out);

#ifdef __cplusplus
}
#endif

#endif /* !defined(UNIJP_BUILD_H) */
/* ----------------------------------------------------------------------------
 * End of File.
 * ------------------------------------------------------------------------- */