oscap_text.h
Go to the documentation of this file.
/*
* Copyright 2009 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
* "David Niemoller" <David.Niemoller@g2-inc.com>
* Lukas Kuklinek <lkuklinek@redhat.com>
*/
#pragma once
#ifndef OSCAP_TEXT_H_
#define OSCAP_TEXT_H_
#include <stdbool.h>
extern const char * const OSCAP_LANG_ENGLISH;
extern const char * const OSCAP_LANG_ENGLISH_US;
extern const char * const OSCAP_LANG_DEFAULT;
struct oscap_text;
struct oscap_stringlist;
struct oscap_text *oscap_text_new(void);
struct oscap_text *oscap_text_clone(const struct oscap_text * text);
struct oscap_text *oscap_text_new_html(void);
void oscap_text_free(struct oscap_text *);
/************************************************************/
struct oscap_string_iterator *oscap_stringlist_get_strings(const struct oscap_stringlist* list);
struct oscap_stringlist *oscap_stringlist_clone(struct oscap_stringlist *list);
const char *oscap_text_get_text(const struct oscap_text *text);
const char *oscap_text_get_lang(const struct oscap_text *text);
char *oscap_text_get_plaintext(const struct oscap_text *text);
bool oscap_text_get_is_html(const struct oscap_text *text);
bool oscap_text_get_can_substitute(const struct oscap_text *text);
bool oscap_text_get_can_override(const struct oscap_text *text);
bool oscap_text_get_overrides(const struct oscap_text *text);
/************************************************************/
/************************************************************/
bool oscap_text_set_overrides(struct oscap_text *text, bool overrides);
bool oscap_text_set_text(struct oscap_text *text, const char * string);
bool oscap_text_set_lang(struct oscap_text *text, const char *string);
bool oscap_stringlist_add_string(struct oscap_stringlist* list, const char *str);
struct oscap_stringlist * oscap_stringlist_new(void);
void oscap_stringlist_free(struct oscap_stringlist *list);
/************************************************************/
/************************************************************/
struct oscap_text_iterator;
struct oscap_text *oscap_text_iterator_next(struct oscap_text_iterator *it);
bool oscap_text_iterator_has_more(struct oscap_text_iterator *it);
void oscap_text_iterator_free(struct oscap_text_iterator *it);
void oscap_text_iterator_remove(struct oscap_text_iterator *it);
void oscap_text_iterator_reset(struct oscap_text_iterator *it);
struct oscap_string_iterator;
const char *oscap_string_iterator_next(struct oscap_string_iterator *it);
bool oscap_string_iterator_has_more(struct oscap_string_iterator *it);
void oscap_string_iterator_free(struct oscap_string_iterator *it);
void oscap_string_iterator_remove(struct oscap_string_iterator *it);
void oscap_string_iterator_reset(struct oscap_string_iterator *it);
struct oscap_stringlist_iterator;
struct oscap_stringlist *oscap_stringlist_iterator_next(struct oscap_stringlist_iterator *it);
bool oscap_stringlist_iterator_has_more(struct oscap_stringlist_iterator *it);
void oscap_stringlist_iterator_free(struct oscap_stringlist_iterator *it);
void oscap_stringlist_iterator_remove(struct oscap_stringlist_iterator *it);
void oscap_stringlist_iterator_reset(struct oscap_stringlist_iterator *it);
/************************************************************/
char* oscap_textlist_get_preferred_plaintext(struct oscap_text_iterator* texts, const char* preferred_lang);
#endif