From caa2eff30c93d73ab9baa1e5c3107c5ab7bf547b Mon Sep 17 00:00:00 2001
From: "Eliel C. Sardanons" <eliels@gmail.com>
Date: Sun, 2 May 2010 02:52:23 +0000
Subject: [PATCH] Avoid making AstData depend on libxml2 to compile.

We have some functions inside the AstData API to get the tree
in XML form, but it is not required at the moment to compile
asterisk and we can disable that part of the API if we don't have
libxml2 support.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 include/asterisk/data.h | 2 ++
 main/data.c             | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/asterisk/data.h b/include/asterisk/data.h
index cc92a0c102..54259e48c4 100644
--- a/include/asterisk/data.h
+++ b/include/asterisk/data.h
@@ -500,6 +500,7 @@ int ast_data_search_has_condition(const struct ast_data_search *search,
  */
 struct ast_data *ast_data_get(const struct ast_data_query *query);
 
+#ifdef HAVE_LIBXML2
 /*!
  * \brief Retrieve a subtree from the asterisk data API in XML format..
  * \param[in] query The query structure specifying what nodes to retrieve.
@@ -509,6 +510,7 @@ struct ast_data *ast_data_get(const struct ast_data_query *query);
  * \see ast_data_free, ast_data_get
  */
 struct ast_xml_doc *ast_data_get_xml(const struct ast_data_query *query);
+#endif
 
 /*!
  * \brief Release the allocated memory of a tree.
diff --git a/main/data.c b/main/data.c
index 1b12d451f5..c402c4fa68 100644
--- a/main/data.c
+++ b/main/data.c
@@ -1845,6 +1845,7 @@ struct ast_data *ast_data_get(const struct ast_data_query *query)
 	return res;
 }
 
+#ifdef HAVE_LIBXML2
 /*!
  * \internal
  * \brief Helper function to move an ast_data tree to xml.
@@ -1944,6 +1945,7 @@ struct ast_xml_doc *ast_data_get_xml(const struct ast_data_query *query)
 
 	return doc;
 }
+#endif
 
 enum ast_data_type ast_data_retrieve_type(struct ast_data *node, const char *path)
 {
-- 
GitLab