]> git.sesse.net Git - vlc/blobdiff - plugins/dummy/intf_dummy.c
* ALL: new module API. Makes a few things a lot simpler, and we gain
[vlc] / plugins / dummy / intf_dummy.c
index 54fa2c586dc2c72e2b059bb2c40174d6f19d23ad..0c6bc8effa0e2ca76fe04be87d2ce3bd5cd9a8d8 100644 (file)
@@ -2,7 +2,7 @@
  * intf_dummy.c: dummy interface plugin
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: intf_dummy.c,v 1.21 2002/07/20 18:01:42 sam Exp $
+ * $Id: intf_dummy.c,v 1.22 2002/07/31 20:56:51 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
 
-/*****************************************************************************
- * intf_sys_t: description and status of FB interface
- *****************************************************************************/
-struct intf_sys_t
-{
-    /* Prevent malloc(0) */
-    int i_dummy;
-};
-
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static int  intf_Open      ( intf_thread_t *p_intf );
-static void intf_Close     ( intf_thread_t *p_intf );
-static void intf_Run       ( intf_thread_t *p_intf );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list )
-{
-    p_function_list->functions.intf.pf_open  = intf_Open;
-    p_function_list->functions.intf.pf_close = intf_Close;
-    p_function_list->functions.intf.pf_run   = intf_Run;
-}
+static void Run   ( intf_thread_t * );
 
 /*****************************************************************************
- * intf_Open: initialize dummy interface
+ * Open: initialize dummy interface
  *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
+int  E_(OpenIntf) ( vlc_object_t *p_this )
 {
-    /* Allocate instance and initialize some members */
-    p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
-    if( p_intf->p_sys == NULL )
-    {
-        return( 1 );
-    };
-
+    intf_thread_t *p_intf = (intf_thread_t*) p_this;
 #ifdef WIN32
     AllocConsole();
     freopen( "CONOUT$", "w", stdout );
@@ -78,23 +50,15 @@ static int intf_Open( intf_thread_t *p_intf )
     msg_Info( p_intf, _("\nUsing the dummy interface plugin...") );
 #endif
 
-    return( 0 );
-}
+    p_intf->pf_run = Run;
 
-/*****************************************************************************
- * intf_Close: destroy dummy interface
- *****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
-    /* Destroy structure */
-    free( p_intf->p_sys );
+    return VLC_SUCCESS;
 }
 
-
 /*****************************************************************************
- * intf_Run: main loop
+ * Run: main loop
  *****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
 {
     while( !p_intf->b_die )
     {