00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OSCAP_ELEMENTS_H_
00028 #define OSCAP_ELEMENTS_H_
00029
00030 #include <libxml/xmlreader.h>
00031 #include <libxml/xmlwriter.h>
00032 #include <stdbool.h>
00033 #include <time.h>
00034 #include "public/oscap.h"
00035 #include "util.h"
00036
00038 extern const struct oscap_string_map OSCAP_BOOL_MAP[];
00039
00041 bool oscap_to_start_element(xmlTextReaderPtr reader, int depth);
00043 char *oscap_element_string_copy(xmlTextReaderPtr reader);
00045 const char *oscap_element_string_get(xmlTextReaderPtr reader);
00047 int oscap_element_depth(xmlTextReaderPtr reader);
00049 char *oscap_get_xml(xmlTextReaderPtr reader);
00051 time_t oscap_get_date(const char *date);
00053 time_t oscap_get_datetime(const char *date);
00055 char *oscap_get_schema_filename(const char *xmlfile);
00057 xmlNode *oscap_xmlstr_to_dom(xmlNode *parent, const char *elname, const char *content);
00058
00059
00060 struct xml_metadata {
00061 char *nspace;
00062 char *URI;
00063 char *lang;
00064 };
00065
00066 struct oscap_title {
00067 struct xml_metadata xml;
00068 char *content;
00069 };
00070
00071 struct oscap_title *oscap_title_parse(xmlTextReaderPtr reader, const char *name);
00072 void oscap_title_export(const struct oscap_title *title, xmlTextWriterPtr writer);
00073 void oscap_title_free(struct oscap_title *title);
00074
00075 const char *oscap_import_source_get_name(const struct oscap_import_source *src);
00076
00077 struct oscap_nsinfo_entry {
00078 char *nsprefix;
00079 char *nsname;
00080 char *schema_location;
00081 };
00082
00083 struct oscap_nsinfo {
00084 struct oscap_list *entries;
00085 struct oscap_nsinfo_entry *root_entry;
00086 };
00087
00088 bool oscap_nsinfo_add_parse(struct oscap_nsinfo *info, xmlTextReaderPtr reader, bool set_root);
00089 struct oscap_nsinfo *oscap_nsinfo_new_parse(xmlTextReaderPtr reader);
00090
00091 #endif