* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.43 2002/11/06 09:26:25 sam Exp $
+ * $Id: libvlc.c,v 1.49 2002/12/03 16:29:04 gitan Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h> /* ENOMEM */
+#include <vlc/vlc.h>
+
+#ifdef HAVE_ERRNO_H
+# include <errno.h> /* ENOMEM */
+#endif
#include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */
#include <stdlib.h> /* free() */
-#include <vlc/vlc.h>
-
#ifndef WIN32
# include <netinet/in.h> /* BSD: struct in_addr */
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
-#elif defined( _MSC_VER ) && defined( _WIN32 )
+#elif defined( _MSC_VER ) && defined( _WIN32 ) && !defined( UNDER_CE )
# include <io.h>
#endif
#ifdef WIN32 /* optind, getopt(), included in unistd.h */
-# include "extras/GNUgetopt/getopt.h"
+# include "extras/getopt.h"
#endif
#ifdef HAVE_LOCALE_H
/* Check for short help option */
if( config_GetInt( p_vlc, "help" ) )
{
- fprintf( stderr, _("Usage: %s [options] [items]...\n\n"),
+ fprintf( stdout, _("Usage: %s [options] [items]...\n\n"),
p_vlc->psz_object_name );
Usage( p_vlc, "main" );
Usage( p_vlc, "help" );
{
return VLC_ENOOBJ;
}
+
+ /* add pseudo sap interface; non blocking */
+ if( config_GetInt( p_vlc, "sap" ) )
+ {
+ msg_Dbg( p_vlc, "adding sap interface" );
+ VLC_AddIntf( 0, "sap", VLC_FALSE );
+ }
+
p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
if( !p_playlist )
{
vlc_object_detach( p_vout );
vlc_object_release( p_vout );
- vout_DestroyThread( p_vout );
+ vout_Destroy( p_vout );
}
/*
{
case CONFIG_HINT_CATEGORY:
case CONFIG_HINT_USAGE:
- fprintf( stderr, " %s\n", p_item->psz_text );
+ fprintf( stdout, " %s\n", p_item->psz_text );
break;
case CONFIG_ITEM_STRING:
if( p_item->i_type == CONFIG_ITEM_BOOL &&
!b_help_module )
{
- fprintf( stderr, psz_format, p_item->psz_name, psz_prefix,
+ fprintf( stdout, psz_format, p_item->psz_name, psz_prefix,
p_item->psz_name, psz_bra, psz_type, psz_ket,
psz_spaces, p_item->psz_text, psz_suf );
}
else
{
- fprintf( stderr, psz_format, p_item->psz_name, "", "",
+ fprintf( stdout, psz_format, p_item->psz_name, "", "",
psz_bra, psz_type, psz_ket, psz_spaces,
p_item->psz_text, psz_suf );
}
vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stderr, _("\nPress the RETURN key to continue...\n") );
+ fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
getchar();
#endif
}
#endif
/* Usage */
- fprintf( stderr, _("Usage: %s [options] [items]...\n\n"),
+ fprintf( stdout, _("Usage: %s [options] [items]...\n\n"),
p_this->p_vlc->psz_object_name );
- fprintf( stderr, _("[module] [description]\n") );
+ fprintf( stdout, _("[module] [description]\n") );
/* List all modules */
p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
if( i < 0 ) i = 0;
psz_spaces[i] = 0;
- fprintf( stderr, " %s%s %s\n", (*pp_parser)->psz_object_name,
+ fprintf( stdout, " %s%s %s\n", (*pp_parser)->psz_object_name,
psz_spaces, (*pp_parser)->psz_longname );
psz_spaces[i] = ' ';
vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stderr, _("\nPress the RETURN key to continue...\n") );
+ fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
getchar();
#endif
}
ShowConsole();
#endif
- fprintf( stderr, VERSION_MESSAGE "\n" );
- fprintf( stderr,
+ fprintf( stdout, VERSION_MESSAGE "\n" );
+ fprintf( stdout,
_("This program comes with NO WARRANTY, to the extent permitted by "
"law.\nYou may redistribute it under the terms of the GNU General "
"Public License;\nsee the file named COPYING for details.\n"
"Written by the VideoLAN team at Ecole Centrale, Paris.\n") );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stderr, _("\nPress the RETURN key to continue...\n") );
+ fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
getchar();
#endif
}
#ifdef WIN32 /* */
static void ShowConsole( void )
{
+# ifndef UNDER_CE
AllocConsole();
freopen( "CONOUT$", "w", stdout );
freopen( "CONOUT$", "w", stderr );
freopen( "CONIN$", "r", stdin );
+# endif
return;
}
#endif