diff --git a/src/Makefile.am b/src/Makefile.am index f495f53..82c574e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,6 +8,6 @@ ezstream_LDADD = @LIBOBJS@ @XIPH_LIBS@ AM_CFLAGS = @XIPH_CFLAGS@ AM_CPPFLAGS = @XIPH_CPPFLAGS@ -EXTRA_DIST = configfile.h getopt.h playlist.h strfctns.h util.h +EXTRA_DIST = compat.h configfile.h getopt.h playlist.h strfctns.h util.h CLEANFILES = core *.core *~ .*~ diff --git a/src/compat.h b/src/compat.h new file mode 100644 index 0000000..f93c83e --- /dev/null +++ b/src/compat.h @@ -0,0 +1,41 @@ +#ifndef __COMPAT_H__ +#define __COMPAT_H__ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifndef PATH_SEPARATOR +# ifdef WIN32 +# define PATH_SEPARATOR '\\' +# else +# define PATH_SEPARATOR '/' +# endif /* WIN32 */ +#endif /* !PATH_SEPARATOR */ + +#ifdef WIN32 + +# define _PATH_DEVNULL "nul" + +# define strncasecmp strnicmp +# define popen _popen +# define pclose _pclose +# define snprintf _snprintf +# define stat _stat + +# define S_IXGRP 0 +# define S_IXOTH 0 +# define S_IWGRP 0 +# define S_IWOTH 0 +# define S_IRGRP 0 +# define S_IROTH 0 + +#else + +# ifndef S_IEXEC +# define S_IEXEC S_IXUSR +# endif + +#endif /* WIN32 */ + +#endif /* __COMPAT_H__ */ diff --git a/src/ezstream.c b/src/ezstream.c index 1f4cc83..e174ee9 100644 --- a/src/ezstream.c +++ b/src/ezstream.c @@ -54,10 +54,11 @@ #include #include +#include "compat.h" +#include "configfile.h" #ifndef HAVE_GETOPT # include "getopt.h" #endif -#include "configfile.h" #include "playlist.h" #include "strfctns.h" #include "util.h" @@ -71,16 +72,6 @@ # define _PATH_DEVNULL "/dev/null" #endif /* _PATH_DEVNULL */ -#ifdef WIN32 -# define STRNCASECMP strnicmp -# define popen _popen -# define pclose _pclose -# define snprintf _snprintf -# define stat _stat -#else -# define STRNCASECMP strncasecmp -#endif /* WIN32 */ - #define STREAM_DONE 0 #define STREAM_CONT 1 #define STREAM_SKIP 2 @@ -420,10 +411,10 @@ processMetadata(shout_t *shout, const char *extension, const char *fileName) while(*ptr){ if (artist == NULL && - STRNCASECMP(*ptr, "ARTIST", strlen("ARTIST")) == 0) + strncasecmp(*ptr, "ARTIST", strlen("ARTIST")) == 0) artist = xstrdup(*ptr + strlen("ARTIST=")); if (title == NULL && - STRNCASECMP(*ptr, "TITLE", strlen("TITLE")) == 0) + strncasecmp(*ptr, "TITLE", strlen("TITLE")) == 0) title = xstrdup(*ptr + strlen("TITLE=")); ++ptr; } @@ -878,7 +869,7 @@ getProgname(const char *argv0) if (argv0 == NULL) return ((char *)"ezstream"); - p = strrchr(argv0, '/'); + p = strrchr(argv0, PATH_SEPARATOR); if (p == NULL) p = (char *)argv0; else diff --git a/src/playlist.c b/src/playlist.c index f639829..f79e9e5 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -31,16 +31,10 @@ #include #include +#include "compat.h" #include "playlist.h" #include "util.h" -#ifdef WIN32 -# define snprintf _snprintf -# define popen _popen -# define pclose _pclose -# define stat _stat -#endif - #ifndef SIZE_T_MAX # define SIZE_T_MAX UINT_MAX #endif @@ -239,7 +233,7 @@ playlist_program(const char *filename) playlist_free(pl); return (NULL); } - if (!(st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { + if (!(st.st_mode & (S_IEXEC | S_IXGRP | S_IXOTH))) { printf("%s: %s: Not an executable program\n", __progname, filename); playlist_free(pl); return (NULL); diff --git a/win32/Makefile.am b/win32/Makefile.am index c4eeaa1..9089d6e 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = 1.9 foreign -EXTRA_DIST = ezstream.dsp ezstream.dsw ezstream.iss +EXTRA_DIST = ezstream.sln ezstream.vcproj CLEANFILES = core *.core *~ .*~ diff --git a/win32/ezstream.dsp b/win32/ezstream.dsp deleted file mode 100644 index f8c6377..0000000 --- a/win32/ezstream.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ezstream" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=ezstream - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ezstream.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ezstream.mak" CFG="ezstream - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ezstream - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "ezstream - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ezstream - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../ogg/include" /I "../../vorbis/include" /I "../../libshout/include" /I "../src" /I "../../libxml2/include" /I "../../iconv/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\libshout\win32\Release\libshout.lib ogg_static.lib vorbis_static.lib ..\..\pthreads\pthreadVSE.lib ws2_32.lib winmm.lib libxml2.lib iconv.lib vorbisfile_static.lib /nologo /subsystem:console /machine:I386 /libpath:"../../oggvorbis-win32sdk-1.0.1/lib" /libpath:"../../libshout-2.0/win32/Release" /libpath:"../../libxml2/lib" /libpath:"../../iconv/lib" /libpath:"../../ogg/win32/Static_Release" /libpath:"../../vorbis/win32/Vorbis_Static_Release" /libpath:"../../vorbis/win32/VorbisFile_Static_Release" - -!ELSEIF "$(CFG)" == "ezstream - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../ogg/include" /I "../../vorbis/include" /I "../../libshout/include" /I "../src" /I "../../libxml2/include" /I "../../iconv/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\libshout\win32\Debug\libshout.lib ogg_static_d.lib vorbis_static_d.lib ..\..\pthreads\pthreadVSE.lib ws2_32.lib winmm.lib libxml2.lib iconv.lib vorbisfile_static_d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../libshout-2.0/win32/Debug" /libpath:"../../libxml2/lib" /libpath:"../../iconv/lib" /libpath:"../../ogg/win32/Static_Debug" /libpath:"../../vorbis/win32/Vorbis_Static_Debug" /libpath:"../../vorbis/win32/VorbisFile_Static_Debug" - -!ENDIF - -# Begin Target - -# Name "ezstream - Win32 Release" -# Name "ezstream - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\src\configfile.c -# End Source File -# Begin Source File - -SOURCE=..\src\configfile.h -# End Source File -# Begin Source File - -SOURCE=..\src\ezstream.c -# End Source File -# Begin Source File - -SOURCE=..\src\getopt.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\src\getopt.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/win32/ezstream.dsw b/win32/ezstream.dsw deleted file mode 100644 index 9d857b5..0000000 --- a/win32/ezstream.dsw +++ /dev/null @@ -1,89 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "ezstream"=.\ezstream.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libshout - End Project Dependency - Begin Project Dependency - Project_Dep_Name ogg_static - End Project Dependency - Begin Project Dependency - Project_Dep_Name vorbis_static - End Project Dependency - Begin Project Dependency - Project_Dep_Name vorbisfile_static - End Project Dependency -}}} - -############################################################################### - -Project: "libshout"=..\..\libshout\win32\libshout.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ogg_static"=..\..\ogg\win32\ogg_static.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "vorbis_static"=..\..\vorbis\win32\vorbis_static.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "vorbisfile_static"=..\..\vorbis\win32\vorbisfile_static.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/ezstream.iss b/win32/ezstream.iss deleted file mode 100644 index 58856cf..0000000 --- a/win32/ezstream.iss +++ /dev/null @@ -1,41 +0,0 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -[Setup] -AppName=ezstream -AppVerName=ezstream v0.2.1 -AppPublisherURL=http://www.icecast.org -AppSupportURL=http://www.icecast.org -AppUpdatesURL=http://www.icecast.org -DefaultDirName={pf}\ezstream -DefaultGroupName=ezstream -AllowNoIcons=yes -LicenseFile=..\COPYING -InfoAfterFile=..\README -OutputDir=. -OutputBaseFilename=ezstream_win32_0.2.1_setup -; uncomment the following line if you want your installation to run on NT 3.51 too. -; MinVersion=4,3.51 - -[Tasks] -Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; MinVersion: 4,4 - -[Dirs] -Name: "{app}" - - -[Files] -Source: "Release\ezstream.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\..\pthreads\pthreadVSE.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\conf\ezstream_mp3.xml"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\conf\ezstream_vorbis.xml"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\conf\ezstream_reencoding_example_mp3.xml"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\conf\ezstream_reencoding_example_vorbis.xml"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\conf\ezstream_reencoding_example_theora.xml"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\..\iconv\lib\iconv.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\..\libxml2\lib\libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion - -[Icons] - -[Run] - diff --git a/win32/ezstream.sln b/win32/ezstream.sln new file mode 100644 index 0000000..0c1253c --- /dev/null +++ b/win32/ezstream.sln @@ -0,0 +1,72 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ogg_static", "..\..\ogg\win32\ogg_static.vcproj", "{A0144DD0-0064-46CF-93D3-78DB712034D4}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vorbis_static", "..\..\vorbis\win32\vorbis_static.vcproj", "{FB2ECA7B-D98C-4341-84B7-005E037E25A7}" + ProjectSection(ProjectDependencies) = postProject + {A0144DD0-0064-46CF-93D3-78DB712034D4} = {A0144DD0-0064-46CF-93D3-78DB712034D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vorbisfile_static", "..\..\vorbis\win32\vorbisfile_static.vcproj", "{5E55AD4D-483E-466D-B3B7-EAD8B6128DC9}" + ProjectSection(ProjectDependencies) = postProject + {FB2ECA7B-D98C-4341-84B7-005E037E25A7} = {FB2ECA7B-D98C-4341-84B7-005E037E25A7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "theora_static", "..\..\theora\win32\theora_static.vcproj", "{63A539B9-C6CD-4DC9-80B2-B28DB92C151E}" + ProjectSection(ProjectDependencies) = postProject + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9} = {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9} + {FB2ECA7B-D98C-4341-84B7-005E037E25A7} = {FB2ECA7B-D98C-4341-84B7-005E037E25A7} + {A0144DD0-0064-46CF-93D3-78DB712034D4} = {A0144DD0-0064-46CF-93D3-78DB712034D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libshout", "..\..\shout\win32\libshout.vcproj", "{376BDB5E-7092-44EC-AF16-C087D2D80FC6}" + ProjectSection(ProjectDependencies) = postProject + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9} = {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9} + {FB2ECA7B-D98C-4341-84B7-005E037E25A7} = {FB2ECA7B-D98C-4341-84B7-005E037E25A7} + {63A539B9-C6CD-4DC9-80B2-B28DB92C151E} = {63A539B9-C6CD-4DC9-80B2-B28DB92C151E} + {A0144DD0-0064-46CF-93D3-78DB712034D4} = {A0144DD0-0064-46CF-93D3-78DB712034D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ezstream", "ezstream.vcproj", "{4C27B249-0C17-4007-9D51-2ED145DF06C2}" + ProjectSection(ProjectDependencies) = postProject + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9} = {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9} + {376BDB5E-7092-44EC-AF16-C087D2D80FC6} = {376BDB5E-7092-44EC-AF16-C087D2D80FC6} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {A0144DD0-0064-46CF-93D3-78DB712034D4}.Debug.ActiveCfg = Debug|Win32 + {A0144DD0-0064-46CF-93D3-78DB712034D4}.Debug.Build.0 = Debug|Win32 + {A0144DD0-0064-46CF-93D3-78DB712034D4}.Release.ActiveCfg = Release|Win32 + {A0144DD0-0064-46CF-93D3-78DB712034D4}.Release.Build.0 = Release|Win32 + {FB2ECA7B-D98C-4341-84B7-005E037E25A7}.Debug.ActiveCfg = Debug|Win32 + {FB2ECA7B-D98C-4341-84B7-005E037E25A7}.Debug.Build.0 = Debug|Win32 + {FB2ECA7B-D98C-4341-84B7-005E037E25A7}.Release.ActiveCfg = Release|Win32 + {FB2ECA7B-D98C-4341-84B7-005E037E25A7}.Release.Build.0 = Release|Win32 + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9}.Debug.ActiveCfg = Debug|Win32 + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9}.Debug.Build.0 = Debug|Win32 + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9}.Release.ActiveCfg = Release|Win32 + {5E55AD4D-483E-466D-B3B7-EAD8B6128DC9}.Release.Build.0 = Release|Win32 + {63A539B9-C6CD-4DC9-80B2-B28DB92C151E}.Debug.ActiveCfg = Debug|Win32 + {63A539B9-C6CD-4DC9-80B2-B28DB92C151E}.Debug.Build.0 = Debug|Win32 + {63A539B9-C6CD-4DC9-80B2-B28DB92C151E}.Release.ActiveCfg = Release|Win32 + {63A539B9-C6CD-4DC9-80B2-B28DB92C151E}.Release.Build.0 = Release|Win32 + {376BDB5E-7092-44EC-AF16-C087D2D80FC6}.Debug.ActiveCfg = Debug|Win32 + {376BDB5E-7092-44EC-AF16-C087D2D80FC6}.Debug.Build.0 = Debug|Win32 + {376BDB5E-7092-44EC-AF16-C087D2D80FC6}.Release.ActiveCfg = Release|Win32 + {376BDB5E-7092-44EC-AF16-C087D2D80FC6}.Release.Build.0 = Release|Win32 + {4C27B249-0C17-4007-9D51-2ED145DF06C2}.Debug.ActiveCfg = Debug|Win32 + {4C27B249-0C17-4007-9D51-2ED145DF06C2}.Debug.Build.0 = Debug|Win32 + {4C27B249-0C17-4007-9D51-2ED145DF06C2}.Release.ActiveCfg = Release|Win32 + {4C27B249-0C17-4007-9D51-2ED145DF06C2}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/win32/ezstream.vcproj b/win32/ezstream.vcproj new file mode 100644 index 0000000..bc5de92 --- /dev/null +++ b/win32/ezstream.vcproj @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +