~ubuntu-branches/ubuntu/precise/evolution/precise

« back to all changes in this revision

Viewing changes to e-util/e-plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-05-30 14:08:05 UTC
  • mfrom: (1.1.79 upstream)
  • Revision ID: james.westby@ubuntu.com-20110530140805-nhlx5os5z2ru31vy
Tags: 3.0.2-0ubuntu1
New upstream release 3.0.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
732
732
 * @id: The name of the property to retrieve.
733
733
 *
734
734
 * A static helper function to look up a property on an XML node, and
735
 
 * ensure it is allocated in GLib system memory.  If GLib isn't using
736
 
 * the system malloc then it must copy the property value.
 
735
 * ensure it is allocated in GLib system memory.
737
736
 *
738
737
 * Return value: The property, allocated in GLib memory, or NULL if no
739
738
 * such property exists.
741
740
gchar *
742
741
e_plugin_xml_prop (xmlNodePtr node, const gchar *id)
743
742
{
744
 
        gchar *p = (gchar *)xmlGetProp (node, (const guchar *)id);
745
 
 
746
 
        if (g_mem_is_system_malloc ()) {
747
 
                return p;
748
 
        } else {
749
 
                gchar * out = g_strdup (p);
750
 
 
751
 
                if (p)
752
 
                        xmlFree (p);
753
 
                return out;
 
743
        xmlChar *xml_prop;
 
744
        gchar *glib_prop = NULL;
 
745
 
 
746
        xml_prop = xmlGetProp (node, (xmlChar *) id);
 
747
 
 
748
        if (xml_prop != NULL) {
 
749
                glib_prop = g_strdup ((gchar *) xml_prop);
 
750
                xmlFree (xml_prop);
754
751
        }
 
752
 
 
753
        return glib_prop;
755
754
}
756
755
 
757
756
/**