Open SCAP Library: text_priv.h Source File

Open SCAP Library

text_priv.h
1 /*
2 * Copyright 2009 Red Hat Inc., Durham, North Carolina.
3 * All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Authors:
20 * "David Niemoller" <David.Niemoller@g2-inc.com>
21 * Lukas Kuklinek <lkuklinek@redhat.com>
22 */
23
24 #pragma once
25 #ifndef OSCAP_TEXT_PRIV_H_
26 #define OSCAP_TEXT_PRIV_H_
27
28 #include "public/oscap_text.h"
29 #include "elements.h"
30 #include <libxml/xmlreader.h>
31 #include <libxml/xmlwriter.h>
32
33 OSCAP_HIDDEN_START;
34
39 struct oscap_text_traits {
40 bool override_given : 1;
41 bool html : 1;
42 bool can_override : 1;
43 bool can_substitute : 1;
44 bool overrides : 1;
45 };
46
47 struct oscap_text {
48 char *lang;
49 char *text;
50 struct oscap_text_traits traits;
51 };
52
53 struct oscap_list;
54
56 extern const struct oscap_text_traits OSCAP_TEXT_TRAITS_PLAIN;
58 extern const struct oscap_text_traits OSCAP_TEXT_TRAITS_HTML;
59
66 struct oscap_text *oscap_text_new_full(struct oscap_text_traits traits, const char *string, const char *lang);
67
71 struct oscap_text *oscap_text_new_parse(struct oscap_text_traits traits, xmlTextReaderPtr reader);
72
73 xmlNode *oscap_text_to_dom(struct oscap_text *text, xmlNode *parent, const char *elname);
74 bool oscap_text_export(struct oscap_text *text, xmlTextWriter *writer, const char *elname);
75 bool oscap_textlist_export(struct oscap_text_iterator *texts, xmlTextWriter *writer, const char *elname);
76
77 char *_xhtml_to_plaintext(const char *xhtml_in);
78
79 OSCAP_HIDDEN_END;
80
81 #endif
oscap_text_traits::can_substitute
bool can_substitute
can proces the sub element and such
Definition: text_priv.h:43
oscap_text_traits::can_override
bool can_override
can override parent&#39;s value.
Definition: text_priv.h:42
oscap_text_traits::html
bool html
XHTML-formatted text.
Definition: text_priv.h:41
oscap_text_iterator
Internationalized string iterator.
oscap_list
Definition: list.h:54
oscap_text_traits::overrides
bool overrides
overrides parent&#39;s value
Definition: text_priv.h:44
oscap_text.h
Multilingual text processing interface.
oscap_text_traits::override_given
bool override_given
override attribute given
Definition: text_priv.h:40
oscap_text
Representation of internationalizable character strings.
Definition: text_priv.h:47
oscap_text_traits
oscap_text traits
Definition: text_priv.h:39