00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00030 #ifndef OSCAP_H_
00031 #define OSCAP_H_
00032 #include <stdbool.h>
00033
00034
00047 #define OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) \
00048 { \
00049 struct itype##_iterator *val##_it_ = (init_val); \
00050 vtype val; \
00051 while (itype##_iterator_has_more(val##_it_)) { \
00052 val = itype##_iterator_next(val##_it_); \
00053 code \
00054 } \
00055 itype##_iterator_free(val##_it_); \
00056 }
00057
00066 #define OSCAP_FOREACH(type, val, init_val, code) \
00067 OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code)
00068
00076 #define OSCAP_FOREACH_STR(val, init_val, code) \
00077 OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code)
00078
00079
00084 struct oscap_string_iterator;
00086 const char* oscap_string_iterator_next(struct oscap_string_iterator* it);
00088 bool oscap_string_iterator_has_more(struct oscap_string_iterator* it);
00090 void oscap_string_iterator_free(struct oscap_string_iterator* it);
00091
00096 struct oscap_title;
00097
00102 const char *oscap_title_get_content(const struct oscap_title *title);
00103
00108 const char *oscap_title_get_language(const struct oscap_title *title);
00109
00114 bool oscap_title_set_content(struct oscap_title *title, const char *new_content);
00115
00121 struct oscap_title_iterator;
00123 struct oscap_title* oscap_title_iterator_next(struct oscap_title_iterator* it);
00125 void oscap_title_iterator_free(struct oscap_title_iterator* it);
00127 bool oscap_title_iterator_has_more(struct oscap_title_iterator* it);
00128
00136 void oscap_cleanup(void);
00137
00140 struct oscap_export_target;
00143 struct oscap_import_source;
00144
00147 const char * oscap_import_source_get_filename(const struct oscap_import_source *item);
00151 const char * oscap_import_source_get_encoding(const struct oscap_import_source *item);
00155 const char * oscap_export_target_get_filename(const struct oscap_export_target *item);
00159 const char * oscap_export_target_get_encoding(const struct oscap_export_target *item);
00163 int oscap_export_target_get_indent(const struct oscap_export_target *item);
00167 const char * oscap_export_target_get_indent_string(const struct oscap_export_target *item);
00171 struct oscap_import_source * oscap_import_source_new(const char * filename, const char * encoding);
00175 void oscap_import_source_free(struct oscap_import_source * target);
00179 struct oscap_export_target * oscap_export_target_new(const char * filename, const char * encoding);
00183 void oscap_export_target_free(struct oscap_export_target * target);
00184
00185 #endif
00186