]> git.0d.be Git - empathy.git/commitdiff
utils: Drop the file-based empathy_xml_validate()
authorEmanuele Aina <emanuele.aina@collabora.com>
Tue, 26 Mar 2013 14:13:53 +0000 (15:13 +0100)
committerEmanuele Aina <emanuele.aina@collabora.com>
Mon, 1 Apr 2013 09:50:29 +0000 (11:50 +0200)
After embedding all the DTDs with GResource the file-based
empathy_xml_validate() is no longer needed, replaced by
empathy_xml_validate_from_resource().

https://bugzilla.gnome.org/show_bug.cgi?id=696974

libempathy/empathy-utils.c
libempathy/empathy-utils.h

index e074327b636e94aea968a59e93108c625c68d2c6..235b0224659ea83cc83abab5340a071c4bf828db 100644 (file)
@@ -143,41 +143,6 @@ empathy_xml_validate_from_resource (xmlDoc *doc,
   return ret;
 }
 
-gboolean
-empathy_xml_validate (xmlDoc      *doc,
-    const gchar *dtd_filename)
-{
-  gchar *path;
-  xmlChar *escaped;
-  xmlValidCtxt  cvp;
-  xmlDtd *dtd;
-  gboolean ret;
-
-  path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "libempathy",
-         dtd_filename, NULL);
-  if (!g_file_test (path, G_FILE_TEST_EXISTS))
-    {
-      g_free (path);
-      path = g_build_filename (DATADIR, "empathy", dtd_filename, NULL);
-    }
-
-  DEBUG ("Loading dtd file %s", path);
-
-  /* The list of valid chars is taken from libxml. */
-  escaped = xmlURIEscapeStr ((const xmlChar *) path,
-    (const xmlChar *)":@&=+$,/?;");
-  g_free (path);
-
-  memset (&cvp, 0, sizeof (cvp));
-  dtd = xmlParseDTD (NULL, escaped);
-  ret = xmlValidateDtd (&cvp, doc, dtd);
-
-  xmlFree (escaped);
-  xmlFreeDtd (dtd);
-
-  return ret;
-}
-
 xmlNodePtr
 empathy_xml_node_get_child (xmlNodePtr   node,
     const gchar *child_name)
index 7077d835e79bd49e037456bbaed92d75e7882c88..935b501a49aae974ec17ef0487d1d340b9624478 100644 (file)
@@ -46,8 +46,6 @@ void empathy_init (void);
 /* XML */
 gboolean empathy_xml_validate_from_resource (xmlDoc *doc,
     const gchar *dtd_resourcename);
-gboolean empathy_xml_validate (xmlDoc *doc,
-    const gchar *dtd_filename);
 xmlNodePtr empathy_xml_node_get_child (xmlNodePtr node,
     const gchar *child_name);
 xmlChar * empathy_xml_node_get_child_content (xmlNodePtr node,