1 /* ----------------------------------------------------------------------------
2  * unijp_types.h
3  * ----------------------------------------------------------------------------
4  * Mastering programmed by YAMASHINA Hio
5  *
6  * Copyright 2008 YAMASHINA Hio
7  * ----------------------------------------------------------------------------
8  * $Id$
9  * ------------------------------------------------------------------------- */
10 #ifndef UNIJP_TYPES_H
11 #define UNIJP_TYPES_H
12 
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17 
18 #include "unijp_int.h"
19 
20 #include <stddef.h>
21 
22 typedef size_t uj_size_t;
23 enum uj_bool { uj_false, uj_true };
24 typedef enum uj_bool uj_bool;
25 
26 enum uj_charcode_e {
27   ujc_auto,
28   ujc_utf8,
29   ujc_sjis,
30   ujc_eucjp,
31   ujc_jis,
32 
33   ujc_ucs2,
34   ujc_ucs4,
35   ujc_utf16,
36   ujc_ascii,
37 
38   ujc_binary,
39   ujc_undefined,
40 };
41 typedef enum uj_charcode_e uj_charcode_t;
42 
43 struct uj_alloc_s
44 {
45   uj_uint32 magic;
46   void* baton;
47   void* (*alloc)(void* baton, uj_size_t size);
48   void* (*realloc)(void* baton, void* ptr, uj_size_t size);
49   void  (*free)(void* baton, void* ptr);
50 };
51 typedef struct uj_alloc_s uj_alloc_t;
52 extern const uj_alloc_t* _uj_default_alloc;
53 #define UJ_ALLOC_MAGIC (0)
54 
55 struct uj_encname_s
56 {
57   const char*   name;
58   uj_charcode_t code;
59   uj_bool       is_canon;
60   uj_bool       in_ok;
61   uj_bool       out_ok;
62 };
63 typedef struct uj_encname_s uj_encname_t;
64 extern const uj_encname_t uj_encnames[];
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* !defined(UNIJP_TYPES_H) */
71 /* ----------------------------------------------------------------------------
72  * End of File.
73  * ------------------------------------------------------------------------- */
74