aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-xml-utils.c92
-rw-r--r--e-util/e-xml-utils.h5
3 files changed, 8 insertions, 94 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index c8250bfab4..158ce2e383 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -28,6 +28,11 @@
the uses of fsync() in evo are pretty irrelevant. Just #define
fsync() away on Win32.
+ * e-xml-utils.c (e_xml_get_child_by_name, e_xml_save_file): Remove
+ these functions that are now in libedataserver/e-xml-utils.c
+
+ * e-xml-utils.h: Include libedataserver/e-xml-utils.h.
+
2005-12-12 Irene Huang <Irene.Huang@sun.com>
reviewed by: Veerapuram Varadhan <vvaradhan@novell.com>
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
index 5ac741a278..f761225d8b 100644
--- a/e-util/e-xml-utils.c
+++ b/e-util/e-xml-utils.c
@@ -44,22 +44,6 @@
#include "e-util.h"
#include "e-xml-utils.h"
-xmlNode *
-e_xml_get_child_by_name (const xmlNode *parent, const xmlChar *child_name)
-{
- xmlNode *child;
-
- g_return_val_if_fail (parent != NULL, NULL);
- g_return_val_if_fail (child_name != NULL, NULL);
-
- for (child = parent->xmlChildrenNode; child != NULL; child = child->next) {
- if (xmlStrcmp (child->name, child_name) == 0) {
- return child;
- }
- }
- return NULL;
-}
-
/* Returns the first child with the name child_name and the "lang"
* attribute that matches the current LC_MESSAGES, or else, the first
* child with the name child_name and no "lang" attribute.
@@ -448,79 +432,3 @@ e_xml_get_translated_string_prop_by_name (const xmlNode *parent, const xmlChar *
return ret_val;
}
-
-int
-e_xml_save_file (const char *filename, xmlDocPtr doc)
-{
- char *filesave, *xmlbuf;
- size_t n, written = 0;
- int ret, fd, size;
- int errnosave;
- ssize_t w;
-
- {
- gchar *dirname = g_path_get_dirname (filename);
- gchar *basename = g_path_get_basename (filename);
- gchar *savebasename = g_strconcat (".#", basename, NULL);
-
- g_free (basename);
- filesave = g_build_filename (dirname, savebasename, NULL);
- g_free (savebasename);
- g_free (dirname);
- }
-
- fd = g_open (filesave, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd == -1) {
- g_free (filesave);
- return -1;
- }
-
- xmlDocDumpFormatMemory (doc, (xmlChar **) &xmlbuf, &size, TRUE);
- if (size <= 0) {
- close (fd);
- g_unlink (filesave);
- g_free (filesave);
- errno = ENOMEM;
- return -1;
- }
-
- n = (size_t) size;
- do {
- do {
- w = write (fd, xmlbuf + written, n - written);
- } while (w == -1 && errno == EINTR);
-
- if (w > 0)
- written += w;
- } while (w != -1 && written < n);
-
- xmlFree (xmlbuf);
-
- if (written < n || fsync (fd) == -1) {
- errnosave = errno;
- close (fd);
- g_unlink (filesave);
- g_free (filesave);
- errno = errnosave;
- return -1;
- }
-
- while ((ret = close (fd)) == -1 && errno == EINTR)
- ;
-
- if (ret == -1) {
- g_free (filesave);
- return -1;
- }
-
- if (g_rename (filesave, filename) == -1) {
- errnosave = errno;
- g_unlink (filesave);
- g_free (filesave);
- errno = errnosave;
- return -1;
- }
- g_free (filesave);
-
- return 0;
-}
diff --git a/e-util/e-xml-utils.h b/e-util/e-xml-utils.h
index 6c39ee6f79..501a643fea 100644
--- a/e-util/e-xml-utils.h
+++ b/e-util/e-xml-utils.h
@@ -25,12 +25,13 @@
#define __E_XML_UTILS__
#include <glib.h>
+
#include <libxml/tree.h>
+#include <libedataserver/e-xml-utils.h>
+
G_BEGIN_DECLS
-xmlNode *e_xml_get_child_by_name (const xmlNode *parent,
- const xmlChar *child_name);
/* lang set to NULL means use the current locale. */
xmlNode *e_xml_get_child_by_name_by_lang (const xmlNode *parent,
const xmlChar *child_name,
td>-4/+14 * BROKEN on 5.x: Does not compilekris2004-09-291-1/+7 * BROKEN on 5.x: Does not compilekris2004-09-261-0/+4 * Fix build on 5.x.linimon2004-08-232-4/+200 * Fix build.krion2004-08-221-1/+1 * Fix more hardcoding of imake-4 port directory to use X_IMAKE_PORT.anholt2004-08-191-1/+1 * New port udpcast version 20040531: A file transfer tool usinglioux2004-07-218-0/+192 * Fix build on -CURRENTkris2004-06-091-0/+11 * Sync with new bsd.autotools.mkade2004-06-051-2/+2 * - Fix MASTER_SITESkrion2004-05-172-2/+4 * Tidy up whitespace.trevor2004-04-111-1/+1 * Remove category pkg/COMMENT files in favour of a COMMENT variable in thekris2004-04-022-1/+2 * SIZEify (maintainer timeout)trevor2004-03-3112-0/+12 * Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-143-3/+3 * Update MASTER_SITES.petef2004-03-111-1/+1 * BROKEN on !i386: Does not compilekris2004-02-251-0/+4 * Correct error in previous commitkris2004-02-181-1/+1 * Remove BROKEN tag; this now compiles on 5.x.kris2004-02-181-6/+0 * Remove BROKEN tag; this port now compiles on 5.x.kris2004-02-181-4/+0 * [seems like when I thought I committed this first, I only committedfenner2004-02-082-6/+5 * Use PLIST_FILES (bento-tested, marcus-reviewed).trevor2004-02-0612-6/+6 * Use PLIST_FILES.trevor2004-02-062-1/+1 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-045-1/+5 * Update tcl/tk dependency to 8.4.fenner2004-02-023-3/+14 * Upgrade rat to version 4.2.25.fenner2004-02-025-33/+12 * Update to sdr 3.0.fenner2004-02-023-14/+3 * SIZEify.trevor2004-01-303-0/+3 * Use the new ghostscript options.marcus2004-01-211-9/+3 * Add a dummy run-autotools target to pacify the new bsd.port.mk.marcus2004-01-201-0/+3 * Reset maintainer to ports@ due to maintainer's request -- he hasn'tlinimon2004-01-131-1/+1 * - Update to 2.99.1pav2004-01-0912-37/+189 * Add xspeakfree, a Tcl/Tk frontent to Speak Freely.pav2003-12-135-0/+56 * Mark as broken on 5.x due to the usual gcc3.3 bitrot.linimon2003-12-121-2/+8 * - Unbreak by adding dependency on makedepend.pav2003-11-211-0/+2 * Define USE_PERL5_BUILD, not erroneous USE_PERL.trevor2003-11-201-1/+1 * Define USE_PERL to make Perl available for (mostly deprecated)trevor2003-11-201-0/+1 * Add mcl 2.99,bms2003-11-1532-0/+560 * ports with possibly unreachable MAINTAINERsedwin2003-11-021-1/+1 * Move inclusion of bsd.port.pre.mk after definiton of all variables.linimon2003-10-295-24/+28 * Remove blank line to pacify portlint.linimon2003-10-221-1/+0 * Mark as broken on 5.x. Fix plist. Notified maintainer.linimon2003-10-222-2/+7 * Mark as broken on 5.x. The last distfile is from 1997. A google searchlinimon2003-10-221-2/+8 * Mark as broken on 5.x. The distfile is from 1997. While here, updatelinimon2003-10-222-1/+9 * Mark broken on 5.x. The distfile is from 1996 so updates might notlinimon2003-10-222-1/+9 * Make portlint(1) happy by changing strip to ${STRIP_CMD}osa2003-09-243-4/+4 * [PATCH] mbone/wb: enable choose of ghostscript interpreteredwin2003-08-311-1/+15 * Update to 7.6a.naddy2003-06-264