]> git.sesse.net Git - vlc/blobdiff - src/misc/xml.c
eventfd: set close-on-exec flag
[vlc] / src / misc / xml.c
index ae8a81b79775da92039e71fa071a7acfcb5d8882..0d2625f8b3c6ece215b7ff0c3db0d4be1fbfbeef 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * xml.c: XML parser wrapper for XML modules
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2004 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <stdlib.h>
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
+#include <vlc_common.h>
 #include "vlc_xml.h"
+#include "../libvlc.h"
 
+#undef xml_Create
 /*****************************************************************************
  * xml_Create:
  *****************************************************************************
  * Create an instance of an XML parser.
  * Returns NULL on error.
  *****************************************************************************/
-xml_t *__xml_Create( vlc_object_t *p_this )
+xml_t *xml_Create( vlc_object_t *p_this )
 {
     xml_t *p_xml;
 
-    p_xml = vlc_object_create( p_this, VLC_OBJECT_XML );
+    p_xml = vlc_custom_create( p_this, sizeof( *p_xml ), VLC_OBJECT_GENERIC,
+                               "xml" );
     vlc_object_attach( p_xml, p_this );
 
-    p_xml->p_module = module_Need( p_xml, "xml", 0, 0 );
+    p_xml->p_module = module_need( p_xml, "xml", NULL, false );
     if( !p_xml->p_module )
     {
-        vlc_object_detach( p_xml );
-        vlc_object_destroy( p_xml );
+        vlc_object_release( p_xml );
         msg_Err( p_this, "XML provider not found" );
         return NULL;
     }
@@ -56,7 +60,6 @@ xml_t *__xml_Create( vlc_object_t *p_this )
  *****************************************************************************/
 void xml_Delete( xml_t *p_xml )
 {
-    module_Unneed( p_xml, p_xml->p_module );
-    vlc_object_detach( p_xml );
-    vlc_object_destroy( p_xml );
+    module_unneed( p_xml, p_xml->p_module );
+    vlc_object_release( p_xml );
 }