libabigail/include/abg-libxml-utils.h

132 lines
3.3 KiB
C
Raw Normal View History

Re-license the project to Apache v2 With LLVM Exception Thanks to the previous work done, changing the license is just a matter of changing the SPDX identifer from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception". Note that for the abigail.m4, tests/test-dot.cc and tests/test-svg.cc the change was from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception". include/abg-cxx-compat.h was changed from "LGPL-2.0-or-later" to "Apache-2.0 WITH LLVM-exception". Source code of programs (as opposed to source code of the library) where generally licensed under GPL-3.0-or-later; they are also now licensed "Apache-2.0 WITH LLVM-exception". This is what this patch does. * abigail.m4: Change the SPDX identifier from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception" * include/abg-cxx-compat.h: Change the SPDX identifier from "LGPL-2.0-or-later" to "Apache-2.0 WITH LLVM-exception". * .clang-format: Change the SPDX identifier from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception". * Makefile.am: Likewise. * bash-completion/Makefile.am: Likewise. * bash-completion/abicompat: Likewise. * bash-completion/abidiff: Likewise. * bash-completion/abidw: Likewise. * bash-completion/abilint: Likewise. * bash-completion/abinilint: Likewise. * bash-completion/abipkgdiff: Likewise. * bash-completion/abisym: Likewise. * bash-completion/fedabipkgdiff: Likewise. * configure.ac: Likewise. * default.abignore: Likewise. * doc/Makefile.am: Likewise. * doc/api/libabigail.doxy: Likewise. * doc/manuals/Makefile.am: Likewise. * doc/website/libabigail-website.doxy: Likewise. * include/Makefile.am: Likewise. * include/abg-comp-filter.h: Likewise. * include/abg-comparison.h: Likewise. * include/abg-config.h: Likewise. * include/abg-corpus.h: Likewise. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-fwd.h: Likewise. * include/abg-hash.h: Likewise. * include/abg-ini.h: Likewise. * include/abg-interned-str.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * include/abg-libzip-utils.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-regex.h: Likewise. * include/abg-reporter.h: Likewise. * include/abg-sptr-utils.h: Likewise. * include/abg-suppression.h: Likewise. * include/abg-tools-utils.h: Likewise. * include/abg-traverse.h: Likewise. * include/abg-version.h.in: Likewise. * include/abg-viz-common.h: Likewise. * include/abg-viz-dot.h: Likewise. * include/abg-viz-svg.h: Likewise. * include/abg-workers.h: Likewise. * include/abg-writer.h: Likewise. * scripts/dot_to_png.sh: Likewise. * scripts/dot_to_svg.sh: Likewise. * scripts/make-verbose.sh: Likewise. * scripts/svg_to_plain_svg.sh: Likewise. * scripts/svg_to_png_and_pdf.sh: Likewise. * src/Makefile.am: Likewise. * src/abg-comp-filter.cc: Likewise. * src/abg-comparison-priv.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus-priv.h: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-default-reporter.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-elf-helpers.cc: Likewise. * src/abg-elf-helpers.h: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-internal.h: Likewise. * src/abg-ir-priv.h: Likewise. * src/abg-ir.cc: Likewise. * src/abg-leaf-reporter.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-regex.cc: Likewise. * src/abg-reporter-priv.cc: Likewise. * src/abg-reporter-priv.h: Likewise. * src/abg-suppression-priv.h: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. * tests/Makefile.am: Likewise. * tests/data/Makefile.am: Likewise. * tests/lib/catch.cc: Likewise. * tests/mockfedabipkgdiff.in: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/runtestcanonicalizetypes.sh.in: Likewise. * tests/runtestdefaultsupprs.py.in: Likewise. * tests/runtestdefaultsupprspy3.sh.in: Likewise. * tests/runtestfedabipkgdiff.py.in: Likewise. * tests/runtestfedabipkgdiffpy3.sh.in: Likewise. * tests/test-abicompat.cc: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-annotate.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-cxx-compat.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-pkg.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-diff2.cc: Likewise. * tests/test-dot.cc: Change the SPDX identifier from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception" * tests/test-elf-helpers.cc: Change the SPDX identifier from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception" * tests/test-ini.cc: Likewise. * tests/test-ir-walker.cc: Likewise. * tests/test-kmi-whitelist.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-svg.cc: Change the SPDX identifier from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception". * tests/test-symtab.cc: Change the SPDX identifier from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception" * tests/test-tools-utils.cc: Likewise. * tests/test-types-stability.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. * tests/test-write-read-archive.cc: Likewise. * tests/update-test-output.py: Likewise. * tools/Makefile.am: Likewise. * tools/abiar.cc: Likewise. * tools/abicompat.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abipkgdiff.cc: Likewise. * tools/abisym.cc: Likewise. * tools/binilint.cc: Likewise. * tools/fedabipkgdiff: Likewise. * tools/kmidiff.cc: Likewise. * update-copyright.sh: Likewise. Signed-off-by: Benjamin De Kosnik <bkoz@gnu.org> Signed-off-by: Ben Woodard <woodard@redhat.com> Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> Signed-off-by: Giuliano Procida <gprocida@google.com> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jessica Yu <jeyu@kernel.org> Signed-off-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Mark Wielaard <mark@klomp.org> Signed-off-by: Matthias Klose <doko@ubuntu.com> Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> Signed-off-by: Roland McGrath <roland@hack.frob.com> Signed-off-by: Sinny Kumari <ksinny@gmail.com> Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2020-05-29 14:26:04 +00:00
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// -*- mode: C++ -*-
//
Update copyright year to 2020 We are in February 2020 so this is long overdue. * include/abg-comp-filter.h: Update copyright year to 2020. * include/abg-comparison.h: Likewise. * include/abg-config.h: Likewise. * include/abg-corpus.h: Likewise. * include/abg-cxx-compat.h: Likewise. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-fwd.h: Likewise. * include/abg-hash.h: Likewise. * include/abg-ini.h: Likewise. * include/abg-interned-str.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * include/abg-libzip-utils.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-reporter.h: Likewise. * include/abg-sptr-utils.h: Likewise. * include/abg-suppression.h: Likewise. * include/abg-tools-utils.h: Likewise. * include/abg-traverse.h: Likewise. * include/abg-viz-common.h: Likewise. * include/abg-viz-dot.h: Likewise. * include/abg-viz-svg.h: Likewise. * include/abg-workers.h: Likewise. * include/abg-writer.h: Likewise. * src/abg-comp-filter.cc: Likewise. * src/abg-comparison-priv.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus-priv.h: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-default-reporter.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-internal.h: Likewise. * src/abg-ir-priv.h: Likewise. * src/abg-ir.cc: Likewise. * src/abg-leaf-reporter.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-reporter-priv.cc: Likewise. * src/abg-reporter-priv.h: Likewise. * src/abg-sptr-utils.cc: Likewise. * src/abg-suppression-priv.h: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/test-abicompat.cc: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-pkg.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-diff2.cc: Likewise. * tests/test-dot.cc: Likewise. * tests/test-ini.cc: Likewise. * tests/test-ir-walker.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-svg.cc: Likewise. * tests/test-tools-utils.cc: Likewise. * tests/test-types-stability.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. * tests/test-write-read-archive.cc: Likewise. * tools/abiar.cc: Likewise. * tools/abicompat.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abipkgdiff.cc: Likewise. * tools/abisym.cc: Likewise. * tools/binilint.cc: Likewise. * tools/kmidiff.cc: Likewise. * update-copyright.sh: Fix the updating script to handle not just "Red Hat, Inc." Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-02-21 15:42:35 +00:00
// Copyright (C) 2013-2020 Red Hat, Inc.
/// @file
#ifndef __ABG_LIBXML_UTILS_H__
#define __ABG_LIBXML_UTILS_H__
#include <libxml/xmlreader.h>
#include <istream>
Add compatibility layer for C++11 mode Introduce a compatibility layer for C++11 code by adding include/abg-cxx-compat.h. abg-cxx-compat defines a new namespace abg_compat and defines abg_compat::hash abg_compat::shared_ptr abg_compat::weak_ptr abg_compat::dynamic_pointer_cast abg_compat::static_pointer_cast abg_compat::unordered_map abg_compat::unordered_set based on definitions from std::tr1 (std=gnu++98) or std:: (std=gnu++11). I decided for introducing abg_compat:: rather than polluting abigail:: to allow an easier transition to C++11 at a later time and to not subtly break existing code. As the shared_ptr in C++11 defines shared_ptr::operator bool() explicit, some locations where a shared_ptr is assigned to boolean, needed to be adjusted to explicitly cast to bool. * include/abg-cxx-compat.h: new file introducing the abg_compat namespace to provide C++11 functionality from either std::tr1 or std:: * include/Makefile.am: Add the new abg-cxx-compat.h to source distribution. * include/abg-comparison.h: replace std::tr1 usage by abg_compat and adjust includes accordingly: likewise * include/abg-diff-utils.h: likewise * include/abg-fwd.h: likewise * include/abg-ini.h: likewise * include/abg-interned-str.h: likewise * include/abg-ir.h: likewise * include/abg-libxml-utils.h: likewise * include/abg-libzip-utils.h: likewise * include/abg-reporter.h: likewise * include/abg-sptr-utils.h: likewise * include/abg-suppression.h: likewise * include/abg-tools-utils.h: likewise * include/abg-workers.h: likewise * src/abg-comp-filter.cc: likewise * src/abg-comparison-priv.h: likewise * src/abg-corpus.cc: likewise * src/abg-dwarf-reader.cc: likewise * src/abg-hash.cc: likewise * src/abg-ir.cc: likewise * src/abg-reader.cc: likewise * src/abg-suppression.cc: likewise * src/abg-tools-utils.cc: likewise * src/abg-writer.cc: likewise * tests/test-diff-filter.cc: likewise * tests/test-diff-pkg.cc: likewise * tests/test-read-dwarf.cc: likewise * tests/test-read-write.cc: likewise * tests/test-types-stability.cc: likewise * tests/test-write-read-archive.cc: likewise * tools/abicompat.cc: likewise * tools/abidiff.cc: likewise * tools/abidw.cc: likewise * tools/abilint.cc: likewise * tools/abipkgdiff.cc: likewise Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-07-05 11:00:23 +00:00
#include "abg-sptr-utils.h"
#include "abg-cxx-compat.h"
namespace abigail
{
Add --drop/--keep options to bidiff * include/abg-sptr-utils.h: New file. * include/Makefile.am: Add abg-sptr-utils. to the build system. * include/abg-libxml-utils.h (reader_sptr, xml_char_sptr): Remove these typedefs as there are now in abg-sptr-utils. (build_sptr): Likewise for this template and its specializations declarations. * src/abg-libxml-utils.cc (sptr_utils::build_sptr): Mode the definition of the specializations for xmlTextReader and xmlChar into the sptr_utils namespace. * include/abg-corpus.h (corpus::{get_regex_patterns_of_fns_to_suppress, get_regex_patterns_of_vars_to_suppress, get_regex_patterns_of_fns_to_keep, get_regex_patterns_of_vars_to_keep}): Declare new member functions. * src/abg-comparison.cc (sptr_utils::regex_t_deleter): Define new functor. (build_sptr) Define new specialization for regex_t. (struct array_deleter): Remove unused functor. (corpus::priv::regex_patterns_{fns,vars}_to_{suppress,keep}): New data members. (symtab_build_visitor_type::regex_patterns_{fns,vars}_to_{suppress,keep}): Likewise. (symtab_build_visitor_type::r_{fns,vars}_{suppress,keep})): Likewise. (symtab_build_visitor_type::symtab_build_visitor_type): Update the signature of this constructor to take regex patterns for functions and variables to suppress and to keep. Also, initialize the data members from these new parameters. (symtab_build_visitor_type::regex_{fns,vars}_{suppress,keep}): New member functions. (symtab_build_visitor_type::{add_fn_to_wip_fns, add_var_to_wip_vars}): Likewise. (symtab_build_visitor_type::visit) Use either add_fn_to_wip_fns or add_var_to_wip_vars depending on the overload of the visit() member. (corpus::priv::build_symbol_table): Update for the change of the symtab_build_visitor_type constructor signature. (corpus::get_regex_patterns_of_{fns,vars}_to_{suppress,keep}): Define new member functions. * tools/bidiff.cc (options::{drop,keep}_{fn,var}_regex_patterns}): New data member. (display_usage): Add help strings for --drop, --drop-fn, --drop-var, --keep, --keep-fn, --keep-var (parse_command_line): Parse the command lines above. (set_corpus_keep_drop_regex_patterns): Define new static function. (main): Use the new set_corpus_keep_drop_regex_patterns. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-02-28 16:26:18 +00:00
/// Internal namespace for xml manipulation utilities.
namespace xml
{
Add --drop/--keep options to bidiff * include/abg-sptr-utils.h: New file. * include/Makefile.am: Add abg-sptr-utils. to the build system. * include/abg-libxml-utils.h (reader_sptr, xml_char_sptr): Remove these typedefs as there are now in abg-sptr-utils. (build_sptr): Likewise for this template and its specializations declarations. * src/abg-libxml-utils.cc (sptr_utils::build_sptr): Mode the definition of the specializations for xmlTextReader and xmlChar into the sptr_utils namespace. * include/abg-corpus.h (corpus::{get_regex_patterns_of_fns_to_suppress, get_regex_patterns_of_vars_to_suppress, get_regex_patterns_of_fns_to_keep, get_regex_patterns_of_vars_to_keep}): Declare new member functions. * src/abg-comparison.cc (sptr_utils::regex_t_deleter): Define new functor. (build_sptr) Define new specialization for regex_t. (struct array_deleter): Remove unused functor. (corpus::priv::regex_patterns_{fns,vars}_to_{suppress,keep}): New data members. (symtab_build_visitor_type::regex_patterns_{fns,vars}_to_{suppress,keep}): Likewise. (symtab_build_visitor_type::r_{fns,vars}_{suppress,keep})): Likewise. (symtab_build_visitor_type::symtab_build_visitor_type): Update the signature of this constructor to take regex patterns for functions and variables to suppress and to keep. Also, initialize the data members from these new parameters. (symtab_build_visitor_type::regex_{fns,vars}_{suppress,keep}): New member functions. (symtab_build_visitor_type::{add_fn_to_wip_fns, add_var_to_wip_vars}): Likewise. (symtab_build_visitor_type::visit) Use either add_fn_to_wip_fns or add_var_to_wip_vars depending on the overload of the visit() member. (corpus::priv::build_symbol_table): Update for the change of the symtab_build_visitor_type constructor signature. (corpus::get_regex_patterns_of_{fns,vars}_to_{suppress,keep}): Define new member functions. * tools/bidiff.cc (options::{drop,keep}_{fn,var}_regex_patterns}): New data member. (display_usage): Add help strings for --drop, --drop-fn, --drop-var, --keep, --keep-fn, --keep-var (parse_command_line): Parse the command lines above. (set_corpus_keep_drop_regex_patterns): Define new static function. (main): Use the new set_corpus_keep_drop_regex_patterns. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-02-28 16:26:18 +00:00
using sptr_utils::build_sptr;
Add compatibility layer for C++11 mode Introduce a compatibility layer for C++11 code by adding include/abg-cxx-compat.h. abg-cxx-compat defines a new namespace abg_compat and defines abg_compat::hash abg_compat::shared_ptr abg_compat::weak_ptr abg_compat::dynamic_pointer_cast abg_compat::static_pointer_cast abg_compat::unordered_map abg_compat::unordered_set based on definitions from std::tr1 (std=gnu++98) or std:: (std=gnu++11). I decided for introducing abg_compat:: rather than polluting abigail:: to allow an easier transition to C++11 at a later time and to not subtly break existing code. As the shared_ptr in C++11 defines shared_ptr::operator bool() explicit, some locations where a shared_ptr is assigned to boolean, needed to be adjusted to explicitly cast to bool. * include/abg-cxx-compat.h: new file introducing the abg_compat namespace to provide C++11 functionality from either std::tr1 or std:: * include/Makefile.am: Add the new abg-cxx-compat.h to source distribution. * include/abg-comparison.h: replace std::tr1 usage by abg_compat and adjust includes accordingly: likewise * include/abg-diff-utils.h: likewise * include/abg-fwd.h: likewise * include/abg-ini.h: likewise * include/abg-interned-str.h: likewise * include/abg-ir.h: likewise * include/abg-libxml-utils.h: likewise * include/abg-libzip-utils.h: likewise * include/abg-reporter.h: likewise * include/abg-sptr-utils.h: likewise * include/abg-suppression.h: likewise * include/abg-tools-utils.h: likewise * include/abg-workers.h: likewise * src/abg-comp-filter.cc: likewise * src/abg-comparison-priv.h: likewise * src/abg-corpus.cc: likewise * src/abg-dwarf-reader.cc: likewise * src/abg-hash.cc: likewise * src/abg-ir.cc: likewise * src/abg-reader.cc: likewise * src/abg-suppression.cc: likewise * src/abg-tools-utils.cc: likewise * src/abg-writer.cc: likewise * tests/test-diff-filter.cc: likewise * tests/test-diff-pkg.cc: likewise * tests/test-read-dwarf.cc: likewise * tests/test-read-write.cc: likewise * tests/test-types-stability.cc: likewise * tests/test-write-read-archive.cc: likewise * tools/abicompat.cc: likewise * tools/abidiff.cc: likewise * tools/abidw.cc: likewise * tools/abilint.cc: likewise * tools/abipkgdiff.cc: likewise Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-07-05 11:00:23 +00:00
using abg_compat::shared_ptr;
/// A convenience typedef for a shared pointer of xmlTextReader.
typedef shared_ptr<xmlTextReader> reader_sptr;
/// A convenience typedef for a shared pointer of xmlChar.
typedef shared_ptr<xmlChar> xml_char_sptr;
/// This functor is used to instantiate a shared_ptr for the
/// xmlTextReader.
struct textReaderDeleter
{
void
operator()(xmlTextReaderPtr reader)
Add --drop/--keep options to bidiff * include/abg-sptr-utils.h: New file. * include/Makefile.am: Add abg-sptr-utils. to the build system. * include/abg-libxml-utils.h (reader_sptr, xml_char_sptr): Remove these typedefs as there are now in abg-sptr-utils. (build_sptr): Likewise for this template and its specializations declarations. * src/abg-libxml-utils.cc (sptr_utils::build_sptr): Mode the definition of the specializations for xmlTextReader and xmlChar into the sptr_utils namespace. * include/abg-corpus.h (corpus::{get_regex_patterns_of_fns_to_suppress, get_regex_patterns_of_vars_to_suppress, get_regex_patterns_of_fns_to_keep, get_regex_patterns_of_vars_to_keep}): Declare new member functions. * src/abg-comparison.cc (sptr_utils::regex_t_deleter): Define new functor. (build_sptr) Define new specialization for regex_t. (struct array_deleter): Remove unused functor. (corpus::priv::regex_patterns_{fns,vars}_to_{suppress,keep}): New data members. (symtab_build_visitor_type::regex_patterns_{fns,vars}_to_{suppress,keep}): Likewise. (symtab_build_visitor_type::r_{fns,vars}_{suppress,keep})): Likewise. (symtab_build_visitor_type::symtab_build_visitor_type): Update the signature of this constructor to take regex patterns for functions and variables to suppress and to keep. Also, initialize the data members from these new parameters. (symtab_build_visitor_type::regex_{fns,vars}_{suppress,keep}): New member functions. (symtab_build_visitor_type::{add_fn_to_wip_fns, add_var_to_wip_vars}): Likewise. (symtab_build_visitor_type::visit) Use either add_fn_to_wip_fns or add_var_to_wip_vars depending on the overload of the visit() member. (corpus::priv::build_symbol_table): Update for the change of the symtab_build_visitor_type constructor signature. (corpus::get_regex_patterns_of_{fns,vars}_to_{suppress,keep}): Define new member functions. * tools/bidiff.cc (options::{drop,keep}_{fn,var}_regex_patterns}): New data member. (display_usage): Add help strings for --drop, --drop-fn, --drop-var, --keep, --keep-fn, --keep-var (parse_command_line): Parse the command lines above. (set_corpus_keep_drop_regex_patterns): Define new static function. (main): Use the new set_corpus_keep_drop_regex_patterns. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-02-28 16:26:18 +00:00
{xmlFreeTextReader(reader);}
};
/// This functor is used to instantiate a shared_ptr for xmlChar
struct charDeleter
{
void
operator()(xmlChar* str)
{ xmlFree(str); }
};
reader_sptr new_reader_from_file(const std::string& path);
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
reader_sptr new_reader_from_buffer(const std::string& buffer);
reader_sptr new_reader_from_istream(std::istream*);
bool xml_char_sptr_to_string(xml_char_sptr, std::string&);
Initial Support for class declarations * src/abg-ir.h (scope_decl::scope_decl) (scope_type_decl::scope_type_decl): Don't set mangled name for scope_decl instances as it doesn't make sense. (var_decl::var_decl): Pass the type shared pointer by value. (struct var_decl_hash, function_decl::parameter::operator==) (struct function_decl::parameter_hash, function_decl::operator==) (struct function_decl_hash, class class_decl, struct class_decl_hash): New declarations. * src/abg-ir.cc (scope_type_decl::scope_type_decl): Don't set the mangled name. It doesn't make sense for scope_decls. (dynamic_type_hash::operator): Fix comment. Run the hashing for scope_type_decl instances *after* running it for class_decl instance, otherwise, the class_decl instances case will never get hit. (var_decl::var_decl): Pass the type shared pointer by value. (function_decl::operator==, class_decl::operator==) (class_decl_hash::operator()): New fns. * src/abg-libxml-utils.h (get_xml_node_depth): Declare new fn. (XML_READER_GET_ATTRIBUTE): Fix comment. (XML_NODE_GET_ATTRIBUTE): New getter macro. * src/abg-libxml-utils.cc (get_xml_node_depth): New definition. * src/abg-reader.cc (update_read_context) (update_depth_info_of_read_context, read_visibility, read_binding) (read_access, read_size_and_alignment, read_static) (read_var_offset_in_bits, read_cdtor_const, build_function_decl) ( build_var_decl, build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_typedef_decl, build_class_decl) (build_type, handle_class_decl): New functions or overloads. (handle_element): Update to handle "class-decl" xml elements. * src/abg-writer.cc (write_size_and_alignment, write_access) (write_class, do_indent_to_level, get_indent_to_level): New fns. (write_decl): Update to serialize instances of class_decl. (write_type_decl, write_pointer_type_def) (write_reference_type_def): Use the new write_size_and_alignment instead of writing the attributes directly. * tests/data/test-read-write/test10.xml: New test file. * tests/Makefile.am: Add tests/data/test-read-write/test10.xml to the build system. * tests/test-read-write.cc (in_out_spec): De-serialize data/test-read-write/test10.xml, serialize it back into output/test-read-write/test10.xml, and compare the two output that should be identical.
2013-04-11 20:02:08 +00:00
int get_xml_node_depth(xmlNodePtr);
/// Get the name of the current element node the reader is pointing
/// to. Note that this macro returns an instance of
/// shared_ptr<xmlChar> so that the caller doesn't have to worry about
/// managing memory itself. Also note that the reader is a
/// shared_ptr<xmlTextReader>
#define XML_READER_GET_NODE_NAME(reader) \
xml::build_sptr(xmlTextReaderName(reader.get()))
/// Get the type of the current node of the shared_ptr<xmlTextReader>
/// passed in argument.
#define XML_READER_GET_NODE_TYPE(reader) \
static_cast<xmlReaderTypes> (xmlTextReaderNodeType(reader.get()))
Initial Support for class declarations * src/abg-ir.h (scope_decl::scope_decl) (scope_type_decl::scope_type_decl): Don't set mangled name for scope_decl instances as it doesn't make sense. (var_decl::var_decl): Pass the type shared pointer by value. (struct var_decl_hash, function_decl::parameter::operator==) (struct function_decl::parameter_hash, function_decl::operator==) (struct function_decl_hash, class class_decl, struct class_decl_hash): New declarations. * src/abg-ir.cc (scope_type_decl::scope_type_decl): Don't set the mangled name. It doesn't make sense for scope_decls. (dynamic_type_hash::operator): Fix comment. Run the hashing for scope_type_decl instances *after* running it for class_decl instance, otherwise, the class_decl instances case will never get hit. (var_decl::var_decl): Pass the type shared pointer by value. (function_decl::operator==, class_decl::operator==) (class_decl_hash::operator()): New fns. * src/abg-libxml-utils.h (get_xml_node_depth): Declare new fn. (XML_READER_GET_ATTRIBUTE): Fix comment. (XML_NODE_GET_ATTRIBUTE): New getter macro. * src/abg-libxml-utils.cc (get_xml_node_depth): New definition. * src/abg-reader.cc (update_read_context) (update_depth_info_of_read_context, read_visibility, read_binding) (read_access, read_size_and_alignment, read_static) (read_var_offset_in_bits, read_cdtor_const, build_function_decl) ( build_var_decl, build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_typedef_decl, build_class_decl) (build_type, handle_class_decl): New functions or overloads. (handle_element): Update to handle "class-decl" xml elements. * src/abg-writer.cc (write_size_and_alignment, write_access) (write_class, do_indent_to_level, get_indent_to_level): New fns. (write_decl): Update to serialize instances of class_decl. (write_type_decl, write_pointer_type_def) (write_reference_type_def): Use the new write_size_and_alignment instead of writing the attributes directly. * tests/data/test-read-write/test10.xml: New test file. * tests/Makefile.am: Add tests/data/test-read-write/test10.xml to the build system. * tests/test-read-write.cc (in_out_spec): De-serialize data/test-read-write/test10.xml, serialize it back into output/test-read-write/test10.xml, and compare the two output that should be identical.
2013-04-11 20:02:08 +00:00
/// Get the value of attribute 'name' on the current node of 'reader'
/// which is an instance of shared_ptr<xmlTextReader>.
#define XML_READER_GET_ATTRIBUTE(reader, name) \
xml::build_sptr(xmlTextReaderGetAttribute(reader.get(), BAD_CAST(name)))
Initial Support for class declarations * src/abg-ir.h (scope_decl::scope_decl) (scope_type_decl::scope_type_decl): Don't set mangled name for scope_decl instances as it doesn't make sense. (var_decl::var_decl): Pass the type shared pointer by value. (struct var_decl_hash, function_decl::parameter::operator==) (struct function_decl::parameter_hash, function_decl::operator==) (struct function_decl_hash, class class_decl, struct class_decl_hash): New declarations. * src/abg-ir.cc (scope_type_decl::scope_type_decl): Don't set the mangled name. It doesn't make sense for scope_decls. (dynamic_type_hash::operator): Fix comment. Run the hashing for scope_type_decl instances *after* running it for class_decl instance, otherwise, the class_decl instances case will never get hit. (var_decl::var_decl): Pass the type shared pointer by value. (function_decl::operator==, class_decl::operator==) (class_decl_hash::operator()): New fns. * src/abg-libxml-utils.h (get_xml_node_depth): Declare new fn. (XML_READER_GET_ATTRIBUTE): Fix comment. (XML_NODE_GET_ATTRIBUTE): New getter macro. * src/abg-libxml-utils.cc (get_xml_node_depth): New definition. * src/abg-reader.cc (update_read_context) (update_depth_info_of_read_context, read_visibility, read_binding) (read_access, read_size_and_alignment, read_static) (read_var_offset_in_bits, read_cdtor_const, build_function_decl) ( build_var_decl, build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_typedef_decl, build_class_decl) (build_type, handle_class_decl): New functions or overloads. (handle_element): Update to handle "class-decl" xml elements. * src/abg-writer.cc (write_size_and_alignment, write_access) (write_class, do_indent_to_level, get_indent_to_level): New fns. (write_decl): Update to serialize instances of class_decl. (write_type_decl, write_pointer_type_def) (write_reference_type_def): Use the new write_size_and_alignment instead of writing the attributes directly. * tests/data/test-read-write/test10.xml: New test file. * tests/Makefile.am: Add tests/data/test-read-write/test10.xml to the build system. * tests/test-read-write.cc (in_out_spec): De-serialize data/test-read-write/test10.xml, serialize it back into output/test-read-write/test10.xml, and compare the two output that should be identical.
2013-04-11 20:02:08 +00:00
/// Get the value of attribute 'name' ont the instance of xmlNodePtr
/// denoted by 'node'.
#define XML_NODE_GET_ATTRIBUTE(node, name) \
xml::build_sptr(xmlGetProp(node, BAD_CAST(name)))
#define CHAR_STR(xml_char_str) \
reinterpret_cast<char*>(xml_char_str.get())
Initial support of de-serializing the KMI of a Linux Kernel Tree With this patch, kmidiff knows how to compare a serialized corpus_group that represents a Kernel Module Interface (a .kmi file) against either another serialized .kmi file, or against a kernel tree. The patch extends the abixml reader to make it parse an 'abi-corpus-group' element. To do that, the patch modifies read_corpus_from_input to make it be capable of parsing several 'abi-corpus' in a row. That modified function is then used by a new read_corpus_group_from_input, which is itself used by the new public entry points read_corpus_group_from_native_xml_file and read_corpus_group_from_native_xml. With that read_corpus_group_from_native_xml_file building block function, the kmidiff program is modified so that it can take either two directory trees, two .kmi files or one directory tree and one .kmi file. * include/abg-libxml-utils.h (advance_to_next_sibling_element): Declare new function. * src/abg-libxml-utils.cc (go_to_next_sibling_element_or_stay) (advance_to_next_sibling_element): Define new functions. * include/abg-reader.h (read_corpus_group_from_input) (read_corpus_group_from_native_xml) (read_corpus_group_from_native_xml_file): Declare new functions. * src/abg-reader.cc (read_context::m_corpus_group): New data member. (read_context::{get_corpus_group, set_corpus_group}): Define new member functions. (read_translation_unit_from_input): Cleanup logic. (read_corpus_from_input): Don't assume that the document is starting with an 'abi-corpus' element. Support the mode where a caller called the xmlTextReaderExpand function (and so we are given an expanded xmlNodePtr) and the mode where we need to use the xmlTextReader API to walk through the 'abi-corpus' element. Also, if we are building a corpus group, do not clear what used to be 'per-corpus' data. That data must be shared by all the corpora of a given abi-corpus-group. (read_corpus_group_from_input, read_corpus_group_from_native_xml) (read_corpus_group_from_native_xml_file): Define new functions. * include/abg-tools-utils.h (FILE_TYPE_XML_CORPUS_GROUP): New enumerator of the file_type enum. * src/abg-tools-utils.cc (operator<<): In the overload for file_type, add a case for the new FILE_TYPE_XML_CORPUS_GROUP. (guess_file_type): Dectect abi-corpus-group xml element. * tools/abidiff.cc (adjust_diff_context_for_kmidiff): Define new static function. (main): Adjust to handle the new FILE_TYPE_XML_CORPUS_GROUP. That is, compare two FILE_TYPE_XML_CORPUS_GROUP if they are present. * tools/abilint.cc (main): Likewise. * tools/kmidiff.cc (main): Detect that one of two .kmi files are passed. In that case, load the .kmi file(s), build a corpus_group of it and use it in the comparison. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-04-07 21:06:14 +00:00
xmlNodePtr
advance_to_next_sibling_element(xmlNodePtr node);
void
escape_xml_string(const std::string& str,
std::string& escaped);
std::string
escape_xml_string(const std::string& str);
Bug 20970 - Add a --annotate option to abidw This option annotates (read "pretty-prints") the types and elf symbols in the form of XML comments in the ABIXML output emitted by the abidw command. Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> * doc/manuals/abidiff.rst: Document the '--no-corpus-path' option. * doc/manuals/abidw.rst: Document the '--no-corpus-path' and '--annotate' options. * include/abg-libxml-utils.h ({un,}escape_xml_comment): Add new function declarations. * include/abg-writer.h: Add new annotate functions (write_{translation_unit,corpus_to_{archive,native_xml_file}}): Add an optional "annotate" parameter defaulting to "false". * src/abg-libxml-utils.cc ({un,}escape_xml_comment): Add new function definitions. * src/abg-writer.cc (annotate): Define new templatized function and specialize it for necessary cases. * tests/Makefile.am: Add runtestannotate as a new test. * tests/data/Makefile.am: Add paths to below reference test outputs. * tests/data/test-annotate/libtest23.so.abi: New reference test output. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test1.abi: Likewise. * tests/data/test-annotate/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-annotate/test11-pr18828.so.abi: Likewise. * tests/data/test-annotate/test12-pr18844.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test16-pr18904.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test2.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-annotate/test3.so.abi: Likewise. * tests/data/test-annotate/test4.so.abi: Likewise. * tests/data/test-annotate/test5.o.abi: Likewise. * tests/data/test-annotate/test6.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-annotate/test9-pr18818-clang.so.abi: Likewise. * tests/test-annotate.cc: New test for ABIXML annotations. * tools/abidiff.cc: Add the new option '--no-corpus-path'. * tools/abidw.cc: Likewise. Also add the '--annotate' option. reviews round 1 Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-01-17 18:41:51 +00:00
void
escape_xml_comment(const std::string& str,
std::string& escaped);
std::string
escape_xml_comment(const std::string& str);
void
unescape_xml_string(const std::string& str,
Bug 20970 - Add a --annotate option to abidw This option annotates (read "pretty-prints") the types and elf symbols in the form of XML comments in the ABIXML output emitted by the abidw command. Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> * doc/manuals/abidiff.rst: Document the '--no-corpus-path' option. * doc/manuals/abidw.rst: Document the '--no-corpus-path' and '--annotate' options. * include/abg-libxml-utils.h ({un,}escape_xml_comment): Add new function declarations. * include/abg-writer.h: Add new annotate functions (write_{translation_unit,corpus_to_{archive,native_xml_file}}): Add an optional "annotate" parameter defaulting to "false". * src/abg-libxml-utils.cc ({un,}escape_xml_comment): Add new function definitions. * src/abg-writer.cc (annotate): Define new templatized function and specialize it for necessary cases. * tests/Makefile.am: Add runtestannotate as a new test. * tests/data/Makefile.am: Add paths to below reference test outputs. * tests/data/test-annotate/libtest23.so.abi: New reference test output. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test1.abi: Likewise. * tests/data/test-annotate/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-annotate/test11-pr18828.so.abi: Likewise. * tests/data/test-annotate/test12-pr18844.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test16-pr18904.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test2.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-annotate/test3.so.abi: Likewise. * tests/data/test-annotate/test4.so.abi: Likewise. * tests/data/test-annotate/test5.o.abi: Likewise. * tests/data/test-annotate/test6.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-annotate/test9-pr18818-clang.so.abi: Likewise. * tests/test-annotate.cc: New test for ABIXML annotations. * tools/abidiff.cc: Add the new option '--no-corpus-path'. * tools/abidw.cc: Likewise. Also add the '--annotate' option. reviews round 1 Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-01-17 18:41:51 +00:00
std::string& escaped);
std::string
unescape_xml_string(const std::string& str);
Bug 20970 - Add a --annotate option to abidw This option annotates (read "pretty-prints") the types and elf symbols in the form of XML comments in the ABIXML output emitted by the abidw command. Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> * doc/manuals/abidiff.rst: Document the '--no-corpus-path' option. * doc/manuals/abidw.rst: Document the '--no-corpus-path' and '--annotate' options. * include/abg-libxml-utils.h ({un,}escape_xml_comment): Add new function declarations. * include/abg-writer.h: Add new annotate functions (write_{translation_unit,corpus_to_{archive,native_xml_file}}): Add an optional "annotate" parameter defaulting to "false". * src/abg-libxml-utils.cc ({un,}escape_xml_comment): Add new function definitions. * src/abg-writer.cc (annotate): Define new templatized function and specialize it for necessary cases. * tests/Makefile.am: Add runtestannotate as a new test. * tests/data/Makefile.am: Add paths to below reference test outputs. * tests/data/test-annotate/libtest23.so.abi: New reference test output. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test1.abi: Likewise. * tests/data/test-annotate/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-annotate/test11-pr18828.so.abi: Likewise. * tests/data/test-annotate/test12-pr18844.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test16-pr18904.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test2.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-annotate/test3.so.abi: Likewise. * tests/data/test-annotate/test4.so.abi: Likewise. * tests/data/test-annotate/test5.o.abi: Likewise. * tests/data/test-annotate/test6.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-annotate/test9-pr18818-clang.so.abi: Likewise. * tests/test-annotate.cc: New test for ABIXML annotations. * tools/abidiff.cc: Add the new option '--no-corpus-path'. * tools/abidw.cc: Likewise. Also add the '--annotate' option. reviews round 1 Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-01-17 18:41:51 +00:00
void
unescape_xml_comment(const std::string& str,
std::string& escaped);
std::string
unescape_xml_comment(const std::string& str);
}//end namespace xml
namespace sptr_utils
{
/// Specialization of sptr_utils::build_sptr for xmlTextReader
template<>
xml::reader_sptr
build_sptr<xmlTextReader>(xmlTextReader *p);
/// Specialization of build_str for xmlChar.
template<>
xml::xml_char_sptr
build_sptr<xmlChar>(xmlChar *p);
}// end namespace sptr_utils
}//end namespace abigail
#endif //__ABG_LIBXML_UTILS_H__