ReactOS 0.4.17-dev-966-gf06eace
xmllite_private.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  xml_encoding {
  XmlEncoding_ISO_8859_1 = 0 , XmlEncoding_ISO_8859_13 , XmlEncoding_ISO_8859_15 , XmlEncoding_ISO_8859_2 ,
  XmlEncoding_ISO_8859_3 , XmlEncoding_ISO_8859_4 , XmlEncoding_ISO_8859_5 , XmlEncoding_ISO_8859_7 ,
  XmlEncoding_ISO_8859_9 , XmlEncoding_UTF16 , XmlEncoding_UTF8 , XmlEncoding_windows_1250 ,
  XmlEncoding_windows_1251 , XmlEncoding_windows_1252 , XmlEncoding_windows_1253 , XmlEncoding_windows_1254 ,
  XmlEncoding_windows_1255 , XmlEncoding_windows_1256 , XmlEncoding_windows_1257 , XmlEncoding_windows_1258 ,
  XmlEncoding_Unknown , XmlEncoding_USASCII , XmlEncoding_UTF16 , XmlEncoding_UTF8 ,
  XmlEncoding_Unknown
}
 

Functions

static void * m_alloc (IMalloc *imalloc, size_t len)
 
static void * m_realloc (IMalloc *imalloc, void *mem, size_t len)
 
static void m_free (IMalloc *imalloc, void *mem)
 
xml_encoding parse_encoding_name (const WCHAR *, int)
 
HRESULT get_code_page (xml_encoding, UINT *)
 
const WCHAR * get_encoding_name (xml_encoding)
 
xml_encoding get_encoding_from_codepage (UINT)
 
BOOL is_ncnamechar (WCHAR ch)
 
BOOL is_pubchar (WCHAR ch)
 
BOOL is_namestartchar (WCHAR ch)
 
BOOL is_namechar (WCHAR ch)
 
static BOOL is_char (WCHAR ch)
 
static BOOL is_wchar_space (WCHAR ch)
 

Enumeration Type Documentation

◆ xml_encoding

Enumerator
XmlEncoding_ISO_8859_1 
XmlEncoding_ISO_8859_13 
XmlEncoding_ISO_8859_15 
XmlEncoding_ISO_8859_2 
XmlEncoding_ISO_8859_3 
XmlEncoding_ISO_8859_4 
XmlEncoding_ISO_8859_5 
XmlEncoding_ISO_8859_7 
XmlEncoding_ISO_8859_9 
XmlEncoding_UTF16 
XmlEncoding_UTF8 
XmlEncoding_windows_1250 
XmlEncoding_windows_1251 
XmlEncoding_windows_1252 
XmlEncoding_windows_1253 
XmlEncoding_windows_1254 
XmlEncoding_windows_1255 
XmlEncoding_windows_1256 
XmlEncoding_windows_1257 
XmlEncoding_windows_1258 
XmlEncoding_Unknown 
XmlEncoding_USASCII 
XmlEncoding_UTF16 
XmlEncoding_UTF8 
XmlEncoding_Unknown 

Definition at line 48 of file xmllite_private.h.

49{
xml_encoding
@ XmlEncoding_UTF8
@ XmlEncoding_Unknown
@ XmlEncoding_UTF16
@ XmlEncoding_USASCII

Function Documentation

◆ get_code_page()

HRESULT get_code_page ( xml_encoding  encoding,
UINT *  cp 
)

Definition at line 724 of file reader.c.

725{
726 if (encoding == XmlEncoding_Unknown)
727 {
728 FIXME("unsupported encoding %d\n", encoding);
729 return E_NOTIMPL;
730 }
731
732 *cp = xml_encoding_map[encoding].cp;
733
734 return S_OK;
735}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
static const struct xml_encoding_data xml_encoding_map[]
Definition: reader.c:148
#define S_OK
Definition: intsafe.h:52
POINT cp
Definition: magnifier.c:59
@ XmlEncoding_Unknown
Definition: mxwriter.c:70

Referenced by readerinput_switchencoding().

◆ get_encoding_from_codepage()

xml_encoding get_encoding_from_codepage ( UINT  codepage)

Definition at line 160 of file reader.c.

161{
162 int i;
163 for (i = 0; i < ARRAY_SIZE(xml_encoding_map); i++)
164 {
165 if (xml_encoding_map[i].cp == codepage) return xml_encoding_map[i].enc;
166 }
167 return XmlEncoding_Unknown;
168}
#define ARRAY_SIZE(A)
Definition: main.h:20
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
Definition: glfuncs.h:248
int codepage
Definition: win_iconv.c:156

Referenced by CreateXmlReaderInputWithEncodingCodePage(), and CreateXmlWriterOutputWithEncodingCodePage().

◆ get_encoding_name()

const WCHAR * get_encoding_name ( xml_encoding  encoding)

Definition at line 155 of file reader.c.

156{
157 return xml_encoding_map[encoding].name;
158}

Referenced by get_output_encoding_name().

◆ is_char()

static BOOL is_char ( WCHAR  ch)
inlinestatic

Definition at line 67 of file xmllite_private.h.

68{
69 return (ch == '\t') || (ch == '\r') || (ch == '\n') ||
70 (ch >= 0x20 && ch <= 0xd7ff) ||
71 (ch >= 0xd800 && ch <= 0xdbff) || /* high surrogate */
72 (ch >= 0xdc00 && ch <= 0xdfff) || /* low surrogate */
73 (ch >= 0xe000 && ch <= 0xfffd);
74}
unsigned char ch[4][2]
Definition: console.c:118

◆ is_namechar()

BOOL is_namechar ( WCHAR  ch)

Definition at line 1530 of file reader.c.

1531{
1532 return (ch == ':') || is_ncnamechar(ch);
1533}
BOOL is_ncnamechar(WCHAR ch)
Definition: reader.c:1506

Referenced by is_valid_name(), and reader_parse_name().

◆ is_namestartchar()

BOOL is_namestartchar ( WCHAR  ch)

Definition at line 1486 of file reader.c.

1487{
1488 return (ch == ':') || (ch >= 'A' && ch <= 'Z') ||
1489 (ch == '_') || (ch >= 'a' && ch <= 'z') ||
1490 (ch >= 0xc0 && ch <= 0xd6) ||
1491 (ch >= 0xd8 && ch <= 0xf6) ||
1492 (ch >= 0xf8 && ch <= 0x2ff) ||
1493 (ch >= 0x370 && ch <= 0x37d) ||
1494 (ch >= 0x37f && ch <= 0x1fff) ||
1495 (ch >= 0x200c && ch <= 0x200d) ||
1496 (ch >= 0x2070 && ch <= 0x218f) ||
1497 (ch >= 0x2c00 && ch <= 0x2fef) ||
1498 (ch >= 0x3001 && ch <= 0xd7ff) ||
1499 (ch >= 0xd800 && ch <= 0xdbff) || /* high surrogate */
1500 (ch >= 0xdc00 && ch <= 0xdfff) || /* low surrogate */
1501 (ch >= 0xf900 && ch <= 0xfdcf) ||
1502 (ch >= 0xfdf0 && ch <= 0xfffd);
1503}

Referenced by is_valid_name(), reader_parse_name(), and readerinput_detectencoding().

◆ is_ncnamechar()

BOOL is_ncnamechar ( WCHAR  ch)

Definition at line 1506 of file reader.c.

1507{
1508 return (ch >= 'A' && ch <= 'Z') ||
1509 (ch == '_') || (ch >= 'a' && ch <= 'z') ||
1510 (ch == '-') || (ch == '.') ||
1511 (ch >= '0' && ch <= '9') ||
1512 (ch == 0xb7) ||
1513 (ch >= 0xc0 && ch <= 0xd6) ||
1514 (ch >= 0xd8 && ch <= 0xf6) ||
1515 (ch >= 0xf8 && ch <= 0x2ff) ||
1516 (ch >= 0x300 && ch <= 0x36f) ||
1517 (ch >= 0x370 && ch <= 0x37d) ||
1518 (ch >= 0x37f && ch <= 0x1fff) ||
1519 (ch >= 0x200c && ch <= 0x200d) ||
1520 (ch >= 0x203f && ch <= 0x2040) ||
1521 (ch >= 0x2070 && ch <= 0x218f) ||
1522 (ch >= 0x2c00 && ch <= 0x2fef) ||
1523 (ch >= 0x3001 && ch <= 0xd7ff) ||
1524 (ch >= 0xd800 && ch <= 0xdbff) || /* high surrogate */
1525 (ch >= 0xdc00 && ch <= 0xdfff) || /* low surrogate */
1526 (ch >= 0xf900 && ch <= 0xfdcf) ||
1527 (ch >= 0xfdf0 && ch <= 0xfffd);
1528}

Referenced by is_namechar(), is_valid_ncname(), reader_parse_local(), and reader_parse_qname().

◆ is_pubchar()

BOOL is_pubchar ( WCHAR  ch)

Definition at line 1473 of file reader.c.

1474{
1475 return (ch == ' ') ||
1476 (ch >= 'a' && ch <= 'z') ||
1477 (ch >= 'A' && ch <= 'Z') ||
1478 (ch >= '0' && ch <= '9') ||
1479 (ch >= '-' && ch <= ';') || /* '()*+,-./:; */
1480 (ch == '=') || (ch == '?') ||
1481 (ch == '@') || (ch == '!') ||
1482 (ch >= '#' && ch <= '%') || /* #$% */
1483 (ch == '_') || (ch == '\r') || (ch == '\n');
1484}

Referenced by is_valid_pubid(), and reader_parse_pub_literal().

◆ is_wchar_space()

static BOOL is_wchar_space ( WCHAR  ch)
inlinestatic

Definition at line 77 of file xmllite_private.h.

78{
79 return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
80}

Referenced by reader_parse_attvalue(), reader_parse_chardata(), reader_parse_misc(), reader_parse_pi(), reader_parse_reference(), reader_skipspaces(), and xmlwriter_WriteWhitespace().

◆ m_alloc()

static void * m_alloc ( IMalloc *  imalloc,
size_t  len 
)
inlinestatic

Definition at line 24 of file xmllite_private.h.

25{
26 if (imalloc)
27 return IMalloc_Alloc(imalloc, len);
28 else
29 return malloc(len);
30}
#define malloc
Definition: debug_ros.c:4
GLenum GLsizei len
Definition: glext.h:6722

Referenced by create_reader_input(), create_writer_output(), CreateXmlReader(), CreateXmlWriter(), reader_alloc(), readerinput_alloc(), writer_alloc(), and writeroutput_alloc().

◆ m_free()

static void m_free ( IMalloc *  imalloc,
void *  mem 
)
inlinestatic

Definition at line 40 of file xmllite_private.h.

41{
42 if (imalloc)
43 IMalloc_Free(imalloc, mem);
44 else
45 free(mem);
46}
#define free
Definition: debug_ros.c:5
Definition: mem.c:349

Referenced by reader_free(), readerinput_free(), writer_free(), and writeroutput_free().

◆ m_realloc()

static void * m_realloc ( IMalloc *  imalloc,
void *  mem,
size_t  len 
)
inlinestatic

Definition at line 32 of file xmllite_private.h.

33{
34 if (imalloc)
35 return IMalloc_Realloc(imalloc, mem, len);
36 else
37 return realloc(mem, len);
38}
#define realloc
Definition: debug_ros.c:6

Referenced by readerinput_realloc(), and writeroutput_realloc().

◆ parse_encoding_name()

xml_encoding parse_encoding_name ( const WCHAR *  name,
int  len 
)

Definition at line 737 of file reader.c.

738{
739 int min, max, n, c;
740
741 if (!name) return XmlEncoding_Unknown;
742
743 min = 0;
745
746 while (min <= max)
747 {
748 n = (min+max)/2;
749
750 if (len != -1)
752 else
754 if (!c)
755 return xml_encoding_map[n].enc;
756
757 if (c > 0)
758 max = n-1;
759 else
760 min = n+1;
761 }
762
763 return XmlEncoding_Unknown;
764}
#define wcsnicmp
Definition: compat.h:14
#define wcsicmp
Definition: compat.h:15
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define min(a, b)
Definition: monoChain.cc:55
Definition: name.c:39
#define max(a, b)
Definition: svc.c:63

Referenced by CreateXmlReaderInputWithEncodingName(), and reader_parse_encname().