| 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 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 23 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 24 | #endif |
| 25 | |
| 26 | #include "xmltext_priv.h"cxx . . $ `<file>/src/common/xmltext_priv.h`/ |
| 27 | #include "_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 28 | |
| 29 | int xmlTextReaderNextElementcxx . . $ xmlTextReaderNextElement(82a242a19623f75).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 30 | { |
| 31 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(reader); |
| 32 | |
| 33 | int ret; |
| 34 | do { |
| 35 | ret = xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); |
| 36 | // if end of file |
| 37 | if (ret < 1) |
| 38 | break; |
| 39 | } while (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.); |
| 40 | |
| 41 | if (ret == -1) { |
| 42 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlCtxtGetLastError(reader)); |
| 43 | /* TODO: Should we end here as fatal ? */ |
| 44 | } |
| 45 | |
| 46 | return ret; |
| 47 | } |
| 48 | |
| 49 | int xmlTextReaderNextNodecxx . . $ xmlTextReaderNextNode(82a242a19623f75).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 50 | { |
| 51 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(reader); |
| 52 | |
| 53 | int ret = xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); |
| 54 | if (ret == -1) |
| 55 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 56 | |
| 57 | return ret; |
| 58 | } |
| 59 | |
| 60 | int xmlTextReaderNextElementWEcxx . . $ xmlTextReaderNextElementWE(3030c74046fb4b82).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xmlCharcxx . . $ xmlChar#* end_tag) |
| 61 | { |
| 62 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(reader); |
| 63 | |
| 64 | int ret; |
| 65 | do { |
| 66 | ret = xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); |
| 67 | // if end of file |
| 68 | if (ret < 1) |
| 69 | break; |
| 70 | |
| 71 | if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) == XML_READER_TYPE_END_ELEMENTcxx . . $ XML_READER_TYPE_END_ELEMENT.) { |
| 72 | if (!xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader), end_tag)) { |
| 73 | ret = 0; |
| 74 | break; |
| 75 | } |
| 76 | } |
| 77 | } while (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.); |
| 78 | |
| 79 | if (ret == -1) { |
| 80 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlCtxtGetLastError(reader)); |
| 81 | /* TODO: Should we end here as fatal ? */ |
| 82 | } |
| 83 | |
| 84 | return ret; |
| 85 | } |