| 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_indexcxx . . $ rds_report_index# |
| 37 | { |
| 38 | char *idcxx . . $ rds_report_index#id.; |
| 39 | struct rds_report_request_indexcxx . . $ rds_report_request_index# *requestcxx . . $ rds_report_index#request.; |
| 40 | }; |
| 41 | |
| 42 | struct rds_report_indexcxx . . $ rds_report_index#* rds_report_index_newcxx . . $ rds_report_index_new(8b838d277589c213).(void) |
| 43 | { |
| 44 | struct rds_report_indexcxx . . $ rds_report_index# *ret = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct rds_report_indexcxx . . $ rds_report_index#)); |
| 45 | ret->idcxx . . $ rds_report_index#id. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 46 | |
| 47 | return ret; |
| 48 | } |
| 49 | |
| 50 | void rds_report_index_freecxx . . $ rds_report_index_free(fa7e9f950c1d7e71).(struct rds_report_indexcxx . . $ rds_report_index# *s) |
| 51 | { |
| 52 | if (s != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 53 | freecxx . . $ free(5d22bdacc48458e8).(s->idcxx . . $ rds_report_index#id.); |
| 54 | freecxx . . $ free(5d22bdacc48458e8).(s); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | const char *rds_report_index_get_idcxx . . $ rds_report_index_get_id(7cda95b454727dd1).(struct rds_report_indexcxx . . $ rds_report_index# *s) |
| 59 | { |
| 60 | return s->idcxx . . $ rds_report_index#id.; |
| 61 | } |
| 62 | |
| 63 | void rds_report_index_set_requestcxx . . $ rds_report_index_set_request(792f784afce23e03).(struct rds_report_indexcxx . . $ rds_report_index# *s, struct rds_report_request_indexcxx . . $ rds_report_request_index# *request) |
| 64 | { |
| 65 | s->requestcxx . . $ rds_report_index#request. = request; |
| 66 | } |
| 67 | |
| 68 | struct rds_report_request_indexcxx . . $ rds_report_request_index# *rds_report_index_get_requestcxx . . $ rds_report_index_get_request(cf03ef1554bacd8a).(struct rds_report_indexcxx . . $ rds_report_index# *s) |
| 69 | { |
| 70 | return s->requestcxx . . $ rds_report_index#request.; |
| 71 | } |
| 72 | |
| 73 | struct rds_report_indexcxx . . $ rds_report_index# *rds_report_index_parsecxx . . $ rds_report_index_parse(1729bea9ee323d5f).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 74 | { |
| 75 | // sanity check |
| 76 | if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT. || |
| 77 | strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char*)xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), "report") != 0) { |
| 78 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, |
| 79 | "Expected to have xmlTextReader at start of <arf:report>, " |
| 80 | "the current event is '%i' at '%s' instead. I refuse to parse!", |
| 81 | xmlTextReaderNodeType(reader), (const char*)xmlTextReaderConstLocalName(reader)); |
| 82 | |
| 83 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 84 | } |
| 85 | |
| 86 | struct rds_report_indexcxx . . $ rds_report_index# *ret = rds_report_index_newcxx . . $ rds_report_index_new(8b838d277589c213).(); |
| 87 | |
| 88 | ret->idcxx . . $ rds_report_index#id. = (char*)xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "id"); |
| 89 | return ret; |
| 90 | } |
| 91 | |
| 92 | struct rds_report_indexcxx . . $ rds_report_index# *rds_report_index_iterator_nextcxx . . $ rds_report_index_iterator_next(3245c31063e7085e).(struct rds_report_index_iteratorcxx . . $ rds_report_index_iterator# *it) |
| 93 | { |
| 94 | return (struct rds_report_indexcxx . . $ rds_report_index#*)(oscap_iterator_nextcxx . . $ oscap_iterator_next(4c75051c806960eb).((struct oscap_iteratorcxx . . $ oscap_iterator#*)it)); |
| 95 | } |
| 96 | |
| 97 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! rds_report_index_iterator_has_morecxx . . $ rds_report_index_iterator_has_more(6c8d9b5d20d60db1).(struct rds_report_index_iteratorcxx . . $ rds_report_index_iterator# *it) |
| 98 | { |
| 99 | return oscap_iterator_has_morecxx . . $ oscap_iterator_has_more(63b1de9a5adb9205).((struct oscap_iteratorcxx . . $ oscap_iterator#*)it); |
| 100 | } |
| 101 | |
| 102 | void rds_report_index_iterator_freecxx . . $ rds_report_index_iterator_free(3beba17d79004ab6).(struct rds_report_index_iteratorcxx . . $ rds_report_index_iterator# *it) |
| 103 | { |
| 104 | oscap_iterator_freecxx . . $ oscap_iterator_free(3cba44c1b7872358).((struct oscap_iteratorcxx . . $ oscap_iterator#*)it); |
| 105 | } |
| 106 |