3#include <wine/unicode.h>
24 delta /= (firsttime ?
DAMP : 2);
25 delta += delta/numpoints;
38 LPWSTR lpUnicodeCharStr,
INT cchUnicodeChar)
42 INT i, label_start, label_end, out_label,
out = 0;
45 DPRINT(
"%x %p %d %p %d\n",
dwFlags, lpASCIICharStr, cchASCIIChar,
46 lpUnicodeCharStr, cchUnicodeChar);
48 for(label_start=0; label_start<cchASCIIChar;) {
52 for(
i=label_start;
i<cchASCIIChar;
i++) {
53 ch = lpASCIICharStr[
i];
55 if(ch>0x7f || (
i!=cchASCIIChar-1 && !ch)) {
65 if((
dwFlags&IDN_USE_STD3_ASCII_RULES) == 0)
67 if((ch>=
'a' && ch<=
'z') || (ch>=
'A' && ch<=
'Z')
68 || (ch>=
'0' && ch<=
'9') || ch==
'-')
76 if(label_start==label_end && ch) {
81 if((
dwFlags&IDN_USE_STD3_ASCII_RULES) && (lpASCIICharStr[label_start]==
'-' ||
82 lpASCIICharStr[label_end-1]==
'-')) {
86 if(label_end-label_start > 63) {
91 if(label_end-label_start<4 ||
92 tolowerW(lpASCIICharStr[label_start])!=
'x' ||
93 tolowerW(lpASCIICharStr[label_start+1])!=
'n' ||
94 lpASCIICharStr[label_start+2]!=
'-' || lpASCIICharStr[label_start+3]!=
'-') {
95 if(label_end < cchASCIIChar)
98 if(!lpUnicodeCharStr) {
99 out += label_end-label_start;
100 }
else if(
out+label_end-label_start <= cchUnicodeChar) {
101 memcpy(lpUnicodeCharStr+
out, lpASCIICharStr+label_start,
102 (label_end-label_start)*
sizeof(
WCHAR));
103 out += label_end-label_start;
109 label_start = label_end;
113 if(delim == label_start+3)
115 if(!lpUnicodeCharStr) {
116 out += delim-label_start-4;
117 }
else if(
out+delim-label_start-4 <= cchUnicodeChar) {
118 memcpy(lpUnicodeCharStr+
out, lpASCIICharStr+label_start+4,
119 (delim-label_start-4)*
sizeof(
WCHAR));
120 out += delim-label_start-4;
128 for(
i=delim;
i<label_end;) {
132 ch =
i<label_end ?
tolowerW(lpASCIICharStr[
i++]) : 0;
133 if((ch<
'a' || ch>
'z') && (ch<
'0' || ch>
'9')) {
137 digit = ch<=
'9' ? ch-
'0'+
'z'-
'a'+1 : ch-
'a';
148 if((
dwFlags&IDN_ALLOW_UNASSIGNED)==0 &&
153 if(!lpUnicodeCharStr) {
155 }
else if(
out+1 <= cchASCIIChar) {
157 lpUnicodeCharStr+out_label+
pos,
159 lpUnicodeCharStr[out_label+
pos] =
n;
168 if(
out-out_label > 63) {
173 if(label_end < cchASCIIChar) {
174 if(!lpUnicodeCharStr) {
176 }
else if(
out+1 <= cchUnicodeChar) {
177 lpUnicodeCharStr[
out++] = lpASCIICharStr[label_end];
183 label_start = label_end+1;
static INT adapt(INT delta, INT numpoints, BOOL firsttime)
INT WINAPI IdnToUnicode(DWORD dwFlags, LPCWSTR lpASCIICharStr, INT cchASCIIChar, LPWSTR lpUnicodeCharStr, INT cchUnicodeChar)
static unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_INVALID_NAME
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
const unsigned short nameprep_char_type[4432]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags