mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
1.9.4... too many small changes to comment
This commit is contained in:
@@ -154,10 +154,19 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000;
|
||||
|
||||
void FLAC__cpu_info(FLAC__CPUInfo *info)
|
||||
{
|
||||
/*
|
||||
* IA64-specific
|
||||
*/
|
||||
#if defined FLAC__CPU_IA64
|
||||
info->type = FLAC__CPUINFO_TYPE_IA64;
|
||||
#if !defined FLAC__NO_ASM && defined FLAC__HAS_NASM
|
||||
info->use_asm = true;
|
||||
#endif
|
||||
|
||||
#elif defined FLAC__CPU_IA32
|
||||
/*
|
||||
* IA32-specific
|
||||
*/
|
||||
#ifdef FLAC__CPU_IA32
|
||||
info->type = FLAC__CPUINFO_TYPE_IA32;
|
||||
#if !defined FLAC__NO_ASM && defined FLAC__HAS_NASM
|
||||
info->use_asm = true; /* we assume a minimum of 80386 with FLAC__CPU_IA32 */
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
FLAC__CPUINFO_TYPE_IA64,
|
||||
FLAC__CPUINFO_TYPE_IA32,
|
||||
FLAC__CPUINFO_TYPE_PPC,
|
||||
FLAC__CPUINFO_TYPE_UNKNOWN
|
||||
|
||||
@@ -77,6 +77,13 @@ void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12(const FLAC__real data
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FLAC__CPU_IA64
|
||||
# ifdef FLAC__HAS_NASM
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia64_sse_lag_4(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia64_sse_lag_8(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia64_sse_lag_12(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -109,10 +109,12 @@
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\include;..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__CPU_IA64;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\";FLAC__NO_DLL;DEBUG;FLAC__OVERFLOW_DETECT"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
@@ -290,11 +292,11 @@
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\include\private\all.h"
|
||||
RelativePath=".\include\protected\all.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\protected\all.h"
|
||||
RelativePath=".\include\private\all.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -746,6 +748,52 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ia64\lpc_asm.nasm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="nasmw.exe -f win64 -d OBJ_FORMAT_win64 -i ia64/ ia32/lpc_asm.nasm -o ia64/lpc_asm.obj"
|
||||
AdditionalDependencies="ia64/lpc_asm.nasm;ia64/nasm.h"
|
||||
Outputs="ia64/lpc_asm.obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="nasmw.exe -f win64 -d OBJ_FORMAT_win64 -i ia64/ ia64/lpc_asm.nasm -o ia64/lpc_asm.obj"
|
||||
AdditionalDependencies="ia64/lpc_asm.nasm;ia64/nasm.h"
|
||||
Outputs="ia64/lpc_asm.obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="nasmw.exe -f win64 -d OBJ_FORMAT_win64 -i ia64/ ia32/lpc_asm.nasm -o ia64/lpc_asm.obj"
|
||||
AdditionalDependencies="ia64/lpc_asm.nasm;ia64/nasm.h"
|
||||
Outputs="ia64/lpc_asm.obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="nasmw.exe -f win64 -d OBJ_FORMAT_win64 -i ia64/ ia64/lpc_asm.nasm -o ia64/lpc_asm.obj"
|
||||
AdditionalDependencies="ia64/lpc_asm.nasm;ia64/nasm.h"
|
||||
Outputs="ia64/lpc_asm.obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ia32\lpc_asm.nasm"
|
||||
>
|
||||
|
||||
@@ -935,6 +935,17 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
|
||||
encoder->private_->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov;
|
||||
# endif /* FLAC__HAS_NASM */
|
||||
# endif /* FLAC__CPU_IA32 */
|
||||
# ifdef FLAC__CPU_IA64
|
||||
FLAC__ASSERT(encoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA64);
|
||||
# ifdef FLAC__HAS_NASM
|
||||
if(encoder->protected_->max_lpc_order < 4)
|
||||
encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia64_sse_lag_4;
|
||||
else if(encoder->protected_->max_lpc_order < 8)
|
||||
encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia64_sse_lag_8;
|
||||
//else if(encoder->protected_->max_lpc_order < 12)
|
||||
// encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia64_sse_lag_12;
|
||||
# endif /* FLAC__HAS_NASM */
|
||||
# endif /* FLAC__CPU_IA64 */
|
||||
}
|
||||
# endif /* !FLAC__NO_ASM */
|
||||
#endif /* !FLAC__INTEGER_ONLY_LIBRARY */
|
||||
|
||||
@@ -1,208 +1,416 @@
|
||||
/* flac_mac - wedge utility to add FLAC support to Monkey's Audio
|
||||
|
||||
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Josh Coalson
|
||||
|
||||
*
|
||||
|
||||
* 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-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
* This program can be used to allow FLAC to masquerade as one of the other
|
||||
|
||||
* supported lossless codecs in Monkey's Audio. See the documentation for
|
||||
|
||||
* how to do this.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
||||
# include <config.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include<stdio.h>
|
||||
|
||||
#include<stdlib.h>
|
||||
|
||||
#include<string.h>
|
||||
|
||||
#include<wtypes.h>
|
||||
|
||||
#include<process.h>
|
||||
|
||||
#include<winbase.h>
|
||||
|
||||
|
||||
|
||||
static int execit(char *prog, char *args);
|
||||
|
||||
static int forkit(char *prog, char *args);
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
|
||||
int flac_return_val = 0, opt_arg = 1, from_arg = -1, to_arg = -1, flac_level = 5, i;
|
||||
|
||||
char prog[MAX_PATH], cmdline[MAX_PATH*2], from[MAX_PATH], to[MAX_PATH], macdir[MAX_PATH], options[256], *p;
|
||||
|
||||
enum { WAVPACK, RKAU, SHORTEN } codec;
|
||||
|
||||
|
||||
|
||||
/* get the directory where MAC external codecs reside */
|
||||
|
||||
if(0 != (p = strrchr(argv[0],'\\'))) {
|
||||
|
||||
strcpy(macdir, argv[0]);
|
||||
|
||||
*(strrchr(macdir,'\\')+1) = '\0';
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
strcpy(macdir, "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* determine which codec we were called as and parse the options */
|
||||
|
||||
if(p == 0)
|
||||
|
||||
p = argv[0];
|
||||
|
||||
else
|
||||
|
||||
p++;
|
||||
|
||||
if(0 == strnicmp(p, "short", 5)) {
|
||||
|
||||
codec = SHORTEN;
|
||||
|
||||
}
|
||||
|
||||
else if(0 == strnicmp(p, "rkau", 4)) {
|
||||
|
||||
codec = RKAU;
|
||||
|
||||
if(argv[1][0] == '-' && argv[1][1] == 'l') {
|
||||
|
||||
opt_arg = 2;
|
||||
|
||||
switch(argv[1][2]) {
|
||||
|
||||
case '1': flac_level = 1; break;
|
||||
|
||||
case '2': flac_level = 5; break;
|
||||
|
||||
case '3': flac_level = 8; break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if(0 == strnicmp(p, "wavpack", 7)) {
|
||||
|
||||
codec = WAVPACK;
|
||||
|
||||
if(argv[1][0] == '-') {
|
||||
|
||||
opt_arg = 2;
|
||||
|
||||
switch(argv[1][1]) {
|
||||
|
||||
case 'f': flac_level = 1; break;
|
||||
|
||||
case 'h': flac_level = 8; break;
|
||||
|
||||
default: opt_arg = 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
return -5;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* figure out which arguments are the source and destination files */
|
||||
|
||||
for(i = 1; i < argc; i++)
|
||||
|
||||
if(argv[i][0] != '-') {
|
||||
|
||||
from_arg = i++;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
for( ; i < argc; i++)
|
||||
|
||||
if(argv[i][0] != '-') {
|
||||
|
||||
to_arg = i++;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(to_arg < 0)
|
||||
|
||||
return -4;
|
||||
|
||||
|
||||
|
||||
/* build the command to call flac with */
|
||||
|
||||
sprintf(prog, "%sflac.exe", macdir);
|
||||
|
||||
sprintf(options, "-%d", flac_level);
|
||||
|
||||
/* flac_mac - wedge utility to add FLAC support to Monkey's Audio
|
||||
|
||||
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Josh Coalson
|
||||
|
||||
*
|
||||
|
||||
* 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-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
* This program can be used to allow FLAC to masquerade as one of the other
|
||||
|
||||
* supported lossless codecs in Monkey's Audio. See the documentation for
|
||||
|
||||
* how to do this.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
||||
# include <config.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include<stdio.h>
|
||||
|
||||
#include<stdlib.h>
|
||||
|
||||
#include<string.h>
|
||||
|
||||
#include<wtypes.h>
|
||||
|
||||
#include<process.h>
|
||||
|
||||
#include<winbase.h>
|
||||
|
||||
|
||||
|
||||
static int execit(char *prog, char *args);
|
||||
|
||||
static int forkit(char *prog, char *args);
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
|
||||
int flac_return_val = 0, opt_arg = 1, from_arg = -1, to_arg = -1, flac_level = 5, i;
|
||||
|
||||
char prog[MAX_PATH], cmdline[MAX_PATH*2], from[MAX_PATH], to[MAX_PATH], macdir[MAX_PATH], options[256], *p;
|
||||
|
||||
enum { WAVPACK, RKAU, SHORTEN } codec;
|
||||
|
||||
|
||||
|
||||
/* get the directory where MAC external codecs reside */
|
||||
|
||||
if(0 != (p = strrchr(argv[0],'\\'))) {
|
||||
|
||||
strcpy(macdir, argv[0]);
|
||||
|
||||
*(strrchr(macdir,'\\')+1) = '\0';
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
strcpy(macdir, "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* determine which codec we were called as and parse the options */
|
||||
|
||||
if(p == 0)
|
||||
|
||||
p = argv[0];
|
||||
|
||||
else
|
||||
|
||||
p++;
|
||||
|
||||
if(0 == strnicmp(p, "short", 5)) {
|
||||
|
||||
codec = SHORTEN;
|
||||
|
||||
}
|
||||
|
||||
else if(0 == strnicmp(p, "rkau", 4)) {
|
||||
|
||||
codec = RKAU;
|
||||
|
||||
if(argv[1][0] == '-' && argv[1][1] == 'l') {
|
||||
|
||||
opt_arg = 2;
|
||||
|
||||
switch(argv[1][2]) {
|
||||
|
||||
case '1': flac_level = 1; break;
|
||||
|
||||
case '2': flac_level = 5; break;
|
||||
|
||||
case '3': flac_level = 8; break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if(0 == strnicmp(p, "wavpack", 7)) {
|
||||
|
||||
codec = WAVPACK;
|
||||
|
||||
if(argv[1][0] == '-') {
|
||||
|
||||
opt_arg = 2;
|
||||
|
||||
switch(argv[1][1]) {
|
||||
|
||||
case 'f': flac_level = 1; break;
|
||||
|
||||
case 'h': flac_level = 8; break;
|
||||
|
||||
default: opt_arg = 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
return -5;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* figure out which arguments are the source and destination files */
|
||||
|
||||
for(i = 1; i < argc; i++)
|
||||
|
||||
if(argv[i][0] != '-') {
|
||||
|
||||
from_arg = i++;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
for( ; i < argc; i++)
|
||||
|
||||
if(argv[i][0] != '-') {
|
||||
|
||||
to_arg = i++;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(to_arg < 0)
|
||||
|
||||
return -4;
|
||||
|
||||
|
||||
|
||||
/* build the command to call flac with */
|
||||
|
||||
sprintf(prog, "%sflac.exe", macdir);
|
||||
|
||||
sprintf(options, "-%d", flac_level);
|
||||
|
||||
for(i = opt_arg; i < argc; i++)
|
||||
|
||||
if(argv[i][0] == '-') {
|
||||
|
||||
strcat(options, " ");
|
||||
|
||||
strcat(options, argv[i]);
|
||||
|
||||
}
|
||||
|
||||
sprintf(cmdline, "\"%s\" %s -o \"%s\" \"%s\"", prog, options, argv[to_arg], argv[from_arg]);
|
||||
|
||||
|
||||
|
||||
flac_return_val = execit(prog, cmdline);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
* Now that flac has finished, we need to fork a process that will rename
|
||||
|
||||
* the resulting file with the correct extension once MAC has moved it to
|
||||
|
||||
* it's final resting place.
|
||||
|
||||
*/
|
||||
|
||||
if(0 == flac_return_val) {
|
||||
|
||||
/* get the destination directory, if any */
|
||||
|
||||
if(0 != (p = strchr(argv[to_arg],'\\'))) {
|
||||
|
||||
strcpy(from, argv[to_arg]);
|
||||
|
||||
*(strrchr(from,'\\')+1) = '\0';
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
strcpy(from, "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* for the full 'from' and 'to' paths for the renamer process */
|
||||
|
||||
p = strrchr(argv[from_arg],'\\');
|
||||
|
||||
strcat(from, p? p+1 : argv[from_arg]);
|
||||
|
||||
strcpy(to, from);
|
||||
|
||||
if(0 == strchr(from,'.'))
|
||||
|
||||
return -3;
|
||||
|
||||
switch(codec) {
|
||||
|
||||
case SHORTEN: strcpy(strrchr(from,'.'), ".shn"); break;
|
||||
|
||||
case WAVPACK: strcpy(strrchr(from,'.'), ".wv"); break;
|
||||
|
||||
case RKAU: strcpy(strrchr(from,'.'), ".rka"); break;
|
||||
|
||||
}
|
||||
|
||||
strcpy(strrchr(to,'.'), ".flac");
|
||||
|
||||
|
||||
|
||||
sprintf(prog, "%sflac_ren.exe", macdir);
|
||||
|
||||
sprintf(cmdline, "\"%s\" \"%s\" \"%s\"", prog, from, to);
|
||||
|
||||
|
||||
|
||||
flac_return_val = forkit(prog, cmdline);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return flac_return_val;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int execit(char *prog, char *args)
|
||||
|
||||
{
|
||||
|
||||
BOOL ok;
|
||||
|
||||
STARTUPINFO startup_info;
|
||||
|
||||
PROCESS_INFORMATION proc_info;
|
||||
|
||||
|
||||
|
||||
GetStartupInfo(&startup_info);
|
||||
|
||||
|
||||
|
||||
ok = CreateProcess(
|
||||
|
||||
prog,
|
||||
|
||||
args,
|
||||
|
||||
0, /*process security attributes*/
|
||||
|
||||
0, /*thread security attributes*/
|
||||
|
||||
FALSE,
|
||||
|
||||
0, /*dwCreationFlags*/
|
||||
|
||||
0, /*environment*/
|
||||
|
||||
0, /*lpCurrentDirectory*/
|
||||
|
||||
&startup_info,
|
||||
|
||||
&proc_info
|
||||
|
||||
);
|
||||
|
||||
if(ok) {
|
||||
|
||||
DWORD dw;
|
||||
|
||||
dw = WaitForSingleObject(proc_info.hProcess, INFINITE);
|
||||
|
||||
ok = (dw != 0xFFFFFFFF);
|
||||
|
||||
CloseHandle(proc_info.hThread);
|
||||
|
||||
CloseHandle(proc_info.hProcess);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return ok? 0 : -1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int forkit(char *prog, char *args)
|
||||
|
||||
{
|
||||
|
||||
BOOL ok;
|
||||
|
||||
STARTUPINFO startup_info;
|
||||
|
||||
PROCESS_INFORMATION proc_info;
|
||||
|
||||
|
||||
|
||||
GetStartupInfo(&startup_info);
|
||||
|
||||
|
||||
|
||||
ok = CreateProcess(
|
||||
|
||||
prog,
|
||||
|
||||
args,
|
||||
|
||||
0, /*process security attributes*/
|
||||
|
||||
0, /*thread security attributes*/
|
||||
|
||||
FALSE,
|
||||
|
||||
DETACHED_PROCESS, /*dwCreationFlags*/
|
||||
|
||||
0, /*environment*/
|
||||
|
||||
0, /*lpCurrentDirectory*/
|
||||
|
||||
&startup_info,
|
||||
|
||||
&proc_info
|
||||
|
||||
);
|
||||
|
||||
if(ok) {
|
||||
|
||||
CloseHandle(proc_info.hThread);
|
||||
|
||||
CloseHandle(proc_info.hProcess);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return ok? 0 : -2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,39 +1,78 @@
|
||||
/* flac_ren - renamer part of utility to add FLAC support to Monkey's Audio
|
||||
|
||||
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Josh Coalson
|
||||
|
||||
*
|
||||
|
||||
* 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-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
||||
# include <config.h>
|
||||
/* flac_ren - renamer part of utility to add FLAC support to Monkey's Audio
|
||||
|
||||
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Josh Coalson
|
||||
|
||||
*
|
||||
|
||||
* 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-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
||||
# include <config.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include <io.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <wtypes.h>
|
||||
|
||||
#include <winbase.h>
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
|
||||
struct stat s;
|
||||
|
||||
|
||||
|
||||
/* wait till the 'from' file has reached its final destination */
|
||||
|
||||
do {
|
||||
|
||||
Sleep(2000);
|
||||
|
||||
} while(stat(argv[1], &s) < 0);
|
||||
|
||||
|
||||
|
||||
/* now rename it */
|
||||
|
||||
return rename(argv[1], argv[2]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user