Open SCAP Library
/home/pvrabec/project/openscap/openscap-0.7.3/src/common/text_priv.h
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 
00024 #pragma once
00025 #ifndef OSCAP_TEXT_PRIV_H_
00026 #define OSCAP_TEXT_PRIV_H_
00027 
00028 #include "public/text.h"
00029 #include "elements.h"
00030 #include <libxml/xmlreader.h>
00031 #include <libxml/xmlwriter.h>
00032 
00033 OSCAP_HIDDEN_START;
00034 
00039 struct oscap_text_traits {
00040         bool override_given : 1; 
00041         bool html           : 1; 
00042         bool can_override   : 1; 
00043         bool can_substitute : 1; 
00044         bool overrides      : 1; 
00045 };
00046 
00047 struct oscap_text {
00048         char *lang;
00049         char *text;
00050     struct oscap_text_traits traits;
00051 };
00052 
00053 struct oscap_list;
00054 
00056 extern const struct oscap_text_traits OSCAP_TEXT_TRAITS_PLAIN;
00058 extern const struct oscap_text_traits OSCAP_TEXT_TRAITS_HTML;
00059 
00066 struct oscap_text *oscap_text_new_full(struct oscap_text_traits traits, const char *string, const char *lang);
00067 
00071 struct oscap_text *oscap_text_new_parse(struct oscap_text_traits traits, xmlTextReaderPtr reader);
00072 
00073 xmlNode *oscap_text_to_dom(struct oscap_text *text, xmlNode *parent, const char *elname);
00074 bool oscap_text_export(struct oscap_text *text, xmlTextWriter *writer, const char *elname);
00075 bool oscap_textlist_export(struct oscap_text_iterator *texts, xmlTextWriter *writer, const char *elname);
00076 
00077 OSCAP_HIDDEN_END;
00078 
00079 #endif