mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-03 15:06:34 +00:00
Include compatability defines for libxml: use xmlChildrenNode instead of childs.
Original commit message from CVS: Include compatability defines for libxml: use xmlChildrenNode instead of childs.
This commit is contained in:
parent
c9f2ed4f20
commit
55bc3d863c
1 changed files with 11 additions and 4 deletions
|
@ -2,6 +2,13 @@
|
||||||
#include <gnome-xml/parser.h>
|
#include <gnome-xml/parser.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
// Include compatability defines: if libxml hasn't already defined these,
|
||||||
|
// we have an old version 1.x
|
||||||
|
#ifndef xmlChildrenNode
|
||||||
|
#define xmlChildrenNode childs
|
||||||
|
#define xmlRootNode root
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _GstRegistryPlugin GstRegistryPlugin;
|
typedef struct _GstRegistryPlugin GstRegistryPlugin;
|
||||||
typedef struct _GstRegistryElement GstRegistryElement;
|
typedef struct _GstRegistryElement GstRegistryElement;
|
||||||
|
|
||||||
|
@ -17,7 +24,7 @@ struct _GstRegistryElement {
|
||||||
};
|
};
|
||||||
|
|
||||||
gchar *getcontents(xmlDocPtr doc,xmlNodePtr cur) {
|
gchar *getcontents(xmlDocPtr doc,xmlNodePtr cur) {
|
||||||
return g_strdup(xmlNodeListGetString(doc,cur->childs,1));
|
return g_strdup(xmlNodeListGetString(doc,cur->xmlChildrenNode,1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc,char *argv[]) {
|
int main(int argc,char *argv[]) {
|
||||||
|
@ -51,10 +58,10 @@ int main(int argc,char *argv[]) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur = cur->childs; /* 'childs'??? He (Daniel) is Dutch, so... */
|
cur = cur->xmlChildrenNode;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
if (!strcmp(cur->name,"plugin")) {
|
if (!strcmp(cur->name,"plugin")) {
|
||||||
xmlNodePtr field = cur->childs;
|
xmlNodePtr field = cur->xmlChildrenNode;
|
||||||
GstRegistryPlugin *plugin = g_new0(GstRegistryPlugin,1);
|
GstRegistryPlugin *plugin = g_new0(GstRegistryPlugin,1);
|
||||||
|
|
||||||
while (field) {
|
while (field) {
|
||||||
|
@ -67,7 +74,7 @@ int main(int argc,char *argv[]) {
|
||||||
g_print("new plugin '%s' at '%s'\n",plugin->name,plugin->filename);
|
g_print("new plugin '%s' at '%s'\n",plugin->name,plugin->filename);
|
||||||
plugins = g_slist_prepend(plugins,plugin);
|
plugins = g_slist_prepend(plugins,plugin);
|
||||||
} else if (!strcmp(cur->name,"element")) {
|
} else if (!strcmp(cur->name,"element")) {
|
||||||
xmlNodePtr field = cur->childs;
|
xmlNodePtr field = cur->xmlChildrenNode;
|
||||||
GstRegistryElement *element = g_new0(GstRegistryElement,1);
|
GstRegistryElement *element = g_new0(GstRegistryElement,1);
|
||||||
|
|
||||||
while (field) {
|
while (field) {
|
||||||
|
|
Loading…
Reference in a new issue