| 1 | /* |
| 2 | * Copyright 2014 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 | * Author: |
| 20 | * Šimon Lukašík |
| 21 | */ |
| 22 | #ifndef OSCAP_SOURCE_PRIV_H |
| 23 | #define OSCAP_SOURCE_PRIV_Hcxx . . $ `src/source/oscap_source_priv.h:23:9`! |
| 24 | |
| 25 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 26 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 27 | #endif |
| 28 | |
| 29 | #include <libxml/parser.h> |
| 30 | #include <libxml/xmlreader.h> |
| 31 | |
| 32 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 33 | #include "oscap.h"cxx . . $ `<file>/src/common/public/oscap.h`/ |
| 34 | #include "oscap_source.h"cxx . . $ `<file>/src/source/public/oscap_source.h`/ |
| 35 | |
| 36 | |
| 37 | /** |
| 38 | * Create new oscap_source from raw memory. The memory can contain \0 bytes |
| 39 | * and they are not considered NULL-terminations! Always pass the correct |
| 40 | * size. This constructor is meant as a last resort when no other constructor |
| 41 | * will work for your use case. If at all possible you should use the more |
| 42 | * specialized constructors. |
| 43 | * oscap_source will will not allocate memory new memory buffer |
| 44 | * @param buffer Memory buffer with raw data |
| 45 | * @param size size of the memory buffer |
| 46 | * @param filepath Suggested filename for the file or NULL |
| 47 | * @returns newly created oscap_source_structure |
| 48 | */ |
| 49 | struct oscap_sourcecxx . . $ oscap_source# *oscap_source_new_take_memorycxx . . $ oscap_source_new_take_memory(2b1f5a784648902c).(char *buffer, size_t size, const char *filepath); |
| 50 | |
| 51 | /** |
| 52 | * Build new oscap_source from existing xmlDoc. The xmlDoc becomes owned |
| 53 | * by oscap_source. |
| 54 | * @memberof oscap_source |
| 55 | * @param doc XML DOM to build from |
| 56 | * @param filepath Suggested filename for the file or NULL |
| 57 | * @returns newly created oscap_source |
| 58 | */ |
| 59 | struct oscap_sourcecxx . . $ oscap_source# *oscap_source_new_from_xmlDoccxx . . $ oscap_source_new_from_xmlDoc(20d5db8f38e74517).(xmlDoccxx . . $ xmlDoc# *doc, const char *filepath); |
| 60 | |
| 61 | /** |
| 62 | * Get an xmlTextReader assigned with this resource. The reader needs to be |
| 63 | * disposed by caller. |
| 64 | * @memberof oscap_source |
| 65 | * @param source Resource to read the content |
| 66 | * @returns xmlTextReader structure to read the content |
| 67 | */ |
| 68 | xmlTextReadercxx . . $ xmlTextReader# *oscap_source_get_xmlTextReadercxx . . $ oscap_source_get_xmlTextReader(9a7ef22a0934f79d).(struct oscap_sourcecxx . . $ oscap_source# *source); |
| 69 | |
| 70 | /** |
| 71 | * Get a DOM representation of this resource. The document ins still owned |
| 72 | * by oscap_source. |
| 73 | * @memberof oscap_source |
| 74 | * @param source Resource to build DOM representation from |
| 75 | * @returns xmlDoc structure to read the content |
| 76 | */ |
| 77 | xmlDoccxx . . $ xmlDoc# *oscap_source_get_xmlDoccxx . . $ oscap_source_get_xmlDoc(51aac4e66711e6e6).(struct oscap_sourcecxx . . $ oscap_source# *source); |
| 78 | |
| 79 | /** |
| 80 | * Get a DOM representation of this resource. The document is removed from |
| 81 | * oscap_source and isn't owned by oscap_source anymore. |
| 82 | * @memberof oscap_source |
| 83 | * @param source Resource to build DOM representation from |
| 84 | * @returns xmlDoc structure to read the content |
| 85 | */ |
| 86 | xmlDoccxx . . $ xmlDoc# *oscap_source_pop_xmlDoccxx . . $ oscap_source_pop_xmlDoc(51aac4e66711e6e6).(struct oscap_sourcecxx . . $ oscap_source# *source); |
| 87 | |
| 88 | #endif |