Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/parser/expat/lib/xmltok_ns.c
Line
Count
Source (jump to first uncovered line)
1
const ENCODING *
2
NS(XmlGetUtf8InternalEncoding)(void)
3
0
{
4
0
  return &ns(internal_utf8_encoding).enc;
5
0
}
Unexecuted instantiation: MOZ_XmlGetUtf8InternalEncoding
Unexecuted instantiation: MOZ_XmlGetUtf8InternalEncodingNS
6
7
const ENCODING *
8
NS(XmlGetUtf16InternalEncoding)(void)
9
0
{
10
0
#if BYTEORDER == 1234
11
0
  return &ns(internal_little2_encoding).enc;
12
#elif BYTEORDER == 4321
13
  return &ns(internal_big2_encoding).enc;
14
#else
15
  const short n = 1;
16
  return (*(const char *)&n
17
          ? &ns(internal_little2_encoding).enc
18
          : &ns(internal_big2_encoding).enc);
19
#endif
20
}
Unexecuted instantiation: MOZ_XmlGetUtf16InternalEncoding
Unexecuted instantiation: MOZ_XmlGetUtf16InternalEncodingNS
21
22
static const ENCODING * const NS(encodings)[] = {
23
  &ns(latin1_encoding).enc,
24
  &ns(ascii_encoding).enc,
25
  &ns(utf8_encoding).enc,
26
  &ns(big2_encoding).enc,
27
  &ns(big2_encoding).enc,
28
  &ns(little2_encoding).enc,
29
  &ns(utf8_encoding).enc /* NO_ENC */
30
};
31
32
static int PTRCALL
33
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
34
                   const char **nextTokPtr)
35
0
{
36
0
  return initScan(NS(encodings), (const INIT_ENCODING *)enc,
37
0
                  XML_PROLOG_STATE, ptr, end, nextTokPtr);
38
0
}
Unexecuted instantiation: xmltok.c:initScanProlog
Unexecuted instantiation: xmltok.c:initScanPrologNS
39
40
static int PTRCALL
41
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
42
                    const char **nextTokPtr)
43
0
{
44
0
  return initScan(NS(encodings), (const INIT_ENCODING *)enc,
45
0
                  XML_CONTENT_STATE, ptr, end, nextTokPtr);
46
0
}
Unexecuted instantiation: xmltok.c:initScanContent
Unexecuted instantiation: xmltok.c:initScanContentNS
47
48
int
49
NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
50
                    const char *name)
51
0
{
52
0
  int i = getEncodingIndex(name);
53
0
  if (i == UNKNOWN_ENC)
54
0
    return 0;
55
0
  SET_INIT_ENC_INDEX(p, i);
56
0
  p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
57
0
  p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
58
0
  p->initEnc.updatePosition = initUpdatePosition;
59
0
  p->encPtr = encPtr;
60
0
  *encPtr = &(p->initEnc);
61
0
  return 1;
62
0
}
Unexecuted instantiation: MOZ_XmlInitEncoding
Unexecuted instantiation: MOZ_XmlInitEncodingNS
63
64
static const ENCODING *
65
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
66
0
{
67
0
#define ENCODING_MAX 128
68
0
  char buf[ENCODING_MAX];
69
0
  char *p = buf;
70
0
  int i;
71
0
  XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
72
0
  if (ptr != end)
73
0
    return 0;
74
0
  *p = 0;
75
0
  if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
76
0
    return enc;
77
0
  i = getEncodingIndex(buf);
78
0
  if (i == UNKNOWN_ENC)
79
0
    return 0;
80
0
  return NS(encodings)[i];
81
0
}
Unexecuted instantiation: xmltok.c:findEncoding
Unexecuted instantiation: xmltok.c:findEncodingNS
82
83
int
84
NS(XmlParseXmlDecl)(int isGeneralTextEntity,
85
                    const ENCODING *enc,
86
                    const char *ptr,
87
                    const char *end,
88
                    const char **badPtr,
89
                    const char **versionPtr,
90
                    const char **versionEndPtr,
91
                    const char **encodingName,
92
                    const ENCODING **encoding,
93
                    int *standalone)
94
0
{
95
0
  return doParseXmlDecl(NS(findEncoding),
96
0
                        isGeneralTextEntity,
97
0
                        enc,
98
0
                        ptr,
99
0
                        end,
100
0
                        badPtr,
101
0
                        versionPtr,
102
0
                        versionEndPtr,
103
0
                        encodingName,
104
0
                        encoding,
105
0
                        standalone);
106
0
}
Unexecuted instantiation: MOZ_XmlParseXmlDecl
Unexecuted instantiation: MOZ_XmlParseXmlDeclNS