$(NULL)
show-libvlc-sources: FORCE
- @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt) $(SOURCES_libvlc_libc)
+ @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt)
show-libvlc-headers: FORCE
@echo X: $(HEADERS_include) $(HEADERS_include_built)
if BUILD_GETOPT
OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
endif
-if BUILD_LIBC
-OPT_SOURCES_libvlc_libc = $(SOURCES_libvlc_libc)
-endif
if BUILD_MOZILLA
LIBRARIES_libvlc_pic = lib/libvlc_pic.a
endif
$(SOURCES_libvlc_win32) \
$(SOURCES_libvlc_dirent) \
$(SOURCES_libvlc_getopt) \
- $(SOURCES_libvlc_libc) \
$(NULL)
SOURCES_libvlc_beos = \
src/extras/getopt1.c \
$(NULL)
-SOURCES_libvlc_libc = \
- src/extras/libc.c
- $(NULL)
-
SOURCES_libvlc_common = \
src/libvlc.c \
src/libvlc.h \
src/misc/objects.c \
src/misc/variables.c \
src/misc/error.c \
+ src/extras/libc.c \
$(NULL)
SOURCES_libvlc = \
$(OPT_SOURCES_libvlc_win32) \
$(OPT_SOURCES_libvlc_dirent) \
$(OPT_SOURCES_libvlc_getopt) \
- $(OPT_SOURCES_libvlc_libc) \
$(NULL)
###############################################################################
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll getenv putenv setenv)
dnl Check for usual libc functions
-AC_CHECK_FUNCS(strdup,,[need_libc=:])
-AC_CHECK_FUNCS(strndup,,[need_libc=:])
-AC_CHECK_FUNCS(atof,,[need_libc=:])
-AC_CHECK_FUNCS(lseek,,[need_libc=:])
-AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp,,[need_libc=:])])
-AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp,,[need_libc=:])])
-
-AM_CONDITIONAL(BUILD_LIBC, ${need_libc})
+AC_CHECK_FUNCS(strdup strndup atof lseek)
+AC_CHECK_FUNC(strcasecmp,,[AC_CHECK_FUNC(stricmp)])
+AC_CHECK_FUNC(strncasecmp,,[AC_CHECK_FUNC(strnicmp)])
AC_CHECK_FUNC(connect,,[
AC_CHECK_LIB(socket,connect,
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.45 2002/12/18 11:47:35 sam Exp $
+ * $Id: vlc_common.h,v 1.46 2002/12/27 15:31:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
/*****************************************************************************
* I18n stuff
*****************************************************************************/
-#if defined( ENABLE_NLS ) \
- && ( defined(HAVE_GETTEXT) || defined(HAVE_INCLUDED_GETTEXT) )
+VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) );
+
+#if defined( ENABLE_NLS ) && defined( HAVE_INCLUDED_GETTEXT )
+# include "libintl.h"
+# undef _
+# define _(String) vlc_dgettext (PACKAGE, String)
+# define N_(String) ((char*)(String))
+#elif defined( ENABLE_NLS ) && defined( HAVE_GETTEXT )
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
+# define N_(String) ((char*)(String))
#elif !defined( NEED_GNOMESUPPORT_H )
-# define _(String) (String)
-# define N_(String) (String)
+# define _(String) ((char*)(String))
+# define N_(String) ((char*)(String))
#endif
/*****************************************************************************
* libc.c: Extra libc function for some systems.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: libc.c,v 1.4 2002/11/20 08:58:24 sam Exp $
+ * $Id: libc.c,v 1.5 2002/12/27 15:31:56 sam Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Samuel Hocevar <sam@zoy.org>
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/*****************************************************************************
* getenv: just in case, but it should never be called
*****************************************************************************/
-#ifndef HAVE_GETENV
+#if !defined( HAVE_GETENV )
char *vlc_getenv( const char *name )
{
return NULL;
#endif
/*****************************************************************************
- * strdup: returns a malloc'd copy of a string
+ * strdup: returns a malloc'd copy of a string
*****************************************************************************/
-#ifndef HAVE_STRDUP
+#if !defined( HAVE_STRDUP )
char *vlc_strdup( const char *string )
{
return strndup( string, strlen( string ) );
#endif
/*****************************************************************************
- * strndup: returns a malloc'd copy of at most n bytes of string
+ * strndup: returns a malloc'd copy of at most n bytes of string
* Does anyone know whether or not it will be present in Jaguar?
*****************************************************************************/
-#ifndef HAVE_STRNDUP
+#if !defined( HAVE_STRNDUP )
char *vlc_strndup( const char *string, size_t n )
{
char *psz;
size_t len = strlen( string );
- len = __MIN( len, n );
+ len = __MIN( len, n );
psz = (char*)malloc( len + 1 );
if( psz != NULL )
/*****************************************************************************
* atof: convert a string to a double.
*****************************************************************************/
-#ifndef HAVE_ATOF
+#if !defined( HAVE_ATOF )
double vlc_atof( const char *nptr )
-{
+{
double f_result;
wchar_t *psz_tmp;
int i_len = strlen( nptr ) + 1;
-
+
psz_tmp = malloc( i_len * sizeof(wchar_t) );
MultiByteToWideChar( CP_ACP, 0, nptr, -1, psz_tmp, i_len );
f_result = wcstod( psz_tmp, NULL );
}
#endif
+/*****************************************************************************
+ * dgettext: gettext for plugins.
+ *****************************************************************************/
+char *vlc_dgettext( const char *package, const char *msgid )
+{
+#if defined( ENABLE_NLS ) \
+ && ( defined(HAVE_GETTEXT) || defined(HAVE_INCLUDED_GETTEXT) )
+ return dgettext( package, msgid );
+#else
+ return (char *)msgid;
+#endif
+}
+