[vlc-commits] Move intf_EJect() out of core

Rémi Denis-Courmont git at videolan.org
Fri Nov 25 16:22:01 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 25 16:41:22 2011 +0200| [2a70bf3485b7c8ae409b5fbc73655713a1ef440b] | committer: Rémi Denis-Courmont

Move intf_EJect() out of core

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a70bf3485b7c8ae409b5fbc73655713a1ef440b
---

 include/vlc_interface.h                           |    3 ---
 modules/gui/Modules.am                            |    1 +
 src/interface/intf_eject.c => modules/gui/eject.c |   19 +++++++++----------
 modules/gui/ncurses.c                             |    2 ++
 modules/gui/qt4/components/open_panels.cpp        |    2 ++
 po/POTFILES.in                                    |    1 -
 src/Makefile.am                                   |    1 -
 src/libvlccore.sym                                |    1 -
 8 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index 2e02f6b..da3c5bd 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -102,9 +102,6 @@ struct intf_dialog_args_t
 VLC_API int intf_Create( vlc_object_t *, const char * );
 #define intf_Create(a,b) intf_Create(VLC_OBJECT(a),b)
 
-VLC_API int intf_Eject( vlc_object_t *, const char * );
-#define intf_Eject(a,b) intf_Eject(VLC_OBJECT(a),b)
-
 VLC_API void libvlc_Quit( libvlc_int_t * );
 
 /*@}*/
diff --git a/modules/gui/Modules.am b/modules/gui/Modules.am
index 5711e1a..94b6805 100644
--- a/modules/gui/Modules.am
+++ b/modules/gui/Modules.am
@@ -16,3 +16,4 @@ endif
 
 SOURCES_ncurses = ncurses.c
 SOURCES_fbosd = fbosd.c
+EXTRA_DIST += eject.c
diff --git a/src/interface/intf_eject.c b/modules/gui/eject.c
similarity index 93%
rename from src/interface/intf_eject.c
rename to modules/gui/eject.c
index 3afd0e8..8e9ffb9 100644
--- a/src/interface/intf_eject.c
+++ b/modules/gui/eject.c
@@ -1,8 +1,7 @@
 /*****************************************************************************
- * intf_eject.c: CD/DVD-ROM ejection handling functions
+ * eject.c: CD/DVD-ROM ejection handling functions
  *****************************************************************************
- * Copyright (C) 2001-2004 the VideoLAN team
- * $Id$
+ * Copyright (C) 2001-2011 the VideoLAN team
  *
  * Authors: Julien Blache <jb at technologeek.org> for the Linux part
  *                with code taken from the Linux "eject" command
@@ -29,13 +28,12 @@
  *  This file contain functions to eject CD and DVD drives
  */
 
-#ifdef HAVE_CONFIG_H
+/*#ifdef HAVE_CONFIG_H
 # include "config.h"
-#endif
+#endif*/
 
 #include <vlc_common.h>
 #include <vlc_fs.h>
-#include <vlc_interface.h>
 
 #if defined( WIN32 ) && !defined( UNDER_CE )
 #   include <mmsystem.h>
@@ -115,13 +113,12 @@ static int EjectSCSI( int i_fd )
 
 #undef intf_Eject
 /**
- * \brief Ejects the CD /DVD
- * \ingroup vlc_interface
+ * Ejects the optical disc in a device
  * \param p_this the calling vlc_object_t
  * \param psz_device the CD/DVD to eject
- * \return 0 on success, 1 on failure, -1 if not implemented
+ * \return VLC_SUCCESS or VLC_EGENERIC
  */
-int intf_Eject( vlc_object_t *p_this, const char *psz_device )
+static int intf_Eject( vlc_object_t *p_this, const char *psz_device )
 {
     VLC_UNUSED(p_this);
 
@@ -179,3 +176,5 @@ int intf_Eject( vlc_object_t *p_this, const char *psz_device )
     return VLC_EGENERIC;
 #endif
 }
+
+#define intf_Eject(o, p) intf_Eject(VLC_OBJECT(o), p)
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 7a844aa..f2802fe 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -85,6 +85,8 @@ vlc_module_begin ()
     add_directory("browse-dir", NULL, BROWSE_TEXT, BROWSE_LONGTEXT, false)
 vlc_module_end ()
 
+#include "eject.c"
+
 /*****************************************************************************
  * intf_sys_t: description and status of ncurses interface
  *****************************************************************************/
diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 5866a05..8ac5b75 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -57,6 +57,8 @@
     I_DIR_OR_FOLDER( N_("Select a device or a VIDEO_TS directory"), \
                      N_("Select a device or a VIDEO_TS folder") )
 
+#include "../../eject.c"
+
 /* Populate a combobox with the devices matching a pattern.
    Combobox will automatically do autocompletion on the edit zone */
 #define POPULATE_WITH_DEVS(ppsz_devlist, targetCombo) \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c82ac26..8e86982 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -105,7 +105,6 @@ src/input/vlm.c
 src/input/vlm_internal.h
 src/input/vlmshell.c
 src/interface/interface.c
-src/interface/intf_eject.c
 src/libvlc.c
 src/libvlc.h
 src/libvlc-module.c
diff --git a/src/Makefile.am b/src/Makefile.am
index e93961d..84ed676 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -304,7 +304,6 @@ SOURCES_libvlc_common = \
 	version.c \
 	interface/dialog.c \
 	interface/interface.c \
-	interface/intf_eject.c \
 	playlist/playlist_internal.h \
 	playlist/art.c \
 	playlist/art.h \
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 2bcdfba..7538bf2 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -230,7 +230,6 @@ input_Stop
 input_vaControl
 input_Close
 intf_Create
-intf_Eject
 IsUTF8
 libvlc_InternalAddIntf
 libvlc_InternalCleanup



More information about the vlc-commits mailing list