1
- /* $Id: pg_wchar.h,v 1.17 2000/08/25 14:24:09 ishii Exp $ */
1
+ /* $Id: pg_wchar.h,v 1.18 2000/10/12 06:08:28 ishii Exp $ */
2
2
3
3
#ifndef PG_WCHAR_H
4
4
#define PG_WCHAR_H
@@ -82,6 +82,8 @@ typedef struct
82
82
* client only */
83
83
void (* to_mic ) (); /* client encoding to MIC */
84
84
void (* from_mic ) (); /* MIC to client encoding */
85
+ void (* to_unicode ) (); /* client encoding to UTF-8 */
86
+ void (* from_unicode ) (); /* UTF-8 to client encoding */
85
87
} pg_encoding_conv_tbl ;
86
88
87
89
extern pg_encoding_conv_tbl pg_conv_tbl [];
@@ -95,13 +97,27 @@ typedef struct
95
97
96
98
extern pg_wchar_tbl pg_wchar_table [];
97
99
100
+ typedef struct
101
+ {
102
+ unsigned int utf ; /* UTF-8 */
103
+ unsigned int code ; /* local code */
104
+ unsigned char encoding ; /* encoding */
105
+ } pg_utf_to_local ;
106
+
107
+ typedef struct
108
+ {
109
+ unsigned int code ; /* local code */
110
+ unsigned int utf ; /* UTF-8 */
111
+ } pg_local_to_utf ;
112
+
98
113
extern int pg_mb2wchar (const unsigned char * , pg_wchar * );
99
114
extern int pg_mb2wchar_with_len (const unsigned char * , pg_wchar * , int );
100
115
extern int pg_char_and_wchar_strcmp (const char * , const pg_wchar * );
101
116
extern int pg_wchar_strncmp (const pg_wchar * , const pg_wchar * , size_t );
102
117
extern int pg_char_and_wchar_strncmp (const char * , const pg_wchar * , size_t );
103
118
extern size_t pg_wchar_strlen (const pg_wchar * );
104
119
extern int pg_mblen (const unsigned char * );
120
+ extern int pg_mblen_with_encoding (const unsigned char * , int );
105
121
extern int pg_encoding_mblen (int , const unsigned char * );
106
122
extern int pg_mule_mblen (const unsigned char * );
107
123
extern int pg_mic_mblen (const unsigned char * );
@@ -120,6 +136,8 @@ extern int pg_get_client_encoding(void);
120
136
extern unsigned char * pg_client_to_server (unsigned char * , int );
121
137
extern unsigned char * pg_server_to_client (unsigned char * , int );
122
138
extern int pg_valid_client_encoding (const char * );
139
+ extern pg_encoding_conv_tbl * pg_get_enc_ent (int );
140
+ extern int pg_utf_mblen (const unsigned char * );
123
141
124
142
/* internally-used versions of functions. The PG_xxx forms of these
125
143
* functions have fmgr-compatible interfaves.
0 commit comments