ReactOS 0.4.15-dev-7842-g558ab78
xmllite_private.h File Reference
#include "wine/heap.h"
Include dependency graph for xmllite_private.h:
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_Unknown ,
  XmlEncoding_USASCII , XmlEncoding_UTF16 , XmlEncoding_UTF8 , XmlEncoding_Unknown
}
 

Functions

static voidm_alloc (IMalloc *imalloc, size_t len)
 
static voidm_realloc (IMalloc *imalloc, void *mem, size_t len)
 
static void m_free (IMalloc *imalloc, void *mem)
 
xml_encoding parse_encoding_name (const WCHAR *, int) DECLSPEC_HIDDEN
 
HRESULT get_code_page (xml_encoding, UINT *) DECLSPEC_HIDDEN
 
const WCHARget_encoding_name (xml_encoding) DECLSPEC_HIDDEN
 
xml_encoding get_encoding_from_codepage (UINT) DECLSPEC_HIDDEN
 
BOOL is_ncnamechar (WCHAR ch) DECLSPEC_HIDDEN
 
BOOL is_pubchar (WCHAR ch) DECLSPEC_HIDDEN
 
BOOL is_namestartchar (WCHAR ch) DECLSPEC_HIDDEN
 
BOOL is_namechar (WCHAR ch) DECLSPEC_HIDDEN
 

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_Unknown 
XmlEncoding_USASCII 
XmlEncoding_UTF16 
XmlEncoding_UTF8 
XmlEncoding_Unknown 

Definition at line 50 of file xmllite_private.h.

51{
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 734 of file reader.c.

735{
737 {
738 FIXME("unsupported encoding %d\n", encoding);
739 return E_NOTIMPL;
740 }
741
743
744 return S_OK;
745}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static const struct xml_encoding_data xml_encoding_map[]
Definition: reader.c:159
#define S_OK
Definition: intsafe.h:52
POINT cp
Definition: magnifier.c:59
@ XmlEncoding_Unknown
Definition: mxwriter.c:66
static char * encoding
Definition: xmllint.c:155

Referenced by readerinput_switchencoding().

◆ get_encoding_from_codepage()

xml_encoding get_encoding_from_codepage ( UINT  codepage)

Definition at line 170 of file reader.c.

171{
172 int i;
173 for (i = 0; i < ARRAY_SIZE(xml_encoding_map); i++)
174 {
175 if (xml_encoding_map[i].cp == codepage) return xml_encoding_map[i].enc;
176 }
177 return XmlEncoding_Unknown;
178}
#define ARRAY_SIZE(A)
Definition: main.h:33
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 CreateXmlWriterOutputWithEncodingCodePage().

◆ get_encoding_name()

const WCHAR * get_encoding_name ( xml_encoding  encoding)

Definition at line 165 of file reader.c.

166{
167 return xml_encoding_map[encoding].name;
168}

Referenced by get_output_encoding_name().

◆ is_namechar()

BOOL is_namechar ( WCHAR  ch)

Definition at line 1553 of file reader.c.

1554{
1555 return (ch == ':') || is_ncnamechar(ch);
1556}
BOOL is_ncnamechar(WCHAR ch)
Definition: reader.c:1529

Referenced by is_valid_name(), and reader_parse_name().

◆ is_namestartchar()

BOOL is_namestartchar ( WCHAR  ch)

Definition at line 1509 of file reader.c.

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

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

◆ is_ncnamechar()

BOOL is_ncnamechar ( WCHAR  ch)

Definition at line 1529 of file reader.c.

1530{
1531 return (ch >= 'A' && ch <= 'Z') ||
1532 (ch == '_') || (ch >= 'a' && ch <= 'z') ||
1533 (ch == '-') || (ch == '.') ||
1534 (ch >= '0' && ch <= '9') ||
1535 (ch == 0xb7) ||
1536 (ch >= 0xc0 && ch <= 0xd6) ||
1537 (ch >= 0xd8 && ch <= 0xf6) ||
1538 (ch >= 0xf8 && ch <= 0x2ff) ||
1539 (ch >= 0x300 && ch <= 0x36f) ||
1540 (ch >= 0x370 && ch <= 0x37d) ||
1541 (ch >= 0x37f && ch <= 0x1fff) ||
1542 (ch >= 0x200c && ch <= 0x200d) ||
1543 (ch >= 0x203f && ch <= 0x2040) ||
1544 (ch >= 0x2070 && ch <= 0x218f) ||
1545 (ch >= 0x2c00 && ch <= 0x2fef) ||
1546 (ch >= 0x3001 && ch <= 0xd7ff) ||
1547 (ch >= 0xd800 && ch <= 0xdbff) || /* high surrogate */
1548 (ch >= 0xdc00 && ch <= 0xdfff) || /* low surrogate */
1549 (ch >= 0xf900 && ch <= 0xfdcf) ||
1550 (ch >= 0xfdf0 && ch <= 0xfffd);
1551}

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

◆ is_pubchar()

BOOL is_pubchar ( WCHAR  ch)

Definition at line 1496 of file reader.c.

1497{
1498 return (ch == ' ') ||
1499 (ch >= 'a' && ch <= 'z') ||
1500 (ch >= 'A' && ch <= 'Z') ||
1501 (ch >= '0' && ch <= '9') ||
1502 (ch >= '-' && ch <= ';') || /* '()*+,-./:; */
1503 (ch == '=') || (ch == '?') ||
1504 (ch == '@') || (ch == '!') ||
1505 (ch >= '#' && ch <= '%') || /* #$% */
1506 (ch == '_') || (ch == '\r') || (ch == '\n');
1507}

Referenced by is_valid_pubid(), and reader_parse_pub_literal().

◆ m_alloc()

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

Definition at line 26 of file xmllite_private.h.

27{
28 if (imalloc)
29 return IMalloc_Alloc(imalloc, len);
30 else
31 return heap_alloc(len);
32}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
GLenum GLsizei len
Definition: glext.h:6722

Referenced by reader_alloc(), readerinput_alloc(), writer_alloc(), and writeroutput_alloc().

◆ m_free()

static void m_free ( IMalloc imalloc,
void mem 
)
inlinestatic

Definition at line 42 of file xmllite_private.h.

43{
44 if (imalloc)
45 IMalloc_Free(imalloc, mem);
46 else
48}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
Definition: mem.c:156

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 34 of file xmllite_private.h.

35{
36 if (imalloc)
37 return IMalloc_Realloc(imalloc, mem, len);
38 else
39 return heap_realloc(mem, len);
40}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71

Referenced by readerinput_realloc(), and writeroutput_realloc().

◆ parse_encoding_name()

xml_encoding parse_encoding_name ( const WCHAR name,
int  len 
)

Definition at line 747 of file reader.c.

748{
749 int min, max, n, c;
750
751 if (!name) return XmlEncoding_Unknown;
752
753 min = 0;
755
756 while (min <= max)
757 {
758 n = (min+max)/2;
759
760 if (len != -1)
762 else
764 if (!c)
765 return xml_encoding_map[n].enc;
766
767 if (c > 0)
768 max = n-1;
769 else
770 min = n+1;
771 }
772
773 return XmlEncoding_Unknown;
774}
#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
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Definition: name.c:39
#define max(a, b)
Definition: svc.c:63

Referenced by CreateXmlReaderInputWithEncodingName(), and reader_parse_encname().