Use macro to access minBytesPerChar
This commit is contained in:
parent
56440b93f3
commit
2fd2484a0a
@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef MIN_BYTES_PER_CHAR
|
||||||
|
#define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef int PROLOG_HANDLER(struct prolog_state *state,
|
typedef int PROLOG_HANDLER(struct prolog_state *state,
|
||||||
int tok,
|
int tok,
|
||||||
const char *ptr,
|
const char *ptr,
|
||||||
@ -53,7 +57,7 @@ int prolog0(PROLOG_STATE *state,
|
|||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
case XML_TOK_DECL_OPEN:
|
case XML_TOK_DECL_OPEN:
|
||||||
if (!XmlNameMatchesAscii(enc,
|
if (!XmlNameMatchesAscii(enc,
|
||||||
ptr + 2 * enc->minBytesPerChar,
|
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
|
||||||
"DOCTYPE"))
|
"DOCTYPE"))
|
||||||
break;
|
break;
|
||||||
state->handler = doctype0;
|
state->handler = doctype0;
|
||||||
@ -81,7 +85,7 @@ int prolog1(PROLOG_STATE *state,
|
|||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
case XML_TOK_DECL_OPEN:
|
case XML_TOK_DECL_OPEN:
|
||||||
if (!XmlNameMatchesAscii(enc,
|
if (!XmlNameMatchesAscii(enc,
|
||||||
ptr + 2 * enc->minBytesPerChar,
|
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
|
||||||
"DOCTYPE"))
|
"DOCTYPE"))
|
||||||
break;
|
break;
|
||||||
state->handler = doctype0;
|
state->handler = doctype0;
|
||||||
@ -243,25 +247,25 @@ int internalSubset(PROLOG_STATE *state,
|
|||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
case XML_TOK_DECL_OPEN:
|
case XML_TOK_DECL_OPEN:
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + 2 * enc->minBytesPerChar,
|
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
|
||||||
"ENTITY")) {
|
"ENTITY")) {
|
||||||
state->handler = entity0;
|
state->handler = entity0;
|
||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
}
|
}
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + 2 * enc->minBytesPerChar,
|
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
|
||||||
"ATTLIST")) {
|
"ATTLIST")) {
|
||||||
state->handler = attlist0;
|
state->handler = attlist0;
|
||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
}
|
}
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + 2 * enc->minBytesPerChar,
|
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
|
||||||
"ELEMENT")) {
|
"ELEMENT")) {
|
||||||
state->handler = element0;
|
state->handler = element0;
|
||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
}
|
}
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + 2 * enc->minBytesPerChar,
|
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
|
||||||
"NOTATION")) {
|
"NOTATION")) {
|
||||||
state->handler = notation0;
|
state->handler = notation0;
|
||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
@ -758,19 +762,19 @@ int attlist8(PROLOG_STATE *state,
|
|||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
case XML_TOK_POUND_NAME:
|
case XML_TOK_POUND_NAME:
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + enc->minBytesPerChar,
|
ptr + MIN_BYTES_PER_CHAR(enc),
|
||||||
"IMPLIED")) {
|
"IMPLIED")) {
|
||||||
state->handler = attlist1;
|
state->handler = attlist1;
|
||||||
return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE;
|
return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE;
|
||||||
}
|
}
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + enc->minBytesPerChar,
|
ptr + MIN_BYTES_PER_CHAR(enc),
|
||||||
"REQUIRED")) {
|
"REQUIRED")) {
|
||||||
state->handler = attlist1;
|
state->handler = attlist1;
|
||||||
return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE;
|
return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE;
|
||||||
}
|
}
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + enc->minBytesPerChar,
|
ptr + MIN_BYTES_PER_CHAR(enc),
|
||||||
"FIXED")) {
|
"FIXED")) {
|
||||||
state->handler = attlist9;
|
state->handler = attlist9;
|
||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
@ -857,7 +861,7 @@ int element2(PROLOG_STATE *state,
|
|||||||
return XML_ROLE_NONE;
|
return XML_ROLE_NONE;
|
||||||
case XML_TOK_POUND_NAME:
|
case XML_TOK_POUND_NAME:
|
||||||
if (XmlNameMatchesAscii(enc,
|
if (XmlNameMatchesAscii(enc,
|
||||||
ptr + enc->minBytesPerChar,
|
ptr + MIN_BYTES_PER_CHAR(enc),
|
||||||
"PCDATA")) {
|
"PCDATA")) {
|
||||||
state->handler = element3;
|
state->handler = element3;
|
||||||
return XML_ROLE_CONTENT_PCDATA;
|
return XML_ROLE_CONTENT_PCDATA;
|
||||||
|
Loading…
Reference in New Issue
Block a user