MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlSchemaPValAttrBlockFinal

Function xmlSchemaPValAttrBlockFinal

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:7874–7960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7872 */
7873
7874static int
7875xmlSchemaPValAttrBlockFinal(const xmlChar *value,
7876 int *flags,
7877 int flagAll,
7878 int flagExtension,
7879 int flagRestriction,
7880 int flagSubstitution,
7881 int flagList,
7882 int flagUnion)
7883{
7884 int ret = 0;
7885
7886 /*
7887 * TODO: This does not check for duplicate entries.
7888 */
7889 if ((flags == NULL) || (value == NULL))
7890 return (-1);
7891 if (value[0] == 0)
7892 return (0);
7893 if (xmlStrEqual(value, BAD_CAST "#all")) {
7894 if (flagAll != -1)
7895 *flags |= flagAll;
7896 else {
7897 if (flagExtension != -1)
7898 *flags |= flagExtension;
7899 if (flagRestriction != -1)
7900 *flags |= flagRestriction;
7901 if (flagSubstitution != -1)
7902 *flags |= flagSubstitution;
7903 if (flagList != -1)
7904 *flags |= flagList;
7905 if (flagUnion != -1)
7906 *flags |= flagUnion;
7907 }
7908 } else {
7909 const xmlChar *end, *cur = value;
7910 xmlChar *item;
7911
7912 do {
7913 while (IS_BLANK_CH(*cur))
7914 cur++;
7915 end = cur;
7916 while ((*end != 0) && (!(IS_BLANK_CH(*end))))
7917 end++;
7918 if (end == cur)
7919 break;
7920 item = xmlStrndup(cur, end - cur);
7921 if (xmlStrEqual(item, BAD_CAST "extension")) {
7922 if (flagExtension != -1) {
7923 if ((*flags & flagExtension) == 0)
7924 *flags |= flagExtension;
7925 } else
7926 ret = 1;
7927 } else if (xmlStrEqual(item, BAD_CAST "restriction")) {
7928 if (flagRestriction != -1) {
7929 if ((*flags & flagRestriction) == 0)
7930 *flags |= flagRestriction;
7931 } else

Callers 4

xmlSchemaParseElementFunction · 0.85
xmlSchemaParseSimpleTypeFunction · 0.85

Calls 2

xmlStrEqualFunction · 0.85
xmlStrndupFunction · 0.85

Tested by

no test coverage detected