| 1 | /* |
| 2 | * Copyright 2013--2016 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 | * Martin Preisler <[email protected]> |
| 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 "public/scap_ds.h"cxx . . $ `<file>/src/DS/public/scap_ds.h`/ |
| 28 | #include "common/list.h"cxx . . $ `<file>/src/common/list.h`/ |
| 29 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 30 | #include "rds_index_priv.h"cxx . . $ `<file>/src/DS/rds_index_priv.h`/ |
| 31 | |
| 32 | |
| 33 | #include <libxml/xmlreader.h> |
| 34 | #include <string.h> |
| 35 | |
| 36 | struct rds_report_request_indexcxx . . $ rds_report_request_index# |
| 37 | { |
| 38 | char *idcxx . . $ rds_report_request_index#id.; |
| 39 | }; |
| 40 | |
| 41 | struct rds_report_request_indexcxx . . $ rds_report_request_index# *rds_report_request_index_newcxx . . $ rds_report_request_index_new(da8c344cb93d4f60).(void) |
| 42 | { |
| 43 | struct rds_report_request_indexcxx . . $ rds_report_request_index# *ret = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct rds_report_request_indexcxx . . $ rds_report_request_index#)); |
| 44 | ret->idcxx . . $ rds_report_request_index#id. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 45 | |
| 46 | return ret; |
| 47 | } |
| 48 | |
| 49 | void rds_report_request_index_freecxx . . $ rds_report_request_index_free(9cc6ee84e09a1d94).(struct rds_report_request_indexcxx . . $ rds_report_request_index# *s) |
| 50 | { |
| 51 | if (s != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 52 | freecxx . . $ free(5d22bdacc48458e8).(s->idcxx . . $ rds_report_request_index#id.); |
| 53 | freecxx . . $ free(5d22bdacc48458e8).(s); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | const char *rds_report_request_index_get_idcxx . . $ rds_report_request_index_get_id(5a818ffca7a10dcf).(struct rds_report_request_indexcxx . . $ rds_report_request_index# *s) |
| 58 | { |
| 59 | return s->idcxx . . $ rds_report_request_index#id.; |
| 60 | } |
| 61 | |
| 62 | struct rds_report_request_indexcxx . . $ rds_report_request_index# *rds_report_request_index_parsecxx . . $ rds_report_request_index_parse(350659b37ad1aafb).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 63 | { |
| 64 | // sanity check |
| 65 | if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT. || |
| 66 | strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char*)xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), "report-request") != 0) { |
| 67 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, |
| 68 | "Expected to have xmlTextReader at start of <arf:report-request>, " |
| 69 | "the current event is '%i' at '%s' instead. I refuse to parse!", |
| 70 | xmlTextReaderNodeType(reader), (const char*)xmlTextReaderConstLocalName(reader)); |
| 71 | |
| 72 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 73 | } |
| 74 | |
| 75 | struct rds_report_request_indexcxx . . $ rds_report_request_index#* ret = rds_report_request_index_newcxx . . $ rds_report_request_index_new(da8c344cb93d4f60).(); |
| 76 | |
| 77 | ret->idcxx . . $ rds_report_request_index#id. = (char*)xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "id"); |
| 78 | return ret; |
| 79 | } |
| 80 | |
| 81 | struct rds_report_request_indexcxx . . $ rds_report_request_index# *rds_report_request_index_iterator_nextcxx . . $ rds_report_request_index_iterator_next(1039cc10de702769).(struct rds_report_request_index_iteratorcxx . . $ rds_report_request_index_iterator# *it) |
| 82 | { |
| 83 | return (struct rds_report_request_indexcxx . . $ rds_report_request_index#*)(oscap_iterator_nextcxx . . $ oscap_iterator_next(4c75051c806960eb).((struct oscap_iteratorcxx . . $ oscap_iterator#*)it)); |
| 84 | } |
| 85 | |
| 86 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! rds_report_request_index_iterator_has_morecxx . . $ rds_report_request_index_iterator_has_more(ba3f3242fa80f4a6).(struct rds_report_request_index_iteratorcxx . . $ rds_report_request_index_iterator# *it) |
| 87 | { |
| 88 | return oscap_iterator_has_morecxx . . $ oscap_iterator_has_more(63b1de9a5adb9205).((struct oscap_iteratorcxx . . $ oscap_iterator#*)it); |
| 89 | } |
| 90 | |
| 91 | void rds_report_request_index_iterator_freecxx . . $ rds_report_request_index_iterator_free(64a6e17520fe4bd0).(struct rds_report_request_index_iteratorcxx . . $ rds_report_request_index_iterator# *it) |
| 92 | { |
| 93 | oscap_iterator_freecxx . . $ oscap_iterator_free(3cba44c1b7872358).((struct oscap_iteratorcxx . . $ oscap_iterator#*)it); |
| 94 | } |