]> pd.if.org Git - pdclib.old/blob - includes/uchar.h
[gandr] s/__lp64__/__LP64__/ to match GCC define
[pdclib.old] / includes / uchar.h
1 /* 7.28 <uchar.h>
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7
8 #ifndef _PDCLIB_UCHAR_H
9 #define _PDCLIB_UCHAR_H
10 #include <_PDCLIB_int.h>
11 _PDCLIB_BEGIN_EXTERN_C
12
13 /* This is mostly a placeholder. for now. This header will be completed by the
14  * release of 0.6, but at present merely exposes types needed by the rest of the
15  * library
16  */
17
18 #ifndef _PDCLIB_SIZE_T_DEFINED
19 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
20 typedef _PDCLIB_size_t size_t;
21 #endif
22
23 #ifndef _PDCLIB_MBSTATE_T_DEFINED
24 #define _PDCLIB_MBSTATE_T_DEFINED _PDCLIB_MBSTATE_T_DEFINED
25 typedef _PDCLIB_mbstate_t mbstate_t;
26 #endif
27
28 #ifndef __cplusplus
29 #ifndef _PDCLIB_CHAR16_T_DEFINED
30 #define _PDCLIB_CHAR16_T_DEFINED _PDCLIB_CHAR16_T_DEFINED
31 typedef _PDCLIB_char16_t char16_t;
32 #endif
33
34 #ifndef _PDCLIB_CHAR32_T_DEFINED
35 #define _PDCLIB_CHAR32_T_DEFINED _PDCLIB_CHAR32_T_DEFINED
36 typedef _PDCLIB_char32_t char32_t;
37 #endif
38 #endif
39
40 size_t mbrtoc16(
41     char16_t    *_PDCLIB_restrict   pc16,
42     const char  *_PDCLIB_restrict   s, 
43     size_t                          n,
44     mbstate_t   *_PDCLIB_restrict   ps);
45
46 size_t c16rtomb(
47     char        *_PDCLIB_restrict   s, 
48     char16_t                        c16, 
49     mbstate_t   *_PDCLIB_restrict   ps);
50
51 size_t mbrtoc32(
52     char32_t    *_PDCLIB_restrict   pc32,
53     const char  *_PDCLIB_restrict   s, 
54     size_t                          n,
55     mbstate_t   *_PDCLIB_restrict   ps);
56
57 size_t c32rtomb(
58     char        *_PDCLIB_restrict   s, 
59     char32_t                        c32,
60     mbstate_t   *_PDCLIB_restrict   ps);
61
62 #if defined(_PDCLIB_EXTENSIONS)
63 /* Analogous to strlen/wcslen */
64 size_t _PDCLIB_c16slen(const char16_t * str);
65 size_t _PDCLIB_c32slen(const char32_t * str);
66
67 /* String generalizations of the above functions */
68 size_t _PDCLIB_mbsrtoc16s(
69     char16_t    *_PDCLIB_restrict   dst, 
70     const char **_PDCLIB_restrict   src, 
71     size_t                          len, 
72     mbstate_t   *_PDCLIB_restrict   ps);
73
74 size_t _PDCLIB_mbsrtoc32s(
75     char32_t        *_PDCLIB_restrict   dst, 
76     const char     **_PDCLIB_restrict   src, 
77     size_t                              len, 
78     mbstate_t       *_PDCLIB_restrict   ps);
79
80 size_t _PDCLIB_c16srtombs(
81     char            *_PDCLIB_restrict   dst, 
82     const char16_t **_PDCLIB_restrict   src, 
83     size_t                              len, 
84     mbstate_t       *_PDCLIB_restrict   ps);
85
86 size_t _PDCLIB_c32srtombs(
87     char            *_PDCLIB_restrict   dst, 
88     const char32_t **_PDCLIB_restrict   src, 
89     size_t                              len, 
90     mbstate_t       *_PDCLIB_restrict   ps);
91 #endif
92
93 #endif