00001 /* 00002 * Copyright 2009 Red Hat Inc., Durham, North Carolina. 00003 * All Rights Reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * Authors: 00020 * "David Niemoller" <David.Niemoller@g2-inc.com> 00021 * Lukas Kuklinek <lkuklinek@redhat.com> 00022 */ 00023 00037 #pragma once 00038 #ifndef OSCAP_TEXT_H_ 00039 #define OSCAP_TEXT_H_ 00040 00045 00046 extern const char * const OSCAP_LANG_ENGLISH; 00048 extern const char * const OSCAP_LANG_ENGLISH_US; 00050 extern const char * const OSCAP_LANG_DEFAULT; 00057 struct oscap_text; 00058 00063 struct oscap_title; 00064 00069 struct oscap_stringlist; 00070 00077 struct oscap_text *oscap_text_new(void); 00078 00084 struct oscap_text *oscap_text_clone(const struct oscap_text * text); 00085 00092 struct oscap_text *oscap_text_new_html(void); 00093 00098 void oscap_text_free(struct oscap_text *); 00099 00100 /************************************************************/ 00112 const char *oscap_title_get_content(const struct oscap_title *title); 00113 00115 struct oscap_string_iterator *oscap_stringlist_get_strings(const struct oscap_stringlist* list); 00117 struct oscap_stringlist *oscap_stringlist_clone(struct oscap_stringlist *list); 00118 00123 const char *oscap_title_get_language(const struct oscap_title *title); 00124 00126 const char *oscap_text_get_text(const struct oscap_text *text); 00128 const char *oscap_text_get_lang(const struct oscap_text *text); 00129 00134 bool oscap_text_get_is_html(const struct oscap_text *text); 00139 bool oscap_text_get_can_substitute(const struct oscap_text *text); 00144 bool oscap_text_get_can_override(const struct oscap_text *text); 00149 bool oscap_text_get_overrides(const struct oscap_text *text); 00150 00151 /************************************************************/ 00154 /************************************************************/ 00166 //bool oscap_text_set_overrides(struct oscap_text *text, bool overrides); 00167 00169 bool oscap_text_set_text(struct oscap_text *text, const char * string); 00171 bool oscap_text_set_lang(struct oscap_text *text, const char *string); 00172 00177 bool oscap_title_set_content(struct oscap_title *title, const char *new_content); 00179 bool oscap_stringlist_add_string(struct oscap_stringlist* list, const char *str); 00180 00181 00182 /************************************************************/ 00185 /************************************************************/ 00195 struct oscap_text_iterator; 00197 struct oscap_text *oscap_text_iterator_next(struct oscap_text_iterator *it); 00199 bool oscap_text_iterator_has_more(struct oscap_text_iterator *it); 00201 void oscap_text_iterator_free(struct oscap_text_iterator *it); 00203 void oscap_text_iterator_remove(struct oscap_text_iterator *it); 00204 00210 struct oscap_title_iterator; 00212 struct oscap_title *oscap_title_iterator_next(struct oscap_title_iterator *it); 00214 void oscap_title_iterator_free(struct oscap_title_iterator *it); 00216 bool oscap_title_iterator_has_more(struct oscap_title_iterator *it); 00218 void oscap_title_iterator_remove(struct oscap_title_iterator *it); 00219 00227 struct oscap_string_iterator; 00229 const char *oscap_string_iterator_next(struct oscap_string_iterator *it); 00231 bool oscap_string_iterator_has_more(struct oscap_string_iterator *it); 00233 void oscap_string_iterator_free(struct oscap_string_iterator *it); 00235 void oscap_string_iterator_remove(struct oscap_string_iterator *it); 00236 00242 struct oscap_stringlist_iterator; 00244 struct oscap_stringlist *oscap_stringlist_iterator_next(struct oscap_stringlist_iterator *it); 00246 bool oscap_stringlist_iterator_has_more(struct oscap_stringlist_iterator *it); 00248 void oscap_stringlist_iterator_free(struct oscap_stringlist_iterator *it); 00250 void oscap_stringlist_iterator_remove(struct oscap_stringlist_iterator *it); 00251 00252 00253 /************************************************************/ 00259 #endif 00260