| 1 | /* |
| 2 | * Copyright 2013 Red Hat Inc., Durham, North Carolina. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | * Authors: |
| 20 | * Šimon Lukašík |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 24 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 25 | #endif |
| 26 | |
| 27 | #include <libxml/xmlreader.h> |
| 28 | #include <libxml/xmlwriter.h> |
| 29 | |
| 30 | #include "public/cpe_name.h"cxx . . $ `<file>/src/CPE/public/cpe_name.h`/ |
| 31 | #include "cpe_ctx_priv.h"cxx . . $ `<file>/src/CPE/cpe_ctx_priv.h`/ |
| 32 | #include "cpedict_ext_priv.h"cxx . . $ `<file>/src/CPE/cpedict_ext_priv.h`/ |
| 33 | |
| 34 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 35 | #include "common/list.h"cxx . . $ `<file>/src/common/list.h`/ |
| 36 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 37 | #include "common/xmlns_priv.h"cxx . . $ `<file>/src/common/xmlns_priv.h`/ |
| 38 | #include "common/xmltext_priv.h"cxx . . $ `<file>/src/common/xmltext_priv.h`/ |
| 39 | |
| 40 | #define ATTR_NAME_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:40:9`! "name" |
| 41 | #define ATTR_DATE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:41:9`! "date" |
| 42 | #define ATTR_TYPE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:42:9`! "type" |
| 43 | #define TAG_CPE_EXT_DEPRECATION_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:43:9`! "deprecation" |
| 44 | #define TAG_CPE_EXT_DEPRECATEDBY_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:44:9`! "deprecated-by" |
| 45 | |
| 46 | enum cpe_deprecation_typecxx . . $ cpe_deprecation_type# { ///< cpe_dict_ext:deprecationTypeType |
| 47 | CPE_DEP_NAME_CORRECTIONcxx . . $ CPE_DEP_NAME_CORRECTION. = 1, |
| 48 | CPE_DEP_NAME_REMOVALcxx . . $ CPE_DEP_NAME_REMOVAL. = 2, |
| 49 | CPE_DEP_ADDITIONAL_INFORMATIONcxx . . $ CPE_DEP_ADDITIONAL_INFORMATION. = 3, |
| 50 | }; |
| 51 | |
| 52 | struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# { ///< <cpe_dict_ext:deprecated-by> node |
| 53 | char *namecxx . . $ cpe_ext_deprecatedby#name.; ///< @name attribute |
| 54 | enum cpe_deprecation_typecxx . . $ cpe_deprecation_type# typecxx . . $ cpe_ext_deprecatedby#type.; ///< @type attribute |
| 55 | }; |
| 56 | |
| 57 | struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# { ///< <cpe_dict_ext:deprecation> node |
| 58 | char *datecxx . . $ cpe_ext_deprecation#date.; ///< @date attribute |
| 59 | struct oscap_listcxx . . $ oscap_list# *deprecatedbyscxx . . $ cpe_ext_deprecation#deprecatedbys.; ///< <deprecated-by> sub-nodes |
| 60 | }; |
| 61 | |
| 62 | struct cpe23_itemcxx . . $ cpe23_item# { ///< <cpe23-item> node |
| 63 | char *namecxx . . $ cpe23_item#name.; ///< @name attribute |
| 64 | struct oscap_listcxx . . $ oscap_list# *deprecationscxx . . $ cpe23_item#deprecations.; ///< <deprecation> sub-nodes |
| 65 | }; |
| 66 | |
| 67 | static const struct oscap_string_mapcxx . . $ oscap_string_map# CPE_EXT_DEPRECATION_MAPcxx . . $ CPE_EXT_DEPRECATION_MAP.[] = { |
| 68 | {CPE_DEP_NAME_CORRECTIONcxx . . $ CPE_DEP_NAME_CORRECTION., "NAME_CORRECTION"}, |
| 69 | {CPE_DEP_NAME_REMOVALcxx . . $ CPE_DEP_NAME_REMOVAL., "NAME_REMOVAL"}, |
| 70 | {CPE_DEP_ADDITIONAL_INFORMATIONcxx . . $ CPE_DEP_ADDITIONAL_INFORMATION., "ADDITIONAL_INFORMATION"}, |
| 71 | {0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!} |
| 72 | }; |
| 73 | |
| 74 | struct cpe_ext_deprecatedby_iteratorcxx . . $ cpe_ext_deprecatedby_iterator#; |
| 75 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! cpe_ext_deprecatedby_iterator_has_morecxx . . $ cpe_ext_deprecatedby_iterator_has_more(212a56e20285d099).(struct cpe_ext_deprecatedby_iteratorcxx . . $ cpe_ext_deprecatedby_iterator# *it); |
| 76 | static struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *cpe_ext_deprecatedby_iterator_nextcxx . . $ cpe_ext_deprecatedby_iterator_next(5c2f4a73a9b89f7e).(struct cpe_ext_deprecatedby_iteratorcxx . . $ cpe_ext_deprecatedby_iterator# *it); |
| 77 | static void cpe_ext_deprecatedby_iterator_freecxx . . $ cpe_ext_deprecatedby_iterator_free(6e00cc3ab5f93953).(struct cpe_ext_deprecatedby_iteratorcxx . . $ cpe_ext_deprecatedby_iterator# *it); |
| 78 | void cpe_ext_deprecatedby_iterator_resetcxx . . $ cpe_ext_deprecatedby_iterator_reset(6e00cc3ab5f93953).(struct cpe_ext_deprecatedby_iteratorcxx . . $ cpe_ext_deprecatedby_iterator# *it); |
| 79 | static void cpe_ext_deprecatedby_freecxx . . $ cpe_ext_deprecatedby_free(ed4e8d87985f7862).(struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *deprecatedby); |
| 80 | struct cpe_ext_deprecatedby_iteratorcxx . . $ cpe_ext_deprecatedby_iterator# *cpe_ext_deprecation_get_deprecatedbyscxx . . $ cpe_ext_deprecation_get_deprecatedbys(3371be0f42e71027).(const struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation); |
| 81 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! cpe_ext_deprecation_add_deprecatedbycxx . . $ cpe_ext_deprecation_add_deprecatedby(10fd0864d3ed18a9).(struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation, struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *deprecatedby); |
| 82 | |
| 83 | struct cpe_ext_deprecation_iteratorcxx . . $ cpe_ext_deprecation_iterator#; |
| 84 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! cpe_ext_deprecation_iterator_has_morecxx . . $ cpe_ext_deprecation_iterator_has_more(351ad29b6c1138bf).(struct cpe_ext_deprecation_iteratorcxx . . $ cpe_ext_deprecation_iterator# *it); |
| 85 | static struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *cpe_ext_deprecation_iterator_nextcxx . . $ cpe_ext_deprecation_iterator_next(14e8553523d10744).(struct cpe_ext_deprecation_iteratorcxx . . $ cpe_ext_deprecation_iterator# *it); |
| 86 | static void cpe_ext_deprecation_iterator_freecxx . . $ cpe_ext_deprecation_iterator_free(702490ae67c93339).(struct cpe_ext_deprecation_iteratorcxx . . $ cpe_ext_deprecation_iterator# *it); |
| 87 | void cpe_ext_deprecation_iterator_resetcxx . . $ cpe_ext_deprecation_iterator_reset(702490ae67c93339).(struct cpe_ext_deprecation_iteratorcxx . . $ cpe_ext_deprecation_iterator# *it); |
| 88 | static void cpe_ext_deprecation_freecxx . . $ cpe_ext_deprecation_free(8f4ab1ec6f91b208).(struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation); |
| 89 | struct cpe_ext_deprecation_iteratorcxx . . $ cpe_ext_deprecation_iterator# *cpe23_item_get_deprecationscxx . . $ cpe23_item_get_deprecations(28596af740b67246).(const struct cpe23_itemcxx . . $ cpe23_item# *item); |
| 90 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! cpe23_item_add_deprecationcxx . . $ cpe23_item_add_deprecation(582cdf9a9b4cb0c0).(struct cpe23_itemcxx . . $ cpe23_item# *item, struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation); |
| 91 | |
| 92 | static struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *cpe_ext_deprecatedby_newcxx . . $ cpe_ext_deprecatedby_new(13b61dc317b889ed).() |
| 93 | { |
| 94 | return calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby#)); |
| 95 | } |
| 96 | |
| 97 | static struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *cpe_ext_deprecation_newcxx . . $ cpe_ext_deprecation_new(ae4fac6005dbf189).() |
| 98 | { |
| 99 | struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation#)); |
| 100 | deprecation->deprecatedbyscxx . . $ cpe_ext_deprecation#deprecatedbys. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 101 | return deprecation; |
| 102 | } |
| 103 | |
| 104 | static struct cpe23_itemcxx . . $ cpe23_item# *cpe23_item_newcxx . . $ cpe23_item_new(cbee3005acc06ba9).() |
| 105 | { |
| 106 | struct cpe23_itemcxx . . $ cpe23_item# *item = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct cpe23_itemcxx . . $ cpe23_item#)); |
| 107 | item->deprecationscxx . . $ cpe23_item#deprecations. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 108 | return item; |
| 109 | } |
| 110 | |
| 111 | static struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *cpe_ext_deprecatedby_parsecxx . . $ cpe_ext_deprecatedby_parse(7ddc3f52cdb4dc4a).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 112 | { |
| 113 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(reader); |
| 114 | |
| 115 | if (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATEDBY_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:44:9`!) != 0 || |
| 116 | xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != 1) { |
| 117 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Found '%s' node when expecting: '%s'!", |
| 118 | xmlTextReaderConstLocalName(reader), TAG_CPE_EXT_DEPRECATEDBY_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:44:9`!); |
| 119 | } |
| 120 | const xmlCharcxx . . $ xmlChar#* nsuri = xmlTextReaderConstNamespaceUricxx . . $ xmlTextReaderConstNamespaceUri(60a5affeeceb06fd).(reader); |
| 121 | if (nsuri && xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(nsuri, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!) != 0) { |
| 122 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Found '%s' namespace when expecting: '%s'!", |
| 123 | nsuri, XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!); |
| 124 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 125 | } |
| 126 | |
| 127 | struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *deprecatedby = cpe_ext_deprecatedby_newcxx . . $ cpe_ext_deprecatedby_new(13b61dc317b889ed).(); |
| 128 | deprecatedby->namecxx . . $ cpe_ext_deprecatedby#name. = (char *) xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_NAME_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:40:9`!); |
| 129 | char *type = (char *) xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_TYPE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:42:9`!); |
| 130 | if (type == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 131 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Compulsory attribute '%s' missing at '%s' element.", |
| 132 | ATTR_TYPE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:42:9`!, TAG_CPE_EXT_DEPRECATEDBY_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:44:9`!); |
| 133 | cpe_ext_deprecatedby_freecxx . . $ cpe_ext_deprecatedby_free(ed4e8d87985f7862).(deprecatedby); |
| 134 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 135 | } |
| 136 | deprecatedby->typecxx . . $ cpe_ext_deprecatedby#type. = oscap_string_to_enumcxx . . $ oscap_string_to_enum(851d6ce10579b7d8).(CPE_EXT_DEPRECATION_MAPcxx . . $ CPE_EXT_DEPRECATION_MAP., type); |
| 137 | freecxx . . $ free(5d22bdacc48458e8).(type); |
| 138 | return deprecatedby; |
| 139 | } |
| 140 | |
| 141 | static int cpe_ext_deprecatedby_exportcxx . . $ cpe_ext_deprecatedby_export(fc9de5630dfa5c37).(const struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *deprecatedby, xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer) |
| 142 | { |
| 143 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(writer); |
| 144 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(deprecatedby); |
| 145 | |
| 146 | xmlTextWriterStartElementNScxx . . $ xmlTextWriterStartElementNS(98d4c72a1ba35a00).(writer, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATEDBY_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:44:9`!, |
| 147 | BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!); |
| 148 | |
| 149 | if (deprecatedby->namecxx . . $ cpe_ext_deprecatedby#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 150 | xmlTextWriterWriteAttributecxx . . $ xmlTextWriterWriteAttribute(ea634d2c1b0a45f7).(writer, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_NAME_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:40:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! deprecatedby->namecxx . . $ cpe_ext_deprecatedby#name.); |
| 151 | } |
| 152 | if (deprecatedby->typecxx . . $ cpe_ext_deprecatedby#type. != 0) { |
| 153 | xmlTextWriterWriteAttributecxx . . $ xmlTextWriterWriteAttribute(ea634d2c1b0a45f7).(writer, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_TYPE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:42:9`!, |
| 154 | BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oscap_enum_to_stringcxx . . $ oscap_enum_to_string(64165c519d473d40).(CPE_EXT_DEPRECATION_MAPcxx . . $ CPE_EXT_DEPRECATION_MAP., deprecatedby->typecxx . . $ cpe_ext_deprecatedby#type.)); |
| 155 | } |
| 156 | xmlTextWriterEndElementcxx . . $ xmlTextWriterEndElement(7e81f973a4eb6684).(writer); |
| 157 | if (xmlGetLastErrorcxx . . $ xmlGetLastError(8a16e63d0dea4f48).() != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 158 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 159 | return 0; |
| 160 | } |
| 161 | |
| 162 | static struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *cpe_ext_deprecation_parsecxx . . $ cpe_ext_deprecation_parse(73db601fc2575825).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 163 | { |
| 164 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(reader); |
| 165 | |
| 166 | if (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATION_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:43:9`!) != 0 || |
| 167 | xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != 1) { |
| 168 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Found '%s' node when expecting: '%s'!", |
| 169 | xmlTextReaderConstLocalName(reader), TAG_CPE_EXT_DEPRECATION_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:43:9`!); |
| 170 | } |
| 171 | const xmlCharcxx . . $ xmlChar#* nsuri = xmlTextReaderConstNamespaceUricxx . . $ xmlTextReaderConstNamespaceUri(60a5affeeceb06fd).(reader); |
| 172 | if (nsuri && xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(nsuri, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!) != 0) { |
| 173 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Found '%s' namespace when expecting: '%s'!", |
| 174 | nsuri, XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!); |
| 175 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 176 | } |
| 177 | |
| 178 | struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation = cpe_ext_deprecation_newcxx . . $ cpe_ext_deprecation_new(ae4fac6005dbf189).(); |
| 179 | deprecation->datecxx . . $ cpe_ext_deprecation#date. = (char *) xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_DATE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:41:9`!); |
| 180 | if (xmlTextReaderIsEmptyElementcxx . . $ xmlTextReaderIsEmptyElement(82a242a19623f75).(reader) == 0) { // the element contains child nodes |
| 181 | xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(reader); |
| 182 | while (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATION_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:43:9`!) != 0) { |
| 183 | if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.) { |
| 184 | xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(reader); |
| 185 | continue; |
| 186 | } |
| 187 | |
| 188 | if (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATEDBY_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:44:9`!) == 0) { |
| 189 | struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *deprecatedby = cpe_ext_deprecatedby_parsecxx . . $ cpe_ext_deprecatedby_parse(7ddc3f52cdb4dc4a).(reader); |
| 190 | if (deprecatedby == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 191 | cpe_ext_deprecation_freecxx . . $ cpe_ext_deprecation_free(8f4ab1ec6f91b208).(deprecation); |
| 192 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 193 | } |
| 194 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(deprecation->deprecatedbyscxx . . $ cpe_ext_deprecation#deprecatedbys., deprecatedby); |
| 195 | } |
| 196 | else { |
| 197 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Unexpected element within deprecation element: '%s'", |
| 198 | xmlTextReaderConstLocalName(reader)); |
| 199 | cpe_ext_deprecation_freecxx . . $ cpe_ext_deprecation_free(8f4ab1ec6f91b208).(deprecation); |
| 200 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 201 | } |
| 202 | xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(reader); |
| 203 | } |
| 204 | } |
| 205 | return deprecation; |
| 206 | } |
| 207 | |
| 208 | static int cpe_ext_deprecation_exportcxx . . $ cpe_ext_deprecation_export(db304b3160f5f45e).(const struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation, xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer) |
| 209 | { |
| 210 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(writer); |
| 211 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(deprecation); |
| 212 | |
| 213 | xmlTextWriterStartElementNScxx . . $ xmlTextWriterStartElementNS(98d4c72a1ba35a00).(writer, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATION_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:43:9`!, |
| 214 | BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!); |
| 215 | |
| 216 | if (deprecation->datecxx . . $ cpe_ext_deprecation#date. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 217 | xmlTextWriterWriteAttributecxx . . $ xmlTextWriterWriteAttribute(ea634d2c1b0a45f7).(writer, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_DATE_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:41:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! deprecation->datecxx . . $ cpe_ext_deprecation#date.); |
| 218 | } |
| 219 | OSCAP_FOREACHcxx . . $ `src/common/list.h:128:9`!(cpe_ext_deprecatedby, d, oscap_iterator_new(deprecation->deprecatedbys), |
| 220 | cpe_ext_deprecatedby_export(d, writer);); |
| 221 | xmlTextWriterEndElementcxx . . $ xmlTextWriterEndElement(7e81f973a4eb6684).(writer); |
| 222 | if (xmlGetLastErrorcxx . . $ xmlGetLastError(8a16e63d0dea4f48).() != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 223 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | struct cpe23_itemcxx . . $ cpe23_item# *cpe23_item_parsecxx . . $ cpe23_item_parse(28941171ca6229ef).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 228 | { |
| 229 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(reader); |
| 230 | |
| 231 | if (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE23_ITEM_STRcxx . . $ `src/CPE/cpedict_ext_priv.h:33:9`!) != 0 || |
| 232 | xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != 1) { |
| 233 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Found '%s' node when expecting: '%s'!", |
| 234 | xmlTextReaderConstLocalName(reader), TAG_CPE23_ITEM_STRcxx . . $ `src/CPE/cpedict_ext_priv.h:33:9`!); |
| 235 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 236 | } |
| 237 | const xmlCharcxx . . $ xmlChar#* nsuri = xmlTextReaderConstNamespaceUricxx . . $ xmlTextReaderConstNamespaceUri(60a5affeeceb06fd).(reader); |
| 238 | if (nsuri && xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(nsuri, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!) != 0) { |
| 239 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Found '%s' namespace when expecting: '%s'!", |
| 240 | nsuri, XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!); |
| 241 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 242 | } |
| 243 | |
| 244 | struct cpe23_itemcxx . . $ cpe23_item# *item = cpe23_item_newcxx . . $ cpe23_item_new(cbee3005acc06ba9).(); |
| 245 | item->namecxx . . $ cpe23_item#name. = (char *) xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_NAME_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:40:9`!); |
| 246 | if (xmlTextReaderIsEmptyElementcxx . . $ xmlTextReaderIsEmptyElement(82a242a19623f75).(reader) == 0) { // the element contains child nodes |
| 247 | xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(reader); |
| 248 | while (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE23_ITEM_STRcxx . . $ `src/CPE/cpedict_ext_priv.h:33:9`!) != 0) { |
| 249 | if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.) { |
| 250 | xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(reader); |
| 251 | continue; |
| 252 | } |
| 253 | |
| 254 | if (xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE_EXT_DEPRECATION_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:43:9`!) == 0) { |
| 255 | struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation = cpe_ext_deprecation_parsecxx . . $ cpe_ext_deprecation_parse(73db601fc2575825).(reader); |
| 256 | if (deprecation == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 257 | cpe23_item_freecxx . . $ cpe23_item_free(946360b5191aeb70).(item); |
| 258 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 259 | } |
| 260 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(item->deprecationscxx . . $ cpe23_item#deprecations., deprecation); |
| 261 | } |
| 262 | else { |
| 263 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Unexpected element within cpe23-item[@name='%s']: '%s'", |
| 264 | item->name, xmlTextReaderConstLocalName(reader)); |
| 265 | cpe23_item_freecxx . . $ cpe23_item_free(946360b5191aeb70).(item); |
| 266 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 267 | } |
| 268 | xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(reader); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | return item; |
| 273 | } |
| 274 | |
| 275 | int cpe23_item_exportcxx . . $ cpe23_item_export(54cb2700ca7e789c).(const struct cpe23_itemcxx . . $ cpe23_item# *item, xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer) |
| 276 | { |
| 277 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(writer); |
| 278 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(item); |
| 279 | |
| 280 | xmlTextWriterStartElementNScxx . . $ xmlTextWriterStartElementNS(98d4c72a1ba35a00).(writer, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! TAG_CPE23_ITEM_STRcxx . . $ `src/CPE/cpedict_ext_priv.h:33:9`!, |
| 281 | BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XMLNS_CPE2D3_EXTENSIONcxx . . $ `src/common/xmlns_priv.h:38:9`!); |
| 282 | |
| 283 | if (item->namecxx . . $ cpe23_item#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 284 | xmlTextWriterWriteAttributecxx . . $ xmlTextWriterWriteAttribute(ea634d2c1b0a45f7).(writer, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ATTR_NAME_STRcxx . . $ `src/CPE/cpedict_ext_priv.c:40:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! item->namecxx . . $ cpe23_item#name.); |
| 285 | } |
| 286 | OSCAP_FOREACHcxx . . $ `src/common/list.h:128:9`!(cpe_ext_deprecation, d, oscap_iterator_new(item->deprecations), |
| 287 | cpe_ext_deprecation_export(d, writer);); |
| 288 | xmlTextWriterEndElementcxx . . $ xmlTextWriterEndElement(7e81f973a4eb6684).(writer); |
| 289 | if (xmlGetLastErrorcxx . . $ xmlGetLastError(8a16e63d0dea4f48).() != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 290 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 291 | return 0; |
| 292 | } |
| 293 | |
| 294 | static void cpe_ext_deprecatedby_freecxx . . $ cpe_ext_deprecatedby_free(ed4e8d87985f7862).(struct cpe_ext_deprecatedbycxx . . $ cpe_ext_deprecatedby# *deprecatedby) |
| 295 | { |
| 296 | freecxx . . $ free(5d22bdacc48458e8).(deprecatedby->namecxx . . $ cpe_ext_deprecatedby#name.); |
| 297 | freecxx . . $ free(5d22bdacc48458e8).(deprecatedby); |
| 298 | } |
| 299 | |
| 300 | static void cpe_ext_deprecation_freecxx . . $ cpe_ext_deprecation_free(8f4ab1ec6f91b208).(struct cpe_ext_deprecationcxx . . $ cpe_ext_deprecation# *deprecation) |
| 301 | { |
| 302 | if (deprecation != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 303 | freecxx . . $ free(5d22bdacc48458e8).(deprecation->datecxx . . $ cpe_ext_deprecation#date.); |
| 304 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(deprecation->deprecatedbyscxx . . $ cpe_ext_deprecation#deprecatedbys., (oscap_destruct_funccxx . . $ oscap_destruct_func#) cpe_ext_deprecatedby_freecxx . . $ cpe_ext_deprecatedby_free(ed4e8d87985f7862).); |
| 305 | freecxx . . $ free(5d22bdacc48458e8).(deprecation); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | void cpe23_item_freecxx . . $ cpe23_item_free(946360b5191aeb70).(struct cpe23_itemcxx . . $ cpe23_item# *item) |
| 310 | { |
| 311 | if (item != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 312 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(item->deprecationscxx . . $ cpe23_item#deprecations., (oscap_destruct_funccxx . . $ oscap_destruct_func#) cpe_ext_deprecation_freecxx . . $ cpe_ext_deprecation_free(8f4ab1ec6f91b208).); |
| 313 | freecxx . . $ free(5d22bdacc48458e8).(item->namecxx . . $ cpe23_item#name.); |
| 314 | freecxx . . $ free(5d22bdacc48458e8).(item); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | OSCAP_IGETINS_GENcxx . . $ `src/common/util.h:286:9`!(cpe_ext_deprecatedby, cpe_ext_deprecation, deprecatedbys, deprecatedby); |
| 319 | OSCAP_IGETINS_GENcxx . . $ `src/common/util.h:286:9`!(cpe_ext_deprecation, cpe23_item, deprecations, deprecation); |