yet so there's little that can be tested, but threads work at least.
* ./src/extras/libc.c: renamed strndup.c to libc.c because a few other
libc functions were added (strcasecmp, atof, getenv...).
@echo X: $(vlc_SOURCES)
show-libvlc-sources: FORCE
- @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt) $(SOURCES_libvlc_strndup)
+ @echo X: $(SOURCES_libvlc_common) $(SOURCES_libvlc_win32) $(SOURCES_libvlc_dirent) $(SOURCES_libvlc_getopt) $(SOURCES_libvlc_libc)
show-libvlc-headers: FORCE
@echo X: $(HEADERS_include) $(HEADERS_include_built)
if BUILD_GETOPT
OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
endif
-if BUILD_STRNDUP
-OPT_SOURCES_libvlc_strndup = $(SOURCES_libvlc_strndup)
+if BUILD_LIBC
+OPT_SOURCES_libvlc_libc = $(SOURCES_libvlc_libc)
endif
if BUILD_MOZILLA
LIBRARIES_libvlc_pic = lib/libvlc_pic.a
$(SOURCES_libvlc_win32) \
$(SOURCES_libvlc_dirent) \
$(SOURCES_libvlc_getopt) \
- $(SOURCES_libvlc_strndup) \
+ $(SOURCES_libvlc_libc) \
$(NULL)
SOURCES_libvlc_beos = \
src/extras/getopt1.c \
$(NULL)
-SOURCES_libvlc_strndup = \
- src/extras/strndup.c
+SOURCES_libvlc_libc = \
+ src/extras/libc.c
$(NULL)
SOURCES_libvlc_common = \
$(OPT_SOURCES_libvlc_win32) \
$(OPT_SOURCES_libvlc_dirent) \
$(OPT_SOURCES_libvlc_getopt) \
- $(OPT_SOURCES_libvlc_strndup) \
+ $(OPT_SOURCES_libvlc_libc) \
$(NULL)
###############################################################################
CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
dnl Check for system libs needed
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll)
+need_libc=false
-dnl Check for strndup
-need_strndup=false
-AC_CHECK_FUNCS(strndup,,[need_strndup=:])
-AM_CONDITIONAL(BUILD_STRNDUP, ${need_strndup})
+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_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.35 2002/11/08 10:26:52 gbazin Exp $
+ * $Id: vlc_common.h,v 1.36 2002/11/10 23:41:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
#endif
-/* strndup (defined in src/misc/extras.c) */
+/* strdup/strndup (defined in src/extras/libc.c) */
+#ifndef HAVE_STRDUP
+ char * strdup( const char *s );
+#endif
#ifndef HAVE_STRNDUP
-char * strndup( const char *s, size_t n );
+ char * strndup( const char *s, size_t n );
+#endif
+
+/* atof (defined in src/extras/libc.c) */
+#ifndef HAVE_ATOF
+ double atof( const char *nptr );
+#endif
+
+/* getenv - always returns NULL */
+#ifndef HAVE_GETENV
+ char *getenv( const char *name );
+#endif
+
+/* strncasecmp/strcasecmp (defined in src/extras/libc.c) */
+#ifndef HAVE_STRCASECMP
+# ifdef HAVE_STRICMP
+# define strcasecmp stricmp
+# else
+ int strcasecmp( const char *s1, const char *s2 );
+# endif
+#endif
+
+#ifndef HAVE_STRNCASECMP
+# ifdef HAVE_STRNICMP
+# define strncasecmp strnicmp
+# else
+ int strncasecmp( const char *s1, const char *s2, size_t n );
+# endif
#endif
/* Format type specifiers for 64 bits numbers */
# if defined( _MSC_VER ) || !defined( __MINGW32__ )
# define __attribute__(x)
# define __inline__ __inline
-# define strncasecmp strnicmp
-# define strcasecmp stricmp
# define S_IFBLK 0x3000 /* Block */
# define S_ISBLK(m) (0)
# define S_ISCHR(m) (0)
#endif
+/* lseek (defined in src/extras/libc.c) */
+#ifndef HAVE_ATOF
+ off_t lseek( int fildes, off_t offset, int whence );
+#endif
+
/*****************************************************************************
* CPU capabilities
*****************************************************************************/
!ENDIF\r
# End Source File\r
# Begin Source File\r
-SOURCE="..\src\extras\strndup.c"\r
+SOURCE="..\src\extras\libc.c"\r
# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\"plugins\" /D DATA_PATH=\"share\"\r
!IF "$(CFG)" == "vlc - Win32 Release"\r
# PROP Intermediate_Dir "Release\extras"\r
!ENDIF\r
# End Source File\r
# Begin Source File\r
-SOURCE="..\src\misc\iso-639.def"\r
+SOURCE="..\src\misc\iso-639_def.h"\r
# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\"plugins\" /D DATA_PATH=\"share\"\r
!IF "$(CFG)" == "vlc - Win32 Release"\r
# PROP Intermediate_Dir "Release\misc"\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r\r
CPP=clmips.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r\r
CPP=clmips.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Qsh4 /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Qsh4 /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Qsh4 /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /Qsh4 /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /Qsh4 /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Qsh4 /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r\r
CPP=clarm.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r\r
CPP=clarm.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r\r
CPP=cl.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /Yu"stdafx.h" /Gz /Oxs /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /Yu"stdafx.h" /Gz /Oxs /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /Gz /Oxs /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r\r
CPP=cl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Yu"stdafx.h" /Gz /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Yu"stdafx.h" /Gz /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Gz /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
!ENDIF\r
# End Source File\r
# Begin Source File\r
-SOURCE="..\src\extras\strndup.c"\r
+SOURCE="..\src\extras\libc.c"\r
# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\"plugins\" /D DATA_PATH=\"share\"\r
!IF "$(CFG)" == "vlc - Win32 (WCE MIPS) Release"\r
# PROP Intermediate_Dir "Release\extras"\r
!ENDIF\r
# End Source File\r
# Begin Source File\r
-SOURCE="..\src\misc\iso-639.def"\r
+SOURCE="..\src\misc\iso-639_def.h"\r
# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\"plugins\" /D DATA_PATH=\"share\"\r
!IF "$(CFG)" == "vlc - Win32 (WCE MIPS) Release"\r
# PROP Intermediate_Dir "Release\misc"\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r\r
CPP=clmips.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r\r
CPP=clmips.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Qsh4 /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Qsh4 /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Qsh4 /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /Qsh4 /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /Qsh4 /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Qsh4 /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r\r
CPP=shcl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r\r
CPP=clarm.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Yu"stdafx.h" /Oxs /M$(CECrtMT) /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Oxs /M$(CECrtMT) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r\r
CPP=clarm.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /M$(CECrtMTDebug) /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /M$(CECrtMTDebug) /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r\r
CPP=cl.exe\r
# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /Yu"stdafx.h" /Gz /Oxs /c\r
-# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /Yu"stdafx.h" /Gz /Oxs /c\r
+# ADD CPP /nologo /W3 /I "." /I "..\include" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /Gz /Oxs /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r\r
CPP=cl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Yu"stdafx.h" /Gz /c\r
-# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Yu"stdafx.h" /Gz /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Gz /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
* Significantly revised and rewinddir, seekdir and telldir added by Colin
* Peters <colin@fu.is.saga-u.ac.jp>
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
* $Author: sam $
- * $Date: 2002/11/10 18:04:23 $
+ * $Date: 2002/11/10 23:41:53 $
*
*/
#if defined( UNDER_CE )
if (szPath[0] == '\\' || szPath[0] == '/')
{
- snprintf (szFullPath, MAX_PATH, "%s", szPath);
+ sprintf (szFullPath, MAX_PATH, "%s", szPath);
szFullPath[0] = '\\';
}
else
{
- snprintf (szFullPath, MAX_PATH, "\\%s", szPath );
+ /* FIXME: if I wasn't lazy, I'dcheck for overflows here. */
+ sprintf (szFullPath, MAX_PATH, "\\%s", szPath );
}
#else
_fullpath (szFullPath, szPath, MAX_PATH);
--- /dev/null
+/*****************************************************************************
+ * libc.c: Extra libc function for some systems.
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: libc.c,v 1.1 2002/11/10 23:41:53 sam Exp $
+ *
+ * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
+ * Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * 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
+ * GNU General Public License for more details.
+ *
+ * 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.
+ *****************************************************************************/
+#include <string.h> /* strdup() */
+#include <stdlib.h>
+
+#include <vlc/vlc.h>
+
+/*****************************************************************************
+ * getenv: just in case, but it should never be called
+ *****************************************************************************/
+#ifndef HAVE_GETENV
+char *getenv( const char *name )
+{
+ return NULL;
+}
+#endif
+
+/*****************************************************************************
+ * strdup: returns a malloc'd copy of a string
+ *****************************************************************************/
+#ifndef HAVE_STRDUP
+char *strdup( const char *string )
+{
+ return strndup( string, strlen( string ) );
+}
+#endif
+
+/*****************************************************************************
+ * 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_STRDUP
+char *strndup( const char *string, size_t n )
+{
+ char *psz;
+ size_t len = strlen( string );
+
+ len = __MIN( len, n );
+ psz = (char*)malloc( len + 1 );
+
+ if( psz != NULL )
+ {
+ memcpy( (void*)psz, (const void*)string, len );
+ psz[ len ] = 0;
+ }
+
+ return( psz );
+}
+#endif
+
+/*****************************************************************************
+ * strcasecmp: compare two strings ignoring case
+ *****************************************************************************/
+#if !defined( HAVE_STRCASECMP ) && !defined( HAVE_STRICMP )
+int strcasecmp( const char *s1, const char *s2 )
+{
+ int i_delta = 0;
+
+ while( !i_delta && *s1 && *s2 )
+ {
+ i_delta = *s1 - *s2;
+
+ if( *s1 >= 'A' && *s1 <= 'Z' )
+ {
+ i_delta -= 'A' - 'a';
+ }
+
+ if( *s2 >= 'A' && *s2 <= 'Z' )
+ {
+ i_delta += 'A' - 'a';
+ }
+ }
+
+ return i_delta;
+}
+#endif
+
+/*****************************************************************************
+ * strncasecmp: compare n chars from two strings ignoring case
+ *****************************************************************************/
+#if !defined( HAVE_STRNCASECMP ) && !defined( HAVE_STRNICMP )
+int strncasecmp( const char *s1, const char *s2, size_t n )
+{
+ int i_delta = 0;
+
+ while( n-- && !i_delta && *s1 )
+ {
+ i_delta = *s1 - *s2;
+
+ if( *s1 >= 'A' && *s1 <= 'Z' )
+ {
+ i_delta -= 'A' - 'a';
+ }
+
+ if( *s2 >= 'A' && *s2 <= 'Z' )
+ {
+ i_delta += 'A' - 'a';
+ }
+ }
+
+ return i_delta;
+}
+#endif
+
+/*****************************************************************************
+ * atof: convert a string to a double.
+ *****************************************************************************/
+#ifndef HAVE_ATOF
+double 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 );
+ free( psz_tmp );
+
+ return f_result;
+}
+#endif
+
+/*****************************************************************************
+ * lseek: reposition read/write file offset.
+ *****************************************************************************
+ * FIXME: this cast sucks!
+ *****************************************************************************/
+#if !defined( HAVE_LSEEK )
+off_t lseek( int fildes, off_t offset, int whence )
+{
+ return SetFilePointer( (HANDLE)fildes, offset, NULL, whence );
+}
+#endif
+
+++ /dev/null
-/*****************************************************************************
- * strndup.c: Extra strndup function for some systems.
- *****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: strndup.c,v 1.1 2002/11/09 16:34:52 sam Exp $
- *
- * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.
- *****************************************************************************/
-#include <string.h> /* strdup() */
-#include <stdlib.h>
-
-#include <vlc/vlc.h>
-
-/*****************************************************************************
- * 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?
- *****************************************************************************/
-char *strndup( const char *string, size_t n )
-{
- char *psz;
- size_t len = strlen( string );
-
- len = __MIN( len, n );
- psz = (char*)malloc( len + 1 );
-
- if( psz != NULL )
- {
- memcpy( (void*)psz, (const void*)string, len );
- psz[ len ] = 0;
- }
-
- return( psz );
-}
-
* input_ext-plugins.c: useful functions for access and demux plug-ins
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_ext-plugins.c,v 1.20 2002/11/10 18:04:23 sam Exp $
+ * $Id: input_ext-plugins.c,v 1.21 2002/11/10 23:41:53 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
msg_Info( p_input, "closing `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
+#ifdef UNDER_CE
+ CloseHandle( (HANDLE)p_access_data->i_handle );
+#else
close( p_access_data->i_handle );
+#endif
+
free( p_access_data );
}
msg_Info( p_input, "closing network `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
-#if defined( WIN32 ) && !defined( UNDER_CE )
+#ifdef UNDER_CE
+ CloseHandle( (HANDLE)p_access_data->i_handle );
+#elif defined( WIN32 )
closesocket( p_access_data->i_handle );
#else
close( p_access_data->i_handle );
ssize_t input_FDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
{
input_socket_t * p_access_data = (input_socket_t *)p_input->p_access_data;
+ ssize_t i_ret;
- ssize_t i_ret = read( p_access_data->i_handle, p_buffer, i_len );
+#ifdef UNDER_CE
+ if( !ReadFile( (HANDLE)p_access_data->i_handle, p_buffer, i_len,
+ (LPWORD)&i_ret, NULL ) )
+ {
+ i_ret = -1;
+ }
+#else
+ i_ret = read( p_access_data->i_handle, p_buffer, i_len );
+#endif
if( i_ret < 0 )
{
-#ifdef HAVE_ERRNO_H
+# ifdef HAVE_ERRNO_H
msg_Err( p_input, "read failed (%s)", strerror(errno) );
-#else
+# else
msg_Err( p_input, "read failed" );
-#endif
+# endif
}
return i_ret;
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.45 2002/11/10 18:04:23 sam Exp $
+ * $Id: libvlc.c,v 1.46 2002/11/10 23:41:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#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
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.43 2002/11/10 18:04:23 sam Exp $
+ * $Id: configuration.c,v 1.44 2002/11/10 23:41:53 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/* The config file is organized in sections, one per module. Look for
* the interesting section ( a section is of the form [foo] ) */
- rewind( file );
+ fseek( file, 0L, SEEK_SET );
while( fgets( line, 1024, file ) )
{
if( (line[0] == '[')
}
sprintf( psz_filename, "%s/" CONFIG_DIR, psz_homedir );
-#ifdef HAVE_ERRNO_H
+#if defined( UNDER_CE )
+ {
+ wchar_t psz_new[ MAX_PATH ];
+ MultiByteToWideChar( CP_ACP, 0, psz_filename, -1, psz_new, MAX_PATH );
+ if( CreateDirectory( psz_new, NULL ) )
+ {
+ msg_Err( p_this, "could not create %s", psz_filename );
+ }
+ }
+
+#elif defined( HAVE_ERRNO_H )
# if defined( WIN32 )
if( mkdir( psz_filename ) && errno != EEXIST )
# else
else
{
/* look for file size */
- fseek( file, 0, SEEK_END );
+ fseek( file, 0L, SEEK_END );
i_sizebuf = ftell( file );
- rewind( file );
+ fseek( file, 0L, SEEK_SET );
}
p_bigbuffer = p_index = malloc( i_sizebuf+1 );
* threads.c : threads implementation for the VideoLAN client
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: threads.c,v 1.24 2002/11/10 18:04:24 sam Exp $
+ * $Id: threads.c,v 1.25 2002/11/10 23:41:53 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* hope nothing wrong happens. */
#if defined( PTH_INIT_IN_PTH_H )
#elif defined( ST_INIT_IN_ST_H )
+#elif defined( UNDER_CE )
#elif defined( WIN32 )
HINSTANCE hInstLib;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
unsigned threadID;
/* When using the MSVCRT C library you have to use the _beginthreadex
* function instead of CreateThread, otherwise you'll end up with
- * memory leaks and the signal functions not working */
+ * memory leaks and the signal functions not working (see Microsoft
+ * Knowledge Base, article 104641) */
p_this->thread_id =
+#if defined( UNDER_CE )
+ (HANDLE)CreateThread( NULL, 0, (PTHREAD_START) func,
+ (void *)p_this, 0, &threadID );
+#else
(HANDLE)_beginthreadex( NULL, 0, (PTHREAD_START) func,
(void *)p_this, 0, &threadID );
+#endif
}
if ( p_this->thread_id && i_priority )
}
else
{
+#ifdef HAVE_STRERROR
msg_Err( p_this, "%s thread could not be created at %s:%d (%s)",
psz_name, psz_file, i_line, strerror(i_ret) );
+#else
+ msg_Err( p_this, "%s thread could not be created at %s:%d",
+ psz_name, psz_file, i_line );
+#endif
vlc_mutex_unlock( &p_this->object_lock );
}
if( i_ret )
{
+#ifdef HAVE_STRERROR
msg_Err( p_this, "thread_join(%d) failed at %s:%d (%s)",
p_this->thread_id, psz_file, i_line, strerror(i_ret) );
+#else
+ msg_Err( p_this, "thread_join(%d) failed at %s:%d",
+ p_this->thread_id, psz_file, i_line );
+#endif
}
else
{
* video_text.c : text manipulation functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: video_text.c,v 1.38 2002/11/10 18:04:24 sam Exp $
+ * $Id: video_text.c,v 1.39 2002/11/10 23:41:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
}
/* Read magic number */
+#ifndef UNDER_CE /* FIXME */
if( read( i_file, pi_buffer, 2 ) != 2 )
{
msg_Err( p_vout, "unexpected end of file in '%s'", psz_name );
close( i_file );
return( NULL );
}
+#endif
/* Allocate font descriptor */
p_font = malloc( sizeof( vout_font_t ) );
if( p_font == NULL )
{
msg_Err( p_vout, "out of memory" );
+#ifndef UNDER_CE /* FIXME */
close( i_file );
+#endif
return( NULL );
}
*/
/* Read font header - two bytes indicate the font properties */
+#ifndef UNDER_CE /* FIXME */
if( read( i_file, pi_buffer, 2 ) != 2)
{
msg_Err( p_vout, "unexpected end of file in '%s'", psz_name );
close( i_file );
return( NULL );
}
+#endif
/* Copy font properties */
p_font->i_type = VOUT_FIXED_FONT;
{
msg_Err( p_vout, "out of memory" );
free( p_font );
+#ifndef UNDER_CE /* FIXME */
close( i_file );
+#endif
return( NULL );
}
/* Copy raw data */
+#ifndef UNDER_CE /* FIXME */
if( read( i_file, p_font->p_data, 256 * pi_buffer[1] ) != 256 * pi_buffer[1] )
{
msg_Err( p_vout, "unexpected end of file in '%s'", psz_name );
close( i_file );
return( NULL );
}
+#endif
/* Compute border masks - remember that masks have the same matrix as
* characters, so an empty character border is required to have a
default:
msg_Err( p_vout, "file '%s' has an unknown format", psz_name );
free( p_font );
+#ifndef UNDER_CE /* FIXME */
close( i_file );
+#endif
return( NULL );
break;
}
* vlc.c: the vlc player
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vlc.c,v 1.16 2002/11/10 18:04:23 sam Exp $
+ * $Id: vlc.c,v 1.17 2002/11/10 23:41:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
# include <time.h> /* time() */
#endif
+#ifdef UNDER_CE
+ /* WinCE needs a WINAPI declaration */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
#include <vlc/vlc.h>
/*****************************************************************************
/*****************************************************************************
* main: parse command line, start interface and spawn threads
*****************************************************************************/
+#ifdef UNDER_CE
+int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
+ LPTSTR lpCmdLine, int nCmdShow )
+#else
int main( int i_argc, char *ppsz_argv[] )
+#endif
{
int i_ret;
+#ifdef UNDER_CE
+ int i_argc = 1;
+ char *ppsz_argv[] = { lpCmdLine, NULL };
+#endif
fprintf( stderr, "VideoLAN Client %s\n", VLC_Version() );