00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00032 #ifndef OSCAP_H_
00033 #define OSCAP_H_
00034 #include <stdbool.h>
00035 #include <wchar.h>
00036
00037 #include "text.h"
00038
00060 #define OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) \
00061 { \
00062 struct itype##_iterator *val##_iter = (init_val); \
00063 vtype val; \
00064 while (itype##_iterator_has_more(val##_iter)) { \
00065 val = itype##_iterator_next(val##_iter); \
00066 code \
00067 } \
00068 itype##_iterator_free(val##_iter); \
00069 }
00070
00079 #define OSCAP_FOREACH(type, val, init_val, code) \
00080 OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code)
00081
00089 #define OSCAP_FOREACH_STR(val, init_val, code) \
00090 OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code)
00091
00107 struct xml_metadata;
00108
00110 struct xml_metadata *xml_metadata_new(void);
00111
00113 const char *xml_metadata_get_nspace(const struct xml_metadata *xml);
00115 const char *xml_metadata_get_lang(const struct xml_metadata *xml);
00117 const char *xml_metadata_get_URI(const struct xml_metadata *xml);
00118
00120 bool xml_metadata_set_nspace(struct xml_metadata *xml, const char *new_namespace);
00122 bool xml_metadata_set_lang(struct xml_metadata *xml, const char *new_lang);
00124 bool xml_metadata_set_URI(struct xml_metadata *xml, const char *new_uri);
00125
00127 void xml_metadata_free(struct xml_metadata *xml);
00128
00129
00130
00136 struct xml_metadata_iterator;
00140 struct xml_metadata *xml_metadata_iterator_next(struct xml_metadata_iterator *it);
00144 bool xml_metadata_iterator_has_more(struct xml_metadata_iterator *it);
00148 void xml_metadata_iterator_free(struct xml_metadata_iterator *it);
00149
00153 void xml_metadata_iterator_remove(struct xml_metadata_iterator *it);
00154
00170 struct oscap_string_iterator;
00172 const char *oscap_string_iterator_next(struct oscap_string_iterator *it);
00174 bool oscap_string_iterator_has_more(struct oscap_string_iterator *it);
00176 void oscap_string_iterator_free(struct oscap_string_iterator *it);
00178 void oscap_string_iterator_remove(struct oscap_string_iterator *it);
00179
00184 struct oscap_title;
00185
00190 const char *oscap_title_get_content(const struct oscap_title *title);
00191
00196 const char *oscap_title_get_language(const struct oscap_title *title);
00197
00202 bool oscap_title_set_content(struct oscap_title *title, const char *new_content);
00203
00209 struct oscap_title_iterator;
00211 struct oscap_title *oscap_title_iterator_next(struct oscap_title_iterator *it);
00213 void oscap_title_iterator_free(struct oscap_title_iterator *it);
00215 bool oscap_title_iterator_has_more(struct oscap_title_iterator *it);
00217 void oscap_title_iterator_remove(struct oscap_title_iterator *it);
00218
00228 void oscap_cleanup(void);
00229
00230
00240 struct oscap_export_target;
00244 struct oscap_import_source;
00245
00249 typedef enum {
00250 OSCAP_STREAM_UNKNOWN = 0,
00251 OSCAP_STREAM_FILE = 1,
00252 OSCAP_STREAM_URL = 2,
00253 } oscap_stream_type_t;
00254
00259 oscap_stream_type_t oscap_import_source_get_type(const struct oscap_import_source *item);
00260
00265 const char *oscap_import_source_get_name(const struct oscap_import_source *item);
00266
00271 oscap_stream_type_t oscap_export_target_get_type(const struct oscap_export_target *item);
00272
00277 const char *oscap_export_target_get_name(const struct oscap_export_target *item);
00278
00283 const char *oscap_export_target_get_encoding(const struct oscap_export_target *item);
00284
00289 int oscap_export_target_get_indent(const struct oscap_export_target *item);
00290
00295 const char *oscap_export_target_get_indent_string(const struct oscap_export_target *item);
00296
00301 struct oscap_import_source *oscap_import_source_new_file(const char *filename, const char *encoding);
00302
00307 struct oscap_import_source *oscap_import_source_new_URL(const char *url, const char *encoding);
00308
00313 void oscap_import_source_free(struct oscap_import_source *target);
00314
00319 struct oscap_export_target *oscap_export_target_new_file(const char *filename, const char *encoding);
00320
00325 struct oscap_export_target *oscap_export_target_new_URL(const char *url, const char *encoding);
00326
00331 void oscap_export_target_free(struct oscap_export_target *target);
00332
00335 #endif