Move library tree where it belongs
This commit is contained in:
parent
e74978ba77
commit
58caf78a86
|
@ -0,0 +1,2 @@
|
|||
.AppleDouble
|
||||
Makefile
|
|
@ -0,0 +1,4 @@
|
|||
Makefile
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
|
@ -0,0 +1,136 @@
|
|||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
FileDialog.cpp
|
||||
|
||||
Leland Lucius
|
||||
|
||||
*******************************************************************//**
|
||||
|
||||
\class FileDialog
|
||||
\brief Dialog used to present platform specific "Save As" dialog with
|
||||
custom controls.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "FileDialog.h"
|
||||
|
||||
void FileDialog::EnableButton(wxString label, fdCallback cb, void *data)
|
||||
{
|
||||
m_buttonlabel = label;
|
||||
m_callback = cb;
|
||||
m_cbdata = data;
|
||||
}
|
||||
|
||||
void FileDialog::ClickButton(int index)
|
||||
{
|
||||
if (m_callback)
|
||||
{
|
||||
m_callback(m_cbdata, index);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: common/fldlgcmn.cpp
|
||||
// Purpose: wxFileDialog common functions
|
||||
// Author: John Labenski
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 14.06.03 (extracted from src/*/filedlg.cpp)
|
||||
// RCS-ID: $Id: FileDialog.cpp,v 1.8 2008-10-05 14:48:59 richardash1981 Exp $
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// FileDialog convenience functions
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
wxString FileSelector(const wxChar *title,
|
||||
const wxChar *defaultDir,
|
||||
const wxChar *defaultFileName,
|
||||
const wxChar *defaultExtension,
|
||||
const wxChar *filter,
|
||||
int flags,
|
||||
wxWindow *parent,
|
||||
wxString label, fdCallback cb, void *cbdata)
|
||||
{
|
||||
// The defaultExtension, if non-NULL, is
|
||||
// appended to the filename if the user fails to type an extension. The new
|
||||
// implementation (taken from wxFileSelectorEx) appends the extension
|
||||
// automatically, by looking at the filter specification. In fact this
|
||||
// should be better than the native Microsoft implementation because
|
||||
// Windows only allows *one* default extension, whereas here we do the
|
||||
// right thing depending on the filter the user has chosen.
|
||||
|
||||
// If there's a default extension specified but no filter, we create a
|
||||
// suitable filter.
|
||||
|
||||
wxString filter2;
|
||||
if (defaultExtension && !filter)
|
||||
filter2 = wxString(wxT("*.")) + defaultExtension;
|
||||
else if (filter)
|
||||
filter2 = filter;
|
||||
|
||||
wxString defaultDirString;
|
||||
if (defaultDir)
|
||||
defaultDirString = defaultDir;
|
||||
|
||||
wxString defaultFilenameString;
|
||||
if (defaultFileName)
|
||||
defaultFilenameString = defaultFileName;
|
||||
|
||||
FileDialog fileDialog(parent, title, defaultDirString,
|
||||
defaultFilenameString, filter2,
|
||||
flags);
|
||||
|
||||
// Enable the extra button if desired
|
||||
if ((flags & wxFD_SAVE) && (cb != NULL))
|
||||
{
|
||||
fileDialog.EnableButton(label, cb, cbdata);
|
||||
}
|
||||
|
||||
// if filter is of form "All files (*)|*|..." set correct filter index
|
||||
if ((wxStrlen(defaultExtension) != 0) && (filter2.Find(wxT('|')) != wxNOT_FOUND))
|
||||
{
|
||||
int filterIndex = 0;
|
||||
|
||||
wxArrayString descriptions, filters;
|
||||
// don't care about errors, handled already by FileDialog
|
||||
(void)wxParseCommonDialogsFilter(filter2, descriptions, filters);
|
||||
|
||||
for (size_t n=0; n<filters.GetCount(); n++)
|
||||
{
|
||||
if (filters[n].Contains(defaultExtension))
|
||||
{
|
||||
filterIndex = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (filterIndex > 0)
|
||||
fileDialog.SetFilterIndex(filterIndex);
|
||||
}
|
||||
|
||||
wxString filename;
|
||||
if (fileDialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
filename = fileDialog.GetPath();
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
// arch-tag: 94f72c32-970b-4f4e-bbf3-3880fce7b965
|
|
@ -0,0 +1,70 @@
|
|||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
FileDialog.h
|
||||
|
||||
Leland Lucius
|
||||
|
||||
*******************************************************************//**
|
||||
|
||||
\class FileDialog
|
||||
\brief Dialog used to present platform specific "Save As" dialog with
|
||||
custom controls.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#ifndef _FILE_DIALOG_H_
|
||||
#define _FILE_DIALOG_H_
|
||||
|
||||
#if defined(__WXGTK__)
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/filedlg.h"
|
||||
|
||||
typedef void (*fdCallback)(void *, int);
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
#include "mac/FileDialogPrivate.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "win/FileDialogPrivate.h"
|
||||
#elif defined(__WXGTK__) && defined(HAVE_GTK)
|
||||
#include "gtk/FileDialogPrivate.h"
|
||||
#else
|
||||
#include "generic/FileDialogPrivate.h"
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.h
|
||||
// Purpose: wxFileDialog base header
|
||||
// Author: Robert Roebling
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 8/17/99
|
||||
// Copyright: (c) Robert Roebling
|
||||
// RCS-ID: $Id: FileDialog.h,v 1.9 2008-05-24 02:57:39 llucius Exp $
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxFileDialog convenience functions
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
wxString
|
||||
FileSelector(const wxChar *message = wxFileSelectorPromptStr,
|
||||
const wxChar *default_path = NULL,
|
||||
const wxChar *default_filename = NULL,
|
||||
const wxChar *default_extension = NULL,
|
||||
const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
int flags = 0,
|
||||
wxWindow *parent = NULL,
|
||||
wxString label = wxEmptyString,
|
||||
fdCallback cb = NULL,
|
||||
void *cbdata = NULL);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,566 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="FileDialog"
|
||||
ProjectGUID="{5284D863-3813-479F-BBF0-AC234E216BC6}"
|
||||
RootNamespace="FileDialog"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_lib\mswd";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialogd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_lib\msw";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialog.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Unicode_Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_lib\mswud";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialogud.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Unicode_Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_lib\mswu";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialogu.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug DLL|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_dll\mswd";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WXUSINGDLL;WIN32;_DEBUG;_LIB;__WXMSW__"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialogd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug wx284|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_dll\mswd";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WXUSINGDLL;WIN32;_DEBUG;_LIB;__WXMSW__"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialogd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Modular_Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_dll\msw";"$(WXWIN)\include""
|
||||
PreprocessorDefinitions="WXUSINGDLL;WIN32;NDEBUG;_LIB;__WXMSW__"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="filedialog.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\FileDialog.cpp"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="win"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\win\FileDialogPrivate.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug DLL|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug wx284|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Modular_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\FileDialog.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="win"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\win\FileDialogPrivate.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,29 @@
|
|||
### FileDialog library Makefile
|
||||
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
AR = @AR@
|
||||
RANLIB = @RANLIB@
|
||||
|
||||
CPPFLAGS += -I. @CPPFLAGS@
|
||||
CXXFLAGS += @CXXFLAGS@
|
||||
|
||||
OBJS = FileDialog.o @EXTRAOBJS@
|
||||
|
||||
LIBRARY = FileDialog.a
|
||||
|
||||
all: $(LIBRARY)
|
||||
|
||||
$(LIBRARY): $(OBJS)
|
||||
$(AR) ruv $(LIBRARY) $(OBJS)
|
||||
$(RANLIB) $(LIBRARY)
|
||||
|
||||
$(OBJS): %.o: %.cpp @EXTRADEPS@
|
||||
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
-$(RM) -f $(LIBRARY)
|
||||
-$(RM) -f $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
-$(RM) -rf config.log config.status autom4te.cache Makefile
|
|
@ -0,0 +1,210 @@
|
|||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 1997-2001
|
||||
|
||||
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
|
||||
dnl pass to pkg-config
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_GTK_2_0],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from pkg-config
|
||||
dnl
|
||||
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
|
||||
, enable_gtktest=yes)
|
||||
|
||||
pkg_config_args=gtk+-2.0
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gthread)
|
||||
pkg_config_args="$pkg_config_args gthread-2.0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
no_gtk=""
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
if pkg-config --atleast-pkgconfig-version 0.7 ; then
|
||||
:
|
||||
else
|
||||
echo "*** pkg-config too old; version 0.7 or better required."
|
||||
no_gtk=yes
|
||||
PKG_CONFIG=no
|
||||
fi
|
||||
else
|
||||
no_gtk=yes
|
||||
fi
|
||||
|
||||
min_gtk_version=ifelse([$1], ,2.0.0,$1)
|
||||
AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
## don't try to run the test against uninstalled libtool libs
|
||||
if $PKG_CONFIG --uninstalled $pkg_config_args; then
|
||||
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
|
||||
enable_gtktest=no
|
||||
fi
|
||||
|
||||
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
|
||||
:
|
||||
else
|
||||
no_gtk=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$no_gtk" = x ; then
|
||||
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
|
||||
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
|
||||
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$GTK_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
|
||||
dnl checks the results of pkg-config to some extent)
|
||||
dnl
|
||||
rm -f conf.gtktest
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.gtktest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_gtk_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_gtk_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((gtk_major_version != $gtk_config_major_version) ||
|
||||
(gtk_minor_version != $gtk_config_minor_version) ||
|
||||
(gtk_micro_version != $gtk_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
||||
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
||||
printf("*** to point to the correct configuration files\n");
|
||||
}
|
||||
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
||||
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
||||
(gtk_micro_version != GTK_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
||||
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gtk_major_version > major) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_gtk" = x ; then
|
||||
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** A new enough version of pkg-config was not found."
|
||||
echo "*** See http://pkgconfig.sourceforge.net"
|
||||
else
|
||||
if test -f conf.gtktest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GTK+ test program, checking why..."
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
|
||||
echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GTK_CFLAGS=""
|
||||
GTK_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
rm -f conf.gtktest
|
||||
])
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#if @HAVE_GTK@
|
||||
#define HAVE_GTK 1
|
||||
#else
|
||||
#undef HAVE_GTK
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,109 @@
|
|||
#
|
||||
# FileDialog
|
||||
#
|
||||
|
||||
AC_INIT(FileDialog, 1.0, audacity.sourceforge.net, FileDialog)
|
||||
AC_CONFIG_FILES([Makefile config.h])
|
||||
AC_SUBST(EXTRADEPS)
|
||||
AC_SUBST(EXTRAOBJS)
|
||||
AC_SUBST(HAVE_GTK)
|
||||
|
||||
#
|
||||
# Checks for programs.
|
||||
#
|
||||
AC_PROG_CXX
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(AR, ar, no)
|
||||
if [[ $AR = "no" ]] ; then
|
||||
AC_MSG_ERROR("Could not find ar - needed to create a library");
|
||||
fi
|
||||
|
||||
#
|
||||
# Checks for libraries.
|
||||
#
|
||||
AC_HEADER_STDC
|
||||
|
||||
#
|
||||
# Check for debug
|
||||
#
|
||||
AC_ARG_ENABLE(static,
|
||||
[AC_HELP_STRING([--enable-static],
|
||||
[link wx statically (default=no)])],
|
||||
static_preference="--static=$enableval",
|
||||
static_preference="")
|
||||
|
||||
|
||||
AC_ARG_ENABLE(unicode,
|
||||
[AC_HELP_STRING([--enable-unicode],
|
||||
[enable unicode support (default=no)])],
|
||||
unicode_preference="--unicode=$enableval",
|
||||
unicode_preference="")
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[AC_HELP_STRING([--enable-debug],
|
||||
[enable debug support (default=none)])],
|
||||
debug_preference="--debug=$enableval",
|
||||
debug_preference="")
|
||||
|
||||
AC_ARG_WITH(wx-version,
|
||||
[AC_HELP_STRING([--with-wx-version],
|
||||
[override default wxWidgets version [2.6,2.8]])],
|
||||
wx_preference="--version=$withval",
|
||||
wx_preference="")
|
||||
|
||||
AC_ARG_WITH(wx-config,
|
||||
[AC_HELP_STRING([--with-wx-config],
|
||||
[override default wxWidgets config script])],
|
||||
wx_config="$withval",
|
||||
wx_config="")
|
||||
|
||||
dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
|
||||
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
|
||||
if [[ "$WX_CONFIG" = "no" ]] ; then
|
||||
AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
|
||||
fi
|
||||
|
||||
dnl Gather wx arguments
|
||||
|
||||
CPPFLAGS="$CPPFLAGS `$WX_CONFIG $static_preference $unicode_preference $debug_preference $wx_preference --cxxflags`"
|
||||
|
||||
dnl OS-specific configuration
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
case "${host_os}" in
|
||||
darwin*)
|
||||
dnl Mac OS X configuration
|
||||
EXTRADEPS="mac/FileDialogPrivate.h"
|
||||
EXTRAOBJS="mac/FileDialogPrivate.o"
|
||||
;;
|
||||
|
||||
cygwin*)
|
||||
dnl Windows/CygWin configuration
|
||||
EXTRADEPS="win/FileDialogPrivate.h"
|
||||
EXTRAOBJS="win/FileDialogPrivate.o"
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl Unix configuration
|
||||
AM_PATH_GTK_2_0(2.4.0,
|
||||
have_gtk="yes",
|
||||
have_gtk="no")
|
||||
if [[ "$have_gtk" = "yes" ]]
|
||||
then
|
||||
CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
|
||||
EXTRADEPS="gtk/FileDialogPrivate.h gtk/private.h"
|
||||
EXTRAOBJS="gtk/FileDialogPrivate.o"
|
||||
HAVE_GTK=1
|
||||
else
|
||||
EXTRADEPS="generic/FileDialogPrivate.h"
|
||||
EXTRAOBJS="generic/FileDialogPrivate.o"
|
||||
HAVE_GTK=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# Write it all out
|
||||
#
|
||||
AC_OUTPUT
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,292 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlgg.h
|
||||
// Purpose: wxGenericFileDialog
|
||||
// Author: Robert Roebling
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 8/17/99
|
||||
// Copyright: (c) Robert Roebling
|
||||
// RCS-ID: $Id: FileDialogPrivate.h,v 1.2 2008-05-24 02:57:39 llucius Exp $
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _FILEDIALOGGENERICH_
|
||||
#define _FILEDIALOGGENERICH_
|
||||
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/datetime.h"
|
||||
#include "wx/sizer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton;
|
||||
class wxCheckBox;
|
||||
class wxChoice;
|
||||
class wxFileData;
|
||||
class FileCtrl;
|
||||
class wxGenericFileDialog;
|
||||
class wxListEvent;
|
||||
class wxListItem;
|
||||
class wxStaticText;
|
||||
class wxTextCtrl;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// FileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class FileDialog: public wxFileDialogBase
|
||||
{
|
||||
public:
|
||||
FileDialog() : wxFileDialogBase() { Init(); }
|
||||
|
||||
FileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
bool bypassGenericImpl = false );
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
bool bypassGenericImpl = false );
|
||||
|
||||
virtual ~FileDialog();
|
||||
|
||||
virtual void SetMessage(const wxString& message) { SetTitle(message); }
|
||||
virtual void SetPath(const wxString& path);
|
||||
virtual void SetFilterIndex(int filterIndex);
|
||||
virtual void SetWildcard(const wxString& wildCard);
|
||||
|
||||
// for multiple file selection
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
virtual void GetFilenames(wxArrayString& files) const;
|
||||
|
||||
virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
|
||||
virtual void ClickButton(int index);
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
virtual int ShowModal();
|
||||
virtual bool Show( bool show = true );
|
||||
|
||||
void OnSelected( wxListEvent &event );
|
||||
void OnActivated( wxListEvent &event );
|
||||
void OnList( wxCommandEvent &event );
|
||||
void OnReport( wxCommandEvent &event );
|
||||
void OnUp( wxCommandEvent &event );
|
||||
void OnHome( wxCommandEvent &event );
|
||||
void OnListOk( wxCommandEvent &event );
|
||||
void OnNew( wxCommandEvent &event );
|
||||
void OnChoiceFilter( wxCommandEvent &event );
|
||||
void OnTextEnter( wxCommandEvent &event );
|
||||
void OnTextChange( wxCommandEvent &event );
|
||||
void OnCheck( wxCommandEvent &event );
|
||||
void OnExtra( wxCommandEvent &event );
|
||||
|
||||
virtual void HandleAction( const wxString &fn );
|
||||
|
||||
virtual void UpdateControls();
|
||||
|
||||
private:
|
||||
// Don't use this implementation at all :-)
|
||||
bool m_bypassGenericImpl;
|
||||
|
||||
protected:
|
||||
// use the filter with the given index
|
||||
void DoSetFilterIndex(int filterindex);
|
||||
|
||||
wxString m_filterExtension;
|
||||
wxChoice *m_choice;
|
||||
wxTextCtrl *m_text;
|
||||
FileCtrl *m_list;
|
||||
wxCheckBox *m_check;
|
||||
wxStaticText *m_static;
|
||||
wxBitmapButton *m_upDirButton;
|
||||
wxBitmapButton *m_newDirButton;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
DECLARE_DYNAMIC_CLASS(FileDialog)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
// these variables are preserved between FileDialog calls
|
||||
static long ms_lastViewStyle; // list or report?
|
||||
static bool ms_lastShowHidden; // did we show hidden files?
|
||||
|
||||
long m_dialogStyle;
|
||||
wxBoxSizer *m_choicesizer;
|
||||
wxString m_buttonlabel;
|
||||
fdCallback m_callback;
|
||||
void *m_cbdata;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FileData - a class to hold the file info for the FileCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class FileData
|
||||
{
|
||||
public:
|
||||
enum fileType
|
||||
{
|
||||
is_file = 0x0000,
|
||||
is_dir = 0x0001,
|
||||
is_link = 0x0002,
|
||||
is_exe = 0x0004,
|
||||
is_drive = 0x0008
|
||||
};
|
||||
|
||||
FileData() { Init(); }
|
||||
// Full copy constructor
|
||||
FileData( const FileData& fileData ) { Copy(fileData); }
|
||||
// Create a filedata from this information
|
||||
FileData( const wxString &filePath, const wxString &fileName,
|
||||
fileType type, int image_id );
|
||||
|
||||
// make a full copy of the other FileData
|
||||
void Copy( const FileData &other );
|
||||
|
||||
// (re)read the extra data about the file from the system
|
||||
void ReadData();
|
||||
|
||||
// get the name of the file, dir, drive
|
||||
wxString GetFileName() const { return m_fileName; }
|
||||
// get the full path + name of the file, dir, path
|
||||
wxString GetFilePath() const { return m_filePath; }
|
||||
// Set the path + name and name of the item
|
||||
void SetNewName( const wxString &filePath, const wxString &fileName );
|
||||
|
||||
// Get the size of the file in bytes
|
||||
long GetSize() const { return m_size; }
|
||||
// Get the type of file, either file extension or <DIR>, <LINK>, <DRIVE>
|
||||
wxString GetFileType() const;
|
||||
// get the last modification time
|
||||
wxDateTime GetDateTime() const { return m_dateTime; }
|
||||
// Get the time as a formatted string
|
||||
wxString GetModificationTime() const;
|
||||
// in UNIX get rwx for file, in MSW get attributes ARHS
|
||||
wxString GetPermissions() const { return m_permissions; }
|
||||
// Get the id of the image used in a wxImageList
|
||||
int GetImageId() const { return m_image; }
|
||||
|
||||
bool IsFile() const { return !IsDir() && !IsLink() && !IsDrive(); }
|
||||
bool IsDir() const { return (m_type & is_dir ) != 0; }
|
||||
bool IsLink() const { return (m_type & is_link ) != 0; }
|
||||
bool IsExe() const { return (m_type & is_exe ) != 0; }
|
||||
bool IsDrive() const { return (m_type & is_drive) != 0; }
|
||||
|
||||
// Get/Set the type of file, file/dir/drive/link
|
||||
int GetType() const { return m_type; }
|
||||
|
||||
// the FileCtrl fields in report view
|
||||
enum fileListFieldType
|
||||
{
|
||||
FileList_Name,
|
||||
FileList_Size,
|
||||
FileList_Type,
|
||||
FileList_Time,
|
||||
#if defined(__UNIX__) || defined(__WIN32__)
|
||||
FileList_Perm,
|
||||
#endif // defined(__UNIX__) || defined(__WIN32__)
|
||||
FileList_Max
|
||||
};
|
||||
|
||||
// Get the entry for report view of FileCtrl
|
||||
wxString GetEntry( fileListFieldType num ) const;
|
||||
|
||||
// Get a string representation of the file info
|
||||
wxString GetHint() const;
|
||||
// initialize a wxListItem attributes
|
||||
void MakeItem( wxListItem &item );
|
||||
|
||||
// operators
|
||||
FileData& operator = (const FileData& fd) { Copy(fd); return *this; }
|
||||
|
||||
protected:
|
||||
wxString m_fileName;
|
||||
wxString m_filePath;
|
||||
long m_size;
|
||||
wxDateTime m_dateTime;
|
||||
wxString m_permissions;
|
||||
int m_type;
|
||||
int m_image;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FileCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class FileCtrl : public wxListCtrl
|
||||
{
|
||||
public:
|
||||
FileCtrl();
|
||||
FileCtrl( wxWindow *win,
|
||||
wxWindowID id,
|
||||
const wxString &wild,
|
||||
bool showHidden,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_LIST,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString &name = wxT("filelist") );
|
||||
virtual ~FileCtrl();
|
||||
|
||||
virtual void ChangeToListMode();
|
||||
virtual void ChangeToReportMode();
|
||||
virtual void ChangeToSmallIconMode();
|
||||
virtual void ShowHidden( bool show = true );
|
||||
bool GetShowHidden() const { return m_showHidden; }
|
||||
|
||||
virtual long Add( FileData *fd, wxListItem &item );
|
||||
virtual void UpdateItem(const wxListItem &item);
|
||||
virtual void UpdateFiles();
|
||||
virtual void MakeDir();
|
||||
virtual void GoToParentDir();
|
||||
virtual void GoToHomeDir();
|
||||
virtual void GoToDir( const wxString &dir );
|
||||
virtual void SetWild( const wxString &wild );
|
||||
wxString GetWild() const { return m_wild; }
|
||||
wxString GetDir() const { return m_dirName; }
|
||||
|
||||
void OnListDeleteItem( wxListEvent &event );
|
||||
void OnListDeleteAllItems( wxListEvent &event );
|
||||
void OnListEndLabelEdit( wxListEvent &event );
|
||||
void OnListColClick( wxListEvent &event );
|
||||
|
||||
virtual void SortItems(FileData::fileListFieldType field, bool foward);
|
||||
bool GetSortDirection() const { return m_sort_foward; }
|
||||
FileData::fileListFieldType GetSortField() const { return m_sort_field; }
|
||||
|
||||
protected:
|
||||
void FreeItemData(wxListItem& item);
|
||||
void FreeAllItemsData();
|
||||
|
||||
wxString m_dirName;
|
||||
bool m_showHidden;
|
||||
wxString m_wild;
|
||||
|
||||
bool m_sort_foward;
|
||||
FileData::fileListFieldType m_sort_field;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(FileCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _FILEDIALOGGENERICH_
|
||||
|
|
@ -0,0 +1,589 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gtk/filedlg.cpp
|
||||
// Purpose: native implementation of FileDialog
|
||||
// Author: Robert Roebling, Zbigniew Zagorski, Mart Raudsepp
|
||||
// Id: $Id: FileDialogPrivate.cpp,v 1.7 2009-05-25 11:10:00 llucius Exp $
|
||||
// Copyright: (c) 1998 Robert Roebling, 2004 Zbigniew Zagorski, 2005 Mart Raudsepp
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
// Include setup.h to get wxUSE flags for compilers that do not support precompilation of headers
|
||||
#include "wx/setup.h"
|
||||
|
||||
#include "../FileDialog.h"
|
||||
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "private.h"
|
||||
|
||||
#include <unistd.h> // chdir
|
||||
|
||||
#include "wx/intl.h"
|
||||
#include "wx/filename.h" // wxFilename
|
||||
#include "wx/tokenzr.h" // wxStringTokenizer
|
||||
#include "wx/filefn.h" // ::wxGetCwd
|
||||
#include "wx/msgdlg.h" // wxMessageDialog
|
||||
#include "wx/version.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// idle system
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern void wxapp_install_idle_handler();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Open expanders on the dialog (really only the "Browser for other folders")
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
static void SetExpanded(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
if (GTK_IS_EXPANDER(widget))
|
||||
{
|
||||
gtk_expander_set_expanded(GTK_EXPANDER(widget), true);
|
||||
}
|
||||
else if (GTK_IS_CONTAINER(widget))
|
||||
{
|
||||
gtk_container_forall(GTK_CONTAINER(widget), SetExpanded, data);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void gtk_filedialog_show_callback(GtkWidget *widget, FileDialog *dialog)
|
||||
{
|
||||
gtk_container_forall(GTK_CONTAINER(widget), SetExpanded, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "clicked" for OK-button
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
static void gtk_filedialog_ok_callback(GtkWidget *widget, FileDialog *dialog)
|
||||
{
|
||||
int style = dialog->GetWindowStyle();
|
||||
gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
|
||||
|
||||
// gtk version numbers must be identical with the one in ctor (that calls set_do_overwrite_confirmation)
|
||||
#if GTK_CHECK_VERSION(2,7,3)
|
||||
if(gtk_check_version(2,7,3) != NULL)
|
||||
#endif
|
||||
if ((style & wxFD_SAVE) && (style & wxFD_OVERWRITE_PROMPT))
|
||||
{
|
||||
if ( g_file_test(filename, G_FILE_TEST_EXISTS) )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf(
|
||||
_("File '%s' already exists, do you really want to overwrite it?"),
|
||||
wxString(wxConvFileName->cMB2WX(filename)).c_str());
|
||||
|
||||
wxMessageDialog dlg(dialog, msg, _("Confirm"),
|
||||
wxYES_NO | wxICON_QUESTION);
|
||||
if (dlg.ShowModal() != wxID_YES)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// change to the directory where the user went if asked
|
||||
if (style & wxFD_CHANGE_DIR)
|
||||
{
|
||||
// Use chdir to not care about filename encodings
|
||||
gchar* folder = g_path_get_dirname(filename);
|
||||
chdir(folder);
|
||||
g_free(folder);
|
||||
}
|
||||
|
||||
g_free(filename);
|
||||
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
|
||||
event.SetEventObject(dialog);
|
||||
dialog->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "clicked" for Cancel-button
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
|
||||
FileDialog *dialog)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
event.SetEventObject(dialog);
|
||||
dialog->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
static void gtk_filedialog_response_callback(GtkWidget *w,
|
||||
gint response,
|
||||
FileDialog *dialog)
|
||||
{
|
||||
wxapp_install_idle_handler();
|
||||
|
||||
if (response == GTK_RESPONSE_ACCEPT)
|
||||
gtk_filedialog_ok_callback(w, dialog);
|
||||
else if (response == GTK_RESPONSE_CANCEL)
|
||||
gtk_filedialog_cancel_callback(w, dialog);
|
||||
else // "delete"
|
||||
{
|
||||
gtk_filedialog_cancel_callback(w, dialog);
|
||||
dialog->m_destroyed_by_delete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "clicked" for extra-button
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
static void gtk_filedialog_extra_callback(GtkWidget *WXUNUSED(w),
|
||||
FileDialog *dialog)
|
||||
{
|
||||
dialog->ClickButton(dialog->GetFilterIndex());
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __WXGTK24__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FileDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(FileDialog,wxGenericFileDialog)
|
||||
|
||||
BEGIN_EVENT_TABLE(FileDialog,wxGenericFileDialog)
|
||||
EVT_BUTTON(wxID_OK, FileDialog::OnFakeOk)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
FileDialog::FileDialog(wxWindow *parent, const wxString& message,
|
||||
const wxString& defaultDir,
|
||||
const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style, const wxPoint& pos)
|
||||
: wxGenericFileDialog(parent, message, defaultDir, defaultFileName,
|
||||
wildCard, style, pos,
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
wxDefaultSize,
|
||||
wxFileDialogNameStr,
|
||||
#endif
|
||||
true )
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
wxASSERT_MSG( !( (style & wxFD_SAVE) && (style & wxFD_MULTIPLE) ), wxT("FileDialog - wxFD_MULTIPLE used on a save dialog" ) );
|
||||
m_needParent = false;
|
||||
m_destroyed_by_delete = false;
|
||||
|
||||
if (!PreCreation(parent, pos, wxDefaultSize) ||
|
||||
!CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,
|
||||
wxDefaultValidator, wxT("filedialog")))
|
||||
{
|
||||
wxFAIL_MSG( wxT("FileDialog creation failed") );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkFileChooserAction gtk_action;
|
||||
GtkWindow* gtk_parent = NULL;
|
||||
if (parent)
|
||||
gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) );
|
||||
|
||||
const gchar* ok_btn_stock;
|
||||
if ( style & wxFD_SAVE )
|
||||
{
|
||||
gtk_action = GTK_FILE_CHOOSER_ACTION_SAVE;
|
||||
ok_btn_stock = GTK_STOCK_SAVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_action = GTK_FILE_CHOOSER_ACTION_OPEN;
|
||||
ok_btn_stock = GTK_STOCK_OPEN;
|
||||
}
|
||||
|
||||
m_widget = gtk_file_chooser_dialog_new(
|
||||
wxGTK_CONV(m_message),
|
||||
gtk_parent,
|
||||
gtk_action,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
ok_btn_stock, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
// Allow pressing "Enter" key for default action
|
||||
gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_ACCEPT);
|
||||
|
||||
if ( style & wxFD_MULTIPLE )
|
||||
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(m_widget), true);
|
||||
|
||||
// local-only property could be set to false to allow non-local files to be loaded.
|
||||
// In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere
|
||||
// and the GtkFileChooserDialog should probably also be created with a backend,
|
||||
// e.g "gnome-vfs", "default", ... (gtk_file_chooser_dialog_new_with_backend).
|
||||
// Currently local-only is kept as the default - true:
|
||||
// gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(m_widget), true);
|
||||
|
||||
g_signal_connect(G_OBJECT(m_widget), "response",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_response_callback), (gpointer)this);
|
||||
g_signal_connect(G_OBJECT(m_widget), "show",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_show_callback), (gpointer)this);
|
||||
|
||||
SetWildcard(wildCard);
|
||||
|
||||
if ( style & wxFD_SAVE )
|
||||
{
|
||||
if ( !defaultDir.empty() )
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
|
||||
wxConvFileName->cWX2MB(defaultDir));
|
||||
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget),
|
||||
wxConvFileName->cWX2MB(defaultFileName));
|
||||
|
||||
#if GTK_CHECK_VERSION(2,7,3)
|
||||
if (!gtk_check_version(2,7,3))
|
||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(m_widget), FALSE);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !defaultFileName.empty() )
|
||||
{
|
||||
wxString dir;
|
||||
if ( defaultDir.empty() )
|
||||
dir = ::wxGetCwd();
|
||||
else
|
||||
dir = defaultDir;
|
||||
|
||||
gtk_file_chooser_set_filename(
|
||||
GTK_FILE_CHOOSER(m_widget),
|
||||
wxConvFileName->cWX2MB( wxFileName(dir, defaultFileName).GetFullPath() ) );
|
||||
}
|
||||
else if ( !defaultDir.empty() )
|
||||
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
|
||||
wxConvFileName->cWX2MB(defaultDir) );
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::Create( parent, message, defaultDir, defaultFileName, wildCard, style, pos );
|
||||
}
|
||||
|
||||
FileDialog::~FileDialog()
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
if (m_destroyed_by_delete)
|
||||
m_widget = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void FileDialog::OnFakeOk( wxCommandEvent &event )
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
if (Validate() && TransferDataFromWindow())
|
||||
EndModal(wxID_OK);
|
||||
} else
|
||||
#endif
|
||||
wxGenericFileDialog::OnListOk( event );
|
||||
}
|
||||
|
||||
int FileDialog::ShowModal()
|
||||
{
|
||||
if ( !m_buttonlabel.IsEmpty() )
|
||||
{
|
||||
GtkWidget *widget;
|
||||
wxString label = m_buttonlabel;
|
||||
|
||||
label.Replace(wxT("&"), wxT("_"));
|
||||
|
||||
widget = gtk_button_new_with_mnemonic(wxGTK_CONV(label));
|
||||
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(m_widget), widget);
|
||||
g_signal_connect(G_OBJECT(widget), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_extra_callback), (gpointer)this);
|
||||
}
|
||||
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
return wxDialog::ShowModal();
|
||||
else
|
||||
#endif
|
||||
return wxGenericFileDialog::ShowModal();
|
||||
}
|
||||
|
||||
bool FileDialog::Show( bool show )
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
return wxDialog::Show( show );
|
||||
else
|
||||
#endif
|
||||
return wxGenericFileDialog::Show( show );
|
||||
}
|
||||
|
||||
void FileDialog::DoSetSize(int x, int y, int width, int height, int sizeFlags )
|
||||
{
|
||||
if (!m_wxwindow)
|
||||
return;
|
||||
else
|
||||
wxGenericFileDialog::DoSetSize( x, y, width, height, sizeFlags );
|
||||
}
|
||||
|
||||
wxString FileDialog::GetPath() const
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0)) {
|
||||
char *f = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget));
|
||||
wxString path = wxConvFileName->cMB2WX(f);
|
||||
g_free(f);
|
||||
return path;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return wxGenericFileDialog::GetPath();
|
||||
}
|
||||
|
||||
void FileDialog::GetFilenames(wxArrayString& files) const
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
GetPaths(files);
|
||||
for (size_t n = 0; n < files.GetCount(); ++n )
|
||||
{
|
||||
wxFileName file(files[n]);
|
||||
files[n] = file.GetFullName();
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::GetFilenames( files );
|
||||
}
|
||||
|
||||
void FileDialog::GetPaths(wxArrayString& paths) const
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
paths.Empty();
|
||||
if (gtk_file_chooser_get_select_multiple(GTK_FILE_CHOOSER(m_widget)))
|
||||
{
|
||||
GSList *gpathsi = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(m_widget));
|
||||
GSList *gpaths = gpathsi;
|
||||
while (gpathsi)
|
||||
{
|
||||
wxString file(wxConvFileName->cMB2WX((gchar*) gpathsi->data));
|
||||
paths.Add(file);
|
||||
g_free(gpathsi->data);
|
||||
gpathsi = gpathsi->next;
|
||||
}
|
||||
|
||||
g_slist_free(gpaths);
|
||||
}
|
||||
else
|
||||
paths.Add(GetPath());
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::GetPaths( paths );
|
||||
}
|
||||
|
||||
void FileDialog::SetMessage(const wxString& message)
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
m_message = message;
|
||||
SetTitle(message);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::SetMessage( message );
|
||||
}
|
||||
|
||||
void FileDialog::SetPath(const wxString& path)
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
if (path.empty()) return;
|
||||
|
||||
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(path));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::SetPath( path );
|
||||
}
|
||||
|
||||
void FileDialog::SetDirectory(const wxString& dir)
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
if (wxDirExists(dir))
|
||||
{
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::SetDirectory( dir );
|
||||
}
|
||||
|
||||
wxString FileDialog::GetDirectory() const
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
return wxConvFileName->cMB2WX(gtk_file_chooser_get_current_folder( GTK_FILE_CHOOSER(m_widget) ) );
|
||||
else
|
||||
#endif
|
||||
return wxGenericFileDialog::GetDirectory();
|
||||
}
|
||||
|
||||
void FileDialog::SetFilename(const wxString& name)
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
if (GetWindowStyle() & wxFD_SAVE)
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(name));
|
||||
else
|
||||
SetPath(wxFileName(GetDirectory(), name).GetFullPath());
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::SetFilename( name );
|
||||
}
|
||||
|
||||
wxString FileDialog::GetFilename() const
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0)) {
|
||||
char *f = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget));
|
||||
wxFileName name(wxConvFileName->cMB2WX(f));
|
||||
g_free(f);
|
||||
return name.GetFullName();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return wxGenericFileDialog::GetFilename();
|
||||
}
|
||||
|
||||
void FileDialog::SetWildcard(const wxString& wildCard)
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
// parse filters
|
||||
wxArrayString wildDescriptions, wildFilters;
|
||||
if (!wxParseCommonDialogsFilter(wildCard, wildDescriptions, wildFilters))
|
||||
{
|
||||
wxFAIL_MSG( wxT("FileDialog::SetWildCard - bad wildcard string") );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Parsing went fine. Set m_wildCard to be returned by FileDialogBase::GetWildcard
|
||||
m_wildCard = wildCard;
|
||||
|
||||
GtkFileChooser* chooser = GTK_FILE_CHOOSER(m_widget);
|
||||
|
||||
// empty current filter list:
|
||||
GSList* ifilters = gtk_file_chooser_list_filters(chooser);
|
||||
GSList* filters = ifilters;
|
||||
|
||||
while (ifilters)
|
||||
{
|
||||
gtk_file_chooser_remove_filter(chooser,GTK_FILE_FILTER(ifilters->data));
|
||||
ifilters = ifilters->next;
|
||||
}
|
||||
g_slist_free(filters);
|
||||
|
||||
// add parsed to GtkChooser
|
||||
for (size_t n = 0; n < wildFilters.GetCount(); ++n)
|
||||
{
|
||||
GtkFileFilter* filter = gtk_file_filter_new();
|
||||
gtk_file_filter_set_name(filter, wxGTK_CONV(wildDescriptions[n]));
|
||||
|
||||
wxStringTokenizer exttok(wildFilters[n], wxT(";"));
|
||||
while (exttok.HasMoreTokens())
|
||||
{
|
||||
wxString token = exttok.GetNextToken();
|
||||
gtk_file_filter_add_pattern(filter, wxGTK_CONV(token));
|
||||
}
|
||||
|
||||
gtk_file_chooser_add_filter(chooser, filter);
|
||||
}
|
||||
|
||||
// Reset the filter index
|
||||
SetFilterIndex(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::SetWildcard( wildCard );
|
||||
}
|
||||
|
||||
void FileDialog::SetFilterIndex(int filterIndex)
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
gpointer filter;
|
||||
GtkFileChooser *chooser = GTK_FILE_CHOOSER(m_widget);
|
||||
GSList *filters = gtk_file_chooser_list_filters(chooser);
|
||||
|
||||
filter = g_slist_nth_data(filters, filterIndex);
|
||||
|
||||
if (filter != NULL)
|
||||
{
|
||||
gtk_file_chooser_set_filter(chooser, GTK_FILE_FILTER(filter));
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFAIL_MSG( wxT("FileDialog::SetFilterIndex - bad filter index") );
|
||||
}
|
||||
|
||||
g_slist_free(filters);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wxGenericFileDialog::SetFilterIndex( filterIndex );
|
||||
}
|
||||
|
||||
int FileDialog::GetFilterIndex() const
|
||||
{
|
||||
#if defined(__WXGTK24__) && (!defined(__WXGPE__))
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
GtkFileChooser *chooser = GTK_FILE_CHOOSER(m_widget);
|
||||
GtkFileFilter *filter = gtk_file_chooser_get_filter(chooser);
|
||||
GSList *filters = gtk_file_chooser_list_filters(chooser);
|
||||
gint index = g_slist_index(filters, filter);
|
||||
g_slist_free(filters);
|
||||
|
||||
if (index == -1)
|
||||
{
|
||||
wxFAIL_MSG( wxT("FileDialog::GetFilterIndex - bad filter index returned by gtk+") );
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return index;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return wxGenericFileDialog::GetFilterIndex();
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id: FileDialogPrivate.h,v 1.2 2008-05-24 02:57:39 llucius Exp $
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __FILEDIALOGGTKH__
|
||||
#define __FILEDIALOGGTKH__
|
||||
|
||||
#include "wx/generic/filedlgg.h"
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// FileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class FileDialog: public wxGenericFileDialog
|
||||
{
|
||||
public:
|
||||
FileDialog() { }
|
||||
|
||||
FileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
virtual ~FileDialog();
|
||||
|
||||
virtual wxString GetPath() const;
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
virtual wxString GetDirectory() const;
|
||||
virtual wxString GetFilename() const;
|
||||
virtual void GetFilenames(wxArrayString& files) const;
|
||||
virtual int GetFilterIndex() const;
|
||||
|
||||
virtual void SetMessage(const wxString& message);
|
||||
virtual void SetPath(const wxString& path);
|
||||
virtual void SetDirectory(const wxString& dir);
|
||||
virtual void SetFilename(const wxString& name);
|
||||
virtual void SetWildcard(const wxString& wildCard);
|
||||
virtual void SetFilterIndex(int filterIndex);
|
||||
|
||||
virtual int ShowModal();
|
||||
virtual bool Show( bool show = true );
|
||||
|
||||
//private:
|
||||
bool m_destroyed_by_delete;
|
||||
|
||||
// override this from wxTLW since the native
|
||||
// form doesn't have any m_wxwindow
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
|
||||
virtual void ClickButton(int index);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(FileDialog)
|
||||
DECLARE_EVENT_TABLE()
|
||||
void OnFakeOk( wxCommandEvent &event );
|
||||
|
||||
wxString m_buttonlabel;
|
||||
fdCallback m_callback;
|
||||
void *m_cbdata;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,156 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private.h
|
||||
// Purpose: wxGTK private macros, functions &c
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 12.03.02
|
||||
// RCS-ID: $Id: private.h,v 1.3 2008-05-24 02:57:39 llucius Exp $
|
||||
// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_H_
|
||||
#define _WX_GTK_PRIVATE_H_
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
// fail all version tests if the GTK+ version is so ancient that it doesn't
|
||||
// even have GTK_CHECK_VERSION
|
||||
#ifndef GTK_CHECK_VERSION
|
||||
#define GTK_CHECK_VERSION(a, b, c) 0
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#if wxUSE_UNICODE
|
||||
#define wxGTK_CONV(s) wxConvUTF8.cWX2MB(s)
|
||||
#define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX(s)
|
||||
#else
|
||||
#define wxGTK_CONV(s) wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC(s) )
|
||||
#define wxGTK_CONV_BACK(s) wxConvLocal.cWC2WX( (wxConvUTF8.cMB2WC( s ) ) )
|
||||
#endif
|
||||
#else
|
||||
#define wxGTK_CONV(s) s.c_str()
|
||||
#define wxGTK_CONV_BACK(s) s
|
||||
#endif
|
||||
|
||||
|
||||
// GTK+ 2.0 compatibility define is broken when used from C++ as it
|
||||
// casts enum to int implicitly
|
||||
#ifdef __WXGTK20__
|
||||
#undef gtk_signal_disconnect_by_func
|
||||
#define gtk_signal_disconnect_by_func(object,func,data) \
|
||||
gtk_signal_compat_matched((object), (func), (data), \
|
||||
(GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \
|
||||
G_SIGNAL_MATCH_DATA), 0)
|
||||
#endif
|
||||
|
||||
// child is not a member of GTK_BUTTON() any more in GTK+ 2.0
|
||||
#ifdef __WXGTK20__
|
||||
#define BUTTON_CHILD(w) GTK_BIN((w))->child
|
||||
#else
|
||||
#define BUTTON_CHILD(w) GTK_BUTTON((w))->child
|
||||
#endif
|
||||
|
||||
// event_window has disappeared from GtkToggleButton in GTK+ 2.0
|
||||
#ifdef __WXGTK20__
|
||||
#define TOGGLE_BUTTON_EVENT_WIN(w) GTK_BUTTON((w))->event_window
|
||||
#else
|
||||
#define TOGGLE_BUTTON_EVENT_WIN(w) GTK_TOGGLE_BUTTON((w))->event_window
|
||||
#endif
|
||||
|
||||
// gtk_editable_{copy|cut|paste}_clipboard() had an extra argument under
|
||||
// previous GTK+ versions but no more
|
||||
#if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0)
|
||||
#define DUMMY_CLIPBOARD_ARG
|
||||
#else
|
||||
#define DUMMY_CLIPBOARD_ARG ,0
|
||||
#endif
|
||||
|
||||
// _GtkEditable is now private
|
||||
#ifdef __WXGTK20__
|
||||
#define GET_EDITABLE_POS(w) gtk_editable_get_position(GTK_EDITABLE(w))
|
||||
#define SET_EDITABLE_POS(w, pos) \
|
||||
gtk_editable_set_position(GTK_EDITABLE(w), (pos))
|
||||
#else
|
||||
#define GET_EDITABLE_POS(w) GTK_EDITABLE((w))->current_pos
|
||||
#define SET_EDITABLE_POS(w, pos) \
|
||||
GTK_EDITABLE((w))->current_pos = (pos)
|
||||
#endif
|
||||
|
||||
// this GtkNotebook struct field has been renamed
|
||||
#ifdef __WXGTK20__
|
||||
#define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->event_window
|
||||
#else
|
||||
#define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->panel
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#define SCROLLBAR_CBACK_ARG
|
||||
#define GET_SCROLL_TYPE(w) GTK_SCROLL_JUMP
|
||||
#else
|
||||
#define SCROLLBAR_CBACK_ARG
|
||||
#define GET_SCROLL_TYPE(w) GTK_RANGE((w))->scroll_type
|
||||
#endif
|
||||
|
||||
// translate a GTK+ scroll type to a wxEventType
|
||||
inline wxEventType GtkScrollTypeToWx(guint scrollType)
|
||||
{
|
||||
wxEventType command;
|
||||
switch ( scrollType )
|
||||
{
|
||||
case GTK_SCROLL_STEP_BACKWARD:
|
||||
command = wxEVT_SCROLL_LINEUP;
|
||||
break;
|
||||
|
||||
case GTK_SCROLL_STEP_FORWARD:
|
||||
command = wxEVT_SCROLL_LINEDOWN;
|
||||
break;
|
||||
|
||||
case GTK_SCROLL_PAGE_BACKWARD:
|
||||
command = wxEVT_SCROLL_PAGEUP;
|
||||
break;
|
||||
|
||||
case GTK_SCROLL_PAGE_FORWARD:
|
||||
command = wxEVT_SCROLL_PAGEDOWN;
|
||||
break;
|
||||
|
||||
default:
|
||||
command = wxEVT_SCROLL_THUMBTRACK;
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
|
||||
{
|
||||
// GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
|
||||
return GtkScrollTypeToWx(scrollType) +
|
||||
wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP;
|
||||
}
|
||||
|
||||
// Needed for implementing e.g. combobox on wxGTK within a modal dialog.
|
||||
void wxAddGrab(wxWindow* window);
|
||||
void wxRemoveGrab(wxWindow* window);
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
// Escapes string so that it is valid Pango markup XML string:
|
||||
wxString wxEscapeStringForPangoMarkup(const wxString& str);
|
||||
#endif
|
||||
|
||||
// The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
|
||||
// GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
|
||||
// for Solaris 9 x86.
|
||||
#ifdef NEED_GTK_ICON_SIZE_LOOKUP
|
||||
extern "C" gboolean gtk_icon_size_lookup (GtkIconSize size,
|
||||
gint *width,
|
||||
gint *height);
|
||||
#endif
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_H_
|
||||
|
|
@ -0,0 +1,641 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.cpp
|
||||
// Purpose: wxFileDialog
|
||||
// Author: Stefan Csomor
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 1998-01-01
|
||||
// RCS-ID: $Id: FileDialogPrivate.cpp,v 1.6 2009-07-26 08:58:50 llucius Exp $
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/tokenzr.h"
|
||||
#include "wx/filename.h"
|
||||
|
||||
#include "../FileDialog.h"
|
||||
|
||||
#ifndef __DARWIN__
|
||||
#include "PLStringFuncs.h"
|
||||
#endif
|
||||
|
||||
IMPLEMENT_CLASS(FileDialog, wxFileDialogBase)
|
||||
|
||||
// begin wxmac
|
||||
|
||||
#include "wx/mac/private.h"
|
||||
|
||||
#ifndef __DARWIN__
|
||||
#include <Navigation.h>
|
||||
#endif
|
||||
|
||||
extern bool gUseNavServices ;
|
||||
|
||||
#define kCustom 'cstm'
|
||||
#define kChoice 1
|
||||
#define kButton 2
|
||||
|
||||
static ControlID kChoiceID = { kCustom, kChoice };
|
||||
static ControlID kButtonID = { kCustom, kButton };
|
||||
|
||||
// the data we need to pass to our standard file hook routine
|
||||
// includes a pointer to the dialog, a pointer to the standard
|
||||
// file reply record (so we can inspect the current selection)
|
||||
// and a copy of the "previous" file spec of the reply record
|
||||
// so we can see if the selection has changed
|
||||
|
||||
struct CustomData {
|
||||
FileDialog *me;
|
||||
Rect bounds;
|
||||
ControlRef userpane;
|
||||
ControlRef choice;
|
||||
ControlRef button;
|
||||
MenuRef menu;
|
||||
wxArrayString name;
|
||||
wxArrayString extensions;
|
||||
wxArrayLong filtermactypes;
|
||||
wxString defaultLocation;
|
||||
int currentfilter;
|
||||
bool saveMode;
|
||||
bool showing;
|
||||
};
|
||||
|
||||
typedef struct CustomData
|
||||
CustomData, *CustomDataPtr;
|
||||
|
||||
static pascal void NavEventProc(
|
||||
NavEventCallbackMessage inSelector,
|
||||
NavCBRecPtr ioParams,
|
||||
NavCallBackUserData ioUserData);
|
||||
|
||||
static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc);
|
||||
|
||||
static void HandleAdjustRect(NavCBRecPtr callBackParms, CustomData * data)
|
||||
{
|
||||
Rect rect;
|
||||
|
||||
if (!data->userpane)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GetControlBounds(data->userpane, &rect);
|
||||
|
||||
SInt16 w = rect.right - rect.left;
|
||||
SInt16 h = rect.bottom - rect.top;
|
||||
SInt16 cw = callBackParms->customRect.right - callBackParms->customRect.left;
|
||||
SInt16 ch = callBackParms->customRect.bottom - callBackParms->customRect.top;
|
||||
|
||||
MoveControl(data->userpane,
|
||||
callBackParms->customRect.left + ((cw-w) / 2),
|
||||
callBackParms->customRect.top + ((ch-h) / 2));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void HandleCarbonCustomizeEvent(NavCBRecPtr callBackParms, CustomData * data)
|
||||
{
|
||||
if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0))
|
||||
{
|
||||
callBackParms->customRect.right = callBackParms->customRect.left +
|
||||
(data->bounds.right - data->bounds.left);
|
||||
callBackParms->customRect.bottom = callBackParms->customRect.top +
|
||||
(data->bounds.bottom - data->bounds.top);
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleCustomMouseDown(NavCBRecPtr callBackParms, CustomData *data)
|
||||
{
|
||||
EventRecord *evt = callBackParms->eventData.eventDataParms.event;
|
||||
Point where = evt->where;
|
||||
|
||||
GlobalToLocal(&where);
|
||||
|
||||
ControlRef control = FindControlUnderMouse(where, callBackParms->window, NULL);
|
||||
|
||||
if (control != NULL)
|
||||
{
|
||||
ControlID cid;
|
||||
GetControlID(control, &cid);
|
||||
|
||||
HandleControlClick(control, where, evt->modifiers, (ControlActionUPP)-1L);
|
||||
|
||||
if (cid.signature == kCustom)
|
||||
{
|
||||
switch (cid.id)
|
||||
{
|
||||
case kChoice:
|
||||
{
|
||||
MenuRef menu;
|
||||
UInt32 v;
|
||||
menu = GetControlPopupMenuRef(control);
|
||||
v = GetControl32BitValue(control) - 1;
|
||||
const size_t numFilters = data->extensions.GetCount();
|
||||
|
||||
if (v < numFilters)
|
||||
{
|
||||
data->currentfilter = v;
|
||||
if (data->saveMode)
|
||||
{
|
||||
int i = data->currentfilter;
|
||||
|
||||
wxString extension = data->extensions[i].AfterLast('.') ;
|
||||
extension.MakeLower() ;
|
||||
wxString sfilename ;
|
||||
|
||||
wxMacCFStringHolder cfString(NavDialogGetSaveFileName(callBackParms->context), false);
|
||||
sfilename = cfString.AsString() ;
|
||||
#if 0
|
||||
int pos = sfilename.Find('.', true) ;
|
||||
if (pos != wxNOT_FOUND)
|
||||
{
|
||||
sfilename = sfilename.Left(pos + 1) + extension;
|
||||
cfString.Assign(sfilename, wxFONTENCODING_DEFAULT);
|
||||
NavDialogSetSaveFileName(callBackParms->context, cfString);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
NavCustomControl(callBackParms->context, kNavCtlBrowserRedraw, NULL);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case kButton:
|
||||
{
|
||||
data->me->ClickButton(GetControl32BitValue(data->choice) - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleNormalEvents(NavCBRecPtr callBackParms, CustomData *data)
|
||||
{
|
||||
switch (callBackParms->eventData.eventDataParms.event->what)
|
||||
{
|
||||
case mouseDown:
|
||||
{
|
||||
HandleCustomMouseDown(callBackParms, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleStartEvent(NavCBRecPtr callBackParms, CustomData *data)
|
||||
{
|
||||
CreateUserPaneControl(callBackParms->window, &data->bounds, kControlSupportsEmbedding, &data->userpane);
|
||||
EmbedControl(data->choice, data->userpane);
|
||||
EmbedControl(data->button, data->userpane);
|
||||
|
||||
NavCustomControl(callBackParms->context, kNavCtlAddControl, data->userpane);
|
||||
|
||||
HandleAdjustRect(callBackParms, data);
|
||||
|
||||
if (data && !(data->defaultLocation).IsEmpty())
|
||||
{
|
||||
// Set default location for the modern Navigation APIs
|
||||
// Apple Technical Q&A 1151
|
||||
FSSpec theFSSpec;
|
||||
wxMacFilename2FSSpec(data->defaultLocation, &theFSSpec);
|
||||
AEDesc theLocation = {typeNull, NULL};
|
||||
if (noErr == ::AECreateDesc(typeFSS, &theFSSpec, sizeof(FSSpec), &theLocation))
|
||||
::NavCustomControl(callBackParms->context, kNavCtlSetLocation, (void *) &theLocation);
|
||||
}
|
||||
}
|
||||
|
||||
static pascal void NavEventProc(NavEventCallbackMessage inSelector,
|
||||
NavCBRecPtr ioParams,
|
||||
NavCallBackUserData ioUserData)
|
||||
{
|
||||
CustomData * data = (CustomData *) ioUserData ;
|
||||
|
||||
switch (inSelector)
|
||||
{
|
||||
case kNavCBCustomize:
|
||||
{
|
||||
HandleCarbonCustomizeEvent(ioParams, data);
|
||||
break;
|
||||
}
|
||||
|
||||
case kNavCBStart:
|
||||
{
|
||||
HandleStartEvent(ioParams, data);
|
||||
break;
|
||||
}
|
||||
|
||||
case kNavCBAdjustRect:
|
||||
{
|
||||
HandleAdjustRect(ioParams, data);
|
||||
break;
|
||||
}
|
||||
|
||||
case kNavCBEvent:
|
||||
{
|
||||
HandleNormalEvents(ioParams, data);
|
||||
break;
|
||||
}
|
||||
|
||||
case kNavCBTerminate:
|
||||
{
|
||||
data->showing = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MakeUserDataRec(CustomData *myData, const wxString& filter)
|
||||
{
|
||||
myData->currentfilter = 0 ;
|
||||
|
||||
if (!filter.IsEmpty())
|
||||
{
|
||||
wxString filter2(filter) ;
|
||||
int filterIndex = 0;
|
||||
bool isName = true ;
|
||||
wxString current ;
|
||||
for( unsigned int i = 0; i < filter2.Len() ; i++ )
|
||||
{
|
||||
if( filter2.GetChar(i) == wxT('|') )
|
||||
{
|
||||
if( isName )
|
||||
{
|
||||
myData->name.Add( current ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
myData->extensions.Add( current.MakeUpper() ) ;
|
||||
++filterIndex ;
|
||||
}
|
||||
isName = !isName ;
|
||||
current = wxEmptyString ;
|
||||
}
|
||||
else
|
||||
{
|
||||
current += filter2.GetChar(i) ;
|
||||
}
|
||||
}
|
||||
// we allow for compatibility reason to have a single filter expression (like *.*) without
|
||||
// an explanatory text, in that case the first part is name and extension at the same time
|
||||
|
||||
wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ;
|
||||
if ( current.IsEmpty() )
|
||||
myData->extensions.Add( myData->name[filterIndex] ) ;
|
||||
else
|
||||
myData->extensions.Add( current.MakeUpper() ) ;
|
||||
if ( filterIndex == 0 || isName )
|
||||
myData->name.Add( current.MakeUpper() ) ;
|
||||
|
||||
++filterIndex ;
|
||||
|
||||
const size_t extCount = myData->extensions.GetCount();
|
||||
for ( size_t i = 0 ; i < extCount; i++ )
|
||||
{
|
||||
wxUint32 fileType;
|
||||
wxUint32 creator;
|
||||
wxString extension = myData->extensions[i];
|
||||
|
||||
if (extension.GetChar(0) == '*')
|
||||
extension = extension.Mid(1); // Remove leading *
|
||||
|
||||
if (extension.GetChar(0) == '.')
|
||||
{
|
||||
extension = extension.Mid(1); // Remove leading .
|
||||
}
|
||||
|
||||
if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator ))
|
||||
{
|
||||
myData->filtermactypes.Add( (OSType)fileType );
|
||||
}
|
||||
else
|
||||
{
|
||||
myData->filtermactypes.Add( '****' ) ; // We'll fail safe if it's not recognized
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Boolean CheckFile( const wxString &filename , OSType type , CustomDataPtr data)
|
||||
{
|
||||
wxString file(filename) ;
|
||||
file.MakeUpper() ;
|
||||
|
||||
if ( data->extensions.GetCount() > 0 )
|
||||
{
|
||||
int i = data->currentfilter ;
|
||||
if ( data->extensions[i].Right(2) == wxT(".*") )
|
||||
return true ;
|
||||
|
||||
{
|
||||
if ( type == (OSType)data->filtermactypes[i] )
|
||||
return true ;
|
||||
|
||||
wxStringTokenizer tokenizer( data->extensions[i] , wxT(";") ) ;
|
||||
while( tokenizer.HasMoreTokens() )
|
||||
{
|
||||
wxString extension = tokenizer.GetNextToken() ;
|
||||
if ( extension.GetChar(0) == '*' )
|
||||
extension = extension.Mid(1) ;
|
||||
|
||||
if ( file.Len() >= extension.Len() && extension == file.Right(extension.Len() ) )
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
// end wxmac
|
||||
|
||||
FileDialog::FileDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& defaultDir,
|
||||
const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style,
|
||||
const wxPoint& pos)
|
||||
:wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos)
|
||||
{
|
||||
wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ;
|
||||
m_callback = NULL;
|
||||
m_cbdata = NULL;
|
||||
m_dialogStyle = style;
|
||||
}
|
||||
|
||||
static pascal Boolean CrossPlatformFilterCallback (
|
||||
AEDesc *theItem,
|
||||
void *info,
|
||||
void *callBackUD,
|
||||
NavFilterModes filterMode
|
||||
)
|
||||
{
|
||||
bool display = true;
|
||||
CustomDataPtr data = (CustomDataPtr) callBackUD ;
|
||||
|
||||
if (filterMode == kNavFilteringBrowserList)
|
||||
{
|
||||
NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ;
|
||||
if ( !theInfo->isFolder )
|
||||
{
|
||||
if (theItem->descriptorType == typeFSS )
|
||||
{
|
||||
FSSpec spec;
|
||||
memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ;
|
||||
wxString file = wxMacMakeStringFromPascal( spec.name ) ;
|
||||
display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
|
||||
}
|
||||
else if ( theItem->descriptorType == typeFSRef )
|
||||
{
|
||||
FSRef fsref ;
|
||||
memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ;
|
||||
wxString file = wxMacFSRefToPath( &fsref ) ;
|
||||
display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
int FileDialog::ShowModal()
|
||||
{
|
||||
OSErr err;
|
||||
NavDialogCreationOptions dialogCreateOptions;
|
||||
// set default options
|
||||
::NavGetDefaultDialogCreationOptions(&dialogCreateOptions);
|
||||
|
||||
// this was always unset in the old code
|
||||
dialogCreateOptions.optionFlags &= ~kNavSelectDefaultLocation;
|
||||
|
||||
wxMacCFStringHolder message(m_message, GetFont().GetEncoding());
|
||||
dialogCreateOptions.windowTitle = message;
|
||||
|
||||
wxMacCFStringHolder defaultFileName(m_fileName, GetFont().GetEncoding());
|
||||
dialogCreateOptions.saveFileName = defaultFileName;
|
||||
|
||||
NavDialogRef dialog;
|
||||
NavObjectFilterUPP navFilterUPP = NULL;
|
||||
CustomData myData;
|
||||
|
||||
SetRect(&myData.bounds, 0, 0, 0, 0);
|
||||
myData.me = this;
|
||||
myData.defaultLocation = m_dir;
|
||||
myData.userpane = NULL;
|
||||
myData.choice = NULL;
|
||||
myData.button = NULL;
|
||||
myData.saveMode = false;
|
||||
myData.showing = true;
|
||||
|
||||
Rect r;
|
||||
SInt16 base;
|
||||
SInt16 margin = 3;
|
||||
SInt16 gap = 0;
|
||||
|
||||
MakeUserDataRec(&myData , m_wildCard);
|
||||
myData.currentfilter = m_filterIndex;
|
||||
size_t numFilters = myData.extensions.GetCount();
|
||||
if (numFilters)
|
||||
{
|
||||
CreateNewMenu(0, 0, &myData.menu);
|
||||
|
||||
for ( size_t i = 0 ; i < numFilters ; ++i )
|
||||
{
|
||||
::AppendMenuItemTextWithCFString(myData.menu,
|
||||
wxMacCFStringHolder(myData.name[i],
|
||||
GetFont().GetEncoding()),
|
||||
4,
|
||||
i,
|
||||
NULL);
|
||||
}
|
||||
|
||||
SetRect(&r, 0, margin, 0, 0);
|
||||
CreatePopupButtonControl(NULL, &r, CFSTR("Format:"), -12345, false, 50, teJustLeft, normal, &myData.choice);
|
||||
SetControlID(myData.choice, &kChoiceID);
|
||||
SetControlPopupMenuRef(myData.choice, myData.menu);
|
||||
SetControl32BitMinimum(myData.choice, 1);
|
||||
SetControl32BitMaximum(myData.choice, myData.name.GetCount());
|
||||
SetControl32BitValue(myData.choice, myData.currentfilter + 1);
|
||||
GetBestControlRect(myData.choice, &r, &base);
|
||||
SizeControl(myData.choice, r.right - r.left, r.bottom - r.top);
|
||||
UnionRect(&myData.bounds, &r, &myData.bounds);
|
||||
gap = 15;
|
||||
}
|
||||
|
||||
if (!m_buttonlabel.IsEmpty())
|
||||
{
|
||||
wxMacCFStringHolder cfString(wxStripMenuCodes(m_buttonlabel).c_str(), wxFONTENCODING_DEFAULT);
|
||||
SetRect(&r, myData.bounds.right + gap, margin, 0, 0);
|
||||
CreatePushButtonControl(NULL, &r, cfString, &myData.button);
|
||||
SetControlID(myData.button, &kButtonID);
|
||||
GetBestControlRect(myData.button, &r, &base);
|
||||
SizeControl(myData.button, r.right - r.left, r.bottom - r.top);
|
||||
UnionRect(&myData.bounds, &r, &myData.bounds);
|
||||
}
|
||||
|
||||
// Expand bounding rectangle to include a top and bottom margin
|
||||
myData.bounds.top -= margin;
|
||||
myData.bounds.bottom += margin;
|
||||
|
||||
dialogCreateOptions.optionFlags |= kNavNoTypePopup;
|
||||
|
||||
if (m_dialogStyle & wxFD_SAVE)
|
||||
{
|
||||
dialogCreateOptions.modality = kWindowModalityWindowModal;
|
||||
dialogCreateOptions.parentWindow = (WindowRef) GetParent()->MacGetTopLevelWindowRef();
|
||||
|
||||
myData.saveMode = true;
|
||||
|
||||
if (!numFilters)
|
||||
{
|
||||
dialogCreateOptions.optionFlags |= kNavNoTypePopup;
|
||||
}
|
||||
dialogCreateOptions.optionFlags |= kNavDontAutoTranslate;
|
||||
dialogCreateOptions.optionFlags |= kNavDontAddTranslateItems;
|
||||
|
||||
// The extension is important
|
||||
if (numFilters < 2)
|
||||
dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension;
|
||||
|
||||
#if TARGET_API_MAC_OSX
|
||||
if (!(m_dialogStyle & wxFD_OVERWRITE_PROMPT))
|
||||
{
|
||||
dialogCreateOptions.optionFlags |= kNavDontConfirmReplacement;
|
||||
}
|
||||
#endif
|
||||
|
||||
err = ::NavCreatePutFileDialog(&dialogCreateOptions,
|
||||
// Suppresses the 'Default' (top) menu item
|
||||
kNavGenericSignature, kNavGenericSignature,
|
||||
sStandardNavEventFilter,
|
||||
&myData, // for defaultLocation
|
||||
&dialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//let people select bundles/programs in dialogs
|
||||
dialogCreateOptions.optionFlags |= kNavSupportPackages;
|
||||
|
||||
navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback);
|
||||
err = ::NavCreateGetFileDialog(&dialogCreateOptions,
|
||||
NULL, // NavTypeListHandle
|
||||
sStandardNavEventFilter,
|
||||
NULL, // NavPreviewUPP
|
||||
navFilterUPP,
|
||||
(void *) &myData, // inClientData
|
||||
&dialog);
|
||||
}
|
||||
|
||||
if (err == noErr)
|
||||
err = ::NavDialogRun(dialog);
|
||||
|
||||
if (err == noErr)
|
||||
{
|
||||
WindowRef w = NavDialogGetWindow(dialog);
|
||||
Rect r;
|
||||
|
||||
// This creates our "fake" dialog with the same dimensions as the sheet so
|
||||
// that Options dialogs will center properly on the sheet. The "fake" dialog
|
||||
// is never actually seen.
|
||||
GetWindowBounds(w,kWindowStructureRgn, &r);
|
||||
wxDialog::Create(NULL, // no parent...otherwise strange things happen
|
||||
wxID_ANY,
|
||||
wxEmptyString,
|
||||
wxPoint(r.left, r.top),
|
||||
wxSize(r.right - r.left, r.bottom - r.top));
|
||||
|
||||
BeginAppModalStateForWindow(w);
|
||||
|
||||
while (myData.showing)
|
||||
{
|
||||
wxTheApp->MacDoOneEvent();
|
||||
}
|
||||
|
||||
EndAppModalStateForWindow(w);
|
||||
}
|
||||
|
||||
// clean up filter related data, etc.
|
||||
if (navFilterUPP)
|
||||
::DisposeNavObjectFilterUPP(navFilterUPP);
|
||||
|
||||
if (err != noErr)
|
||||
return wxID_CANCEL;
|
||||
|
||||
NavReplyRecord navReply;
|
||||
err = ::NavDialogGetReply(dialog, &navReply);
|
||||
if (err == noErr && navReply.validRecord)
|
||||
{
|
||||
AEKeyword theKeyword;
|
||||
DescType actualType;
|
||||
Size actualSize;
|
||||
FSRef theFSRef;
|
||||
wxString thePath ;
|
||||
|
||||
m_filterIndex = myData.currentfilter;
|
||||
|
||||
long count;
|
||||
::AECountItems(&navReply.selection , &count);
|
||||
for (long i = 1; i <= count; ++i)
|
||||
{
|
||||
err = ::AEGetNthPtr(&(navReply.selection), i, typeFSRef, &theKeyword, &actualType,
|
||||
&theFSRef, sizeof(theFSRef), &actualSize);
|
||||
if (err != noErr)
|
||||
break;
|
||||
|
||||
if (m_dialogStyle & wxFD_SAVE)
|
||||
thePath = wxMacFSRefToPath( &theFSRef , navReply.saveFileName ) ;
|
||||
else
|
||||
thePath = wxMacFSRefToPath( &theFSRef ) ;
|
||||
|
||||
if (!thePath)
|
||||
{
|
||||
::NavDisposeReply(&navReply);
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
m_path = ConvertSlashInFileName(thePath);
|
||||
m_paths.Add(m_path);
|
||||
m_fileName = wxFileNameFromPath(m_path);
|
||||
m_fileNames.Add(m_fileName);
|
||||
}
|
||||
// set these to the first hit
|
||||
m_path = m_paths[0];
|
||||
m_fileName = wxFileNameFromPath(m_path);
|
||||
m_dir = wxPathOnly(m_path);
|
||||
}
|
||||
::NavDisposeReply(&navReply);
|
||||
|
||||
return (err == noErr) ? wxID_OK : wxID_CANCEL;
|
||||
}
|
||||
|
||||
wxString FileDialog::ConvertSlashInFileName(const wxString& filePath)
|
||||
{
|
||||
#if TARGET_API_MAC_OSX
|
||||
wxString path = filePath;
|
||||
wxString filename;
|
||||
wxString newPath = filePath;
|
||||
int pathLen = 1;
|
||||
while (!wxDirExists(wxPathOnly(newPath)) && ! path.IsEmpty())
|
||||
{
|
||||
path = newPath.BeforeLast('/');
|
||||
filename = newPath.AfterLast('/');
|
||||
newPath = path;
|
||||
newPath += ':';
|
||||
newPath += filename;
|
||||
}
|
||||
return newPath;
|
||||
#else
|
||||
return filePath;
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.h
|
||||
// Purpose: wxFileDialog class
|
||||
// Author: Stefan Csomor
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 1998-01-01
|
||||
// RCS-ID: $Id: FileDialogPrivate.h,v 1.3 2008-05-24 02:57:39 llucius Exp $
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _FILEDIALOGMAC_H_
|
||||
#define _FILEDIALOGMAC_H_
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// FileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class FileDialog: public wxFileDialogBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(FileDialog)
|
||||
protected:
|
||||
long m_dialogStyle;
|
||||
wxArrayString m_fileNames;
|
||||
wxArrayString m_paths;
|
||||
|
||||
wxString m_buttonlabel;
|
||||
fdCallback m_callback;
|
||||
void *m_cbdata;
|
||||
static wxString ConvertSlashInFileName(const wxString& filePath);
|
||||
|
||||
public:
|
||||
FileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; }
|
||||
virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; }
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
// not supported for file dialog, RR
|
||||
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||
|
||||
virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
|
||||
virtual void ClickButton(int index);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,916 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/msw/filedlg.cpp
|
||||
// Purpose: wxFileDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: FileDialogPrivate.cpp,v 1.19 2010-01-19 09:08:39 llucius Exp $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_FILEDLG && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/msw/wrapcdlg.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "wx/filename.h"
|
||||
#include "wx/tokenzr.h"
|
||||
#include "wx/math.h"
|
||||
|
||||
#include "wx/msw/missing.h"
|
||||
|
||||
#include "../FileDialog.h"
|
||||
|
||||
#include <shlobj.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WIN32__
|
||||
# define wxMAXPATH 65534
|
||||
#else
|
||||
# define wxMAXPATH 1024
|
||||
#endif
|
||||
|
||||
# define wxMAXFILE 1024
|
||||
|
||||
# define wxMAXEXT 5
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// standard dialog size
|
||||
static wxRect gs_rectDialog(0, 0, 428, 266);
|
||||
|
||||
// true to use custom filtering code (anything less than Win7)
|
||||
static bool gs_customFilter = true;
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
IMPLEMENT_CLASS(FileDialog, wxFileDialogBase)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Alternative implementation for SHBindToParent() since older
|
||||
// shell32.dll version do not supply it.
|
||||
//
|
||||
// By jim@mvps.org
|
||||
// http://www.geocities.com/SiliconValley/2060/
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include <ShlObj.h>
|
||||
#include <ComDef.h>
|
||||
|
||||
HRESULT SHBindToParentLocal(
|
||||
LPCITEMIDLIST pidl,
|
||||
REFIID riid,
|
||||
VOID** ppv,
|
||||
LPCITEMIDLIST* ppidlLast)
|
||||
{
|
||||
if (!ppv)
|
||||
return E_POINTER;
|
||||
|
||||
// There must be at least one item ID.
|
||||
if (!pidl || !pidl->mkid.cb)
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Get the root folder.
|
||||
IShellFolderPtr desktop;
|
||||
HRESULT hr = SHGetDesktopFolder(&desktop);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// Walk to the penultimate item ID.
|
||||
LPCITEMIDLIST marker = pidl;
|
||||
for (;;)
|
||||
{
|
||||
LPCITEMIDLIST next = reinterpret_cast<LPCITEMIDLIST>(
|
||||
marker->mkid.abID - sizeof(marker->mkid.cb) + marker->mkid.cb);
|
||||
if (!next->mkid.cb)
|
||||
break;
|
||||
marker = next;
|
||||
};
|
||||
|
||||
if (marker == pidl)
|
||||
{
|
||||
// There was only a single item ID, so bind to the root folder.
|
||||
hr = desktop->QueryInterface(riid, ppv);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy the ID list, truncating the last item.
|
||||
int length = marker->mkid.abID - pidl->mkid.abID;
|
||||
if (LPITEMIDLIST parent_id = reinterpret_cast<LPITEMIDLIST>(
|
||||
malloc(length + sizeof(pidl->mkid.cb))))
|
||||
{
|
||||
LPBYTE raw_data = reinterpret_cast<LPBYTE>(parent_id);
|
||||
memcpy(raw_data, pidl, length);
|
||||
memset(raw_data + length, 0, sizeof(pidl->mkid.cb));
|
||||
hr = desktop->BindToObject(parent_id, 0, riid, ppv);
|
||||
free(parent_id);
|
||||
}
|
||||
else
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
// Return a pointer to the last item ID.
|
||||
if (ppidlLast)
|
||||
*ppidlLast = marker;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// hook function for moving the dialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
UINT_PTR APIENTRY
|
||||
FileDialogHookFunction(HWND hDlg,
|
||||
UINT iMsg,
|
||||
WPARAM WXUNUSED(wParam),
|
||||
LPARAM lParam)
|
||||
{
|
||||
HWND hwndDialog;
|
||||
hwndDialog = ::GetParent( hDlg );
|
||||
switch (iMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
#ifdef _WIN64
|
||||
SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam);
|
||||
#else
|
||||
SetWindowLong(hDlg, GWL_USERDATA, lParam);
|
||||
#endif
|
||||
}
|
||||
case WM_DESTROY:
|
||||
{
|
||||
RECT dlgRect;
|
||||
GetWindowRect( hwndDialog, & dlgRect );
|
||||
gs_rectDialog.x = dlgRect.left;
|
||||
gs_rectDialog.y = dlgRect.top;
|
||||
gs_rectDialog.width = dlgRect.right - dlgRect.left;
|
||||
gs_rectDialog.height = dlgRect.bottom - dlgRect.top;
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
OFNOTIFY * pNotifyCode;
|
||||
pNotifyCode = (LPOFNOTIFY) lParam;
|
||||
if (CDN_INITDONE == (pNotifyCode->hdr).code)
|
||||
{
|
||||
SetWindowPos( hwndDialog, HWND_TOP,
|
||||
gs_rectDialog.x,
|
||||
gs_rectDialog.y,
|
||||
gs_rectDialog.width,
|
||||
gs_rectDialog.height,
|
||||
SWP_NOZORDER|SWP_NOSIZE);
|
||||
|
||||
OPENFILENAME *ofn = (OPENFILENAME *)
|
||||
GetWindowLongPtr(hDlg, GWLP_USERDATA);
|
||||
FileDialog *me = (FileDialog *)
|
||||
ofn->lCustData;
|
||||
|
||||
if (!me->m_buttonlabel.IsEmpty())
|
||||
{
|
||||
CommDlg_OpenSave_SetControlText( hwndDialog,
|
||||
pshHelp,
|
||||
(LPTSTR)me->m_buttonlabel.c_str());
|
||||
}
|
||||
}
|
||||
else if (CDN_HELP == (pNotifyCode->hdr).code)
|
||||
{
|
||||
OPENFILENAME *ofn = (OPENFILENAME *)
|
||||
GetWindowLongPtr(hDlg, GWLP_USERDATA);
|
||||
FileDialog *me = (FileDialog *)
|
||||
ofn->lCustData;
|
||||
HWND w = GetFocus();
|
||||
int index = SendDlgItemMessage(hwndDialog,
|
||||
cmb1,
|
||||
CB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
EnableWindow(hwndDialog, FALSE);
|
||||
me->ClickButton(index);
|
||||
EnableWindow(hwndDialog, TRUE);
|
||||
SetFocus(w);
|
||||
}
|
||||
else if (CDN_SELCHANGE == (pNotifyCode->hdr).code && gs_customFilter)
|
||||
{
|
||||
OPENFILENAME *ofn = (OPENFILENAME *)
|
||||
GetWindowLongPtr(hDlg, GWLP_USERDATA);
|
||||
FileDialog *me = (FileDialog *) ofn->lCustData;
|
||||
me->FilterFiles(hDlg, false);
|
||||
}
|
||||
else if (CDN_TYPECHANGE == (pNotifyCode->hdr).code && gs_customFilter)
|
||||
{
|
||||
OPENFILENAME *ofn = (OPENFILENAME *)
|
||||
GetWindowLongPtr(hDlg, GWLP_USERDATA);
|
||||
FileDialog *me = (FileDialog *) ofn->lCustData;
|
||||
me->ParseFilter(ofn->nFilterIndex);
|
||||
me->FilterFiles(hDlg, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// do the default processing
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define WM_GETISHELLBROWSER WM_USER + 7
|
||||
|
||||
void FileDialog::FilterFiles(HWND hDlg, bool refresh)
|
||||
{
|
||||
HWND parent = ::GetParent(hDlg);
|
||||
IShellFolder *ishell = NULL;
|
||||
IShellBrowser *ishellbrowser = NULL; // Does not have to be released
|
||||
IShellView *ishellview = NULL;
|
||||
IFolderView *ifolderview = NULL;
|
||||
LPMALLOC imalloc = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
// Get pointer to the ListView control
|
||||
HWND lv = ::GetDlgItem(::GetDlgItem(parent, lst2), 1);
|
||||
if (lv == NULL)
|
||||
{
|
||||
wxASSERT(lv != NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get shell's memory allocation interface (must be Release()'d)
|
||||
hr = SHGetMalloc(&imalloc);
|
||||
if ((hr != NOERROR) || (imalloc == NULL))
|
||||
{
|
||||
wxASSERT((hr == NOERROR) && (imalloc != NULL));
|
||||
return;
|
||||
}
|
||||
|
||||
// Get IShellBrowser interface for current dialog
|
||||
ishellbrowser = (IShellBrowser*)::SendMessage(parent, WM_GETISHELLBROWSER, 0, 0);
|
||||
if (ishellbrowser)
|
||||
{
|
||||
// Get IShellBrowser interface for returned browser
|
||||
if (ishellbrowser->QueryActiveShellView(&ishellview) == S_OK)
|
||||
{
|
||||
// Get the IFolderView interface...available on XP or greater
|
||||
ishellview->QueryInterface(IID_IFolderView, (void **)&ifolderview);
|
||||
}
|
||||
}
|
||||
|
||||
// Init
|
||||
LVITEM lvi;
|
||||
wxZeroMemory(lvi);
|
||||
|
||||
// Process all items
|
||||
int fltcnt = (int) m_Filters.GetCount();
|
||||
int itmcnt = ::SendMessage(lv, LVM_GETITEMCOUNT, 0, 0);
|
||||
for (int itm = 0; itm < itmcnt; itm++)
|
||||
{
|
||||
// Retrieve the file IDL
|
||||
lvi.iItem = itm;
|
||||
lvi.mask = LVIF_PARAM;
|
||||
if (ListView_GetItem(lv, &lvi) != TRUE)
|
||||
{
|
||||
wxASSERT(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
LPCITEMIDLIST fidl = (LPCITEMIDLIST) lvi.lParam;
|
||||
|
||||
// On Vista, lParam no longer contains the pidl so retrieve it via the
|
||||
// IFolderView interface. This interface is only available on XP or higher
|
||||
// so if that limitation isn't workable, use IShellView::GetItemObject() to
|
||||
// retrieve items.
|
||||
if (fidl == NULL && ifolderview != NULL)
|
||||
{
|
||||
ifolderview->Item(itm, (LPITEMIDLIST *) &fidl);
|
||||
}
|
||||
|
||||
if (fidl == NULL)
|
||||
{
|
||||
wxASSERT(fidl != NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
// Retrieve the IShellFolder interface of the parent (must be Release()'d)
|
||||
if (ishell == NULL)
|
||||
{
|
||||
hr = SHBindToParentLocal(fidl, IID_IShellFolder, (void **)&ishell, NULL);
|
||||
if (!SUCCEEDED(hr))
|
||||
{
|
||||
wxASSERT(SUCCEEDED(hr));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the attributes of the object
|
||||
DWORD attr = SFGAO_FOLDER | SFGAO_BROWSABLE;
|
||||
hr = ishell->GetAttributesOf(1, &fidl, &attr);
|
||||
if (!SUCCEEDED(hr))
|
||||
{
|
||||
wxASSERT(SUCCEEDED(hr));
|
||||
break;
|
||||
}
|
||||
|
||||
// Allow all folders (things like zip files get filtered below)
|
||||
if ((attr & (SFGAO_FOLDER)) && !(attr & SFGAO_BROWSABLE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Retrieve the parsable name of the object (includes extension)
|
||||
STRRET str;
|
||||
hr = ishell->GetDisplayNameOf(fidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str);
|
||||
if (hr != NOERROR)
|
||||
{
|
||||
// For some objects, we get back an error of 80070057. I'm assuming this
|
||||
// means there is no way to represent the name (like some sort of virtual name)
|
||||
// or I've not used the correct PIDL. But, in either case, it "probably"
|
||||
// represents some sort of folder (at least in all cases I've seen), so we
|
||||
// simply allow it to display.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Convert result to wxString
|
||||
wxString filename;
|
||||
switch (str.uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
filename = str.pOleStr;
|
||||
imalloc->Free(str.pOleStr);
|
||||
break;
|
||||
|
||||
case STRRET_OFFSET:
|
||||
filename = wxString(((char *)fidl) + str.uOffset, wxConvISO8859_1);
|
||||
break;
|
||||
|
||||
case STRRET_CSTR:
|
||||
filename = wxString(str.cStr, wxConvISO8859_1);
|
||||
break;
|
||||
}
|
||||
|
||||
// Convert the filename to lowercase (and remember to write filters in lowercase!)
|
||||
filename = filename.Lower();
|
||||
|
||||
// Attempt to match it to all of our filters
|
||||
bool match = false;
|
||||
for (int flt = 0; flt < fltcnt; flt++)
|
||||
{
|
||||
if (wxMatchWild(m_Filters[flt], filename, false))
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove it from the display if it didn't match any of the filters.
|
||||
if (!match)
|
||||
{
|
||||
ListView_DeleteItem(lv, itm);
|
||||
itm--;
|
||||
itmcnt--;
|
||||
}
|
||||
}
|
||||
|
||||
// On Vista and maybe XP, we seem to need to refresh the view after
|
||||
// changing the filters. But, only refresh for type changes and not
|
||||
// selection changes since it causes additional selection change
|
||||
// events to occur.
|
||||
if (ishellview && refresh)
|
||||
{
|
||||
ishellview->Refresh();
|
||||
}
|
||||
|
||||
// Release the interface
|
||||
if (ifolderview)
|
||||
{
|
||||
ifolderview->Release();
|
||||
}
|
||||
|
||||
// Release the interface
|
||||
if (ishellview)
|
||||
{
|
||||
ishellview->Release();
|
||||
}
|
||||
|
||||
// Release the interface
|
||||
if (ishell)
|
||||
{
|
||||
ishell->Release();
|
||||
}
|
||||
|
||||
// Release the interface
|
||||
if (imalloc)
|
||||
{
|
||||
imalloc->Release();
|
||||
}
|
||||
}
|
||||
|
||||
void FileDialog::ParseFilter(int index)
|
||||
{
|
||||
m_Filters.Empty();
|
||||
|
||||
wxStringTokenizer tokenWild(m_FilterGroups[index - 1], wxT(";"));
|
||||
|
||||
while (tokenWild.HasMoreTokens())
|
||||
{
|
||||
wxString token = tokenWild.GetNextToken();
|
||||
if (m_Filters.Index(token, false) == wxNOT_FOUND)
|
||||
{
|
||||
m_Filters.Add(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// FileDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
FileDialog::FileDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& defaultDir,
|
||||
const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style,
|
||||
const wxPoint& pos)
|
||||
: wxFileDialogBase(parent, message, defaultDir, defaultFileName,
|
||||
wildCard, style, pos)
|
||||
|
||||
{
|
||||
m_dialogStyle = style;
|
||||
|
||||
if ( ( m_dialogStyle & wxFD_MULTIPLE ) && ( m_dialogStyle & wxFD_SAVE ) )
|
||||
m_dialogStyle &= ~wxFD_MULTIPLE;
|
||||
|
||||
m_bMovedWindow = false;
|
||||
|
||||
// Must set to zero, otherwise the wx routines won't size the window
|
||||
// the second time you call the file dialog, because it thinks it is
|
||||
// already at the requested size.. (when centering)
|
||||
gs_rectDialog.x =
|
||||
gs_rectDialog.y = 0;
|
||||
|
||||
m_callback = NULL;
|
||||
m_cbdata = NULL;
|
||||
}
|
||||
|
||||
void FileDialog::GetPaths(wxArrayString& paths) const
|
||||
{
|
||||
paths.Empty();
|
||||
|
||||
wxString dir(m_dir);
|
||||
if ( m_dir.Last() != wxT('\\') )
|
||||
dir += wxT('\\');
|
||||
|
||||
size_t count = m_fileNames.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
{
|
||||
if (wxFileName(m_fileNames[n]).IsAbsolute())
|
||||
paths.Add(m_fileNames[n]);
|
||||
else
|
||||
paths.Add(dir + m_fileNames[n]);
|
||||
}
|
||||
}
|
||||
|
||||
void FileDialog::GetFilenames(wxArrayString& files) const
|
||||
{
|
||||
files = m_fileNames;
|
||||
}
|
||||
|
||||
void FileDialog::SetPath(const wxString& path)
|
||||
{
|
||||
wxString ext;
|
||||
wxSplitPath(path, &m_dir, &m_fileName, &ext);
|
||||
if ( !ext.empty() )
|
||||
m_fileName << wxT('.') << ext;
|
||||
}
|
||||
|
||||
void FileDialog::DoGetPosition( int *x, int *y ) const
|
||||
{
|
||||
*x = gs_rectDialog.x;
|
||||
*y = gs_rectDialog.y;
|
||||
}
|
||||
|
||||
|
||||
void FileDialog::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
*width = gs_rectDialog.width;
|
||||
*height = gs_rectDialog.height;
|
||||
}
|
||||
|
||||
void FileDialog::DoMoveWindow(int x, int y, int WXUNUSED(width), int WXUNUSED(height))
|
||||
{
|
||||
m_bMovedWindow = true;
|
||||
|
||||
gs_rectDialog.x = x;
|
||||
gs_rectDialog.y = y;
|
||||
|
||||
/*
|
||||
The width and height can not be set by the programmer
|
||||
its just not possible. But the program can get the
|
||||
size of the Dlg after it has been shown, in case they need
|
||||
that data.
|
||||
*/
|
||||
}
|
||||
|
||||
int FileDialog::ShowModal()
|
||||
{
|
||||
HWND hWnd = 0;
|
||||
if (m_parent) hWnd = (HWND) m_parent->GetHWND();
|
||||
if (!hWnd && wxTheApp->GetTopWindow())
|
||||
hWnd = (HWND) wxTheApp->GetTopWindow()->GetHWND();
|
||||
|
||||
static wxChar fileNameBuffer [ wxMAXPATH ]; // the file-name
|
||||
wxChar titleBuffer [ wxMAXFILE+1+wxMAXEXT ]; // the file-name, without path
|
||||
|
||||
*fileNameBuffer = wxT('\0');
|
||||
*titleBuffer = wxT('\0');
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
long msw_flags = 0;
|
||||
if ( (m_dialogStyle & wxHIDE_READONLY) || (m_dialogStyle & wxSAVE) )
|
||||
msw_flags |= OFN_HIDEREADONLY;
|
||||
#else
|
||||
long msw_flags = OFN_HIDEREADONLY;
|
||||
#endif
|
||||
|
||||
if ( m_dialogStyle & wxFD_FILE_MUST_EXIST )
|
||||
msw_flags |= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||
/*
|
||||
If the window has been moved the programmer is probably
|
||||
trying to center or position it. Thus we set the callback
|
||||
or hook function so that we can actually adjust the position.
|
||||
Without moving or centering the dlg, it will just stay
|
||||
in the upper left of the frame, it does not center
|
||||
automatically.. One additional note, when the hook is
|
||||
enabled, the PLACES BAR in the dlg (shown on later versions
|
||||
of windows (2000 and XP) will automatically be turned off
|
||||
according to the MSDN docs. This is normal. If the
|
||||
programmer needs the PLACES BAR (left side of dlg) they
|
||||
just shouldn't move or center the dlg.
|
||||
*/
|
||||
if (m_bMovedWindow) // we need these flags.
|
||||
{
|
||||
msw_flags |= OFN_EXPLORER|OFN_ENABLEHOOK;
|
||||
#ifndef __WXWINCE__
|
||||
msw_flags |= OFN_ENABLESIZING;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (m_dialogStyle & wxFD_MULTIPLE )
|
||||
{
|
||||
// OFN_EXPLORER must always be specified with OFN_ALLOWMULTISELECT
|
||||
msw_flags |= OFN_EXPLORER | OFN_ALLOWMULTISELECT;
|
||||
}
|
||||
|
||||
// if wxCHANGE_DIR flag is not given we shouldn't change the CWD which the
|
||||
// standard dialog does by default (notice that under NT it does it anyhow,
|
||||
// OFN_NOCHANGEDIR or not, see below)
|
||||
if ( !(m_dialogStyle & wxFD_CHANGE_DIR) )
|
||||
{
|
||||
msw_flags |= OFN_NOCHANGEDIR;
|
||||
}
|
||||
|
||||
if ( m_dialogStyle & wxFD_OVERWRITE_PROMPT )
|
||||
{
|
||||
msw_flags |= OFN_OVERWRITEPROMPT;
|
||||
}
|
||||
|
||||
if ( m_dialogStyle & wxRESIZE_BORDER )
|
||||
{
|
||||
msw_flags |= OFN_ENABLESIZING;
|
||||
}
|
||||
|
||||
if ( m_callback != NULL )
|
||||
{
|
||||
msw_flags |= OFN_SHOWHELP | OFN_EXPLORER | OFN_ENABLEHOOK;
|
||||
}
|
||||
|
||||
// We always need EXPLORER and ENABLEHOOK to use our filtering code
|
||||
msw_flags |= OFN_EXPLORER | OFN_ENABLEHOOK;
|
||||
|
||||
OPENFILENAME of;
|
||||
wxZeroMemory(of);
|
||||
|
||||
// Allow Places bar to show on supported platforms
|
||||
int major, minor;
|
||||
if ( wxGetOsVersion(&major, &minor) == wxOS_WINDOWS_NT )
|
||||
{
|
||||
of.lStructSize = sizeof(OPENFILENAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
of.lStructSize = OPENFILENAME_SIZE_VERSION_400;
|
||||
}
|
||||
|
||||
of.hwndOwner = hWnd;
|
||||
of.lpstrTitle = WXSTRINGCAST m_message;
|
||||
of.lpstrFileTitle = titleBuffer;
|
||||
of.nMaxFileTitle = wxMAXFILE + 1 + wxMAXEXT; // Windows 3.0 and 3.1
|
||||
of.lCustData = (LPARAM) this;
|
||||
|
||||
// Convert forward slashes to backslashes (file selector doesn't like
|
||||
// forward slashes) and also squeeze multiple consecutive slashes into one
|
||||
// as it doesn't like two backslashes in a row neither
|
||||
|
||||
wxString dir;
|
||||
size_t i, len = m_dir.length();
|
||||
dir.reserve(len);
|
||||
for ( i = 0; i < len; i++ )
|
||||
{
|
||||
wxChar ch = m_dir[i];
|
||||
switch ( ch )
|
||||
{
|
||||
case wxT('/'):
|
||||
// convert to backslash
|
||||
ch = wxT('\\');
|
||||
|
||||
// fall through
|
||||
|
||||
case wxT('\\'):
|
||||
while ( i < len - 1 )
|
||||
{
|
||||
wxChar chNext = m_dir[i + 1];
|
||||
if ( chNext != wxT('\\') && chNext != wxT('/') )
|
||||
break;
|
||||
|
||||
// ignore the next one, unless it is at the start of a UNC path
|
||||
if (i > 0)
|
||||
i++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
// fall through
|
||||
|
||||
default:
|
||||
// normal char
|
||||
dir += ch;
|
||||
}
|
||||
}
|
||||
|
||||
of.lpstrInitialDir = dir.c_str();
|
||||
|
||||
of.Flags = msw_flags;
|
||||
of.lpfnHook = FileDialogHookFunction;
|
||||
|
||||
wxArrayString wildDescriptions;
|
||||
|
||||
size_t items = wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, m_FilterGroups);
|
||||
|
||||
wxASSERT_MSG( items > 0 , wxT("empty wildcard list") );
|
||||
|
||||
// We do not use the custom filter code on Windows 7 or higher since it now
|
||||
// handles filters larger than 260 characters.
|
||||
gs_customFilter = (major < 6 || minor < 1);
|
||||
|
||||
wxString filterBuffer;
|
||||
|
||||
for (i = 0; i < items ; i++)
|
||||
{
|
||||
filterBuffer += wildDescriptions[i];
|
||||
filterBuffer += wxT("|");
|
||||
filterBuffer += (gs_customFilter ? wxT("*.*") : m_FilterGroups[i]);
|
||||
filterBuffer += wxT("|");
|
||||
}
|
||||
|
||||
// Replace | with \0
|
||||
for (i = 0; i < filterBuffer.Len(); i++ )
|
||||
{
|
||||
if ( filterBuffer.GetChar(i) == wxT('|') )
|
||||
{
|
||||
filterBuffer[i] = wxT('\0');
|
||||
}
|
||||
}
|
||||
|
||||
of.lpstrFilter = (LPTSTR)filterBuffer.c_str();
|
||||
of.nFilterIndex = m_filterIndex + 1;
|
||||
|
||||
ParseFilter(of.nFilterIndex);
|
||||
|
||||
//=== Setting defaultFileName >>=========================================
|
||||
|
||||
wxStrncpy( fileNameBuffer, (const wxChar *)m_fileName, wxMAXPATH-1 );
|
||||
fileNameBuffer[ wxMAXPATH-1 ] = wxT('\0');
|
||||
|
||||
of.lpstrFile = fileNameBuffer; // holds returned filename
|
||||
of.nMaxFile = wxMAXPATH;
|
||||
|
||||
// we must set the default extension because otherwise Windows would check
|
||||
// for the existing of a wrong file with wxOVERWRITE_PROMPT (i.e. if the
|
||||
// user types "foo" and the default extension is ".bar" we should force it
|
||||
// to check for "foo.bar" existence and not "foo")
|
||||
wxString defextBuffer; // we need it to be alive until GetSaveFileName()!
|
||||
if (m_dialogStyle & wxFD_SAVE && m_dialogStyle & wxFD_OVERWRITE_PROMPT)
|
||||
{
|
||||
const wxChar* extension = filterBuffer;
|
||||
int maxFilter = (int)(of.nFilterIndex*2L) - 1;
|
||||
|
||||
for( int i = 0; i < maxFilter; i++ ) // get extension
|
||||
extension = extension + wxStrlen( extension ) + 1;
|
||||
|
||||
// use dummy name a to avoid assert in AppendExtension
|
||||
defextBuffer = AppendExtension(wxT("a"), extension);
|
||||
if (defextBuffer.StartsWith(wxT("a.")))
|
||||
{
|
||||
defextBuffer.Mid(2);
|
||||
of.lpstrDefExt = defextBuffer.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
// store off before the standard windows dialog can possibly change it
|
||||
const wxString cwdOrig = wxGetCwd();
|
||||
|
||||
//== Execute FileDialog >>=================================================
|
||||
|
||||
bool success = (m_dialogStyle & wxFD_SAVE ? GetSaveFileName(&of)
|
||||
: GetOpenFileName(&of)) != 0;
|
||||
|
||||
#ifdef __WXWINCE__
|
||||
DWORD errCode = GetLastError();
|
||||
#else
|
||||
DWORD errCode = CommDlgExtendedError();
|
||||
|
||||
// GetOpenFileName will always change the current working directory on
|
||||
// (according to MSDN) "Windows NT 4.0/2000/XP" because the flag
|
||||
// OFN_NOCHANGEDIR has no effect. If the user did not specify wxCHANGE_DIR
|
||||
// let's restore the current working directory to what it was before the
|
||||
// dialog was shown (assuming this behavior extends to Windows Server 2003
|
||||
// seems safe).
|
||||
if ( success &&
|
||||
(msw_flags & OFN_NOCHANGEDIR) &&
|
||||
wxGetOsVersion() == wxOS_WINDOWS_NT )
|
||||
{
|
||||
wxSetWorkingDirectory(cwdOrig);
|
||||
}
|
||||
|
||||
#ifdef __WIN32__
|
||||
if (!success && (errCode == CDERR_STRUCTSIZE))
|
||||
{
|
||||
// The struct size has changed so try a smaller or bigger size
|
||||
|
||||
int oldStructSize = of.lStructSize;
|
||||
of.lStructSize = oldStructSize - (sizeof(void *) + 2*sizeof(DWORD));
|
||||
success = (m_dialogStyle & wxFD_SAVE) ? (GetSaveFileName(&of) != 0)
|
||||
: (GetOpenFileName(&of) != 0);
|
||||
errCode = CommDlgExtendedError();
|
||||
|
||||
if (!success && (errCode == CDERR_STRUCTSIZE))
|
||||
{
|
||||
of.lStructSize = oldStructSize + (sizeof(void *) + 2*sizeof(DWORD));
|
||||
success = (m_dialogStyle & wxFD_SAVE) ? (GetSaveFileName(&of) != 0)
|
||||
: (GetOpenFileName(&of) != 0);
|
||||
}
|
||||
}
|
||||
#endif // __WIN32__
|
||||
#endif // __WXWINCE__
|
||||
|
||||
if ( success )
|
||||
{
|
||||
m_fileNames.Empty();
|
||||
|
||||
if ( ( m_dialogStyle & wxFD_MULTIPLE ) &&
|
||||
#if defined(OFN_EXPLORER)
|
||||
( fileNameBuffer[of.nFileOffset-1] == wxT('\0') )
|
||||
#else
|
||||
( fileNameBuffer[of.nFileOffset-1] == wxT(' ') )
|
||||
#endif // OFN_EXPLORER
|
||||
)
|
||||
{
|
||||
#if defined(OFN_EXPLORER)
|
||||
m_dir = fileNameBuffer;
|
||||
i = of.nFileOffset;
|
||||
m_fileName = &fileNameBuffer[i];
|
||||
m_fileNames.Add(m_fileName);
|
||||
i += m_fileName.Len() + 1;
|
||||
|
||||
while (fileNameBuffer[i] != wxT('\0'))
|
||||
{
|
||||
m_fileNames.Add(&fileNameBuffer[i]);
|
||||
i += wxStrlen(&fileNameBuffer[i]) + 1;
|
||||
}
|
||||
#else
|
||||
wxStringTokenizer toke(fileNameBuffer, wxT(" \t\r\n"));
|
||||
m_dir = toke.GetNextToken();
|
||||
m_fileName = toke.GetNextToken();
|
||||
m_fileNames.Add(m_fileName);
|
||||
|
||||
while (toke.HasMoreTokens())
|
||||
m_fileNames.Add(toke.GetNextToken());
|
||||
#endif // OFN_EXPLORER
|
||||
|
||||
wxString dir(m_dir);
|
||||
if ( m_dir.Last() != wxT('\\') )
|
||||
dir += wxT('\\');
|
||||
|
||||
m_path = dir + m_fileName;
|
||||
m_filterIndex = (int)of.nFilterIndex - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//=== Adding the correct extension >>=================================
|
||||
m_filterIndex = (int)of.nFilterIndex - 1;
|
||||
|
||||
#if 0
|
||||
// LLL: Removed to prevent adding extension during Export
|
||||
// processing.
|
||||
|
||||
if ( !of.nFileExtension ||
|
||||
(of.nFileExtension && fileNameBuffer[of.nFileExtension] == wxT('\0')) )
|
||||
{
|
||||
// User has typed a filename without an extension:
|
||||
const wxChar* extension = filterBuffer;
|
||||
int maxFilter = (int)(of.nFilterIndex*2L) - 1;
|
||||
|
||||
for( int i = 0; i < maxFilter; i++ ) // get extension
|
||||
extension = extension + wxStrlen( extension ) + 1;
|
||||
|
||||
m_fileName = AppendExtension(fileNameBuffer, extension);
|
||||
wxStrncpy(fileNameBuffer, m_fileName.c_str(), wxMin(m_fileName.Len(), wxMAXPATH-1));
|
||||
fileNameBuffer[wxMin(m_fileName.Len(), wxMAXPATH-1)] = wxT('\0');
|
||||
}
|
||||
#endif
|
||||
m_path = fileNameBuffer;
|
||||
m_fileName = wxFileNameFromPath(fileNameBuffer);
|
||||
m_fileNames.Add(m_fileName);
|
||||
m_dir = wxPathOnly(fileNameBuffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// common dialog failed - why?
|
||||
#ifdef __WXDEBUG__
|
||||
#ifdef __WXWINCE__
|
||||
if (errCode == 0)
|
||||
{
|
||||
// OK, user cancelled the dialog
|
||||
}
|
||||
else if (errCode == ERROR_INVALID_PARAMETER)
|
||||
{
|
||||
wxLogError(wxT("Invalid parameter passed to file dialog function."));
|
||||
}
|
||||
else if (errCode == ERROR_OUTOFMEMORY)
|
||||
{
|
||||
wxLogError(wxT("Out of memory when calling file dialog function."));
|
||||
}
|
||||
else if (errCode == ERROR_CALL_NOT_IMPLEMENTED)
|
||||
{
|
||||
wxLogError(wxT("Call not implemented when calling file dialog function."));
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError(wxT("Unknown error %d when calling file dialog function."), errCode);
|
||||
}
|
||||
#else
|
||||
DWORD dwErr = CommDlgExtendedError();
|
||||
if ( dwErr != 0 )
|
||||
{
|
||||
// this msg is only for developers
|
||||
wxLogError(wxT("Common dialog failed with error code %0lx."),
|
||||
dwErr);
|
||||
}
|
||||
//else: it was just cancelled
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return success ? wxID_OK : wxID_CANCEL;
|
||||
|
||||
}
|
||||
|
||||
#endif // wxUSE_FILEDLG && !(__SMARTPHONE__ && __WXWINCE__)
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/filedlg.h
|
||||
// Purpose: wxFileDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by: Leland Lucius
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: FileDialogPrivate.h,v 1.6 2009-04-11 05:53:09 llucius Exp $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Modified for Audacity to support an additional button on Save dialogs
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _FILEDIALOGMSW_H_
|
||||
#define _FILEDIALOGMSW_H_
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxFileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class FileDialog: public wxFileDialogBase
|
||||
{
|
||||
public:
|
||||
FileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
virtual void SetPath(const wxString& path);
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
virtual void GetFilenames(wxArrayString& files) const;
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
|
||||
virtual void ClickButton(int index);
|
||||
|
||||
virtual void FilterFiles(HWND hDlg, bool refresh);
|
||||
virtual void ParseFilter(int index);
|
||||
wxString m_buttonlabel;
|
||||
|
||||
protected:
|
||||
|
||||
#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
#endif // !(__SMARTPHONE__ && __WXWINCE__)
|
||||
|
||||
private:
|
||||
wxArrayString m_fileNames;
|
||||
bool m_bMovedWindow;
|
||||
long m_dialogStyle;
|
||||
|
||||
wxArrayString m_FilterGroups;
|
||||
wxArrayString m_Filters;
|
||||
wxChar *m_NameBuf;
|
||||
int m_NameBufLen;
|
||||
|
||||
fdCallback m_callback;
|
||||
void *m_cbdata;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(FileDialog)
|
||||
DECLARE_NO_COPY_CLASS(FileDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
all: @LOCAL_LIBS@ @LIBSRC_BUILD@
|
||||
|
||||
# portSMF
|
||||
portSMF:
|
||||
$(MAKE) -C portsmf
|
||||
|
||||
# dlcompat
|
||||
dl-recursive:
|
||||
$(MAKE) -C dlcompat
|
||||
libdl.a: dl-recursive
|
||||
ln -sf dlcompat/libdl.a libdl.a
|
||||
|
||||
# expat
|
||||
expat-recursive:
|
||||
$(MAKE) -C expat
|
||||
expat.a: expat-recursive
|
||||
ln -sf expat/expat.a expat.a
|
||||
|
||||
# FileDialog
|
||||
FileDialog-recursive:
|
||||
$(MAKE) -C FileDialog
|
||||
FileDialog.a: FileDialog-recursive
|
||||
ln -sf FileDialog/FileDialog.a FileDialog.a
|
||||
|
||||
# libwidgetextra
|
||||
widgetextra:
|
||||
$(MAKE) -C lib-widget-extra
|
||||
|
||||
# libogg
|
||||
libogg-recursive:
|
||||
$(MAKE) -C libogg
|
||||
libogg.a: libogg-recursive
|
||||
ln -sf libogg/src/.libs/libogg.a libogg.a
|
||||
|
||||
# libvorbis
|
||||
libvorbis-recursive:
|
||||
$(MAKE) -C libvorbis
|
||||
libvorbis.a libvorbisfile.a libvorbisenc.a: libogg.a libvorbis-recursive
|
||||
ln -sf libvorbis/lib/.libs/libvorbis.a libvorbis.a
|
||||
ln -sf libvorbis/lib/.libs/libvorbisfile.a libvorbisfile.a
|
||||
ln -sf libvorbis/lib/.libs/libvorbisenc.a libvorbisenc.a
|
||||
|
||||
# libflac
|
||||
libflac-recursive:
|
||||
$(MAKE) -C libflac
|
||||
libFLAC++.a libFLAC.a: libflac-recursive
|
||||
ln -sf libflac/src/libFLAC++/.libs/libFLAC++.a libFLAC++.a
|
||||
ln -sf libflac/src/libFLAC/.libs/libFLAC.a libFLAC.a
|
||||
|
||||
# libnyquist
|
||||
libnyquist-recursive:
|
||||
$(MAKE) -C libnyquist
|
||||
libnyquist.a: libnyquist-recursive
|
||||
ln -sf libnyquist/libnyquist.a libnyquist.a
|
||||
|
||||
# libvamp
|
||||
#
|
||||
# The reason for the "sdkstatic" is that's all that we really need
|
||||
# and it circumvents an issue when building on OSX...the makefile
|
||||
# has different options for OSX, but they aren't configurable via
|
||||
# the configure script.
|
||||
#
|
||||
vamp-sdk:
|
||||
$(MAKE) -C libvamp sdkstatic
|
||||
|
||||
# redland
|
||||
redland-recursive:
|
||||
$(MAKE) -C redland
|
||||
librdf.a: redland-recursive
|
||||
ln -sf redland/librdf/.libs/librdf.a librdf.a
|
||||
libraptor.a: redland-recursive
|
||||
ln -sf redland/raptor/src/.libs/libraptor.a libraptor.a
|
||||
librasqal.a: redland-recursive
|
||||
ln -sf redland/rasqal/src/.libs/librasqal.a librasqal.a
|
||||
|
||||
# liblrdf
|
||||
liblrdf-recursive:
|
||||
$(MAKE) -C liblrdf
|
||||
liblrdf.a: liblrdf-recursive
|
||||
ln -sf liblrdf/src/.libs/liblrdf.a liblrdf.a
|
||||
|
||||
# slv2
|
||||
slv2-recursive:
|
||||
$(MAKE) -C slv2
|
||||
libslv2.a: slv2-recursive
|
||||
ln -sf slv2/src/.libs/libslv2.a libslv2.a
|
||||
|
||||
# libtwolame
|
||||
libtwolame-recursive:
|
||||
$(MAKE) -C twolame
|
||||
libtwolame.a: libtwolame-recursive
|
||||
ln -sf twolame/libtwolame/.libs/libtwolame.a libtwolame.a
|
||||
|
||||
# libmad
|
||||
libmad-recursive:
|
||||
$(MAKE) -C libmad
|
||||
libmad.a: libmad-recursive
|
||||
ln -sf libmad/.libs/libmad.a libmad.a
|
||||
libmad/mad.h: libmad-recursive
|
||||
|
||||
# libid3tag
|
||||
libid3tag-recursive:
|
||||
$(MAKE) -C libid3tag
|
||||
libid3tag.a: libid3tag-recursive
|
||||
ln -sf libid3tag/.libs/libid3tag.a libid3tag.a
|
||||
|
||||
# libsamplerate
|
||||
libsamplerate-recursive:
|
||||
$(MAKE) -C libsamplerate
|
||||
libsamplerate.a: libsamplerate-recursive
|
||||
ln -sf libsamplerate/src/.libs/libsamplerate.a libsamplerate.a
|
||||
|
||||
# libresample
|
||||
libresample-recursive:
|
||||
$(MAKE) -C libresample libresample.a
|
||||
libresample.a: libresample-recursive
|
||||
ln -sf libresample/libresample.a libresample.a
|
||||
|
||||
|
||||
# libsndfile
|
||||
libsndfile-recursive:
|
||||
$(MAKE) -C libsndfile
|
||||
libsndfile.a: libsndfile-recursive
|
||||
ln -sf libsndfile/src/.libs/libsndfile.a libsndfile.a
|
||||
|
||||
# SBSMS
|
||||
sbsms-recursive:
|
||||
$(MAKE) -C sbsms
|
||||
libsbsms.a: sbsms-recursive
|
||||
ln -sf sbsms/src/.libs/libsbsms.a .
|
||||
|
||||
# SoundTouch
|
||||
soundtouch-recursive:
|
||||
$(MAKE) -C soundtouch
|
||||
libSoundTouch.a: soundtouch-recursive
|
||||
ln -sf soundtouch/source/SoundTouch/.libs/libSoundTouch.a .
|
||||
|
||||
# TagLib
|
||||
taglib-recursive:
|
||||
$(MAKE) -C taglib
|
||||
taglib.a: taglib-recursive
|
||||
ln -sf taglib/taglib/.libs/libtag.a taglib.a
|
||||
|
||||
# PortAudio
|
||||
portaudio-v19-recursive:
|
||||
$(MAKE) -C portaudio-v19 lib/libportaudio.la
|
||||
portaudio-v19/lib/libportaudio.a: portaudio-v19-recursive
|
||||
ln -sf .libs/libportaudio.a $@
|
||||
|
||||
# PortMixer
|
||||
portmixer-recursive:
|
||||
$(MAKE) -C portmixer
|
||||
portmixer/libportmixer.a: portmixer-recursive
|
||||
|
||||
portaudio/pa_unix_oss/portaudio.a:
|
||||
$(MAKE) -C portaudio/pa_unix_oss
|
||||
|
||||
portaudio/pa_mac_core/portaudio.a:
|
||||
$(MAKE) -C portaudio/pa_mac_core
|
||||
|
||||
# RTAudio not supported 23/08/2007 R.A.
|
||||
# librtaudio-recursive:
|
||||
# $(MAKE) -C rtaudio
|
||||
#rtaudio/librtaudio.a: librtaudio-recursive
|
||||
# ln -sf rtaudio/librtaudio.a .
|
||||
|
||||
# Utility rules
|
||||
clean:
|
||||
-$(MAKE) -C portsmf clean
|
||||
-$(MAKE) -C dlcompat clean
|
||||
-$(MAKE) -C expat clean
|
||||
-$(MAKE) -C FileDialog clean
|
||||
-$(MAKE) -C libid3tag clean
|
||||
-$(MAKE) -C libmad clean
|
||||
-$(MAKE) -C libnyquist clean
|
||||
-$(MAKE) -C liblrdf clean
|
||||
-$(MAKE) -C libogg clean
|
||||
-$(MAKE) -C libsamplerate clean
|
||||
-$(MAKE) -C libresample clean
|
||||
-$(MAKE) -C libsndfile clean
|
||||
-$(MAKE) -C libvamp clean
|
||||
-$(MAKE) -C libvorbis clean
|
||||
-$(MAKE) -C lib-widget-extra clean
|
||||
-$(MAKE) -C libflac clean
|
||||
-$(MAKE) -C portaudio-v19 clean
|
||||
-$(MAKE) -C portaudio/pa_unix_oss clean
|
||||
-$(MAKE) -C portaudio/pa_mac_core clean
|
||||
-$(MAKE) -C portmixer clean
|
||||
-$(MAKE) -C sbsms clean
|
||||
-$(MAKE) -C soundtouch clean
|
||||
-$(MAKE) -C twolame clean
|
||||
-rm -rf @LOCAL_LIBS@
|
||||
|
||||
distclean:
|
||||
-$(MAKE) -C portsmf distclean
|
||||
-$(MAKE) -C dlcompat distclean
|
||||
-$(MAKE) -C expat distclean
|
||||
-$(MAKE) -C FileDialog distclean
|
||||
-$(MAKE) -C libid3tag distclean
|
||||
-$(MAKE) -C libmad distclean
|
||||
-$(MAKE) -C libnyquist distclean
|
||||
-$(MAKE) -C liblrdf distclean
|
||||
-$(MAKE) -C libogg distclean
|
||||
-$(MAKE) -C libsamplerate distclean
|
||||
-$(MAKE) -C libresample distclean
|
||||
-$(MAKE) -C libsndfile distclean
|
||||
-$(MAKE) -C libvamp distclean
|
||||
-$(MAKE) -C libvorbis distclean
|
||||
-$(MAKE) -C lib-widget-extra distclean
|
||||
-$(MAKE) -C libflac distclean
|
||||
-$(MAKE) -C portaudio-v19 distclean
|
||||
-$(MAKE) -C portaudio/pa_unix_oss distclean
|
||||
-$(MAKE) -C portaudio/pa_mac_core distclean
|
||||
-$(MAKE) -C portmixer distclean
|
||||
-$(MAKE) -C sbsms distclean
|
||||
-$(MAKE) -C soundtouch distclean
|
||||
-$(MAKE) -C twolame distclean
|
||||
-rm -f @LOCAL_LIBS@
|
||||
|
||||
# list here all the targets that aren't actually files to be made
|
||||
.PHONY: portSMF eexpat-recursive FileDialog-recursive \
|
||||
widgetextra libogg-recursive \
|
||||
libvorbis-recursive libnyquist-recursive libmad-recursive \
|
||||
libid3tag-recursive sbsms-recursive soundtouch-recursive libsndfile-recursive \
|
||||
libresample-recursive libsamplerate-recursive vamp-sdk \
|
||||
portaudio-v19-recursive portmixer-recursive libtwolame-recursive \
|
||||
liblrdf-recursive redland-recursive slv2-recursive
|
||||
|
|
@ -0,0 +1,348 @@
|
|||
This is intended as a list of all the patches that have been incorporated into
|
||||
the lib-src copies of libraries, to avoid them getting lost in version upgrades
|
||||
from upstream, and to remind us of the versions we are using.
|
||||
|
||||
Libraries
|
||||
=========
|
||||
dlcompat
|
||||
--------
|
||||
Support library for dynamic loading of modules on OS X 10.3 and older. Used
|
||||
for LADSPA on OS X support, and probably not any where else
|
||||
|
||||
expat
|
||||
-----
|
||||
XML parser library used to parse project files and so on. By default the
|
||||
system copy is prefered over this one, even on OS X (where it is shipped by
|
||||
default). Build against system 2.0.1 works fine.
|
||||
Version in audacity CVS: 1.2
|
||||
Patches: None
|
||||
Upstream version: 2.0.1
|
||||
|
||||
FileDialogue
|
||||
------------
|
||||
The customised file saving dialogues for wxwidgets to provide the options
|
||||
button for format preferences. This is written and maintained by us so doesn't
|
||||
have an upstream at the moment.
|
||||
|
||||
iAVC
|
||||
----
|
||||
disused?
|
||||
|
||||
id3lib
|
||||
------
|
||||
disused?
|
||||
|
||||
libflac
|
||||
-------
|
||||
http://flac.sourceforge.net/
|
||||
Free Lossless Audio Codec encoding and decoding library
|
||||
Version in audacity cvs: 1.2.1
|
||||
Patches: mac-asm-fixes.patch. Fixes build on OS X Intel 10.4 by creating and
|
||||
object format for Mach-O. Needs to go upstream
|
||||
gcc-4.3-includes.patch. Patch from gentoo to fix includes needed for
|
||||
GCC 4.3. Already included in upstream CVS
|
||||
asm-textreloc.patch. Patch from Gentoo to avoid text relocations is
|
||||
the assembly optimisations. In upstream CVS
|
||||
asneeded.patch. Add LDFLAGS needed for non-glibc systems. Taken from Gentoo.
|
||||
flac-lite.diff. Remove all the things not included in audacity CVS from
|
||||
the build system so it will build with 50% less stuff
|
||||
Upstream version: 1.2.1
|
||||
|
||||
libid3tag
|
||||
---------
|
||||
MP3 tag manipulation library. Comes with libmad (below)
|
||||
arguments ([-Wall foreign]) added to AM_INIT_AUTOMAKE to avoid autoreconf
|
||||
failures
|
||||
arguments (--no-verify) removed from ltconfig execution to prevent configure
|
||||
failures
|
||||
|
||||
libmad
|
||||
------
|
||||
http://www.underbit.com/products/mad/
|
||||
MP3 decoding library
|
||||
Version in audacity cvs: 0.15.1 (beta)
|
||||
Patches: libmad-mp2-out-of-spec.patch: Import some forms of MP2 file that are
|
||||
theoretically out of spec but in practise work fine (msmeyer)
|
||||
osx-universal-build.patch: Makes build work on OS X for universal binary by
|
||||
using compiler-defined symbols for targets as well as hosts.
|
||||
autotools.patch: Update to autotools to work with recent auto{conf,
|
||||
make}
|
||||
Upstream version: 0.15.1 (beta)
|
||||
|
||||
libnyquist
|
||||
----------
|
||||
Digital Audio scripting language, with our own library interface added to it
|
||||
kFreeBSD-nyquist.patch Patch from Benjamin Drung to build nyquist on
|
||||
kFreeBSD. Asked him to send it upstream 2009/08/22
|
||||
hurd-nyquist.patch Patch from Benjamin Drung to build nyquist on HURD.
|
||||
Asked him to send it upstream 2009/12/05.
|
||||
|
||||
libogg
|
||||
------
|
||||
library to handle Xiph.org's open multimedia container format
|
||||
Version in Audacity CVS: 1.1.3
|
||||
Patches: None, except docs build disabled in Makefile.am
|
||||
/usr/share/aclocal/libtool.m4 copied to acinclude.m4 (working round not having
|
||||
an m4 directory in the package for libtool files)
|
||||
Upstream Version: 1.1.3
|
||||
|
||||
libresample
|
||||
-----------
|
||||
Audio sample rate conversion library. Maintained by audacity project
|
||||
|
||||
libsamplerate
|
||||
-------------
|
||||
Erik de Castro Lopo's high quality sample rate conversion library. Not used
|
||||
in release builds, could probably be removed altogther except for comparision
|
||||
purposes.
|
||||
Version in Audacity CVS: 0.1.7
|
||||
Patches: endian.m4, lrint.m4, llrint.m4, lrintf.m4, clip_mode.m4 copied from
|
||||
libsndfile's M4/.
|
||||
signal.m4 created out of the tail of acinclude.m4 with the remaining
|
||||
necessary macro
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
Upstream Version: 0.1.7
|
||||
|
||||
libsndfile
|
||||
----------
|
||||
Erik de Castro Lopo's uncompressed audio file I/O library. Core and essential
|
||||
to audacity.
|
||||
Version in Audacity CVS: 1.0.18
|
||||
Patches: macro-quoting.patch: quote arguments to AC_DEFUN such that
|
||||
autoreconf works with autorecnf 2.63. Has been accepted upstream
|
||||
portability.patch: add portability macros / pre-processor to
|
||||
enable build on non-standard platforms. Not yet accepted upstream.
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
Upstream Version: 1.0.18
|
||||
|
||||
libvamp
|
||||
-------
|
||||
Library to load and use VAMP plug-ins. http://www.vamp-plugins.org/
|
||||
Version in Audacity CVS: 2.0
|
||||
Patches: optional-progs.patch: Make building the Vamp host (and so the
|
||||
dependecy on libsndfile) optional rather than mandatory. Accepted upstream.
|
||||
distclean.patch: ensure that distclean actually works and takes away
|
||||
auto* droppings. Accepted upstream.
|
||||
Upstream Version: 2.0
|
||||
|
||||
libvorbis
|
||||
---------
|
||||
library for endcoding and decoding Xiph.org's high-quality compressed audio
|
||||
format.
|
||||
Version in Audacity CVS: 1.2.0
|
||||
Patches: local-libogg.patch: configure patch that lets us build against a
|
||||
local libogg if there isn't a system one.
|
||||
no-docs-examples.patch: disable building documentation and examples, so we can
|
||||
avoid shipping the files in those directories
|
||||
Upstream Version: 1.2.0
|
||||
|
||||
liblrdf
|
||||
-------
|
||||
Patches:
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
|
||||
|
||||
lib-widget-extra
|
||||
----------------
|
||||
|
||||
mod-script-pipe
|
||||
---------------
|
||||
|
||||
portaudio
|
||||
---------
|
||||
http://portaudio.com/
|
||||
cross-platform audio I/O library version 18, used for 1.2.x version of
|
||||
audacity.
|
||||
Quite heavily patched local copy to get AC-97 ALSA cards to play back
|
||||
correctly.
|
||||
|
||||
portaudio-v19
|
||||
-------------
|
||||
http://portaudio.com/
|
||||
cross-platform audio I/O library version 19, used for 1.3.2 onwards releases
|
||||
Version in audacity cvs: 1st July 2009 SVN snapshot (r1416)
|
||||
Patches:
|
||||
../portmixer/portaudio.patch add features needed to make portmixer work.
|
||||
Integration by upstream in progress. Will need updating as upstream
|
||||
portaudio moves
|
||||
|
||||
portaudio/libtool22.patch Patch from Gentoo to ensure that static libraries
|
||||
are always built, not shared ones, otherwise the assumptions elsewhere in the
|
||||
build system break. Not suitable for upstream, what is needed is more
|
||||
powerfull autoconf features to pass the right options to portaudio's configure
|
||||
script, which suffers from the broken-ness of autoconf's subdirectory support
|
||||
|
||||
portsmf
|
||||
-------
|
||||
http://portmedia.sourceforge.net/
|
||||
Cross-platform Midi file reader and writer (succeeded and obsoltes allegro)
|
||||
Version in audacity cvs: SVN snapshot from ????
|
||||
Patches:
|
||||
portsmf-includes.patch add include of <cstring> needed to compile with recent
|
||||
GCC versions
|
||||
portsmf-string-const.patch Add string const qualifiers as needed
|
||||
local-macros.patch Add all the necessary 3rd party m4 macros into autotools
|
||||
/m4/ and supporting changes.
|
||||
unsigned-const-casts.patch Build fix for Solaris compiler, adds casts to
|
||||
unsigned integer literals.
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
All patches have been added to upstream patch tracker at
|
||||
https://sourceforge.net/tracker2/?group_id=196750&atid=958711
|
||||
|
||||
|
||||
portburn
|
||||
--------
|
||||
Doesn't do anything yet
|
||||
|
||||
portmixer
|
||||
---------
|
||||
cross-platform audio mixer control library, hooked onto portaudio. Maintained
|
||||
by the audacity project with some help from portaudio development.
|
||||
|
||||
redland
|
||||
-------
|
||||
http://librdf.org
|
||||
RDF parser and query engine. Consists of three separate libraries, Raptor
|
||||
(the parser), Rasqal (the query engine) and librdf (triple storage and
|
||||
wrapper API). It is needed for liblrdf and SLV2.
|
||||
Version in audacity cvs: 1.0.8
|
||||
Patches:
|
||||
audacity_build_tweaks.patch Patches the configure scripts to turn off parsers, storage models and query languages not used by Audacity as well as using Expat instead of libxml2 for XML parsing. No need to integrate with upstream.
|
||||
|
||||
rtaudio
|
||||
-------
|
||||
http://www.music.mcgill.ca/~gary/rtaudio/
|
||||
Another cross-platform audio I/O library that was at one point available as an
|
||||
alternative to portaudio.
|
||||
|
||||
sbsms
|
||||
-----
|
||||
http://sbsms.sourceforge.net/
|
||||
An audio stretching library for changing pitch or tempo without changing the
|
||||
other. Alternative to SoundTouch, better on large changes but slower.
|
||||
Version in audacity cvs: ??
|
||||
Patches:
|
||||
Misc fixes to configure.in/Makefile.am for autoconf macros and libtool. More
|
||||
files added to m4/ directory by libtoolizing commited to CVS.
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
dont-mangle-cflags.patch patch to stop sed-ing the CXXFLAGS and achieve the
|
||||
same ends by better means, replacing a hacked version from Gentoo. Patch
|
||||
linked to from upstream tracker at
|
||||
https://sourceforge.net/tracker/index.php?func=detail&aid=2561247&group_id=177794&atid=882654
|
||||
because attachements there don't seem to work.
|
||||
|
||||
slv2
|
||||
-------
|
||||
http://wiki.drobilla.net/SLV2
|
||||
Support library for LV2 hosts (like Audacity).
|
||||
Version in audacity cvs: 0.6.0
|
||||
Patches:
|
||||
audacity_build_tweaks.patch Patches the configure scripts to not build hosts and utility programs and to use local Redland libraries if requested. No need to integrate with upstream.
|
||||
lv2core_internal.patch Add lv2.h as an internal header to avoid the dependency on lv2core.
|
||||
i18n.patch Patch to support translation of some form?
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
|
||||
soundtouch
|
||||
----------
|
||||
http://www.surina.net/soundtouch/
|
||||
Independant Pitch and Tempo changing library.
|
||||
Version in audacity cvs: 1.3.1
|
||||
Patches:
|
||||
PPC mac build changes to configure.in in several places
|
||||
correct-const-usage.patch: makes usage of const keyword consistent so it
|
||||
compiles with Sun's C++ compiler. Patch sent upstream 17/03/2008
|
||||
fix-includes.patch: needed for GCC 4.3.1 to include all the headers we use
|
||||
directly. In upstream SVN
|
||||
Argument ([-Wall foreign]) added to AM_INIT_AUTOMAKE because autoreconf fails
|
||||
otherwise
|
||||
Upstream Version: 1.3.1
|
||||
|
||||
taglib
|
||||
------
|
||||
http://developer.kde.org/~wheeler/taglib.html
|
||||
svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib
|
||||
Audio Meta-Data Library
|
||||
Version in audacity cvs: svn revision 924567 (post 1.5)
|
||||
Patches: none
|
||||
|
||||
If replacing via svn, you need to do the following to generate the configure
|
||||
scripts (from within the base taglib directory):
|
||||
sh admin/cvs.sh dist
|
||||
|
||||
And remove the .svn directories (from within the base taglib direcotry):
|
||||
find -d . -path \*/.svn\* -exec rm -rf \{\} \;
|
||||
|
||||
twolame
|
||||
-------
|
||||
http://www.twolame.org/
|
||||
MPEG I layer 2 audio encoding library used for MP2 exports
|
||||
Version in audacity cvs: 0.3.12
|
||||
Patches: None
|
||||
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
|
||||
by default
|
||||
Upstream Version: 0.3.12
|
||||
|
||||
wave++
|
||||
------
|
||||
http://www.scs.ryerson.ca/~lkolasa/CppWavelets.html
|
||||
disused?
|
||||
|
||||
Crib notes on upgrading lib-src trees:
|
||||
======================================
|
||||
1 Remove old files
|
||||
------------------
|
||||
find . -not -wholename '*CVS*' -delete
|
||||
will remove all the source files but not any directories or the CVS files, so
|
||||
after this you have an empty place into which you can unpack the new tarball
|
||||
|
||||
2 Bring in new files
|
||||
--------------------
|
||||
Next unpack the tarball. If you want to unpack within a package directory,
|
||||
then tar --strip-components 1 will remove the un-needed top level directory.
|
||||
|
||||
3 Apply patches and updates
|
||||
---------------------------
|
||||
Now we have a new file tree. This is the point at which to clean out any
|
||||
un-needed files, re-apply any local patches so on. To clean up after patching,
|
||||
run find . -name '*.orig' -delete and find . -name '*~' -delete. To remove
|
||||
.svn directories from projects that use SVN upstream, use
|
||||
find . -wholename '*/.svn/*' -delete and then find . -name '.svn' -delete
|
||||
|
||||
* run autoreconf if we have modified configure.in or configure.ac
|
||||
* If the package uses libtool, run libtoolize --copy --force to update
|
||||
ltmain.sh, config.sub, config.guess. If not, update config.sub,
|
||||
config.guess from /usr/share/gnuconfig/
|
||||
|
||||
By doing it this way we have already updated the mtime on all files, so we
|
||||
don't need to do a recusive touch.
|
||||
|
||||
4 Add new files to CVS and remove old ones
|
||||
------------------------------------------
|
||||
CVS will list files with a ? if they are new and need to be added to the
|
||||
repository. To get a list, run
|
||||
cvs st 2>/dev/null | grep '?'
|
||||
Remember to ignore the generated files from the build system which don't need
|
||||
to be included in CVS, like aclocal.m4 and autom4te.cache
|
||||
|
||||
Finding which files have been removed is a bit harder:
|
||||
cvs st 2>/dev/null | grep 'Status: Needs Checkout'
|
||||
gives file names but not their paths, so you have to go back and grep each
|
||||
file name to find them and do cvs rm on them.
|
||||
|
||||
To remove all the files that are in the working directory but aren't under CVS
|
||||
control, you can use this incantation:
|
||||
\rm $(cvs st 2>/dev/null | grep '?' | cut -d '?' -f 2)
|
||||
|
||||
5 Commit the lot to CVS
|
||||
-----------------------
|
||||
Run cvs ci -f -R to commit all the files in the new library tree. Use an
|
||||
appropriate message that says what library version this is. This should do
|
||||
all the required changes and add / remove files.
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
Makefile
|
|
@ -0,0 +1,16 @@
|
|||
CC = @CC@
|
||||
srcdir=@srcdir@
|
||||
|
||||
override CFLAGS += @CFLAGS@ -Ixmlparse -Ixmltok
|
||||
|
||||
OBJS = xmlparse/xmlparse.o xmltok/xmlrole.o xmltok/xmltok.o
|
||||
|
||||
expat.a: $(OBJS)
|
||||
ar ruv expat.a $(OBJS)
|
||||
ranlib expat.a
|
||||
|
||||
clean:
|
||||
rm -f expat.a xmlparse/*.o xmltok/*.o
|
||||
|
||||
$(OBJS): %.o: $(srcdir)/%.c Makefile
|
||||
$(CC) -I$(srcdir)/xmlparse -I$(srcdir)/xmltok -c $(CFLAGS) $< -o $@
|
|
@ -0,0 +1,20 @@
|
|||
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
|
||||
<TITLE>expat</TITLE>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>expat - XML Parser Toolkit</H1>
|
||||
|
||||
<H3>Version 1.2</H3>
|
||||
|
||||
<P>Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center
|
||||
Ltd. Expat is freely available with source under a very liberal <a
|
||||
href="copying.txt">license</a> (the MIT license).</P>
|
||||
|
||||
<P>This is a production version of expat. Relative to expat 1.1, it
|
||||
adds support for parsing external DTDs and parameter entities.
|
||||
Compiling with -DXML_DTD enables this support. There's a new
|
||||
<CODE>-p</CODE> option for xmlwf which will cause it to process
|
||||
external DTDs and parameter entities; this implies the <CODE>-x</CODE>
|
||||
option. See the comment above <CODE>XML_SetParamEntityParsing</CODE>
|
||||
in <CODE>xmlparse.h</CODE> for the API addition that enables this.</P>
|
||||
|
||||
<P>Expat is an <A
|
||||
HREF="http://www.w3.org/TR/1998/REC-xml-19980210">XML 1.0</A> parser
|
||||
written in C. It aims to be fully conforming. It is currently not a
|
||||
validating XML processor. The current production version of expat 1.X
|
||||
can be downloaded from <A href =
|
||||
"ftp://ftp.jclark.com/pub/xml/expat.zip"
|
||||
>ftp://ftp.jclark.com/pub/xml/expat.zip</A>.</P>
|
||||
|
||||
<P>Development of expat 2.0 is being handled by a team led by Clark
|
||||
Cooper, hosted by <A
|
||||
href="http://www.sourceforge.net">sourceforge.net</A>. See <A href=
|
||||
"http://expat.sourceforge.net">http://expat.sourceforge.net</A> for
|
||||
the latest on expat 2.0.</P>
|
||||
|
||||
<P>The directory <SAMP>xmltok</SAMP> contains a low-level library for
|
||||
tokenizing XML. The interface is documented in
|
||||
<SAMP>xmltok/xmltok.h</SAMP>.</P>
|
||||
|
||||
<P>The directory <SAMP>xmlparse</SAMP> contains an XML parser library
|
||||
which is built on top of the <SAMP>xmltok</SAMP> library. The
|
||||
interface is documented in <SAMP>xmlparse/xmlparse.h</SAMP>. The
|
||||
directory <SAMP>sample</SAMP> contains a simple example program using
|
||||
this interface; <SAMP>sample/build.bat</SAMP> is a batch file to build
|
||||
the example using Visual C++.</P>
|
||||
|
||||
<P>The directory <SAMP>xmlwf</SAMP> contains the <SAMP>xmlwf</SAMP>
|
||||
application, which uses the <SAMP>xmlparse</SAMP> library. The
|
||||
arguments to <SAMP>xmlwf</SAMP> are one or more files which are each
|
||||
to be checked for well-formedness. An option <SAMP>-d
|
||||
<VAR>dir</VAR></SAMP> can be specified; for each well-formed input
|
||||
file the corresponding <A
|
||||
href="http://www.jclark.com/xml/canonxml.html">canonical XML</A> will
|
||||
be written to <SAMP>dir/<VAR>f</VAR></SAMP>, where
|
||||
<SAMP><VAR>f</VAR></SAMP> is the filename (without any path) of the
|
||||
input file. A <CODE>-x</CODE> option will cause references to
|
||||
external general entities to be processed. A <CODE>-s</CODE> option
|
||||
will make documents that are not standalone cause an error (a document
|
||||
is considered standalone if either it is intrinsically standalone
|
||||
because it has no external subset and no references to parameter
|
||||
entities in the internal subset or it is declared as standalone in the
|
||||
XML declaration).</P>
|
||||
|
||||
<P>The <SAMP>bin</SAMP> directory contains Win32 executables. The
|
||||
<SAMP>lib</SAMP> directory contains Win32 import libraries.</P>
|
||||
|
||||
<P>Answers to some frequently asked questions about expat can be found
|
||||
in the <A
|
||||
HREF="http://www.jclark.com/xml/expatfaq.html">expat
|
||||
FAQ</A>.</P>
|
||||
|
||||
<P></P>
|
||||
|
||||
<ADDRESS>
|
||||
|
||||
<A HREF="mailto:jjc@jclark.com">James Clark</A>
|
||||
|
||||
</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
|
@ -0,0 +1,799 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="expat"
|
||||
ProjectGUID="{38C2C6B1-FBF8-4C5C-BB90-63F996083F56}"
|
||||
RootNamespace="expat"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\$(ConfigurationName)"
|
||||
IntermediateDirectory=".\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expatd.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\$(ConfigurationName)"
|
||||
IntermediateDirectory=".\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/O2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expat.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Unicode_Debug|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expatud.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Unicode_Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/O2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expatu.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug DLL|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expatd.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug wx284|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expatd.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Modular_Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/O2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".\xmltok"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\$(ConfigurationName)/expat.pch"
|
||||
AssemblerListingLocation=".\$(ConfigurationName)/"
|
||||
ObjectFile=".\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName=".\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="expat.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="xmlparse\xmlparse.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug DLL|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug wx284|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Modular_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="xmltok\xmlrole.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug DLL|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug wx284|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Modular_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="xmltok\xmltok.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Unicode_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug DLL|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug wx284|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Modular_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,527 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
#ifndef XmlParse_INCLUDED
|
||||
#define XmlParse_INCLUDED 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XMLPARSEAPI
|
||||
#define XMLPARSEAPI /* as nothing */
|
||||
#endif
|
||||
|
||||
typedef void *XML_Parser;
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
|
||||
/* XML_UNICODE_WCHAR_T will work only if sizeof(wchar_t) == 2 and wchar_t
|
||||
uses Unicode. */
|
||||
/* Information is UTF-16 encoded as wchar_ts */
|
||||
|
||||
#ifndef XML_UNICODE
|
||||
#define XML_UNICODE
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
typedef wchar_t XML_Char;
|
||||
typedef wchar_t XML_LChar;
|
||||
|
||||
#else /* not XML_UNICODE_WCHAR_T */
|
||||
|
||||
#ifdef XML_UNICODE
|
||||
|
||||
/* Information is UTF-16 encoded as unsigned shorts */
|
||||
typedef unsigned short XML_Char;
|
||||
typedef char XML_LChar;
|
||||
|
||||
#else /* not XML_UNICODE */
|
||||
|
||||
/* Information is UTF-8 encoded. */
|
||||
typedef char XML_Char;
|
||||
typedef char XML_LChar;
|
||||
|
||||
#endif /* not XML_UNICODE */
|
||||
|
||||
#endif /* not XML_UNICODE_WCHAR_T */
|
||||
|
||||
|
||||
/* Constructs a new parser; encoding is the encoding specified by the external
|
||||
protocol or null if there is none specified. */
|
||||
|
||||
XML_Parser XMLPARSEAPI
|
||||
XML_ParserCreate(const XML_Char *encoding);
|
||||
|
||||
/* Constructs a new parser and namespace processor. Element type names
|
||||
and attribute names that belong to a namespace will be expanded;
|
||||
unprefixed attribute names are never expanded; unprefixed element type
|
||||
names are expanded only if there is a default namespace. The expanded
|
||||
name is the concatenation of the namespace URI, the namespace separator character,
|
||||
and the local part of the name. If the namespace separator is '\0' then
|
||||
the namespace URI and the local part will be concatenated without any
|
||||
separator. When a namespace is not declared, the name and prefix will be
|
||||
passed through without expansion. */
|
||||
|
||||
XML_Parser XMLPARSEAPI
|
||||
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
|
||||
|
||||
|
||||
/* atts is array of name/value pairs, terminated by 0;
|
||||
names and values are 0 terminated. */
|
||||
|
||||
typedef void (*XML_StartElementHandler)(void *userData,
|
||||
const XML_Char *name,
|
||||
const XML_Char **atts);
|
||||
|
||||
typedef void (*XML_EndElementHandler)(void *userData,
|
||||
const XML_Char *name);
|
||||
|
||||
/* s is not 0 terminated. */
|
||||
typedef void (*XML_CharacterDataHandler)(void *userData,
|
||||
const XML_Char *s,
|
||||
int len);
|
||||
|
||||
/* target and data are 0 terminated */
|
||||
typedef void (*XML_ProcessingInstructionHandler)(void *userData,
|
||||
const XML_Char *target,
|
||||
const XML_Char *data);
|
||||
|
||||
/* data is 0 terminated */
|
||||
typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
|
||||
|
||||
typedef void (*XML_StartCdataSectionHandler)(void *userData);
|
||||
typedef void (*XML_EndCdataSectionHandler)(void *userData);
|
||||
|
||||
/* This is called for any characters in the XML document for
|
||||
which there is no applicable handler. This includes both
|
||||
characters that are part of markup which is of a kind that is
|
||||
not reported (comments, markup declarations), or characters
|
||||
that are part of a construct which could be reported but
|
||||
for which no handler has been supplied. The characters are passed
|
||||
exactly as they were in the XML document except that
|
||||
they will be encoded in UTF-8. Line boundaries are not normalized.
|
||||
Note that a byte order mark character is not passed to the default handler.
|
||||
There are no guarantees about how characters are divided between calls
|
||||
to the default handler: for example, a comment might be split between
|
||||
multiple calls. */
|
||||
|
||||
typedef void (*XML_DefaultHandler)(void *userData,
|
||||
const XML_Char *s,
|
||||
int len);
|
||||
|
||||
/* This is called for the start of the DOCTYPE declaration when the
|
||||
name of the DOCTYPE is encountered. */
|
||||
typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
|
||||
const XML_Char *doctypeName);
|
||||
|
||||
/* This is called for the start of the DOCTYPE declaration when the
|
||||
closing > is encountered, but after processing any external subset. */
|
||||
typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
|
||||
|
||||
/* This is called for a declaration of an unparsed (NDATA)
|
||||
entity. The base argument is whatever was set by XML_SetBase.
|
||||
The entityName, systemId and notationName arguments will never be null.
|
||||
The other arguments may be. */
|
||||
|
||||
typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
|
||||
const XML_Char *entityName,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId,
|
||||
const XML_Char *notationName);
|
||||
|
||||
/* This is called for a declaration of notation.
|
||||
The base argument is whatever was set by XML_SetBase.
|
||||
The notationName will never be null. The other arguments can be. */
|
||||
|
||||
typedef void (*XML_NotationDeclHandler)(void *userData,
|
||||
const XML_Char *notationName,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId);
|
||||
|
||||
typedef void (*XML_ExternalParsedEntityDeclHandler)(void *userData,
|
||||
const XML_Char *entityName,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId);
|
||||
|
||||
typedef void (*XML_InternalParsedEntityDeclHandler)(void *userData,
|
||||
const XML_Char *entityName,
|
||||
const XML_Char *replacementText,
|
||||
int replacementTextLength);
|
||||
|
||||
/* When namespace processing is enabled, these are called once for
|
||||
each namespace declaration. The call to the start and end element
|
||||
handlers occur between the calls to the start and end namespace
|
||||
declaration handlers. For an xmlns attribute, prefix will be null.
|
||||
For an xmlns="" attribute, uri will be null. */
|
||||
|
||||
typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
|
||||
const XML_Char *prefix,
|
||||
const XML_Char *uri);
|
||||
|
||||
typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
|
||||
const XML_Char *prefix);
|
||||
|
||||
/* This is called if the document is not standalone (it has an
|
||||
external subset or a reference to a parameter entity, but does not
|
||||
have standalone="yes"). If this handler returns 0, then processing
|
||||
will not continue, and the parser will return a
|
||||
XML_ERROR_NOT_STANDALONE error. */
|
||||
|
||||
typedef int (*XML_NotStandaloneHandler)(void *userData);
|
||||
|
||||
/* This is called for a reference to an external parsed general entity.
|
||||
The referenced entity is not automatically parsed.
|
||||
The application can parse it immediately or later using
|
||||
XML_ExternalEntityParserCreate.
|
||||
The parser argument is the parser parsing the entity containing the reference;
|
||||
it can be passed as the parser argument to XML_ExternalEntityParserCreate.
|
||||
The systemId argument is the system identifier as specified in the entity declaration;
|
||||
it will not be null.
|
||||
The base argument is the system identifier that should be used as the base for
|
||||
resolving systemId if systemId was relative; this is set by XML_SetBase;
|
||||
it may be null.
|
||||
The publicId argument is the public identifier as specified in the entity declaration,
|
||||
or null if none was specified; the whitespace in the public identifier
|
||||
will have been normalized as required by the XML spec.
|
||||
The context argument specifies the parsing context in the format
|
||||
expected by the context argument to
|
||||
XML_ExternalEntityParserCreate; context is valid only until the handler
|
||||
returns, so if the referenced entity is to be parsed later, it must be copied.
|
||||
The handler should return 0 if processing should not continue because of
|
||||
a fatal error in the handling of the external entity.
|
||||
In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING
|
||||
error.
|
||||
Note that unlike other handlers the first argument is the parser, not userData. */
|
||||
|
||||
typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
|
||||
const XML_Char *context,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId);
|
||||
|
||||
/* This structure is filled in by the XML_UnknownEncodingHandler
|
||||
to provide information to the parser about encodings that are unknown
|
||||
to the parser.
|
||||
The map[b] member gives information about byte sequences
|
||||
whose first byte is b.
|
||||
If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c.
|
||||
If map[b] is -1, then the byte sequence is malformed.
|
||||
If map[b] is -n, where n >= 2, then b is the first byte of an n-byte
|
||||
sequence that encodes a single Unicode scalar value.
|
||||
The data member will be passed as the first argument to the convert function.
|
||||
The convert function is used to convert multibyte sequences;
|
||||
s will point to a n-byte sequence where map[(unsigned char)*s] == -n.
|
||||
The convert function must return the Unicode scalar value
|
||||
represented by this byte sequence or -1 if the byte sequence is malformed.
|
||||
The convert function may be null if the encoding is a single-byte encoding,
|
||||
that is if map[b] >= -1 for all bytes b.
|
||||
When the parser is finished with the encoding, then if release is not null,
|
||||
it will call release passing it the data member;
|
||||
once release has been called, the convert function will not be called again.
|
||||
|
||||
Expat places certain restrictions on the encodings that are supported
|
||||
using this mechanism.
|
||||
|
||||
1. Every ASCII character that can appear in a well-formed XML document,
|
||||
other than the characters
|
||||
|
||||
$@\^`{}~
|
||||
|
||||
must be represented by a single byte, and that byte must be the
|
||||
same byte that represents that character in ASCII.
|
||||
|
||||
2. No character may require more than 4 bytes to encode.
|
||||
|
||||
3. All characters encoded must have Unicode scalar values <= 0xFFFF,
|
||||
(ie characters that would be encoded by surrogates in UTF-16
|
||||
are not allowed). Note that this restriction doesn't apply to
|
||||
the built-in support for UTF-8 and UTF-16.
|
||||
|
||||
4. No Unicode character may be encoded by more than one distinct sequence
|
||||
of bytes. */
|
||||
|
||||
typedef struct {
|
||||
int map[256];
|
||||
void *data;
|
||||
int (*convert)(void *data, const char *s);
|
||||
void (*release)(void *data);
|
||||
} XML_Encoding;
|
||||
|
||||
/* This is called for an encoding that is unknown to the parser.
|
||||
The encodingHandlerData argument is that which was passed as the
|
||||
second argument to XML_SetUnknownEncodingHandler.
|
||||
The name argument gives the name of the encoding as specified in
|
||||
the encoding declaration.
|
||||
If the callback can provide information about the encoding,
|
||||
it must fill in the XML_Encoding structure, and return 1.
|
||||
Otherwise it must return 0.
|
||||
If info does not describe a suitable encoding,
|
||||
then the parser will return an XML_UNKNOWN_ENCODING error. */
|
||||
|
||||
typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
|
||||
const XML_Char *name,
|
||||
XML_Encoding *info);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetElementHandler(XML_Parser parser,
|
||||
XML_StartElementHandler start,
|
||||
XML_EndElementHandler end);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetCharacterDataHandler(XML_Parser parser,
|
||||
XML_CharacterDataHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetProcessingInstructionHandler(XML_Parser parser,
|
||||
XML_ProcessingInstructionHandler handler);
|
||||
void XMLPARSEAPI
|
||||
XML_SetCommentHandler(XML_Parser parser,
|
||||
XML_CommentHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetCdataSectionHandler(XML_Parser parser,
|
||||
XML_StartCdataSectionHandler start,
|
||||
XML_EndCdataSectionHandler end);
|
||||
|
||||
/* This sets the default handler and also inhibits expansion of internal entities.
|
||||
The entity reference will be passed to the default handler. */
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetDefaultHandler(XML_Parser parser,
|
||||
XML_DefaultHandler handler);
|
||||
|
||||
/* This sets the default handler but does not inhibit expansion of internal entities.
|
||||
The entity reference will not be passed to the default handler. */
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetDefaultHandlerExpand(XML_Parser parser,
|
||||
XML_DefaultHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetDoctypeDeclHandler(XML_Parser parser,
|
||||
XML_StartDoctypeDeclHandler start,
|
||||
XML_EndDoctypeDeclHandler end);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
|
||||
XML_UnparsedEntityDeclHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetNotationDeclHandler(XML_Parser parser,
|
||||
XML_NotationDeclHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetExternalParsedEntityDeclHandler(XML_Parser parser,
|
||||
XML_ExternalParsedEntityDeclHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetInternalParsedEntityDeclHandler(XML_Parser parser,
|
||||
XML_InternalParsedEntityDeclHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetNamespaceDeclHandler(XML_Parser parser,
|
||||
XML_StartNamespaceDeclHandler start,
|
||||
XML_EndNamespaceDeclHandler end);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetNotStandaloneHandler(XML_Parser parser,
|
||||
XML_NotStandaloneHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetExternalEntityRefHandler(XML_Parser parser,
|
||||
XML_ExternalEntityRefHandler handler);
|
||||
|
||||
/* If a non-null value for arg is specified here, then it will be passed
|
||||
as the first argument to the external entity ref handler instead
|
||||
of the parser object. */
|
||||
void XMLPARSEAPI
|
||||
XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetUnknownEncodingHandler(XML_Parser parser,
|
||||
XML_UnknownEncodingHandler handler,
|
||||
void *encodingHandlerData);
|
||||
|
||||
/* This can be called within a handler for a start element, end element,
|
||||
processing instruction or character data. It causes the corresponding
|
||||
markup to be passed to the default handler. */
|
||||
void XMLPARSEAPI XML_DefaultCurrent(XML_Parser parser);
|
||||
|
||||
/* This value is passed as the userData argument to callbacks. */
|
||||
void XMLPARSEAPI
|
||||
XML_SetUserData(XML_Parser parser, void *userData);
|
||||
|
||||
/* Returns the last value set by XML_SetUserData or null. */
|
||||
#define XML_GetUserData(parser) (*(void **)(parser))
|
||||
|
||||
/* This is equivalent to supplying an encoding argument
|
||||
to XML_ParserCreate. It must not be called after XML_Parse
|
||||
or XML_ParseBuffer. */
|
||||
|
||||
int XMLPARSEAPI
|
||||
XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
|
||||
|
||||
/* If this function is called, then the parser will be passed
|
||||
as the first argument to callbacks instead of userData.
|
||||
The userData will still be accessible using XML_GetUserData. */
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_UseParserAsHandlerArg(XML_Parser parser);
|
||||
|
||||
/* Sets the base to be used for resolving relative URIs in system identifiers in
|
||||
declarations. Resolving relative identifiers is left to the application:
|
||||
this value will be passed through as the base argument to the
|
||||
XML_ExternalEntityRefHandler, XML_NotationDeclHandler
|
||||
and XML_UnparsedEntityDeclHandler. The base argument will be copied.
|
||||
Returns zero if out of memory, non-zero otherwise. */
|
||||
|
||||
int XMLPARSEAPI
|
||||
XML_SetBase(XML_Parser parser, const XML_Char *base);
|
||||
|
||||
const XML_Char XMLPARSEAPI *
|
||||
XML_GetBase(XML_Parser parser);
|
||||
|
||||
/* Returns the number of the attribute/value pairs passed in last call
|
||||
to the XML_StartElementHandler that were specified in the start-tag
|
||||
rather than defaulted. Each attribute/value pair counts as 2; thus
|
||||
this correspondds to an index into the atts array passed to the
|
||||
XML_StartElementHandler. */
|
||||
|
||||
int XMLPARSEAPI XML_GetSpecifiedAttributeCount(XML_Parser parser);
|
||||
|
||||
/* Returns the index of the ID attribute passed in the last call to
|
||||
XML_StartElementHandler, or -1 if there is no ID attribute. Each
|
||||
attribute/value pair counts as 2; thus this correspondds to an index
|
||||
into the atts array passed to the XML_StartElementHandler. */
|
||||
int XMLPARSEAPI XML_GetIdAttributeIndex(XML_Parser parser);
|
||||
|
||||
/* Parses some input. Returns 0 if a fatal error is detected.
|
||||
The last call to XML_Parse must have isFinal true;
|
||||
len may be zero for this call (or any other). */
|
||||
int XMLPARSEAPI
|
||||
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
|
||||
|
||||
void XMLPARSEAPI *
|
||||
XML_GetBuffer(XML_Parser parser, int len);
|
||||
|
||||
int XMLPARSEAPI
|
||||
XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
|
||||
|
||||
/* Creates an XML_Parser object that can parse an external general entity;
|
||||
context is a '\0'-terminated string specifying the parse context;
|
||||
encoding is a '\0'-terminated string giving the name of the externally specified encoding,
|
||||
or null if there is no externally specified encoding.
|
||||
The context string consists of a sequence of tokens separated by formfeeds (\f);
|
||||
a token consisting of a name specifies that the general entity of the name
|
||||
is open; a token of the form prefix=uri specifies the namespace for a particular
|
||||
prefix; a token of the form =uri specifies the default namespace.
|
||||
This can be called at any point after the first call to an ExternalEntityRefHandler
|
||||
so longer as the parser has not yet been freed.
|
||||
The new parser is completely independent and may safely be used in a separate thread.
|
||||
The handlers and userData are initialized from the parser argument.
|
||||
Returns 0 if out of memory. Otherwise returns a new XML_Parser object. */
|
||||
XML_Parser XMLPARSEAPI
|
||||
XML_ExternalEntityParserCreate(XML_Parser parser,
|
||||
const XML_Char *context,
|
||||
const XML_Char *encoding);
|
||||
|
||||
enum XML_ParamEntityParsing {
|
||||
XML_PARAM_ENTITY_PARSING_NEVER,
|
||||
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
|
||||
XML_PARAM_ENTITY_PARSING_ALWAYS
|
||||
};
|
||||
|
||||
/* Controls parsing of parameter entities (including the external DTD
|
||||
subset). If parsing of parameter entities is enabled, then references
|
||||
to external parameter entities (including the external DTD subset)
|
||||
will be passed to the handler set with
|
||||
XML_SetExternalEntityRefHandler. The context passed will be 0.
|
||||
Unlike external general entities, external parameter entities can only
|
||||
be parsed synchronously. If the external parameter entity is to be
|
||||
parsed, it must be parsed during the call to the external entity ref
|
||||
handler: the complete sequence of XML_ExternalEntityParserCreate,
|
||||
XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during
|
||||
this call. After XML_ExternalEntityParserCreate has been called to
|
||||
create the parser for the external parameter entity (context must be 0
|
||||
for this call), it is illegal to make any calls on the old parser
|
||||
until XML_ParserFree has been called on the newly created parser. If
|
||||
the library has been compiled without support for parameter entity
|
||||
parsing (ie without XML_DTD being defined), then
|
||||
XML_SetParamEntityParsing will return 0 if parsing of parameter
|
||||
entities is requested; otherwise it will return non-zero. */
|
||||
|
||||
int XMLPARSEAPI
|
||||
XML_SetParamEntityParsing(XML_Parser parser,
|
||||
enum XML_ParamEntityParsing parsing);
|
||||
|
||||
enum XML_Error {
|
||||
XML_ERROR_NONE,
|
||||
XML_ERROR_NO_MEMORY,
|
||||
XML_ERROR_SYNTAX,
|
||||
XML_ERROR_NO_ELEMENTS,
|
||||
XML_ERROR_INVALID_TOKEN,
|
||||
XML_ERROR_UNCLOSED_TOKEN,
|
||||
XML_ERROR_PARTIAL_CHAR,
|
||||
XML_ERROR_TAG_MISMATCH,
|
||||
XML_ERROR_DUPLICATE_ATTRIBUTE,
|
||||
XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
|
||||
XML_ERROR_PARAM_ENTITY_REF,
|
||||
XML_ERROR_UNDEFINED_ENTITY,
|
||||
XML_ERROR_RECURSIVE_ENTITY_REF,
|
||||
XML_ERROR_ASYNC_ENTITY,
|
||||
XML_ERROR_BAD_CHAR_REF,
|
||||
XML_ERROR_BINARY_ENTITY_REF,
|
||||
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
|
||||
XML_ERROR_MISPLACED_XML_PI,
|
||||
XML_ERROR_UNKNOWN_ENCODING,
|
||||
XML_ERROR_INCORRECT_ENCODING,
|
||||
XML_ERROR_UNCLOSED_CDATA_SECTION,
|
||||
XML_ERROR_EXTERNAL_ENTITY_HANDLING,
|
||||
XML_ERROR_NOT_STANDALONE
|
||||
};
|
||||
|
||||
/* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode
|
||||
returns information about the error. */
|
||||
|
||||
enum XML_Error XMLPARSEAPI XML_GetErrorCode(XML_Parser parser);
|
||||
|
||||
/* These functions return information about the current parse location.
|
||||
They may be called when XML_Parse or XML_ParseBuffer return 0;
|
||||
in this case the location is the location of the character at which
|
||||
the error was detected.
|
||||
They may also be called from any other callback called to report
|
||||
some parse event; in this the location is the location of the first
|
||||
of the sequence of characters that generated the event. */
|
||||
|
||||
int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser);
|
||||
int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser);
|
||||
long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser);
|
||||
|
||||
/* Return the number of bytes in the current event.
|
||||
Returns 0 if the event is in an internal entity. */
|
||||
|
||||
int XMLPARSEAPI XML_GetCurrentByteCount(XML_Parser parser);
|
||||
|
||||
/* For backwards compatibility with previous versions. */
|
||||
#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
|
||||
#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
|
||||
#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
|
||||
|
||||
/* Frees memory used by the parser. */
|
||||
void XMLPARSEAPI
|
||||
XML_ParserFree(XML_Parser parser);
|
||||
|
||||
/* Returns a string describing the error. */
|
||||
const XML_LChar XMLPARSEAPI *XML_ErrorString(int code);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not XmlParse_INCLUDED */
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
#define ASCII_A 0x41
|
||||
#define ASCII_B 0x42
|
||||
#define ASCII_C 0x43
|
||||
#define ASCII_D 0x44
|
||||
#define ASCII_E 0x45
|
||||
#define ASCII_F 0x46
|
||||
#define ASCII_G 0x47
|
||||
#define ASCII_H 0x48
|
||||
#define ASCII_I 0x49
|
||||
#define ASCII_J 0x4A
|
||||
#define ASCII_K 0x4B
|
||||
#define ASCII_L 0x4C
|
||||
#define ASCII_M 0x4D
|
||||
#define ASCII_N 0x4E
|
||||
#define ASCII_O 0x4F
|
||||
#define ASCII_P 0x50
|
||||
#define ASCII_Q 0x51
|
||||
#define ASCII_R 0x52
|
||||
#define ASCII_S 0x53
|
||||
#define ASCII_T 0x54
|
||||
#define ASCII_U 0x55
|
||||
#define ASCII_V 0x56
|
||||
#define ASCII_W 0x57
|
||||
#define ASCII_X 0x58
|
||||
#define ASCII_Y 0x59
|
||||
#define ASCII_Z 0x5A
|
||||
|
||||
#define ASCII_a 0x61
|
||||
#define ASCII_b 0x62
|
||||
#define ASCII_c 0x63
|
||||
#define ASCII_d 0x64
|
||||
#define ASCII_e 0x65
|
||||
#define ASCII_f 0x66
|
||||
#define ASCII_g 0x67
|
||||
#define ASCII_h 0x68
|
||||
#define ASCII_i 0x69
|
||||
#define ASCII_j 0x6A
|
||||
#define ASCII_k 0x6B
|
||||
#define ASCII_l 0x6C
|
||||
#define ASCII_m 0x6D
|
||||
#define ASCII_n 0x6E
|
||||
#define ASCII_o 0x6F
|
||||
#define ASCII_p 0x70
|
||||
#define ASCII_q 0x71
|
||||
#define ASCII_r 0x72
|
||||
#define ASCII_s 0x73
|
||||
#define ASCII_t 0x74
|
||||
#define ASCII_u 0x75
|
||||
#define ASCII_v 0x76
|
||||
#define ASCII_w 0x77
|
||||
#define ASCII_x 0x78
|
||||
#define ASCII_y 0x79
|
||||
#define ASCII_z 0x7A
|
||||
|
||||
#define ASCII_0 0x30
|
||||
#define ASCII_1 0x31
|
||||
#define ASCII_2 0x32
|
||||
#define ASCII_3 0x33
|
||||
#define ASCII_4 0x34
|
||||
#define ASCII_5 0x35
|
||||
#define ASCII_6 0x36
|
||||
#define ASCII_7 0x37
|
||||
#define ASCII_8 0x38
|
||||
#define ASCII_9 0x39
|
||||
|
||||
#define ASCII_TAB 0x09
|
||||
#define ASCII_SPACE 0x20
|
||||
#define ASCII_EXCL 0x21
|
||||
#define ASCII_QUOT 0x22
|
||||
#define ASCII_AMP 0x26
|
||||
#define ASCII_APOS 0x27
|
||||
#define ASCII_MINUS 0x2D
|
||||
#define ASCII_PERIOD 0x2E
|
||||
#define ASCII_COLON 0x3A
|
||||
#define ASCII_SEMI 0x3B
|
||||
#define ASCII_LT 0x3C
|
||||
#define ASCII_EQUALS 0x3D
|
||||
#define ASCII_GT 0x3E
|
||||
#define ASCII_LSQB 0x5B
|
||||
#define ASCII_RSQB 0x5D
|
||||
#define ASCII_UNDERSCORE 0x5F
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
|
||||
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
|
||||
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
|
||||
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
|
||||
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
|
||||
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
|
||||
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
|
||||
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
|
||||
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
|
||||
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
|
||||
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
|
||||
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
|
||||
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
|
||||
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
|
||||
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
|
||||
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
|
||||
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
|
||||
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
|
||||
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
|
||||
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
|
||||
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
|
||||
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
|
||||
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
|
@ -0,0 +1,150 @@
|
|||
static const unsigned namingBitmap[] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
|
||||
0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
|
||||
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
|
||||
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
|
||||
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
|
||||
0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
|
||||
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
|
||||
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
|
||||
0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
|
||||
0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
|
||||
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
|
||||
0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
|
||||
0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
|
||||
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
|
||||
0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
|
||||
0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
|
||||
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
|
||||
0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
|
||||
0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
|
||||
0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
|
||||
0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
|
||||
0x40000000, 0xF580C900, 0x00000007, 0x02010800,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
|
||||
0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
|
||||
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
|
||||
0x00000000, 0x00004C40, 0x00000000, 0x00000000,
|
||||
0x00000007, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
|
||||
0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
|
||||
0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
|
||||
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
|
||||
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
|
||||
0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
|
||||
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
|
||||
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
|
||||
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
|
||||
0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
|
||||
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
|
||||
0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
|
||||
0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
|
||||
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
|
||||
0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
|
||||
0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
|
||||
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
|
||||
0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
|
||||
0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
|
||||
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
|
||||
0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
|
||||
0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
|
||||
0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
|
||||
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
|
||||
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
|
||||
0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF,
|
||||
};
|
||||
static const unsigned char nmstrtPages[] = {
|
||||
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
|
||||
0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
|
||||
0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
static const unsigned char namePages[] = {
|
||||
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
|
||||
0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
|
||||
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
|
||||
0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
|
||||
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
|
||||
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef XML_WINLIB
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
|
||||
#define malloc(x) HeapAlloc(GetProcessHeap(), 0, (x))
|
||||
#define calloc(x, y) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x)*(y))
|
||||
#define free(x) HeapFree(GetProcessHeap(), 0, (x))
|
||||
#define realloc(x, y) HeapReAlloc(GetProcessHeap(), 0, x, y)
|
||||
#define abort() /* as nothing */
|
||||
|
||||
#else /* not XML_WINLIB */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#endif /* not XML_WINLIB */
|
||||
|
||||
/* This file can be used for any definitions needed in
|
||||
particular environments. */
|
||||
|
||||
/* Mozilla specific defines */
|
||||
|
||||
#ifdef MOZILLA_CLIENT
|
||||
|
||||
#include "nspr.h"
|
||||
#define malloc(x) PR_Malloc((size_t)(x))
|
||||
#define realloc(x, y) PR_Realloc((x), (size_t)(y))
|
||||
#define calloc(x, y) PR_Calloc((x),(y))
|
||||
#define free(x) PR_Free(x)
|
||||
#if PR_BYTES_PER_INT != 4
|
||||
#define int int32
|
||||
#endif
|
||||
|
||||
/* Enable Unicode string processing in expat. */
|
||||
#ifndef XML_UNICODE
|
||||
#define XML_UNICODE
|
||||
#endif
|
||||
|
||||
/* Enable external parameter entity parsing in expat */
|
||||
#ifndef XML_DTD
|
||||
#define XML_DTD 1
|
||||
#endif
|
||||
|
||||
#endif /* MOZILLA_CLIENT */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
#ifndef XmlRole_INCLUDED
|
||||
#define XmlRole_INCLUDED 1
|
||||
|
||||
#include "xmltok.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
XML_ROLE_ERROR = -1,
|
||||
XML_ROLE_NONE = 0,
|
||||
XML_ROLE_XML_DECL,
|
||||
XML_ROLE_INSTANCE_START,
|
||||
XML_ROLE_DOCTYPE_NAME,
|
||||
XML_ROLE_DOCTYPE_SYSTEM_ID,
|
||||
XML_ROLE_DOCTYPE_PUBLIC_ID,
|
||||
XML_ROLE_DOCTYPE_CLOSE,
|
||||
XML_ROLE_GENERAL_ENTITY_NAME,
|
||||
XML_ROLE_PARAM_ENTITY_NAME,
|
||||
XML_ROLE_ENTITY_VALUE,
|
||||
XML_ROLE_ENTITY_SYSTEM_ID,
|
||||
XML_ROLE_ENTITY_PUBLIC_ID,
|
||||
XML_ROLE_ENTITY_NOTATION_NAME,
|
||||
XML_ROLE_NOTATION_NAME,
|
||||
XML_ROLE_NOTATION_SYSTEM_ID,
|
||||
XML_ROLE_NOTATION_NO_SYSTEM_ID,
|
||||
XML_ROLE_NOTATION_PUBLIC_ID,
|
||||
XML_ROLE_ATTRIBUTE_NAME,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_CDATA,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_ID,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_IDREF,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
|
||||
XML_ROLE_ATTRIBUTE_ENUM_VALUE,
|
||||
XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
|
||||
XML_ROLE_ATTLIST_ELEMENT_NAME,
|
||||
XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_FIXED_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_ELEMENT_NAME,
|
||||
XML_ROLE_CONTENT_ANY,
|
||||
XML_ROLE_CONTENT_EMPTY,
|
||||
XML_ROLE_CONTENT_PCDATA,
|
||||
XML_ROLE_GROUP_OPEN,
|
||||
XML_ROLE_GROUP_CLOSE,
|
||||
XML_ROLE_GROUP_CLOSE_REP,
|
||||
XML_ROLE_GROUP_CLOSE_OPT,
|
||||
XML_ROLE_GROUP_CLOSE_PLUS,
|
||||
XML_ROLE_GROUP_CHOICE,
|
||||
XML_ROLE_GROUP_SEQUENCE,
|
||||
XML_ROLE_CONTENT_ELEMENT,
|
||||
XML_ROLE_CONTENT_ELEMENT_REP,
|
||||
XML_ROLE_CONTENT_ELEMENT_OPT,
|
||||
XML_ROLE_CONTENT_ELEMENT_PLUS,
|
||||
#ifdef XML_DTD
|
||||
XML_ROLE_TEXT_DECL,
|
||||
XML_ROLE_IGNORE_SECT,
|
||||
XML_ROLE_INNER_PARAM_ENTITY_REF,
|
||||
#endif /* XML_DTD */
|
||||
XML_ROLE_PARAM_ENTITY_REF,
|
||||
XML_ROLE_EXTERNAL_GENERAL_ENTITY_NO_NOTATION
|
||||
};
|
||||
|
||||
typedef struct prolog_state {
|
||||
int (*handler)(struct prolog_state *state,
|
||||
int tok,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
const ENCODING *enc);
|
||||
unsigned level;
|
||||
#ifdef XML_DTD
|
||||
unsigned includeLevel;
|
||||
int documentEntity;
|
||||
#endif /* XML_DTD */
|
||||
} PROLOG_STATE;
|
||||
|
||||
void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *);
|
||||
#ifdef XML_DTD
|
||||
void XMLTOKAPI XmlPrologStateInitExternalEntity(PROLOG_STATE *);
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#define XmlTokenRole(state, tok, ptr, end, enc) \
|
||||
(((state)->handler)(state, tok, ptr, end, enc))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not XmlRole_INCLUDED */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,301 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
#ifndef XmlTok_INCLUDED
|
||||
#define XmlTok_INCLUDED 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XMLTOKAPI
|
||||
#define XMLTOKAPI /* as nothing */
|
||||
#endif
|
||||
|
||||
/* The following token may be returned by XmlContentTok */
|
||||
#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of
|
||||
illegal ]]> sequence */
|
||||
/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */
|
||||
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
|
||||
#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
|
||||
might be part of CRLF sequence */
|
||||
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
|
||||
#define XML_TOK_PARTIAL -1 /* only part of a token */
|
||||
#define XML_TOK_INVALID 0
|
||||
|
||||
/* The following tokens are returned by XmlContentTok; some are also
|
||||
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */
|
||||
|
||||
#define XML_TOK_START_TAG_WITH_ATTS 1
|
||||
#define XML_TOK_START_TAG_NO_ATTS 2
|
||||
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
|
||||
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
|
||||
#define XML_TOK_END_TAG 5
|
||||
#define XML_TOK_DATA_CHARS 6
|
||||
#define XML_TOK_DATA_NEWLINE 7
|
||||
#define XML_TOK_CDATA_SECT_OPEN 8
|
||||
#define XML_TOK_ENTITY_REF 9
|
||||
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
|
||||
|
||||
/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */
|
||||
#define XML_TOK_PI 11 /* processing instruction */
|
||||
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
|
||||
#define XML_TOK_COMMENT 13
|
||||
#define XML_TOK_BOM 14 /* Byte order mark */
|
||||
|
||||
/* The following tokens are returned only by XmlPrologTok */
|
||||
#define XML_TOK_PROLOG_S 15
|
||||
#define XML_TOK_DECL_OPEN 16 /* <!foo */
|
||||
#define XML_TOK_DECL_CLOSE 17 /* > */
|
||||
#define XML_TOK_NAME 18
|
||||
#define XML_TOK_NMTOKEN 19
|
||||
#define XML_TOK_POUND_NAME 20 /* #name */
|
||||
#define XML_TOK_OR 21 /* | */
|
||||
#define XML_TOK_PERCENT 22
|
||||
#define XML_TOK_OPEN_PAREN 23
|
||||
#define XML_TOK_CLOSE_PAREN 24
|
||||
#define XML_TOK_OPEN_BRACKET 25
|
||||
#define XML_TOK_CLOSE_BRACKET 26
|
||||
#define XML_TOK_LITERAL 27
|
||||
#define XML_TOK_PARAM_ENTITY_REF 28
|
||||
#define XML_TOK_INSTANCE_START 29
|
||||
|
||||
/* The following occur only in element type declarations */
|
||||
#define XML_TOK_NAME_QUESTION 30 /* name? */
|
||||
#define XML_TOK_NAME_ASTERISK 31 /* name* */
|
||||
#define XML_TOK_NAME_PLUS 32 /* name+ */
|
||||
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
|
||||
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
|
||||
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
|
||||
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
|
||||
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
|
||||
#define XML_TOK_COMMA 38
|
||||
|
||||
/* The following token is returned only by XmlAttributeValueTok */
|
||||
#define XML_TOK_ATTRIBUTE_VALUE_S 39
|
||||
|
||||
/* The following token is returned only by XmlCdataSectionTok */
|
||||
#define XML_TOK_CDATA_SECT_CLOSE 40
|
||||
|
||||
/* With namespace processing this is returned by XmlPrologTok
|
||||
for a name with a colon. */
|
||||
#define XML_TOK_PREFIXED_NAME 41
|
||||
|
||||
#ifdef XML_DTD
|
||||
#define XML_TOK_IGNORE_SECT 42
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#ifdef XML_DTD
|
||||
#define XML_N_STATES 4
|
||||
#else /* not XML_DTD */
|
||||
#define XML_N_STATES 3
|
||||
#endif /* not XML_DTD */
|
||||
|
||||
#define XML_PROLOG_STATE 0
|
||||
#define XML_CONTENT_STATE 1
|
||||
#define XML_CDATA_SECTION_STATE 2
|
||||
#ifdef XML_DTD
|
||||
#define XML_IGNORE_SECTION_STATE 3
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#define XML_N_LITERAL_TYPES 2
|
||||
#define XML_ATTRIBUTE_VALUE_LITERAL 0
|
||||
#define XML_ENTITY_VALUE_LITERAL 1
|
||||
|
||||
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
|
||||
#define XML_UTF8_ENCODE_MAX 4
|
||||
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
|
||||
#define XML_UTF16_ENCODE_MAX 2
|
||||
|
||||
typedef struct position {
|
||||
/* first line and first column are 0 not 1 */
|
||||
unsigned long lineNumber;
|
||||
unsigned long columnNumber;
|
||||
} POSITION;
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
const char *valuePtr;
|
||||
const char *valueEnd;
|
||||
char normalized;
|
||||
} ATTRIBUTE;
|
||||
|
||||
struct encoding;
|
||||
typedef struct encoding ENCODING;
|
||||
|
||||
struct encoding {
|
||||
int (*scanners[XML_N_STATES])(const ENCODING *,
|
||||
const char *,
|
||||
const char *,
|
||||
const char **);
|
||||
int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *,
|
||||
const char *,
|
||||
const char *,
|
||||
const char **);
|
||||
int (*sameName)(const ENCODING *,
|
||||
const char *, const char *);
|
||||
int (*nameMatchesAscii)(const ENCODING *,
|
||||
const char *, const char *, const char *);
|
||||
int (*nameLength)(const ENCODING *, const char *);
|
||||
const char *(*skipS)(const ENCODING *, const char *);
|
||||
int (*getAtts)(const ENCODING *enc, const char *ptr,
|
||||
int attsMax, ATTRIBUTE *atts);
|
||||
int (*charRefNumber)(const ENCODING *enc, const char *ptr);
|
||||
int (*predefinedEntityName)(const ENCODING *, const char *, const char *);
|
||||
void (*updatePosition)(const ENCODING *,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
POSITION *);
|
||||
int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **badPtr);
|
||||
void (*utf8Convert)(const ENCODING *enc,
|
||||
const char **fromP,
|
||||
const char *fromLim,
|
||||
char **toP,
|
||||
const char *toLim);
|
||||
void (*utf16Convert)(const ENCODING *enc,
|
||||
const char **fromP,
|
||||
const char *fromLim,
|
||||
unsigned short **toP,
|
||||
const unsigned short *toLim);
|
||||
int minBytesPerChar;
|
||||
char isUtf8;
|
||||
char isUtf16;
|
||||
};
|
||||
|
||||
/*
|
||||
Scan the string starting at ptr until the end of the next complete token,
|
||||
but do not scan past eptr. Return an integer giving the type of token.
|
||||
|
||||
Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
|
||||
|
||||
Return XML_TOK_PARTIAL when the string does not contain a complete token;
|
||||
nextTokPtr will not be set.
|
||||
|
||||
Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr
|
||||
will be set to point to the character which made the token invalid.
|
||||
|
||||
Otherwise the string starts with a valid token; nextTokPtr will be set to point
|
||||
to the character following the end of that token.
|
||||
|
||||
Each data character counts as a single token, but adjacent data characters
|
||||
may be returned together. Similarly for characters in the prolog outside
|
||||
literals, comments and processing instructions.
|
||||
*/
|
||||
|
||||
|
||||
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
|
||||
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
|
||||
|
||||
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#ifdef XML_DTD
|
||||
|
||||
#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#endif /* XML_DTD */
|
||||
|
||||
/* This is used for performing a 2nd-level tokenization on
|
||||
the content of a literal that has already been returned by XmlTok. */
|
||||
|
||||
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
|
||||
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
|
||||
|
||||
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
|
||||
|
||||
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
|
||||
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
|
||||
|
||||
#define XmlNameLength(enc, ptr) \
|
||||
(((enc)->nameLength)(enc, ptr))
|
||||
|
||||
#define XmlSkipS(enc, ptr) \
|
||||
(((enc)->skipS)(enc, ptr))
|
||||
|
||||
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
|
||||
(((enc)->getAtts)(enc, ptr, attsMax, atts))
|
||||
|
||||
#define XmlCharRefNumber(enc, ptr) \
|
||||
(((enc)->charRefNumber)(enc, ptr))
|
||||
|
||||
#define XmlPredefinedEntityName(enc, ptr, end) \
|
||||
(((enc)->predefinedEntityName)(enc, ptr, end))
|
||||
|
||||
#define XmlUpdatePosition(enc, ptr, end, pos) \
|
||||
(((enc)->updatePosition)(enc, ptr, end, pos))
|
||||
|
||||
#define XmlIsPublicId(enc, ptr, end, badPtr) \
|
||||
(((enc)->isPublicId)(enc, ptr, end, badPtr))
|
||||
|
||||
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
|
||||
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
|
||||
typedef struct {
|
||||
ENCODING initEnc;
|
||||
const ENCODING **encPtr;
|
||||
} INIT_ENCODING;
|
||||
|
||||
int XMLTOKAPI XmlParseXmlDecl(int isGeneralTextEntity,
|
||||
const ENCODING *enc,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
const char **badPtr,
|
||||
const char **versionPtr,
|
||||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr,
|
||||
int *standalonePtr);
|
||||
|
||||
int XMLTOKAPI XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncoding(void);
|
||||
const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncoding(void);
|
||||
int XMLTOKAPI XmlUtf8Encode(int charNumber, char *buf);
|
||||
int XMLTOKAPI XmlUtf16Encode(int charNumber, unsigned short *buf);
|
||||
|
||||
int XMLTOKAPI XmlSizeOfUnknownEncoding(void);
|
||||
ENCODING XMLTOKAPI *
|
||||
XmlInitUnknownEncoding(void *mem,
|
||||
int *table,
|
||||
int (*conv)(void *userData, const char *p),
|
||||
void *userData);
|
||||
|
||||
int XMLTOKAPI XmlParseXmlDeclNS(int isGeneralTextEntity,
|
||||
const ENCODING *enc,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
const char **badPtr,
|
||||
const char **versionPtr,
|
||||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr,
|
||||
int *standalonePtr);
|
||||
int XMLTOKAPI XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncodingNS(void);
|
||||
const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncodingNS(void);
|
||||
ENCODING XMLTOKAPI *
|
||||
XmlInitUnknownEncodingNS(void *mem,
|
||||
int *table,
|
||||
int (*conv)(void *userData, const char *p),
|
||||
void *userData);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not XmlTok_INCLUDED */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
enum {
|
||||
BT_NONXML,
|
||||
BT_MALFORM,
|
||||
BT_LT,
|
||||
BT_AMP,
|
||||
BT_RSQB,
|
||||
BT_LEAD2,
|
||||
BT_LEAD3,
|
||||
BT_LEAD4,
|
||||
BT_TRAIL,
|
||||
BT_CR,
|
||||
BT_LF,
|
||||
BT_GT,
|
||||
BT_QUOT,
|
||||
BT_APOS,
|
||||
BT_EQUALS,
|
||||
BT_QUEST,
|
||||
BT_EXCL,
|
||||
BT_SOL,
|
||||
BT_SEMI,
|
||||
BT_NUM,
|
||||
BT_LSQB,
|
||||
BT_S,
|
||||
BT_NMSTRT,
|
||||
BT_COLON,
|
||||
BT_HEX,
|
||||
BT_DIGIT,
|
||||
BT_NAME,
|
||||
BT_MINUS,
|
||||
BT_OTHER, /* known not to be a name or name start character */
|
||||
BT_NONASCII, /* might be a name or name start character */
|
||||
BT_PERCNT,
|
||||
BT_LPAR,
|
||||
BT_RPAR,
|
||||
BT_AST,
|
||||
BT_PLUS,
|
||||
BT_COMMA,
|
||||
BT_VERBAR
|
||||
};
|
||||
|
||||
#include <stddef.h>
|
|
@ -0,0 +1,96 @@
|
|||
const ENCODING *NS(XmlGetUtf8InternalEncoding)(void)
|
||||
{
|
||||
return &ns(internal_utf8_encoding).enc;
|
||||
}
|
||||
|
||||
const ENCODING *NS(XmlGetUtf16InternalEncoding)(void)
|
||||
{
|
||||
#if XML_BYTE_ORDER == 12
|
||||
return &ns(internal_little2_encoding).enc;
|
||||
#elif XML_BYTE_ORDER == 21
|
||||
return &ns(internal_big2_encoding).enc;
|
||||
#else
|
||||
const short n = 1;
|
||||
return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
const ENCODING *NS(encodings)[] = {
|
||||
&ns(latin1_encoding).enc,
|
||||
&ns(ascii_encoding).enc,
|
||||
&ns(utf8_encoding).enc,
|
||||
&ns(big2_encoding).enc,
|
||||
&ns(big2_encoding).enc,
|
||||
&ns(little2_encoding).enc,
|
||||
&ns(utf8_encoding).enc /* NO_ENC */
|
||||
};
|
||||
|
||||
static
|
||||
int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **nextTokPtr)
|
||||
{
|
||||
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr);
|
||||
}
|
||||
|
||||
static
|
||||
int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **nextTokPtr)
|
||||
{
|
||||
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr);
|
||||
}
|
||||
|
||||
int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name)
|
||||
{
|
||||
int i = getEncodingIndex(name);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
SET_INIT_ENC_INDEX(p, i);
|
||||
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
|
||||
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
|
||||
p->initEnc.updatePosition = initUpdatePosition;
|
||||
p->encPtr = encPtr;
|
||||
*encPtr = &(p->initEnc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
const ENCODING *NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
|
||||
{
|
||||
#define ENCODING_MAX 128
|
||||
char buf[ENCODING_MAX];
|
||||
char *p = buf;
|
||||
int i;
|
||||
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
|
||||
if (ptr != end)
|
||||
return 0;
|
||||
*p = 0;
|
||||
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
|
||||
return enc;
|
||||
i = getEncodingIndex(buf);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
return NS(encodings)[i];
|
||||
}
|
||||
|
||||
int NS(XmlParseXmlDecl)(int isGeneralTextEntity,
|
||||
const ENCODING *enc,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
const char **badPtr,
|
||||
const char **versionPtr,
|
||||
const char **encodingName,
|
||||
const ENCODING **encoding,
|
||||
int *standalone)
|
||||
{
|
||||
return doParseXmlDecl(NS(findEncoding),
|
||||
isGeneralTextEntity,
|
||||
enc,
|
||||
ptr,
|
||||
end,
|
||||
badPtr,
|
||||
versionPtr,
|
||||
encodingName,
|
||||
encoding,
|
||||
standalone);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,405 @@
|
|||
/*
|
||||
* copyright (c) 2001 Fabrice Bellard
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#ifndef AVFORMAT_AVIO_H
|
||||
#define AVFORMAT_AVIO_H
|
||||
|
||||
/**
|
||||
* @file libavformat/avio.h
|
||||
* unbuffered I/O operations
|
||||
*
|
||||
* @warning This file has to be considered an internal but installed
|
||||
* header, so it should not be directly included in your projects.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/common.h"
|
||||
|
||||
/* unbuffered I/O */
|
||||
|
||||
/**
|
||||
* URL Context.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
* Removal, reordering and changes to existing fields require a major
|
||||
* version bump.
|
||||
* sizeof(URLContext) must not be used outside libav*.
|
||||
*/
|
||||
typedef struct URLContext {
|
||||
#if LIBAVFORMAT_VERSION_MAJOR >= 53
|
||||
const AVClass *av_class; ///< information for av_log(). Set by url_open().
|
||||
#endif
|
||||
struct URLProtocol *prot;
|
||||
int flags;
|
||||
int is_streamed; /**< true if streamed (no seek possible), default = false */
|
||||
int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */
|
||||
void *priv_data;
|
||||
char *filename; /**< specified filename */
|
||||
} URLContext;
|
||||
|
||||
typedef struct URLPollEntry {
|
||||
URLContext *handle;
|
||||
int events;
|
||||
int revents;
|
||||
} URLPollEntry;
|
||||
|
||||
#define URL_RDONLY 0
|
||||
#define URL_WRONLY 1
|
||||
#define URL_RDWR 2
|
||||
|
||||
typedef int URLInterruptCB(void);
|
||||
|
||||
int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
const char *filename, int flags);
|
||||
int url_open(URLContext **h, const char *filename, int flags);
|
||||
int url_read(URLContext *h, unsigned char *buf, int size);
|
||||
int url_read_complete(URLContext *h, unsigned char *buf, int size);
|
||||
int url_write(URLContext *h, unsigned char *buf, int size);
|
||||
int64_t url_seek(URLContext *h, int64_t pos, int whence);
|
||||
int url_close(URLContext *h);
|
||||
int url_exist(const char *filename);
|
||||
int64_t url_filesize(URLContext *h);
|
||||
|
||||
/**
|
||||
* Return the file descriptor associated with this URL. For RTP, this
|
||||
* will return only the RTP file descriptor, not the RTCP file descriptor.
|
||||
* To get both, use rtp_get_file_handles().
|
||||
*
|
||||
* @return the file descriptor associated with this URL, or <0 on error.
|
||||
*/
|
||||
int url_get_file_handle(URLContext *h);
|
||||
|
||||
/**
|
||||
* Return the maximum packet size associated to packetized file
|
||||
* handle. If the file is not packetized (stream like HTTP or file on
|
||||
* disk), then 0 is returned.
|
||||
*
|
||||
* @param h file handle
|
||||
* @return maximum packet size in bytes
|
||||
*/
|
||||
int url_get_max_packet_size(URLContext *h);
|
||||
void url_get_filename(URLContext *h, char *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* The callback is called in blocking functions to test regulary if
|
||||
* asynchronous interruption is needed. AVERROR(EINTR) is returned
|
||||
* in this case by the interrupted function. 'NULL' means no interrupt
|
||||
* callback is given.
|
||||
*/
|
||||
void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
|
||||
|
||||
/* not implemented */
|
||||
int url_poll(URLPollEntry *poll_table, int n, int timeout);
|
||||
|
||||
/**
|
||||
* Pause and resume playing - only meaningful if using a network streaming
|
||||
* protocol (e.g. MMS).
|
||||
* @param pause 1 for pause, 0 for resume
|
||||
*/
|
||||
int av_url_read_pause(URLContext *h, int pause);
|
||||
|
||||
/**
|
||||
* Seek to a given timestamp relative to some component stream.
|
||||
* Only meaningful if using a network streaming protocol (e.g. MMS.).
|
||||
* @param stream_index The stream index that the timestamp is relative to.
|
||||
* If stream_index is (-1) the timestamp should be in AV_TIME_BASE
|
||||
* units from the beginning of the presentation.
|
||||
* If a stream_index >= 0 is used and the protocol does not support
|
||||
* seeking based on component streams, the call will fail with ENOTSUP.
|
||||
* @param timestamp timestamp in AVStream.time_base units
|
||||
* or if there is no stream specified then in AV_TIME_BASE units.
|
||||
* @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
|
||||
* and AVSEEK_FLAG_ANY. The protocol may silently ignore
|
||||
* AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
|
||||
* fail with ENOTSUP if used and not supported.
|
||||
* @return >= 0 on success
|
||||
* @see AVInputFormat::read_seek
|
||||
*/
|
||||
int64_t av_url_read_seek(URLContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
|
||||
/**
|
||||
* Passing this as the "whence" parameter to a seek function causes it to
|
||||
* return the filesize without seeking anywhere. Supporting this is optional.
|
||||
* If it is not supported then the seek function will return <0.
|
||||
*/
|
||||
#define AVSEEK_SIZE 0x10000
|
||||
|
||||
typedef struct URLProtocol {
|
||||
const char *name;
|
||||
int (*url_open)(URLContext *h, const char *filename, int flags);
|
||||
int (*url_read)(URLContext *h, unsigned char *buf, int size);
|
||||
int (*url_write)(URLContext *h, unsigned char *buf, int size);
|
||||
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
|
||||
int (*url_close)(URLContext *h);
|
||||
struct URLProtocol *next;
|
||||
int (*url_read_pause)(URLContext *h, int pause);
|
||||
int64_t (*url_read_seek)(URLContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
int (*url_get_file_handle)(URLContext *h);
|
||||
} URLProtocol;
|
||||
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
extern URLProtocol *first_protocol;
|
||||
#endif
|
||||
|
||||
extern URLInterruptCB *url_interrupt_cb;
|
||||
|
||||
/**
|
||||
* If protocol is NULL, returns the first registered protocol,
|
||||
* if protocol is non-NULL, returns the next registered protocol after protocol,
|
||||
* or NULL if protocol is the last one.
|
||||
*/
|
||||
URLProtocol *av_protocol_next(URLProtocol *p);
|
||||
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @deprecated Use av_register_protocol() instead.
|
||||
*/
|
||||
attribute_deprecated int register_protocol(URLProtocol *protocol);
|
||||
#endif
|
||||
|
||||
int av_register_protocol(URLProtocol *protocol);
|
||||
|
||||
/**
|
||||
* Bytestream IO Context.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
* Removal, reordering and changes to existing fields require a major
|
||||
* version bump.
|
||||
* sizeof(ByteIOContext) must not be used outside libav*.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char *buffer;
|
||||
int buffer_size;
|
||||
unsigned char *buf_ptr, *buf_end;
|
||||
void *opaque;
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence);
|
||||
int64_t pos; /**< position in the file of the current buffer */
|
||||
int must_flush; /**< true if the next seek should flush */
|
||||
int eof_reached; /**< true if eof reached */
|
||||
int write_flag; /**< true if open for writing */
|
||||
int is_streamed;
|
||||
int max_packet_size;
|
||||
unsigned long checksum;
|
||||
unsigned char *checksum_ptr;
|
||||
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
|
||||
int error; ///< contains the error code or 0 if no error happened
|
||||
int (*read_pause)(void *opaque, int pause);
|
||||
int64_t (*read_seek)(void *opaque, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
} ByteIOContext;
|
||||
|
||||
int init_put_byte(ByteIOContext *s,
|
||||
unsigned char *buffer,
|
||||
int buffer_size,
|
||||
int write_flag,
|
||||
void *opaque,
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
ByteIOContext *av_alloc_put_byte(
|
||||
unsigned char *buffer,
|
||||
int buffer_size,
|
||||
int write_flag,
|
||||
void *opaque,
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
|
||||
void put_byte(ByteIOContext *s, int b);
|
||||
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
|
||||
void put_le64(ByteIOContext *s, uint64_t val);
|
||||
void put_be64(ByteIOContext *s, uint64_t val);
|
||||
void put_le32(ByteIOContext *s, unsigned int val);
|
||||
void put_be32(ByteIOContext *s, unsigned int val);
|
||||
void put_le24(ByteIOContext *s, unsigned int val);
|
||||
void put_be24(ByteIOContext *s, unsigned int val);
|
||||
void put_le16(ByteIOContext *s, unsigned int val);
|
||||
void put_be16(ByteIOContext *s, unsigned int val);
|
||||
void put_tag(ByteIOContext *s, const char *tag);
|
||||
|
||||
void put_strz(ByteIOContext *s, const char *buf);
|
||||
|
||||
/**
|
||||
* fseek() equivalent for ByteIOContext.
|
||||
* @return new position or AVERROR.
|
||||
*/
|
||||
int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
|
||||
|
||||
/**
|
||||
* Skip given number of bytes forward.
|
||||
* @param offset number of bytes
|
||||
*/
|
||||
void url_fskip(ByteIOContext *s, int64_t offset);
|
||||
|
||||
/**
|
||||
* ftell() equivalent for ByteIOContext.
|
||||
* @return position or AVERROR.
|
||||
*/
|
||||
int64_t url_ftell(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Gets the filesize.
|
||||
* @return filesize or AVERROR
|
||||
*/
|
||||
int64_t url_fsize(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* feof() equivalent for ByteIOContext.
|
||||
* @return non zero if and only if end of file
|
||||
*/
|
||||
int url_feof(ByteIOContext *s);
|
||||
|
||||
int url_ferror(ByteIOContext *s);
|
||||
|
||||
int av_url_read_fpause(ByteIOContext *h, int pause);
|
||||
int64_t av_url_read_fseek(ByteIOContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
|
||||
#define URL_EOF (-1)
|
||||
/** @note return URL_EOF (-1) if EOF */
|
||||
int url_fgetc(ByteIOContext *s);
|
||||
|
||||
/** @warning currently size is limited */
|
||||
#ifdef __GNUC__
|
||||
int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
#else
|
||||
int url_fprintf(ByteIOContext *s, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
/** @note unlike fgets, the EOL character is not returned and a whole
|
||||
line is parsed. return NULL if first char read was EOF */
|
||||
char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
|
||||
|
||||
void put_flush_packet(ByteIOContext *s);
|
||||
|
||||
|
||||
/**
|
||||
* Reads size bytes from ByteIOContext into buf.
|
||||
* @returns number of bytes read or AVERROR
|
||||
*/
|
||||
int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Reads size bytes from ByteIOContext into buf.
|
||||
* This reads at most 1 packet. If that is not enough fewer bytes will be
|
||||
* returned.
|
||||
* @returns number of bytes read or AVERROR
|
||||
*/
|
||||
int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/** @note return 0 if EOF, so you cannot use it if EOF handling is
|
||||
necessary */
|
||||
int get_byte(ByteIOContext *s);
|
||||
unsigned int get_le24(ByteIOContext *s);
|
||||
unsigned int get_le32(ByteIOContext *s);
|
||||
uint64_t get_le64(ByteIOContext *s);
|
||||
unsigned int get_le16(ByteIOContext *s);
|
||||
|
||||
char *get_strz(ByteIOContext *s, char *buf, int maxlen);
|
||||
unsigned int get_be16(ByteIOContext *s);
|
||||
unsigned int get_be24(ByteIOContext *s);
|
||||
unsigned int get_be32(ByteIOContext *s);
|
||||
uint64_t get_be64(ByteIOContext *s);
|
||||
|
||||
uint64_t ff_get_v(ByteIOContext *bc);
|
||||
|
||||
static inline int url_is_streamed(ByteIOContext *s)
|
||||
{
|
||||
return s->is_streamed;
|
||||
}
|
||||
|
||||
/** @note when opened as read/write, the buffers are only used for
|
||||
writing */
|
||||
int url_fdopen(ByteIOContext **s, URLContext *h);
|
||||
|
||||
/** @warning must be called before any I/O */
|
||||
int url_setbufsize(ByteIOContext *s, int buf_size);
|
||||
/** Reset the buffer for reading or writing.
|
||||
* @note Will drop any data currently in the buffer without transmitting it.
|
||||
* @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
|
||||
* to set up the buffer for writing. */
|
||||
int url_resetbuf(ByteIOContext *s, int flags);
|
||||
|
||||
/** @note when opened as read/write, the buffers are only used for
|
||||
writing */
|
||||
int url_fopen(ByteIOContext **s, const char *filename, int flags);
|
||||
int url_fclose(ByteIOContext *s);
|
||||
URLContext *url_fileno(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Return the maximum packet size associated to packetized buffered file
|
||||
* handle. If the file is not packetized (stream like http or file on
|
||||
* disk), then 0 is returned.
|
||||
*
|
||||
* @param s buffered file handle
|
||||
* @return maximum packet size in bytes
|
||||
*/
|
||||
int url_fget_max_packet_size(ByteIOContext *s);
|
||||
|
||||
int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags);
|
||||
|
||||
/** return the written or read size */
|
||||
int url_close_buf(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Open a write only memory stream.
|
||||
*
|
||||
* @param s new IO context
|
||||
* @return zero if no error.
|
||||
*/
|
||||
int url_open_dyn_buf(ByteIOContext **s);
|
||||
|
||||
/**
|
||||
* Open a write only packetized memory stream with a maximum packet
|
||||
* size of 'max_packet_size'. The stream is stored in a memory buffer
|
||||
* with a big endian 4 byte header giving the packet size in bytes.
|
||||
*
|
||||
* @param s new IO context
|
||||
* @param max_packet_size maximum packet size (must be > 0)
|
||||
* @return zero if no error.
|
||||
*/
|
||||
int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
|
||||
|
||||
/**
|
||||
* Return the written size and a pointer to the buffer. The buffer
|
||||
* must be freed with av_free().
|
||||
* @param s IO context
|
||||
* @param pbuffer pointer to a byte buffer
|
||||
* @return the length of the byte buffer
|
||||
*/
|
||||
int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
|
||||
|
||||
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
|
||||
unsigned int len);
|
||||
unsigned long get_checksum(ByteIOContext *s);
|
||||
void init_checksum(ByteIOContext *s,
|
||||
unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
|
||||
unsigned long checksum);
|
||||
|
||||
/* udp.c */
|
||||
int udp_set_remote_url(URLContext *h, const char *uri);
|
||||
int udp_get_local_port(URLContext *h);
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR <= 52)
|
||||
int udp_get_file_handle(URLContext *h);
|
||||
#endif
|
||||
|
||||
#endif /* AVFORMAT_AVIO_H */
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AVUTIL_H
|
||||
#define AVUTIL_AVUTIL_H
|
||||
|
||||
/**
|
||||
* @file libavutil/avutil.h
|
||||
* external API header
|
||||
*/
|
||||
|
||||
|
||||
#define AV_STRINGIFY(s) AV_TOSTRING(s)
|
||||
#define AV_TOSTRING(s) #s
|
||||
|
||||
#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
|
||||
#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
|
||||
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 50
|
||||
#define LIBAVUTIL_VERSION_MINOR 3
|
||||
#define LIBAVUTIL_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
LIBAVUTIL_VERSION_MICRO)
|
||||
#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
LIBAVUTIL_VERSION_MICRO)
|
||||
#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
|
||||
|
||||
#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
|
||||
|
||||
/**
|
||||
* Returns the LIBAVUTIL_VERSION_INT constant.
|
||||
*/
|
||||
unsigned avutil_version(void);
|
||||
|
||||
#include "common.h"
|
||||
#include "mathematics.h"
|
||||
#include "rational.h"
|
||||
#include "intfloat_readwrite.h"
|
||||
#include "log.h"
|
||||
#include "pixfmt.h"
|
||||
|
||||
#endif /* AVUTIL_AVUTIL_H */
|
|
@ -0,0 +1,287 @@
|
|||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/common.h
|
||||
* common internal and external API header
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_COMMON_H
|
||||
#define AVUTIL_COMMON_H
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
|
||||
#else
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) 0
|
||||
#endif
|
||||
|
||||
#ifndef av_always_inline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_always_inline __attribute__((always_inline)) inline
|
||||
#else
|
||||
# define av_always_inline inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_noinline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_noinline __attribute__((noinline))
|
||||
#else
|
||||
# define av_noinline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_pure
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_pure __attribute__((pure))
|
||||
#else
|
||||
# define av_pure
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_const
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6)
|
||||
# define av_const __attribute__((const))
|
||||
#else
|
||||
# define av_const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_cold
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
# define av_cold __attribute__((cold))
|
||||
#else
|
||||
# define av_cold
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_flatten
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
|
||||
# define av_flatten __attribute__((flatten))
|
||||
#else
|
||||
# define av_flatten
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef attribute_deprecated
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define attribute_deprecated __attribute__((deprecated))
|
||||
#else
|
||||
# define attribute_deprecated
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_unused
|
||||
#if defined(__GNUC__)
|
||||
# define av_unused __attribute__((unused))
|
||||
#else
|
||||
# define av_unused
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_uninit
|
||||
#if defined(__GNUC__) && !defined(__ICC)
|
||||
# define av_uninit(x) x=x
|
||||
#else
|
||||
# define av_uninit(x) x
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//rounded division & shift
|
||||
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
|
||||
/* assume b>0 */
|
||||
#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
|
||||
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
|
||||
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
|
||||
|
||||
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
|
||||
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
|
||||
#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
|
||||
|
||||
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
|
||||
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
|
||||
#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
|
||||
|
||||
/* misc math functions */
|
||||
extern const uint8_t ff_log2_tab[256];
|
||||
|
||||
static inline av_const int av_log2(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xffff0000) {
|
||||
v >>= 16;
|
||||
n += 16;
|
||||
}
|
||||
if (v & 0xff00) {
|
||||
v >>= 8;
|
||||
n += 8;
|
||||
}
|
||||
n += ff_log2_tab[v];
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline av_const int av_log2_16bit(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xff00) {
|
||||
v >>= 8;
|
||||
n += 8;
|
||||
}
|
||||
n += ff_log2_tab[v];
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const int av_clip(int a, int amin, int amax)
|
||||
{
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the 0-255 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const uint8_t av_clip_uint8(int a)
|
||||
{
|
||||
if (a&(~255)) return (-a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the -32768,32767 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const int16_t av_clip_int16(int a)
|
||||
{
|
||||
if ((a+32768) & ~65535) return (a>>31) ^ 32767;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a float value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const float av_clipf(float a, float amin, float amax)
|
||||
{
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
|
||||
#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
|
||||
|
||||
/*!
|
||||
* \def GET_UTF8(val, GET_BYTE, ERROR)
|
||||
* Converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
|
||||
* \param val is the output and should be of type uint32_t. It holds the converted
|
||||
* UCS-4 character and should be a left value.
|
||||
* \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
|
||||
* a function or a statement whose return value or evaluated value is of type
|
||||
* uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range,
|
||||
* and up to 7 times in the general case.
|
||||
* \param ERROR action that should be taken when an invalid UTF-8 byte is returned
|
||||
* from GET_BYTE. It should be a statement that jumps out of the macro,
|
||||
* like exit(), goto, return, break, or continue.
|
||||
*/
|
||||
#define GET_UTF8(val, GET_BYTE, ERROR)\
|
||||
val= GET_BYTE;\
|
||||
{\
|
||||
int ones= 7 - av_log2(val ^ 255);\
|
||||
if(ones==1)\
|
||||
ERROR\
|
||||
val&= 127>>ones;\
|
||||
while(--ones > 0){\
|
||||
int tmp= GET_BYTE - 128;\
|
||||
if(tmp>>6)\
|
||||
ERROR\
|
||||
val= (val<<6) + tmp;\
|
||||
}\
|
||||
}
|
||||
|
||||
/*!
|
||||
* \def PUT_UTF8(val, tmp, PUT_BYTE)
|
||||
* Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
|
||||
* \param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
|
||||
* val is given as a function it is executed only once.
|
||||
* \param tmp is a temporary variable and should be of type uint8_t. It
|
||||
* represents an intermediate value during conversion that is to be
|
||||
* output by PUT_BYTE.
|
||||
* \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
|
||||
* It could be a function or a statement, and uses tmp as the input byte.
|
||||
* For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
|
||||
* executed up to 4 times for values in the valid UTF-8 range and up to
|
||||
* 7 times in the general case, depending on the length of the converted
|
||||
* Unicode character.
|
||||
*/
|
||||
#define PUT_UTF8(val, tmp, PUT_BYTE)\
|
||||
{\
|
||||
int bytes, shift;\
|
||||
uint32_t in = val;\
|
||||
if (in < 0x80) {\
|
||||
tmp = in;\
|
||||
PUT_BYTE\
|
||||
} else {\
|
||||
bytes = (av_log2(in) + 4) / 5;\
|
||||
shift = (bytes - 1) * 6;\
|
||||
tmp = (256 - (256 >> bytes)) | (in >> shift);\
|
||||
PUT_BYTE\
|
||||
while (shift >= 6) {\
|
||||
shift -= 6;\
|
||||
tmp = 0x80 | ((in >> shift) & 0x3f);\
|
||||
PUT_BYTE\
|
||||
}\
|
||||
}\
|
||||
}
|
||||
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
# include "internal.h"
|
||||
#endif /* HAVE_AV_CONFIG_H */
|
||||
|
||||
#endif /* AVUTIL_COMMON_H */
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/fifo.h
|
||||
* a very simple circular buffer FIFO implementation
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_FIFO_H
|
||||
#define AVUTIL_FIFO_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "avutil.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct AVFifoBuffer {
|
||||
uint8_t *buffer;
|
||||
uint8_t *rptr, *wptr, *end;
|
||||
uint32_t rndx, wndx;
|
||||
} AVFifoBuffer;
|
||||
|
||||
/**
|
||||
* Initializes an AVFifoBuffer.
|
||||
* @param size of FIFO
|
||||
* @return AVFifoBuffer or NULL if mem allocation failure
|
||||
*/
|
||||
AVFifoBuffer *av_fifo_alloc(unsigned int size);
|
||||
|
||||
/**
|
||||
* Frees an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to free
|
||||
*/
|
||||
void av_fifo_free(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Resets the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
|
||||
* @param *f AVFifoBuffer to reset
|
||||
*/
|
||||
void av_fifo_reset(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Returns the amount of data in bytes in the AVFifoBuffer, that is the
|
||||
* amount of data you can read from it.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @return size
|
||||
*/
|
||||
int av_fifo_size(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Returns the amount of space in bytes in the AVFifoBuffer, that is the
|
||||
* amount of data you can write into it.
|
||||
* @param *f AVFifoBuffer to write into
|
||||
* @return size
|
||||
*/
|
||||
int av_fifo_space(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Feeds data from an AVFifoBuffer to a user-supplied callback.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @param buf_size number of bytes to read
|
||||
* @param *func generic read function
|
||||
* @param *dest data destination
|
||||
*/
|
||||
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
* Feeds data from a user-supplied callback to an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to write to
|
||||
* @param *src data source
|
||||
* @param size number of bytes to write
|
||||
* @param *func generic write function; the first parameter is src,
|
||||
* the second is dest_buf, the third is dest_buf_size.
|
||||
* func must return the number of bytes written to dest_buf, or <= 0 to
|
||||
* indicate no more data available to write.
|
||||
* If func is NULL, src is interpreted as a simple byte array for source data.
|
||||
* @return the number of bytes written to the FIFO
|
||||
*/
|
||||
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
* Resizes an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to resize
|
||||
* @param size new AVFifoBuffer size in bytes
|
||||
* @return <0 for failure, >=0 otherwise
|
||||
*/
|
||||
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
|
||||
|
||||
/**
|
||||
* Reads and discards the specified amount of data from an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @param size amount of data to read in bytes
|
||||
*/
|
||||
void av_fifo_drain(AVFifoBuffer *f, int size);
|
||||
|
||||
static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
|
||||
{
|
||||
uint8_t *ptr = f->rptr + offs;
|
||||
if (ptr >= f->end)
|
||||
ptr -= f->end - f->buffer;
|
||||
return *ptr;
|
||||
}
|
||||
#endif /* AVUTIL_FIFO_H */
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_INTFLOAT_READWRITE_H
|
||||
#define AVUTIL_INTFLOAT_READWRITE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
/* IEEE 80 bits extended float */
|
||||
typedef struct AVExtFloat {
|
||||
uint8_t exponent[2];
|
||||
uint8_t mantissa[8];
|
||||
} AVExtFloat;
|
||||
|
||||
double av_int2dbl(int64_t v) av_const;
|
||||
float av_int2flt(int32_t v) av_const;
|
||||
double av_ext2dbl(const AVExtFloat ext) av_const;
|
||||
int64_t av_dbl2int(double d) av_const;
|
||||
int32_t av_flt2int(float d) av_const;
|
||||
AVExtFloat av_dbl2ext(double d) av_const;
|
||||
|
||||
#endif /* AVUTIL_INTFLOAT_READWRITE_H */
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_LOG_H
|
||||
#define AVUTIL_LOG_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "avutil.h"
|
||||
|
||||
/**
|
||||
* Describes the class of an AVClass context structure. That is an
|
||||
* arbitrary struct of which the first field is a pointer to an
|
||||
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
|
||||
*/
|
||||
typedef struct AVCLASS AVClass;
|
||||
struct AVCLASS {
|
||||
/**
|
||||
* The name of the class; usually it is the same name as the
|
||||
* context structure type to which the AVClass is associated.
|
||||
*/
|
||||
const char* class_name;
|
||||
|
||||
/**
|
||||
* A pointer to a function which returns the name of a context
|
||||
* instance ctx associated with the class.
|
||||
*/
|
||||
const char* (*item_name)(void* ctx);
|
||||
|
||||
/**
|
||||
* a pointer to the first option specified in the class if any or NULL
|
||||
*
|
||||
* @see av_set_default_options()
|
||||
*/
|
||||
const struct AVOption *option;
|
||||
};
|
||||
|
||||
/* av_log API */
|
||||
|
||||
#define AV_LOG_QUIET -8
|
||||
|
||||
/**
|
||||
* Something went really wrong and we will crash now.
|
||||
*/
|
||||
#define AV_LOG_PANIC 0
|
||||
|
||||
/**
|
||||
* Something went wrong and recovery is not possible.
|
||||
* For example, no header was found for a format which depends
|
||||
* on headers or an illegal combination of parameters is used.
|
||||
*/
|
||||
#define AV_LOG_FATAL 8
|
||||
|
||||
/**
|
||||
* Something went wrong and cannot losslessly be recovered.
|
||||
* However, not all future data is affected.
|
||||
*/
|
||||
#define AV_LOG_ERROR 16
|
||||
|
||||
/**
|
||||
* Something somehow does not look correct. This may or may not
|
||||
* lead to problems. An example would be the use of '-vstrict -2'.
|
||||
*/
|
||||
#define AV_LOG_WARNING 24
|
||||
|
||||
#define AV_LOG_INFO 32
|
||||
#define AV_LOG_VERBOSE 40
|
||||
|
||||
/**
|
||||
* Stuff which is only useful for libav* developers.
|
||||
*/
|
||||
#define AV_LOG_DEBUG 48
|
||||
|
||||
/**
|
||||
* Sends the specified message to the log if the level is less than or equal
|
||||
* to the current av_log_level. By default, all logging messages are sent to
|
||||
* stderr. This behavior can be altered by setting a different av_vlog callback
|
||||
* function.
|
||||
*
|
||||
* @param avcl A pointer to an arbitrary struct of which the first field is a
|
||||
* pointer to an AVClass struct.
|
||||
* @param level The importance level of the message, lower values signifying
|
||||
* higher importance.
|
||||
* @param fmt The format string (printf-compatible) that specifies how
|
||||
* subsequent arguments are converted to output.
|
||||
* @see av_vlog
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
#else
|
||||
void av_log(void*, int level, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
void av_vlog(void*, int level, const char *fmt, va_list);
|
||||
int av_log_get_level(void);
|
||||
void av_log_set_level(int);
|
||||
void av_log_set_callback(void (*)(void*, int, const char*, va_list));
|
||||
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
|
||||
|
||||
#endif /* AVUTIL_LOG_H */
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_MATHEMATICS_H
|
||||
#define AVUTIL_MATHEMATICS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include "common.h"
|
||||
#include "rational.h"
|
||||
|
||||
#ifndef M_E
|
||||
#define M_E 2.7182818284590452354 /* e */
|
||||
#endif
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942 /* log_e 2 */
|
||||
#endif
|
||||
#ifndef M_LN10
|
||||
#define M_LN10 2.30258509299404568402 /* log_e 10 */
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 /* pi */
|
||||
#endif
|
||||
#ifndef M_SQRT1_2
|
||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||
#endif
|
||||
|
||||
enum AVRounding {
|
||||
AV_ROUND_ZERO = 0, ///< Round toward zero.
|
||||
AV_ROUND_INF = 1, ///< Round away from zero.
|
||||
AV_ROUND_DOWN = 2, ///< Round toward -infinity.
|
||||
AV_ROUND_UP = 3, ///< Round toward +infinity.
|
||||
AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
|
||||
};
|
||||
|
||||
int64_t av_const av_gcd(int64_t a, int64_t b);
|
||||
|
||||
/**
|
||||
* Rescales a 64-bit integer with rounding to nearest.
|
||||
* A simple a*b/c isn't possible as it can overflow.
|
||||
*/
|
||||
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
|
||||
|
||||
/**
|
||||
* Rescales a 64-bit integer with specified rounding.
|
||||
* A simple a*b/c isn't possible as it can overflow.
|
||||
*/
|
||||
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
|
||||
|
||||
/**
|
||||
* Rescales a 64-bit integer by 2 rational numbers.
|
||||
*/
|
||||
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
|
||||
|
||||
#endif /* AVUTIL_MATHEMATICS_H */
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/mem.h
|
||||
* memory handling functions
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_MEM_H
|
||||
#define AVUTIL_MEM_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if defined(__ICC) || defined(__SUNPRO_C)
|
||||
#define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
|
||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
||||
#elif defined(__GNUC__)
|
||||
#define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v attribute_used __attribute__ ((aligned (n)))
|
||||
#elif defined(_MSC_VER)
|
||||
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
|
||||
#else
|
||||
#define DECLARE_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v
|
||||
#endif
|
||||
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
#define av_malloc_attrib __attribute__((__malloc__))
|
||||
#else
|
||||
#define av_malloc_attrib
|
||||
#endif
|
||||
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
#define av_alloc_size(n) __attribute__((alloc_size(n)))
|
||||
#else
|
||||
#define av_alloc_size(n)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocates a block of size bytes with alignment suitable for all
|
||||
* memory accesses (including vectors if available on the CPU).
|
||||
* @param size Size in bytes for the memory block to be allocated.
|
||||
* @return Pointer to the allocated block, NULL if the block cannot
|
||||
* be allocated.
|
||||
* @see av_mallocz()
|
||||
*/
|
||||
void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
||||
|
||||
/**
|
||||
* Allocates or reallocates a block of memory.
|
||||
* If ptr is NULL and size > 0, allocates a new block. If \p
|
||||
* size is zero, frees the memory block pointed to by ptr.
|
||||
* @param size Size in bytes for the memory block to be allocated or
|
||||
* reallocated.
|
||||
* @param ptr Pointer to a memory block already allocated with
|
||||
* av_malloc(z)() or av_realloc() or NULL.
|
||||
* @return Pointer to a newly reallocated block or NULL if the block
|
||||
* cannot be reallocated or the function is used to free the memory block.
|
||||
* @see av_fast_realloc()
|
||||
*/
|
||||
void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
|
||||
|
||||
/**
|
||||
* Frees a memory block which has been allocated with av_malloc(z)() or
|
||||
* av_realloc().
|
||||
* @param ptr Pointer to the memory block which should be freed.
|
||||
* @note ptr = NULL is explicitly allowed.
|
||||
* @note It is recommended that you use av_freep() instead.
|
||||
* @see av_freep()
|
||||
*/
|
||||
void av_free(void *ptr);
|
||||
|
||||
/**
|
||||
* Allocates a block of size bytes with alignment suitable for all
|
||||
* memory accesses (including vectors if available on the CPU) and
|
||||
* zeroes all the bytes of the block.
|
||||
* @param size Size in bytes for the memory block to be allocated.
|
||||
* @return Pointer to the allocated block, NULL if it cannot be allocated.
|
||||
* @see av_malloc()
|
||||
*/
|
||||
void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
||||
|
||||
/**
|
||||
* Duplicates the string s.
|
||||
* @param s string to be duplicated
|
||||
* @return Pointer to a newly allocated string containing a
|
||||
* copy of s or NULL if the string cannot be allocated.
|
||||
*/
|
||||
char *av_strdup(const char *s) av_malloc_attrib;
|
||||
|
||||
/**
|
||||
* Frees a memory block which has been allocated with av_malloc(z)() or
|
||||
* av_realloc() and set the pointer pointing to it to NULL.
|
||||
* @param ptr Pointer to the pointer to the memory block which should
|
||||
* be freed.
|
||||
* @see av_free()
|
||||
*/
|
||||
void av_freep(void *ptr);
|
||||
|
||||
#endif /* AVUTIL_MEM_H */
|
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_PIXFMT_H
|
||||
#define AVUTIL_PIXFMT_H
|
||||
|
||||
/**
|
||||
* @file libavutil/pixfmt.h
|
||||
* pixel format definitions
|
||||
*
|
||||
* @warning This file has to be considered an internal but installed
|
||||
* header, so it should not be directly included in your projects.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pixel format. Notes:
|
||||
*
|
||||
* PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
|
||||
* color is put together as:
|
||||
* (A << 24) | (R << 16) | (G << 8) | B
|
||||
* This is stored as BGRA on little-endian CPU architectures and ARGB on
|
||||
* big-endian CPUs.
|
||||
*
|
||||
* When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
|
||||
* image data is stored in AVFrame.data[0]. The palette is transported in
|
||||
* AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
|
||||
* formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
|
||||
* also endian-specific). Note also that the individual RGB palette
|
||||
* components stored in AVFrame.data[1] should be in the range 0..255.
|
||||
* This is important as many custom PAL8 video codecs that were designed
|
||||
* to run on the IBM VGA graphics adapter use 6-bit palette components.
|
||||
*
|
||||
* For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
|
||||
* for pal8. This palette is filled in automatically by the function
|
||||
* allocating the picture.
|
||||
*
|
||||
* Note, make sure that all newly added big endian formats have pix_fmt&1==1
|
||||
* and that all newly added little endian formats have pix_fmt&1==0
|
||||
* this allows simpler detection of big vs little endian.
|
||||
*/
|
||||
enum PixelFormat {
|
||||
PIX_FMT_NONE= -1,
|
||||
PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
|
||||
PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
|
||||
PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
|
||||
PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
|
||||
PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
|
||||
PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
|
||||
PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
|
||||
PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
|
||||
PIX_FMT_GRAY8, ///< Y , 8bpp
|
||||
PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black
|
||||
PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white
|
||||
PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
|
||||
PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
|
||||
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
|
||||
PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
|
||||
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
|
||||
PIX_FMT_XVMC_MPEG2_IDCT,
|
||||
PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
|
||||
PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
|
||||
PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
|
||||
PIX_FMT_BGR4, ///< packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
|
||||
PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
|
||||
PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
|
||||
PIX_FMT_RGB4, ///< packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb)
|
||||
PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
|
||||
PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
|
||||
PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
|
||||
|
||||
PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
|
||||
PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
|
||||
PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
|
||||
PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
|
||||
|
||||
PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
|
||||
PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
|
||||
PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
|
||||
PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG)
|
||||
PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
|
||||
PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, big-endian
|
||||
PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, little-endian
|
||||
|
||||
PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
|
||||
PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
|
||||
PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
|
||||
PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
|
||||
|
||||
PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
|
||||
PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
|
||||
PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
|
||||
PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
|
||||
|
||||
PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
|
||||
PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
|
||||
PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
|
||||
PIX_FMT_YUV420PLE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420PBE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV422PLE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422PBE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444PLE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444PBE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
|
||||
};
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##be
|
||||
#else
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##le
|
||||
#endif
|
||||
|
||||
#define PIX_FMT_RGB32 PIX_FMT_NE(ARGB, BGRA)
|
||||
#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
|
||||
#define PIX_FMT_BGR32 PIX_FMT_NE(ABGR, RGBA)
|
||||
#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
|
||||
|
||||
#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
|
||||
#define PIX_FMT_RGB48 PIX_FMT_NE(RGB48BE, RGB48LE)
|
||||
#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
|
||||
#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
|
||||
#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
|
||||
#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
|
||||
|
||||
#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420PBE, YUV420PLE)
|
||||
#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422PBE, YUV422PLE)
|
||||
#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444PBE, YUV444PLE)
|
||||
|
||||
#endif /* AVUTIL_PIXFMT_H */
|
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* rational numbers
|
||||
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/rational.h
|
||||
* rational numbers
|
||||
* @author Michael Niedermayer <michaelni@gmx.at>
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_RATIONAL_H
|
||||
#define AVUTIL_RATIONAL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* rational number numerator/denominator
|
||||
*/
|
||||
typedef struct AVRational{
|
||||
int num; ///< numerator
|
||||
int den; ///< denominator
|
||||
} AVRational;
|
||||
|
||||
/**
|
||||
* Compares two rationals.
|
||||
* @param a first rational
|
||||
* @param b second rational
|
||||
* @return 0 if a==b, 1 if a>b and -1 if a<b
|
||||
*/
|
||||
static inline int av_cmp_q(AVRational a, AVRational b){
|
||||
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
|
||||
|
||||
if(tmp) return (tmp>>63)|1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts rational to double.
|
||||
* @param a rational to convert
|
||||
* @return (double) a
|
||||
*/
|
||||
static inline double av_q2d(AVRational a){
|
||||
return a.num / (double) a.den;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces a fraction.
|
||||
* This is useful for framerate calculations.
|
||||
* @param dst_num destination numerator
|
||||
* @param dst_den destination denominator
|
||||
* @param num source numerator
|
||||
* @param den source denominator
|
||||
* @param max the maximum allowed for dst_num & dst_den
|
||||
* @return 1 if exact, 0 otherwise
|
||||
*/
|
||||
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
|
||||
|
||||
/**
|
||||
* Multiplies two rationals.
|
||||
* @param b first rational
|
||||
* @param c second rational
|
||||
* @return b*c
|
||||
*/
|
||||
AVRational av_mul_q(AVRational b, AVRational c) av_const;
|
||||
|
||||
/**
|
||||
* Divides one rational by another.
|
||||
* @param b first rational
|
||||
* @param c second rational
|
||||
* @return b/c
|
||||
*/
|
||||
AVRational av_div_q(AVRational b, AVRational c) av_const;
|
||||
|
||||
/**
|
||||
* Adds two rationals.
|
||||
* @param b first rational
|
||||
* @param c second rational
|
||||
* @return b+c
|
||||
*/
|
||||
AVRational av_add_q(AVRational b, AVRational c) av_const;
|
||||
|
||||
/**
|
||||
* Subtracts one rational from another.
|
||||
* @param b first rational
|
||||
* @param c second rational
|
||||
* @return b-c
|
||||
*/
|
||||
AVRational av_sub_q(AVRational b, AVRational c) av_const;
|
||||
|
||||
/**
|
||||
* Converts a double precision floating point number to a rational.
|
||||
* @param d double to convert
|
||||
* @param max the maximum allowed numerator and denominator
|
||||
* @return (AVRational) d
|
||||
*/
|
||||
AVRational av_d2q(double d, int max) av_const;
|
||||
|
||||
/**
|
||||
* @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
|
||||
* than q1, 0 if they have the same distance.
|
||||
*/
|
||||
int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
|
||||
|
||||
/**
|
||||
* Finds the nearest value in q_list to q.
|
||||
* @param q_list an array of rationals terminated by {0, 0}
|
||||
* @return the index of the nearest value found in the array
|
||||
*/
|
||||
int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
|
||||
|
||||
#endif /* AVUTIL_RATIONAL_H */
|
|
@ -0,0 +1,305 @@
|
|||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#endif // __STDC_FORMAT_MACROS ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
|
@ -0,0 +1,222 @@
|
|||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
extern "C++" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef int intptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val##i8
|
||||
#define INT16_C(val) val##i16
|
||||
#define INT32_C(val) val##i32
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val##ui8
|
||||
#define UINT16_C(val) val##ui16
|
||||
#define UINT32_C(val) val##ui32
|
||||
#define UINT64_C(val) val##ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
|
@ -0,0 +1,30 @@
|
|||
No library needs to be built for iAVC.
|
||||
|
||||
The file src/effects/AvcCompressor.cpp includes the iAVC files.
|
||||
While it is somewhat unorthodox to include a .cpp file, it
|
||||
does save building a library.
|
||||
|
||||
Keeping the iAVC files in a directory of its own is appropriate
|
||||
and makes it easy to remember that iAVC is under LGPL license
|
||||
and not simply part of Audacity.
|
||||
|
||||
Vince Busam
|
||||
|
||||
-------------
|
||||
|
||||
New files list:
|
||||
|
||||
lib-src/iAVC/iAVC-Audacity.txt (this file)
|
||||
lib-src/iAVC/iAVC.h
|
||||
lib-src/iAVC/iAVC.cpp
|
||||
lib-src/iAVC/iAVCsamples.h
|
||||
|
||||
src/effects/AvcCompressor.cpp
|
||||
src/effects/AvcCompressor.h
|
||||
src/effects/SimplePairedTwoTrack.cpp
|
||||
src/effects/SimplePairedTwoTrack.h
|
||||
|
||||
Updated files list:
|
||||
|
||||
src/effects/LoadEffects.cpp (one line to load AvcCompressor)
|
||||
win/audacity.dsp (add above new files to project)
|
|
@ -0,0 +1,643 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
// iAVC -- integer Automatic Volume Control (on samples given it)
|
||||
//
|
||||
// Copyright (C) 2002 Vincent A. Busam
|
||||
// 15754 Adams Ridge
|
||||
// Los Gatos, CA 95033
|
||||
// email: vince@busam.com
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
// If you change the algorithm or find other sets of values that improve the
|
||||
// output results, please send me a copy so that I can incorporate them into
|
||||
// iAVC. Of course, you are not required to send me any updates under the
|
||||
// LGPL license, but please consider doing so under the spirit of open source
|
||||
// and in appreciation of being able to take advantage of my efforts expended
|
||||
// in developing iAVC.
|
||||
|
||||
// This code implements a "poor man's" dynamic range compression algorithm
|
||||
// that was build on hueristics. It's purpose is to perform dynamic range
|
||||
// compression in real time using only integer arithmetic. Processing time
|
||||
// is more important than memory. It acts like an automatic volume control,
|
||||
// frequently adjusting the volume (gain) based on an average of the current
|
||||
// sound samples
|
||||
|
||||
#if !defined(IAVC_INLINE) || ( !defined(IAVC_SETNEXTSAMPLE) && !defined(IAVC_GETNEXTSAMPLE) && !defined(IAVC_ADJUSTMULTIPLIER) )
|
||||
|
||||
#ifdef _WINDOWS
|
||||
//#include "stdafx.h" // don't use precompiled headers on this file
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
// You really should consider using C++.
|
||||
// Granted it is not needed or even useful in all situations, but real
|
||||
// object oriented design and code (not faux OO code like in MFC)
|
||||
// has lots of benefits.
|
||||
#endif
|
||||
|
||||
#include "iAVC.h"
|
||||
|
||||
#if (defined ( _WINDOWS ) | defined ( _DEBUG ))
|
||||
#define c_WithDebug 1 // should be = 1
|
||||
#else
|
||||
#define c_WithDebug 0
|
||||
#endif
|
||||
|
||||
#ifdef IDEBUGLOG
|
||||
#include "LogFlags.h"
|
||||
#include "../Logger/IDebugLog.h"
|
||||
#else
|
||||
#ifdef _DEBUG
|
||||
#ifdef _WINDOWS
|
||||
#define _MFC_OVERRIDES_NEW
|
||||
#include <crtdbg.h> // user _RPTF0 to get file name and line in output
|
||||
#define log0(fn,lf,ulid,fmt) _RPT0(_CRT_WARN,fmt);
|
||||
#define log1(fn,lf,ulid,fmt,p1) _RPT1(_CRT_WARN,fmt,p1);
|
||||
#define log2(fn,lf,ulid,fmt,p1,p2) _RPT2(_CRT_WARN,fmt,p1,p2);
|
||||
#define log3(fn,lf,ulid,fmt,p1,p2,p3) _RPT3(_CRT_WARN,fmt,p1,p2,p3);
|
||||
#define log4(fn,lf,ulid,fmt,p1,p2,p3,p4) _RPT4(_CRT_WARN,fmt,p1,p2,p3,p4);
|
||||
#define log5(fn,lf,ulid,fmt,p1,p2,p3,p4,p5) _RPT5(_CRT_WARN,fmt,p1,p2,p3,p4,p5);
|
||||
#elif
|
||||
#define log0(fn,lf,ulid,fmt) fprintf(stderr,fmt);
|
||||
#define log1(fn,lf,ulid,fmt,p1) fprintf(stderr,fmt,p1);
|
||||
#define log2(fn,lf,ulid,fmt,p1,p2) fprintf(stderr,fmt,p1,p2);
|
||||
#define log3(fn,lf,ulid,fmt,p1,p2,p3) fprintf(stderr,fmt,p1,p2,p3);
|
||||
#define log4(fn,lf,ulid,fmt,p1,p2,p3,p4) fprintf(stderr,fmt,p1,p2,p3,p4);
|
||||
#define log5(fn,lf,ulid,fmt,p1,p2,p3,p4,p5) fprintf(stderr,fmt,p1,p2,p3,p4,p5);
|
||||
#endif // _WINDOWS
|
||||
#else
|
||||
#define log0(fn,lf,ulid,fmt) ;
|
||||
#define log1(fn,lf,ulid,fmt,p1) ;
|
||||
#define log2(fn,lf,ulid,fmt,p1,p2) ;
|
||||
#define log3(fn,lf,ulid,fmt,p1,p2,p3) ;
|
||||
#define log4(fn,lf,ulid,fmt,p1,p2,p3,p4) ;
|
||||
#define log5(fn,lf,ulid,fmt,p1,p2,p3,p4,p5) ;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// iAVC constructor
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AutoVolCtrl::AutoVolCtrl()
|
||||
{
|
||||
m_pSampleList = NULL;
|
||||
m_nSampleWindowSize = DEFAULT_SAMPLE_WINDOW_SIZE;
|
||||
m_nSamplesInAvg = DEFAULT_ADJUSTER_WINDOW_SIZE;
|
||||
m_nLookAheadWindowSize = DEFAULT_LOOKAHEAD_WINDOW_SIZE;
|
||||
m_nMinSamplesBeforeSwitch = DEFAULT_MINIMUM_SAMPLES_BEFORE_SWITCH;
|
||||
m_nNumTracks = DEFAULT_NUMBER_OF_TRACKS;
|
||||
m_nMaxChangePct = DEFAULT_MAX_PCT_CHANGE_AT_ONCE;
|
||||
m_nMaxSampleValue = DEFAULT_MAX_SAMPLE_VALUE;
|
||||
|
||||
SetSampleWindowSize ( m_nSampleWindowSize,
|
||||
m_nSamplesInAvg,
|
||||
m_nLookAheadWindowSize );
|
||||
Reset();
|
||||
|
||||
// set multipliers to a nil transform
|
||||
for ( int i = 0 ; i < MULTIPLY_PCT_ARRAY_SIZE ; ++i )
|
||||
m_nMultiplyPct [ i ] = IAVCMULTIPLYPCT ( APPLY_MULTIPLY_FACTOR ( 1 ) ); // default to no transform
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// iAVC destructor
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AutoVolCtrl::~AutoVolCtrl()
|
||||
{
|
||||
// Dump diagnostic information
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Sample Window Size %d\n", m_nSampleWindowSize );
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Adjuster Window Size %d\n", m_nSamplesInAvg );
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Min Samples to Switch %d\n", m_nMinSamplesBeforeSwitch );
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Pct Change threshold %d\n", m_nMaxChangePct );
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Number of Samples = %d\n", m_nTotalSamples );
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Multiplier changes = %d\n", m_nNumMultiplerChanges );
|
||||
log1(CN_iAVC,LL_DEBUG,0, "Number of clips = %d\n", m_nClips );
|
||||
|
||||
if ( m_pSampleList != NULL )
|
||||
delete []m_pSampleList;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Reset
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AutoVolCtrl::Reset()
|
||||
{
|
||||
ZeroSampleWindow();
|
||||
SetMinSamplesBeforeSwitch ( m_nMinSamplesBeforeSwitch );
|
||||
SetMaxPctChangeAtOnce ( m_nMaxChangePct ); // e.g. 10%
|
||||
SetNumberTracks ( m_nNumTracks );
|
||||
m_nMaxSampleValue = DEFAULT_MAX_SAMPLE_VALUE; //TODO: make a method so caller can set
|
||||
|
||||
// set our internal data
|
||||
m_nSampleAvgSum = 0;
|
||||
m_nSamplesInSum = 0;
|
||||
m_nCurrentMultiplier = APPLY_MULTIPLY_FACTOR ( 1 );
|
||||
m_nTotalSamples = 0;
|
||||
m_nNumMultiplerChanges = 0;
|
||||
m_nClips = 0;
|
||||
m_nLookaheadSum = 0;
|
||||
m_nSamplesInLookahead = 0;
|
||||
m_nNumSamplesBeforeNextSwitch = 0; // allows switch on first GetSample
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetSampleWindowSize
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool AutoVolCtrl::SetSampleWindowSize ( unsigned long nSampleWindowSize,
|
||||
unsigned long nAdjusterWindowSize,
|
||||
unsigned long nLookAheadWindowSize )
|
||||
{
|
||||
if ( nSampleWindowSize > MAX_SAMPLE_WINDOW_SIZE )
|
||||
return false; // sums may overflow and we use int for indicies
|
||||
|
||||
if ( nSampleWindowSize < nAdjusterWindowSize + nLookAheadWindowSize )
|
||||
return false;
|
||||
|
||||
m_nSamplesInAvg = nAdjusterWindowSize;
|
||||
m_nLookAheadWindowSize = nLookAheadWindowSize;
|
||||
|
||||
if ( m_nSampleWindowSize != nSampleWindowSize || m_pSampleList == NULL )
|
||||
{ // window size has changed
|
||||
m_nSampleWindowSize = nSampleWindowSize;
|
||||
if ( m_pSampleList )
|
||||
delete m_pSampleList;
|
||||
m_pSampleList = new Sample [ m_nSampleWindowSize ];
|
||||
}
|
||||
|
||||
// initialize a circular list of samples
|
||||
for ( unsigned long j = 0 ; j < m_nSampleWindowSize ; ++j )
|
||||
{
|
||||
m_pSampleList [ j ].m_pNext = &(m_pSampleList[j + 1]);
|
||||
m_pSampleList [ j ].m_nLeft = 0;
|
||||
m_pSampleList [ j ].m_nRight = 0;
|
||||
m_pSampleList [ j ].m_nSampleValid = 0; // false
|
||||
m_pSampleList [ j ].m_nSampleAbsAvg = 0;
|
||||
// set average partner
|
||||
m_pSampleList [ j ].m_pAvgPartner = ( j < m_nSamplesInAvg ) ?
|
||||
&(m_pSampleList [ m_nSampleWindowSize - m_nSamplesInAvg + j]) :
|
||||
&(m_pSampleList [ j - m_nSamplesInAvg ]) ;
|
||||
// set lookahead partner
|
||||
m_pSampleList [ j ].m_pLookaheadPartner = ( j < m_nLookAheadWindowSize ) ?
|
||||
&(m_pSampleList [ m_nSampleWindowSize - m_nLookAheadWindowSize + j]) :
|
||||
&(m_pSampleList [ j - m_nLookAheadWindowSize ]) ;
|
||||
}
|
||||
m_pSampleList [ m_nSampleWindowSize - 1 ].m_pNext = &(m_pSampleList[0]); // last points to first
|
||||
|
||||
ZeroSampleWindow();
|
||||
|
||||
if ( c_WithDebug )
|
||||
{
|
||||
//for ( j = 0 ; j < m_nSampleWindowSize ; ++j )
|
||||
//{
|
||||
// unsigned long nNext = ( m_pSampleList [ j ].m_pNext - m_pSampleList );
|
||||
// unsigned long nAvgp = ( m_pSampleList [ j ].m_pAvgPartner - m_pSampleList );
|
||||
// unsigned long nLkap = ( m_pSampleList [ j ].m_pLookaheadPartner - m_pSampleList );
|
||||
// log4(CN_iAVC,LL_DEBUG,0, "this=%d, next=%d, AvgPartner=%d, LookAheadPartner = %d",
|
||||
// j, nNext, nAvgp, nLkap );
|
||||
//}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetMinSamplesBeforeSwitch
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool AutoVolCtrl::SetMinSamplesBeforeSwitch ( unsigned long nMinSamplesBeforeSwitch )
|
||||
{
|
||||
if ( m_nSampleWindowSize < nMinSamplesBeforeSwitch ||
|
||||
nMinSamplesBeforeSwitch < MIN_MINIMUM_SAMPLES_BEFORE_SWITCH )
|
||||
return false;
|
||||
|
||||
m_nMinSamplesBeforeSwitch = nMinSamplesBeforeSwitch;
|
||||
m_nNumSamplesBeforeNextSwitch = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetMaxPctChangeAtOnce
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AutoVolCtrl::SetMaxPctChangeAtOnce ( IAVCMULTIPLYPCT nPctChange )
|
||||
{
|
||||
m_nMaxChangePct = nPctChange;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetMultipliers
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AutoVolCtrl::SetMultipliers ( unsigned short int nValueWanted [ MULTIPLY_PCT_ARRAY_SIZE ] )
|
||||
{
|
||||
for ( int i = 1 ; i < MULTIPLY_PCT_ARRAY_SIZE ; ++i )
|
||||
{
|
||||
m_nMultiplyPct [ i ] = APPLY_MULTIPLY_FACTOR ( nValueWanted [ i ] ) / IAVCMULTIPLYPCT ( i );
|
||||
if ( ( i % 1000 ) == 0 )
|
||||
log3(CN_iAVC,LL_DEBUG,0, "SetMultipliers at sample %d, =%d (0x%X)\n",
|
||||
i,
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nMultiplyPct [ i ]),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nMultiplyPct [ i ]) );
|
||||
}
|
||||
m_nMultiplyPct [ 0 ] = m_nMultiplyPct [ 1 ];
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetNumberTracks
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool AutoVolCtrl::SetNumberTracks ( unsigned int nNumTracks )
|
||||
{
|
||||
if ( nNumTracks > MAX_NUMBER_OF_TRACKS )
|
||||
return false;
|
||||
m_nNumTracks = nNumTracks;
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ZeroSampleWindow
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AutoVolCtrl::ZeroSampleWindow()
|
||||
{
|
||||
// initialize a circular list of samples
|
||||
for ( unsigned long j = 0 ; j < m_nSampleWindowSize ; ++j )
|
||||
{
|
||||
m_pSampleList [ j ].m_nLeft = 0;
|
||||
m_pSampleList [ j ].m_nRight = 0;
|
||||
m_pSampleList [ j ].m_nSampleValid = 0; // false
|
||||
m_pSampleList [ j ].m_nSampleAbsAvg = 0;
|
||||
}
|
||||
|
||||
// set subscripts for where next data goes or comes from
|
||||
m_pNextSet = &m_pSampleList [ 0 ];
|
||||
m_pNextGet = &m_pSampleList [ 0 ];
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetNextSample
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool AutoVolCtrl::SetNextSample ( IAVCSAMPLETYPE left, IAVCSAMPLETYPE right )
|
||||
{
|
||||
|
||||
#endif // !defined...
|
||||
#if defined(IAVC_SETNEXTSAMPLE)
|
||||
|
||||
// take out of our sum the sample m_nSamplesInAvg before the sample just before the lookahead window
|
||||
Sample* pAddToSum = m_pNextSet->m_pLookaheadPartner; // node just before lookahead window
|
||||
Sample* pRemoveFromSum = pAddToSum->m_pAvgPartner; // node to remove from sample sum
|
||||
|
||||
//if ( m_nTotalSamples <= 2200 )
|
||||
//{ // TEMP
|
||||
// log8(CN_iAVC,LL_DEBUG,0,
|
||||
// "# = %d, sum = %d,"
|
||||
// ", nextSet=%d, AddToAvg=%d (%d), RemoveFromAvg=%d (%d), newAbsAvg=%d",
|
||||
// m_nSamplesInSum,
|
||||
// long(m_nSampleAvgSum),
|
||||
// m_pNextSet - m_pSampleList,
|
||||
// pAddToSum - m_pSampleList, long(pAddToSum->m_nSampleAbsAvg),
|
||||
// pRemoveFromSum - m_pSampleList, long(pRemoveFromSum->m_nSampleAbsAvg),
|
||||
// long( absVal ( left ) + absVal ( right ) ) / m_nNumTracks );
|
||||
//}
|
||||
|
||||
// take this sample out of the sample sum (if valid)
|
||||
m_nSampleAvgSum -= pRemoveFromSum->m_nSampleAbsAvg;
|
||||
m_nSamplesInSum -= pRemoveFromSum->m_nSampleValid;
|
||||
|
||||
// form average value for this cell
|
||||
m_pNextSet->m_nSampleAbsAvg = ( absVal ( left ) + absVal ( right ) ) / m_nNumTracks;
|
||||
if ( m_pNextSet->m_nSampleAbsAvg > DEFAULT_MAX_SAMPLE_VALUE ) // 9/1/02 Safety code needed for Audacity
|
||||
m_pNextSet->m_nSampleAbsAvg = DEFAULT_MAX_SAMPLE_VALUE;
|
||||
// put in new sample
|
||||
m_pNextSet->m_nLeft = left;
|
||||
m_pNextSet->m_nRight = right;
|
||||
m_pNextSet->m_nSampleValid = 1; // true, node will now always have a valid sample in it
|
||||
|
||||
// add a node's samples into the sample sum (if valid)
|
||||
m_nSampleAvgSum += pAddToSum->m_nSampleAbsAvg;
|
||||
m_nSamplesInSum += pAddToSum->m_nSampleValid;
|
||||
|
||||
|
||||
//NOTUSED - not using lookahead
|
||||
//if ( m_nLookAheadWindowSize > 0 )
|
||||
//{ // Figure out lookahead average for our lookahead partner
|
||||
// Sample* pLookaheadPartner = pAddToSum; // take this nodes samples out of lookahead sum
|
||||
// // take this sample out of the sum (if valid)
|
||||
// m_nLookaheadSum -= pLookaheadPartner->m_nSampleAbsAvg;
|
||||
// m_nSamplesInLookahead -= pLookaheadPartner->m_nSampleValid;
|
||||
//
|
||||
// // add into the lookahead sum the new values
|
||||
// ++m_nSamplesInLookahead;
|
||||
// m_nLookaheadSum += m_pNextSet->m_nSampleAbsAvg;
|
||||
//}
|
||||
|
||||
m_pNextSet = m_pNextSet->m_pNext;
|
||||
|
||||
#endif // defined(IAVC_SETNEXTSAMPLE)
|
||||
#if !defined(IAVC_INLINE) || ( !defined(IAVC_SETNEXTSAMPLE) && !defined(IAVC_GETNEXTSAMPLE) && !defined(IAVC_ADJUSTMULTIPLIER) )
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GetNextSample
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool AutoVolCtrl::GetNextSample ( IAVCSAMPLETYPE & left, IAVCSAMPLETYPE & right )
|
||||
{
|
||||
|
||||
#endif // !defined...
|
||||
#if defined(IAVC_GETNEXTSAMPLE)
|
||||
|
||||
// Note: If Puts circle around before we get the samples, then we'll lose one
|
||||
// whole round of samples.
|
||||
|
||||
int nClip; // not used unless c_WithDebug is true
|
||||
|
||||
#if defined(IAVC_INLINE)
|
||||
#undef IAVC_GETNEXTSAMPLE
|
||||
#define IAVC_ADJUSTMULTIPLIER
|
||||
//#pragma message("inlining AdjustMultiplier 1st time")
|
||||
#include "iAVC.cpp"
|
||||
#define IAVC_GETNEXTSAMPLE
|
||||
#undef IAVC_ADJUSTMULTIPLIER
|
||||
#else
|
||||
if ( m_pNextGet == m_pNextSet )
|
||||
{
|
||||
return false; // no sample to give
|
||||
}
|
||||
|
||||
AdjustMultiplier();
|
||||
#endif
|
||||
|
||||
if ( c_WithDebug )
|
||||
{
|
||||
++m_nTotalSamples;
|
||||
|
||||
if ( ( m_nTotalSamples % 10000 ) <= 1 )
|
||||
{
|
||||
log4(CN_iAVC,LL_DEBUG,0,
|
||||
"Sample %d, Number of samples in sum = %d, sample sum = %d, sample avg = %d\n",
|
||||
m_nTotalSamples,
|
||||
m_nSamplesInSum,
|
||||
long ( AVG_TO_MULTIPLIER_SUBSCRIPT(m_nSampleAvgSum) ),
|
||||
long ( AVG_TO_MULTIPLIER_SUBSCRIPT(m_nSampleAvgSum/m_nSamplesInSum) ) );
|
||||
}
|
||||
|
||||
nClip = 0;
|
||||
|
||||
if ( IF_CLIP ( left ) || IF_CLIP ( right ) || m_nTotalSamples == 55666 )
|
||||
{
|
||||
log2(CN_iAVC,LL_ERROR,0,"ERROR: Sample out of range, left=%d, right=%d\n",
|
||||
AVG_TO_MULTIPLIER_SUBSCRIPT( m_pNextGet->m_nLeft ),
|
||||
AVG_TO_MULTIPLIER_SUBSCRIPT( m_pNextGet->m_nRight ) );
|
||||
}
|
||||
}
|
||||
|
||||
IAVCSUMTYPE nLeft;
|
||||
IAVCSUMTYPE nRight;
|
||||
nLeft = UNDO_MULTIPLY_FACTOR ( m_nCurrentMultiplier * m_pNextGet->m_nLeft );
|
||||
nRight = UNDO_MULTIPLY_FACTOR ( m_nCurrentMultiplier * m_pNextGet->m_nRight );
|
||||
|
||||
if ( IF_CLIP ( nLeft ) || IF_CLIP ( nRight ) )
|
||||
{ // We had a clip, see if we can adjust multiplier down.
|
||||
|
||||
// What do we do? If this is a momentary pop, like a pop on a record, we should
|
||||
// do nothing. But most audio today is probably from CDs and therefore
|
||||
// probably clean. So let's be bold and ASSUME that we're just moving into
|
||||
// a loud section from a softer section (which can be why we have a high
|
||||
// multiplier for this sample). In this case, let's just change the multiplier
|
||||
// now and not wait for the end of the next change window. To figure out the
|
||||
// new multiplier, we'll just use this sample.
|
||||
|
||||
long nCurSampleAvgSubscript = AVG_TO_MULTIPLIER_SUBSCRIPT(m_pNextGet->m_nSampleAbsAvg);
|
||||
if ( nCurSampleAvgSubscript < 0 ) // Safety code, should not be needed
|
||||
nCurSampleAvgSubscript = 0;
|
||||
else if ( nCurSampleAvgSubscript >= MULTIPLY_PCT_ARRAY_SIZE )
|
||||
nCurSampleAvgSubscript = MULTIPLY_PCT_ARRAY_SIZE - 1;
|
||||
m_nCurrentMultiplier = m_nMultiplyPct [ nCurSampleAvgSubscript ]; // always positive
|
||||
m_nNumSamplesBeforeNextSwitch = m_nMinSamplesBeforeSwitch;
|
||||
|
||||
if ( c_WithDebug )
|
||||
{
|
||||
nClip = 1;
|
||||
}
|
||||
|
||||
// // This path will take extra time, but shouldn't occur very often.
|
||||
// m_nNumSamplesBeforeNextSwitch = 0; // for multiplier adjustment
|
||||
// ++m_nNumSamplesBeforeNextSwitch; // don't do this twice for a sample, already invoked AdjustMultiplier
|
||||
//
|
||||
//#if defined(IAVC_INLINE)
|
||||
//#undef IAVC_GETNEXTSAMPLE
|
||||
//#define IAVC_ADJUSTMULTIPLIER
|
||||
////#pragma message("inlining AdjustMultiplier 2nd time")
|
||||
//#include "DynRangeComp.cpp"
|
||||
//#define IAVC_GETNEXTSAMPLE
|
||||
//#undef IAVC_ADJUSTMULTIPLIER
|
||||
//#else
|
||||
// AdjustMultiplier();
|
||||
//#endif
|
||||
|
||||
nLeft = UNDO_MULTIPLY_FACTOR ( m_nCurrentMultiplier * m_pNextGet->m_nLeft );
|
||||
nRight = UNDO_MULTIPLY_FACTOR ( m_nCurrentMultiplier * m_pNextGet->m_nRight );
|
||||
|
||||
if ( IF_CLIP ( nLeft ) || IF_CLIP ( nRight ) )
|
||||
{
|
||||
nLeft = m_pNextGet->m_nLeft; // don't clip, use original values instead
|
||||
nRight = m_pNextGet->m_nRight; // don't clip, use original values instead
|
||||
}
|
||||
}
|
||||
left = nLeft;
|
||||
right = nRight;
|
||||
|
||||
if ( c_WithDebug )
|
||||
{
|
||||
if ( nClip != 0 )
|
||||
{
|
||||
m_nClips += nClip;
|
||||
if ( ( m_nClips % 1 ) == 0 )
|
||||
{ // m_nTotalSamples may be off if buffered (i.e. more put samples than get samples done)
|
||||
log4(CN_iAVC,LL_DEBUG,0, "Sample %d clipped, orig left=%d, right=%d, multiplier=0x%X\n",
|
||||
m_nTotalSamples,
|
||||
AVG_TO_MULTIPLIER_SUBSCRIPT(m_pNextGet->m_nLeft),
|
||||
AVG_TO_MULTIPLIER_SUBSCRIPT(m_pNextGet->m_nRight),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( m_nTotalSamples % 5000 ) == 0 )
|
||||
{
|
||||
log3(CN_iAVC,LL_DEBUG,0, "Sample %d, multiplier=%d (0x%X),...\n",
|
||||
m_nTotalSamples,
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier) );
|
||||
log4(CN_iAVC,LL_DEBUG,0, " , Transformed %d->%d %d->%d\n",
|
||||
long(AVG_TO_MULTIPLIER_SUBSCRIPT(m_pNextGet->m_nLeft)),
|
||||
long(AVG_TO_MULTIPLIER_SUBSCRIPT(left)),
|
||||
long(AVG_TO_MULTIPLIER_SUBSCRIPT(m_pNextGet->m_nRight)),
|
||||
long(AVG_TO_MULTIPLIER_SUBSCRIPT(right)) );
|
||||
}
|
||||
}
|
||||
|
||||
m_pNextGet = m_pNextGet->m_pNext;
|
||||
|
||||
#endif // defined(IAVC_GETNEXTSAMPLE)
|
||||
#if !defined(IAVC_INLINE) || ( !defined(IAVC_SETNEXTSAMPLE) && !defined(IAVC_GETNEXTSAMPLE) && !defined(IAVC_ADJUSTMULTIPLIER) )
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AdjustMultiplier
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AutoVolCtrl::AdjustMultiplier()
|
||||
{
|
||||
// TEMPORARY DEBUG CODE
|
||||
if ( c_WithDebug && m_nTotalSamples >= 466930L && m_nTotalSamples <= 466973L )
|
||||
{
|
||||
log3(CN_iAVC,LL_DEBUG,0, "DEBUG at sample %d, mul now=0x%X (%d)\n",
|
||||
m_nTotalSamples,
|
||||
long(m_nCurrentMultiplier),
|
||||
long(m_nCurrentMultiplier) );
|
||||
long nLookaheadAvg; // needs to be long since used as a subscript
|
||||
if ( m_nSamplesInLookahead > 0 )
|
||||
nLookaheadAvg= long ( m_nLookaheadSum/m_nSamplesInLookahead );
|
||||
else
|
||||
nLookaheadAvg = 0;
|
||||
log4(CN_iAVC,LL_DEBUG,0, " sample max=%d, sample win avg=%d, lookahead avg=%d, avg multiplier=0x%X\n",
|
||||
long(maxVal(absVal(m_pNextGet->m_nLeft),absVal(m_pNextGet->m_nRight))),
|
||||
long(m_nSampleAvgSum / m_nSamplesInSum),
|
||||
nLookaheadAvg,
|
||||
long(m_nMultiplyPct [ nLookaheadAvg ]) );
|
||||
}
|
||||
|
||||
|
||||
#endif // !defined...
|
||||
#if defined(IAVC_ADJUSTMULTIPLIER)
|
||||
//#pragma message("inlining AdjustMultiplier")
|
||||
|
||||
--m_nNumSamplesBeforeNextSwitch;
|
||||
if ( m_nNumSamplesBeforeNextSwitch <= 0 )
|
||||
{ // long time since last change, see if it is time to change the multiplier
|
||||
long nCurSampleAvgSubscript = ( m_nSamplesInSum <= 0 ) ? 0 :
|
||||
( AVG_TO_MULTIPLIER_SUBSCRIPT(m_nSampleAvgSum) / m_nSamplesInSum );
|
||||
if ( nCurSampleAvgSubscript < 0 ) // Safety code, should not be needed
|
||||
nCurSampleAvgSubscript = 0;
|
||||
else if ( nCurSampleAvgSubscript >= MULTIPLY_PCT_ARRAY_SIZE )
|
||||
nCurSampleAvgSubscript = MULTIPLY_PCT_ARRAY_SIZE - 1;
|
||||
IAVCMULTIPLYPCT nNewMultiplier = m_nMultiplyPct [ nCurSampleAvgSubscript ]; // always positive
|
||||
IAVCMULTIPLYPCT nMultiplierDiff = nNewMultiplier - m_nCurrentMultiplier; // positive or negative
|
||||
// if new multiplier is 1, force change to get to 1 (nChangeThreshold always positive)
|
||||
IAVCMULTIPLYPCT nChangeThreshold = ( nMultiplierDiff != 0 &&
|
||||
nNewMultiplier == APPLY_MULTIPLY_FACTOR ( 1 ) ) ?
|
||||
nMultiplierDiff :
|
||||
IAVCMULTIPLYPCT ( m_nCurrentMultiplier * m_nMaxChangePct / 100 ); // % of current multiplier
|
||||
//NOTUSED - not using lookahead
|
||||
//unsigned long nLookaheadAvg;
|
||||
//if ( m_nSamplesInLookahead > 0 )
|
||||
// nLookaheadAvg = m_nLookaheadSum/m_nSamplesInLookahead;
|
||||
//else
|
||||
// nLookaheadAvg = 0;
|
||||
//long nLookaheadMultiplier = m_nMultiplyPct [ nLookaheadAvg ];
|
||||
|
||||
if ( nMultiplierDiff >= nChangeThreshold )
|
||||
{ // adjust multiplier up
|
||||
log4(CN_iAVC,LL_DEBUG,0, "Multiplier UP old=%d, new=%d, diff=%d, threshold=%d\n",
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(nNewMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(nMultiplierDiff),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(nChangeThreshold) );
|
||||
m_nCurrentMultiplier = nNewMultiplier; // or m_nCurrentMultiplier += nChangeThreshold;
|
||||
m_nNumSamplesBeforeNextSwitch = m_nMinSamplesBeforeSwitch;
|
||||
if ( c_WithDebug )
|
||||
{
|
||||
++m_nNumMultiplerChanges;
|
||||
log4(CN_iAVC,LL_DEBUG,0, "Multiplier UP at sample %d, current avg=%d, now=%d (0x%X)\n",
|
||||
m_nTotalSamples,
|
||||
nCurSampleAvgSubscript,
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier) );
|
||||
//NOTUSED - not using lookahead
|
||||
//log2(CN_iAVC,LL_DEBUG,0, " lookahead: avg=%d, avg multiplier=0x%X\n",
|
||||
// long(nLookaheadAvg),
|
||||
// long(nLookaheadMultiplier) );
|
||||
}
|
||||
}
|
||||
else if ( nMultiplierDiff <= - nChangeThreshold )
|
||||
{ // adjust multiplier down
|
||||
log4(CN_iAVC,LL_DEBUG,0, "Multiplier DOWN old=%d, new=%d, diff=%d, threshold=%d\n",
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(nNewMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(nMultiplierDiff),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(nChangeThreshold) );
|
||||
m_nCurrentMultiplier = nNewMultiplier; // or m_nCurrentMultiplier -= nChangeThreshold;
|
||||
m_nNumSamplesBeforeNextSwitch = m_nMinSamplesBeforeSwitch;
|
||||
if ( c_WithDebug )
|
||||
{
|
||||
++m_nNumMultiplerChanges;
|
||||
log4(CN_iAVC,LL_DEBUG,0, "Multiplier DOWN at sample %d, current avg=%d, now=%d (0x%X)\n",
|
||||
m_nTotalSamples,
|
||||
nCurSampleAvgSubscript,
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier),
|
||||
MULTIPLY_FACTOR_TO_INT_X256(m_nCurrentMultiplier) );
|
||||
//NOTUSED - not using lookahead
|
||||
//log2(CN_iAVC,LL_DEBUG,0, " lookahead: avg=%d, avg multiplier=0x%X\n",
|
||||
// long(nLookaheadAvg),
|
||||
// long(nLookaheadMultiplier) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // defined(IAVC_ADJUSTMULTIPLIER)
|
||||
#if !defined(IAVC_INLINE) || ( !defined(IAVC_SETNEXTSAMPLE) && !defined(IAVC_GETNEXTSAMPLE) && !defined(IAVC_ADJUSTMULTIPLIER) )
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif // !defined...
|
||||
|
|
@ -0,0 +1,250 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
// iAVC -- integer Automatic Volume Control (on samples given it)
|
||||
//
|
||||
// Copyright (C) 2002 Vincent A. Busam
|
||||
// 15754 Adams Ridge
|
||||
// Los Gatos, CA 95033
|
||||
// email: vince@busam.com
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
// If you change the algorithm or find other sets of values that improve the
|
||||
// output results, please send me a copy so that I can incorporate them into
|
||||
// iAVC. Of course, you are not required to send me any updates under the
|
||||
// LGPL license, but please consider doing so under the spirit of open source
|
||||
// and in appreciation of being able to take advantage of my efforts expended
|
||||
// in developing iAVC.
|
||||
|
||||
// This code implements a "poor man's" dynamic range compression algorithm
|
||||
// that was build on hueristics. It's purpose is to perform dynamic range
|
||||
// compression in real time using only integer arithmetic. Processing time
|
||||
// is more important than memory.
|
||||
|
||||
// There are 3 window sizes that can be set:
|
||||
// Sample Window Size: Total number of samples kept in a circular buffer.
|
||||
// The caller can "delay" retrieving samples this
|
||||
// long, although there is probably no reason to
|
||||
// make this bigger than the Adjuster Window size
|
||||
// plus the Lookahead Window size.
|
||||
// Adjuster Window Size: Total number of samples in the moving average
|
||||
// that is used to determine the amplification
|
||||
// multiplication factor.
|
||||
// Lookahead Window Size: A small window that is this many samples ahead
|
||||
// of the Adjuster Window. The
|
||||
// moving average of this window is used to
|
||||
// delay changing the multiplication factor for
|
||||
// this many samples. Helps avoid distorted
|
||||
// transitions from loud to soft. This is only
|
||||
// useful if the caller delays retrieving samples
|
||||
// by at least this many samples. (The lookahead
|
||||
// window is currently NOT being used.)
|
||||
|
||||
// |- oldest sample newest sample -|
|
||||
// | |
|
||||
// <----------------------- Sample Window --------------------------------->
|
||||
// <-Lookahead Window->
|
||||
// <------------ Adjuster Window -------------->
|
||||
//
|
||||
// ^
|
||||
// last sample put by PutNextSample -|
|
||||
//
|
||||
// ^
|
||||
// |- last sample got by GetNextSample
|
||||
//
|
||||
// <-- callers put/get delay ->
|
||||
|
||||
// The algorithms are safe for files with the number of samples <= 2,147,483,647
|
||||
// since 32 bit signed integer storage is used in some places.
|
||||
|
||||
|
||||
// The define symbol "IAVC_INLINE" is used to make the attributes (data) outside
|
||||
// the class definition so the SetNextSample and PutNextSample methods can be
|
||||
// inline for faster processing in realtime environments. (I don't trust
|
||||
// all C++ compilers to honor the inline directive so I'm forcing inline through
|
||||
// the use of define symbols.) See DRCinlineSample.cpp for how to use define
|
||||
// symbols for inline code.
|
||||
|
||||
// The define symbol "IAVC_FLOAT" is used to perform calculations in floating point
|
||||
// instead of integer. Floating point samples are expected to be in the range
|
||||
// or -1.0 to +1.0. Note that the multiplier array size remains
|
||||
// MULTIPLY_PCT_ARRAY_SIZE.
|
||||
|
||||
#ifndef _IAVC_H_
|
||||
#define _IAVC_H_
|
||||
|
||||
#ifndef IAVC_INLINE
|
||||
// prepare other defines for code inclusion, since not inline
|
||||
#define IAVC_SETNEXTSAMPLE
|
||||
#define IAVC_GETNEXTSAMPLE
|
||||
#define IAVC_ADJUSTMULTIPLIER
|
||||
#else
|
||||
#undef IAVC_SETNEXTSAMPLE
|
||||
#undef IAVC_GETNEXTSAMPLE
|
||||
#undef IAVC_ADJUSTMULTIPLIER
|
||||
#endif
|
||||
|
||||
#define MAX_INTEGER_SAMPLE_VALUE ( 32767 ) // for 16 bit samples
|
||||
#define MULTIPLY_PCT_ARRAY_SIZE ( MAX_INTEGER_SAMPLE_VALUE + 2 )
|
||||
|
||||
#define DEFAULT_MINIMUM_SAMPLES_BEFORE_SWITCH 1100
|
||||
#define MIN_MINIMUM_SAMPLES_BEFORE_SWITCH 1
|
||||
|
||||
#define DEFAULT_ADJUSTER_WINDOW_SIZE 2200
|
||||
#define DEFAULT_LOOKAHEAD_WINDOW_SIZE 0
|
||||
|
||||
#define DEFAULT_SAMPLE_WINDOW_SIZE ( DEFAULT_ADJUSTER_WINDOW_SIZE + DEFAULT_LOOKAHEAD_WINDOW_SIZE )
|
||||
#define MAX_SAMPLE_WINDOW_SIZE 32767
|
||||
|
||||
|
||||
#define DEFAULT_MAX_PCT_CHANGE_AT_ONCE 25 // 25%, not used if == 0
|
||||
|
||||
#define DEFAULT_NUMBER_OF_TRACKS 2
|
||||
#define MAX_NUMBER_OF_TRACKS 2
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifndef AfxMessageBox
|
||||
#define AfxMessageBox( pText ) { fprintf(stderr,"MESSAGE: %s\n",pText); };
|
||||
#endif
|
||||
|
||||
#ifndef maxVal
|
||||
#define maxVal(a,b) ( (a<b)?b:a )
|
||||
#endif
|
||||
|
||||
#ifndef absVal
|
||||
#define absVal(a) ( (a<0)?-a:a )
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef IAVC_FLOAT
|
||||
//#pragma message("iAVC using floating point samples")
|
||||
typedef float IAVCSAMPLETYPE;
|
||||
typedef float IAVCSUMTYPE;
|
||||
typedef float IAVCMULTIPLYPCT;
|
||||
#define APPLY_MULTIPLY_FACTOR(x) (x)
|
||||
#define UNDO_MULTIPLY_FACTOR(x) (x)
|
||||
#define AVG_TO_MULTIPLIER_SUBSCRIPT(x) long(x*MAX_INTEGER_SAMPLE_VALUE)
|
||||
#define MULTIPLY_FACTOR_TO_INT_X256(x) (int(x*256))
|
||||
#define DEFAULT_MAX_SAMPLE_VALUE 1 // values range from -1 to 1 for float
|
||||
#define DEFAULT_MIN_SAMPLE_VALUE -1 // values range from -1 to 1 for float
|
||||
#define IF_CLIP(x) ( absVal(x) > m_nMaxSampleValue )
|
||||
#else
|
||||
//#pragma message("iAVC using short int samples")
|
||||
typedef short int IAVCSAMPLETYPE;
|
||||
typedef long IAVCSUMTYPE;
|
||||
typedef long IAVCMULTIPLYPCT;
|
||||
#define APPLY_MULTIPLY_FACTOR(x) (long(x)<<8)
|
||||
#define UNDO_MULTIPLY_FACTOR(x) (long(x)>>8)
|
||||
#define AVG_TO_MULTIPLIER_SUBSCRIPT(x) (x)
|
||||
#define MULTIPLY_FACTOR_TO_INT_X256(x) (x)
|
||||
#define DEFAULT_MAX_SAMPLE_VALUE 32767 // for 16 bit samples, -32767 to 32767
|
||||
#define DEFAULT_MIN_SAMPLE_VALUE -32768 // for 16 bit samples, -32767 to 32767
|
||||
#define IF_CLIP(x) ( x != IAVCSAMPLETYPE ( x ) )
|
||||
#endif
|
||||
|
||||
struct Sample;
|
||||
|
||||
class AutoVolCtrl
|
||||
{
|
||||
public:
|
||||
AutoVolCtrl(); // standard constructor
|
||||
|
||||
virtual ~AutoVolCtrl(); // destructor
|
||||
|
||||
void Reset(); // reset to default values (can call between tracks, all settings saved)
|
||||
|
||||
// Initialization methods (Set Sample Window Size BEFORE setting Min Samples Before Switch)
|
||||
// Min Samples Before Switch must be < Sample Window Size
|
||||
// window size <= MAX_SAMPLE_WINDOW_SIZE
|
||||
bool SetSampleWindowSize ( unsigned long nSampleWindowSize,
|
||||
unsigned long nAdjusterWindowSize,
|
||||
unsigned long nLookAheadWindowSize );
|
||||
bool SetMinSamplesBeforeSwitch ( unsigned long nMinSamplesBeforeSwitch );
|
||||
void SetMaxPctChangeAtOnce ( IAVCMULTIPLYPCT nPctChange ); // in %, e.g. 10 for 10%
|
||||
void SetMultipliers ( unsigned short int nValueWanted [ MULTIPLY_PCT_ARRAY_SIZE ] );
|
||||
// e.g. if a sample with value 10000 is to be changed to be 20000, then
|
||||
// nValueWanted [ 10000 ] = 20000;
|
||||
// a nil transform is when every array element's value is its subscript
|
||||
//
|
||||
bool SetNumberTracks ( unsigned int nNumTracks ); // currently only 1 or 2 tracks supported
|
||||
|
||||
// Processing samples. In version 1 you MUST do a SetNextSample followed by a GetNextSample
|
||||
// If only one track the right sample must = 0.
|
||||
bool SetNextSample ( IAVCSAMPLETYPE left, IAVCSAMPLETYPE right ); // return true if AOK
|
||||
bool GetNextSample ( IAVCSAMPLETYPE & left, IAVCSAMPLETYPE & right ); // return true if AOK
|
||||
|
||||
protected:
|
||||
|
||||
void AdjustMultiplier();
|
||||
void ZeroSampleWindow();
|
||||
|
||||
#ifdef IAVC_INLINE
|
||||
|
||||
}; // end class definition here if not C++ (make data definitions below outside of class
|
||||
#pragma message("iAVC using inline methods")
|
||||
|
||||
#endif
|
||||
|
||||
struct Sample
|
||||
{
|
||||
Sample* m_pNext; // one entry points to the next, last entry to first entry
|
||||
Sample* m_pAvgPartner; // node "m_nSamplesInAvg" (i.e. adjuster size) before this node
|
||||
Sample* m_pLookaheadPartner; // node "m_nLookAheadWindowSize" before this node
|
||||
|
||||
IAVCSAMPLETYPE m_nLeft;
|
||||
IAVCSAMPLETYPE m_nRight;
|
||||
long m_nSampleValid; // =1 if node contains a sample value, =0 if no value
|
||||
IAVCSUMTYPE m_nSampleAbsAvg; // ( abs(left) + abs(right) ) / num_tracks, zero if not valid
|
||||
};
|
||||
|
||||
// Following are parameters whose values are provided by caller
|
||||
unsigned long m_nSampleWindowSize; // size of window of samples to keep
|
||||
unsigned long m_nSamplesInAvg; // <= m_nSampleWindowSize
|
||||
unsigned long m_nLookAheadWindowSize; // <= m_nMinSamplesBeforeSwitch & <= m_nSampleWindowSize
|
||||
unsigned long m_nMinSamplesBeforeSwitch; // minimum number of samples between multiplier changes
|
||||
IAVCMULTIPLYPCT m_nMaxChangePct; // maximum % change in multiplier at a time
|
||||
IAVCMULTIPLYPCT m_nMultiplyPct [ MULTIPLY_PCT_ARRAY_SIZE ]; // desired multiplier % for each sample value
|
||||
unsigned long m_nNumTracks; // = 2 for stereo, = 1 for mono
|
||||
IAVCSUMTYPE m_nMaxSampleValue; // e.g. 32767 for 16 bit
|
||||
|
||||
// Following are internal attributes
|
||||
IAVCSUMTYPE m_nSampleAvgSum; // sum of sound samples in current sample window
|
||||
unsigned long m_nSamplesInSum; // number of samples in m_nSampleAvgSum ( <= m_nSamplesInAvg )
|
||||
IAVCMULTIPLYPCT m_nCurrentMultiplier; // current % multiplier for sample
|
||||
Sample* m_pNextSet; // next node for SetNextSample
|
||||
Sample* m_pNextGet; // next node for GetNextSample
|
||||
IAVCSUMTYPE m_nLookaheadSum; // sum of lookahead samples
|
||||
unsigned int m_nSamplesInLookahead; // number of samples in m_nLookaheadSum
|
||||
signed long m_nNumSamplesBeforeNextSwitch; // number of samples before next switch
|
||||
|
||||
Sample * m_pSampleList; // array of samples
|
||||
|
||||
// Following are internal attributes for diagnostics
|
||||
long m_nTotalSamples;
|
||||
long m_nNumMultiplerChanges;
|
||||
long m_nClips;
|
||||
|
||||
#ifndef IAVC_INLINE
|
||||
|
||||
};
|
||||
|
||||
#endif // end class definition here if C++
|
||||
|
||||
|
||||
#endif // _IAVC_H_
|
|
@ -0,0 +1,82 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
// iAVC -- integer Automatic Volume Control -- Sample transformations for use with iAVC
|
||||
//
|
||||
// Copyright (C) 2002 Vincent A. Busam
|
||||
// 15754 Adams Ridge
|
||||
// Los Gatos, CA 95033
|
||||
// email: vince@busam.com
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
//-------------------------------
|
||||
// nil transform. Useful for testing.
|
||||
|
||||
static int iHoriz_1K_1K[] = { 0, 1000, 13000, 32768, 99999 }; // leave first and last two pairs
|
||||
static int iVert_1K_1K [] = { 0, 1000, 13000, 32768, 99999 }; // of values alone
|
||||
|
||||
|
||||
//-------------------------------
|
||||
// Heavy amplification in low volumes, linear when sound is louder.
|
||||
// Doesn't turn linear until quite loud, which contributes to more clipping.
|
||||
|
||||
// -100 db -> -100 db expand 2:1 below -60 db 0 -> 0
|
||||
// -60 db -> -20 db compress 4.33:1 below -8 db 1,000 -> 3,500
|
||||
// -8 db -> -8 db flat 1:1 above -8 db 13,000 -> 13,000
|
||||
// 0 db -> 0 db
|
||||
static int iHoriz_1K_3HK[] = { 0, 1000, 13000, 32768, 99999 }; // leave first and last two pairs
|
||||
static int iVert_1K_3HK [] = { 0, 3500, 13000, 32768, 99999 }; // of values alone
|
||||
|
||||
|
||||
//-------------------------------
|
||||
// Another version with heavy amplication in low volumes.
|
||||
// based on x^0.75 from 0 to 5,000 then flat
|
||||
// More points make for a smoother curve but more multiplier changes.
|
||||
|
||||
static int iHoriz_E75_5K[] = {
|
||||
0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950,1000,1050,1100,1150,1200,1250,1300,1350,1400,1450,1500,1550,1600,1650,1700,1750,1800,1850,1900,1950,2000,2050,2100,2150,2200,2250,2300,2350,2400,2450,2500,2550,2600,2650,2700,2750,2800,2850,2900,2950,3000,3050,3100,3150,3200,3250,3300,3350,3400,3450,3500,3550,3600,3650,3700,3750,3800,3850,3900,3950,4000,4050,4100,4150,4200,4250,4300,4350,4400,4450,4500,4550,4600,4650,4700,4750,4800,4850,4900,4950,5000
|
||||
,32768, 99999 };
|
||||
static int iVert_E75_5K [] = {
|
||||
0,1581,1880,2081,2236,2364,2475,2572,2659,2739,2812,2880,2943,3002,3058,3112,3162,3211,3257,3301,3344,3385,3424,3463,3500,3536,3570,3604,3637,3669,3700,3731,3761,3790,3818,3846,3873,3900,3926,3951,3976,4001,4025,4049,4072,4095,4118,4140,4162,4183,4204,4225,4246,4266,4286,4306,4325,4344,4363,4382,4401,4419,4437,4455,4472,4490,4507,4524,4540,4557,4573,4590,4606,4622,4637,4653,4668,4684,4699,4714,4729,4743,4758,4772,4787,4801,4815,4829,4843,4856,4870,4883,4897,4910,4923,4936,4949,4962,4975,4987,5000
|
||||
,32768, 99999 };
|
||||
//multipliers
|
||||
// 1,31.6,18.8,13.9,11.2, 9.5, 8.2 ,7.3, 6.6, 6.1, 5.6, 5.2, 4.9, 4.6, 4.4, 4.1, 4.0, 3.8, 3.6, 3.5, 3.3,3.2,3.1,3.0,2.9,2.8,2.7,2.7,2.6,2.5,2.5,2.4,2.4,2.3,2.2,2.2,2.2,2.1,2.1,2.0,2.0,2.0,1.9,1.9,1.9,1.8,1.8,1.8,1.7,1.7,1.7,1.7,1.6,1.6,1.6,1.6,1.5,1.5,1.5,1.5,1.5,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.1,1.1,1.1,1.1,1.1,1.1,1.1,1.1,1.1,1.1,1.1,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
||||
|
||||
|
||||
//-------------------------------
|
||||
// Another version with heavy amplication in low volumes.
|
||||
// based on x^0.75 from 0 to 3,500 then flat
|
||||
// More points make for a smoother curve but more multiplier changes.
|
||||
|
||||
static int iHoriz_75_3500[] = {
|
||||
0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950,1000,1050,1100,1150,1200,1250,1300,1350,1400,1450,1500,1550,1600,1650,1700,1750,1800,1850,1900,1950,2000,2050,2100,2150,2200,2250,2300,2350,2400,2450,2500,2550,2600,2650,2700,2750,2800,2850,2900,2950,3000,3050,3100,3150,3200,3250,3300,3350,3400,3450,3500
|
||||
,32768, 99999 };
|
||||
static int iVert_75_3500 [] = {
|
||||
0,1210,1439,1592,1711,1809,1894,1968,2035,2096,2152,2204,2252,2298,2341,2381,2420,2457,2492,2526,2559,2590,2621,2650,2678,2706,2732,2758,2783,2808,2832,2855,2878,2900,2922,2943,2964,2984,3004,3024,3043,3062,3080,3099,3116,3134,3151,3168,3185,3201,3218,3234,3249,3265,3280,3295,3310,3325,3339,3354,3368,3382,3395,3409,3422,3436,3449,3462,3475,3487,3500
|
||||
,32768, 99999 };
|
||||
//multipliers
|
||||
// 1,24.2,14.4,10.6, 8.6, 7.2, 6.3, 5.6, 5.1, 4.7, 4.3, 4.0, 3.8, 3.5, 3.3, 3.2, 3.0, 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.2, 2.1, 2.0, 2.0, 1.9, 1.9, 1.8, 1.8, 1.8, 1.7, 1.7, 1.6, 1.6, 1.6, 1.6, 1.5, 1.5, 1.5, 1.4, 1.4, 1.4, 1.4, 1.3, 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.0, 1.0, 1.0, 1.0, 1.0,
|
||||
|
||||
|
||||
//-------------------------------
|
||||
// Another version with heavy amplication in low volumes.
|
||||
// based on x^0.75 from 0 to 3,500 then flat
|
||||
// Fewer point to reduce number of multiplier changes.
|
||||
|
||||
static int iHoriz_AE75_3HK[] = { 0, 150, 300, 450, 650, 2500, 32768, 99999 }; // leave first and last two pairs
|
||||
static int iVert_AE75_3HK [] = { 0, 1592, 1894, 2096, 2298, 3218, 32768, 99999 }; // of values alone
|
||||
|
||||
//static int iHoriz_AE75_3HK[] = { 0, 300, 600, 1000, 2500, 3500, 32768, 99999 }; // leave first and last two pairs
|
||||
//static int iVert_AE75_3HK [] = { 0, 1900, 2250, 2500, 3100, 3500, 32768, 99999 }; // of values alone
|
|
@ -0,0 +1,12 @@
|
|||
ChangeLog
|
||||
Makefile
|
||||
config.cache
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
configure.scan
|
||||
id3lib.spec
|
||||
libtool
|
||||
patches
|
||||
stamp-h
|
||||
tmp
|
|
@ -0,0 +1,4 @@
|
|||
eldamitri: Scott Thomas Haug <scott@id3.org>
|
||||
scott: Scott Thomas Haug <scott@id3.org>
|
||||
johnadcock: John Adcock <johnadcock@hotmail.com>
|
||||
dirk: Dirk Mahoney <dirk@id3.org>
|
|
@ -0,0 +1,482 @@
|
|||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
|
@ -0,0 +1,315 @@
|
|||
$Id: HISTORY,v 1.1 2001-08-27 00:12:17 dmazzoni Exp $
|
||||
|
||||
ID3Lib History
|
||||
|
||||
The following is a history of id3lib up to version 3.05a. Please see the
|
||||
NEWS file for changes since then.
|
||||
|
||||
23 Nov 1998 3.05a - Released 3.05a in which the only change was the
|
||||
inclusion of a C header file for using the DLL
|
||||
(how forgetful I am!).
|
||||
|
||||
22 Nov 1998 3.05 - Released 3.05 and the DLL.
|
||||
|
||||
8 Nov 1998 3.05 - Finished the first revision of the DLL. Interesting
|
||||
stuff. Contains both C++ class and C functions (the
|
||||
C++ classes that are exported to the DLL are Tag,
|
||||
Frame, Field and Error).
|
||||
- Took out the SetVersion function from the ID3_Tag
|
||||
class. This is because I no longer wish ID3Lib to be
|
||||
able to create the old ID3v2-2.0 tags. ID3Lib will
|
||||
always create the latest version tags it is capable
|
||||
of creating.
|
||||
|
||||
1 Nov 1998 3.05 - Removed the encryption and grouping stuff. I have a
|
||||
lot to do before I finish that section and I might
|
||||
end up implementing it differently, so I thought it
|
||||
best to remove it before people started using it
|
||||
(no-one should since it wasn't fully functional
|
||||
anyway).
|
||||
|
||||
13 Oct 1998 3.05 - Work has begun on the Windows DLL.
|
||||
|
||||
9 Oct 1998 3.04 - Added the text list handling functions from 2.16, but
|
||||
they are slightly different under 3.xx.
|
||||
- Also added a Size() function for fields which
|
||||
applications can use to allocate buffers and so on.
|
||||
- Work has progressed on the encryption and grouping
|
||||
side of things, but nothing usable by an application
|
||||
just yet.
|
||||
|
||||
5 Oct 1998 3.04 - Changed the ID3_AddHandler() function to include a
|
||||
parameter which specifies the factor by which the
|
||||
size of the frame may increase as a result of
|
||||
encryption or encoding. This is used for buffer and
|
||||
size estimates.
|
||||
|
||||
3 Oct 1998 3.03a - Fixed a small Unicode BOM bug.
|
||||
|
||||
2 Oct 1998 3.03 - Added very minimal and not-totally-functional support
|
||||
for the automatic handling of encryption and
|
||||
grouping.
|
||||
- Added a function to ID3_Tag which makes attaching
|
||||
arrays of ID3_Frame objects easy.
|
||||
|
||||
1 Oct 1998 3.03 - Yesterday, ID3v2-3.0 became an informal standard.
|
||||
Due to this, ID3Lib now does not create ID3v2-3.0
|
||||
tags with the EXPERIMENTAL bit set.
|
||||
|
||||
30 Sep 1998 3.02 - Expanded the error handling class to include
|
||||
functions which return the ID3Lib source file and
|
||||
line number of the exception. This is useful for
|
||||
debugging and generating bug reports (hint, hint).
|
||||
|
||||
28 Sep 1998 3.02 - Added the grouping registration and encryption
|
||||
registration frames. Also added support for parsing
|
||||
and rendering frames with the grouping and encryption
|
||||
symbols, although currently this data is ignored. I
|
||||
plan to implement call backs to handle the encryption
|
||||
and decryption of data. Also, there is currently no
|
||||
checking at render-time that all frames which have
|
||||
these symbols also have a corresponding rego frame.
|
||||
|
||||
26 Sep 1998 3.02 - Changed the 'tag changed' stuff so that calls to
|
||||
ID3_Tag::SetVersion(), ID3_Tag::SetCompression() etc
|
||||
now constitute a change in the tag. This is because
|
||||
of the relaxed restrictions on the calls to these
|
||||
functions before rendering/updating. - Fixed a bug
|
||||
in the ID3_Tag::Link() command.
|
||||
|
||||
25 Sep 1998 3.01 - Added the ID3_Tag::RemoveFrame() function.
|
||||
- Added the ID3_Tag::SetExtendedHeader() function, even
|
||||
though this setting is currently ignored.
|
||||
- Added luint return type to the Field::Get() functions
|
||||
for ASCII and Unicode strings. These functions now
|
||||
return how many characters (not bytes necessarily) of
|
||||
the supplied buffer were used, not including the
|
||||
NULL-termination.
|
||||
- Added the 'unique file identifier' frame which I
|
||||
omitted from 3.00 but was present in 2.xx.
|
||||
- Added code that allows ID3Lib and applications to
|
||||
track whether a tag has been altered since the last
|
||||
parse or render.
|
||||
- Slightly altered the padding strategy when a tag
|
||||
shrinks in size.
|
||||
- No more requirements on when ID3_Tag::SetVersion()
|
||||
etc must be called, except that they should be called
|
||||
prior to an update or render if you plan to use
|
||||
different settings than the defaults.
|
||||
|
||||
21 Sep 1998 3.00 - Released 3.00
|
||||
|
||||
15 Sep 1998 3.00 - Added support for parsing and converting ID3v1/1.1
|
||||
and Lyrics3 v2.0 tags and CDM frames from 2.01
|
||||
experimental tags. Also parses Unicode now.
|
||||
|
||||
9 Sep 1998 3.00 - Work almost done on 3.00. A little bit to fix up in
|
||||
the parsing department (doesn't parse Unicode yet, or
|
||||
CDMs from the old 2.01 draft). Then just add
|
||||
validity checking and support for most of the frames.
|
||||
|
||||
2 Sep 1998 2.16 - Small Unicode string parsing bug fixed.
|
||||
|
||||
25 Aug 1998 2.15 - Small bug fixes in the tag parsing routines.
|
||||
- Completely removed support for creating extended
|
||||
headers, and ID3Lib will now ignore tags which have
|
||||
the EXTENDEDHEADER bit set (as under 2.00, this bit
|
||||
isn't defined).
|
||||
|
||||
24 Aug 1998 2.14 - Small bug fixes in the example file 'convert.cpp'.
|
||||
- ID3Lib now sets the EXPERIMENTAL bit in the tag
|
||||
header.
|
||||
|
||||
13 Aug 1998 2.13 - As of 2.13, ID3Lib now comes in two flavours. The
|
||||
first is the normal distribution as we have come to
|
||||
know and love. The second is a machine-specific
|
||||
archive which contains the static link libraries.
|
||||
Currently, you can get Win32 link libraries.
|
||||
|
||||
12 Aug 1998 2.12 - As of 2.12, the ID3Lib distribution will contain
|
||||
precompiled static libraries for Visual C++ and
|
||||
eventually for Linux i386. The MSVC static libs are
|
||||
be compiled for the multi-threaded run-time library
|
||||
and there will be one for debugging and one normal
|
||||
one for release-quality applications.
|
||||
|
||||
- Fixed a small exclusion in the 'id3_support.h' file.
|
||||
It now contains a #include for the 'wchar.h' header
|
||||
file. The absence of this line resulted in some
|
||||
applications producing compilation errors if they
|
||||
didn't already include it or 'stdio.h'.
|
||||
|
||||
11 Aug 1998 2.12 - I created a small problem in 2.11 where the name of
|
||||
the URL field in the 'ID3FID_WWWUSER' frame ('WXX')
|
||||
was changed from ID3FN_URL to ID3FN_TEXT. This has
|
||||
been fixed (is back to ID3FN_URL).
|
||||
- When reading a binary tag, previous versions of
|
||||
ID3Lib ignored the fact that some of the frames in
|
||||
the tag may have been compressed, so when writing the
|
||||
tag back out, those old frames were written without
|
||||
compression. This is fixed so that all old frames
|
||||
are written back out as they were read in, unless of
|
||||
course you explicitly change the compression status
|
||||
before rendering the new tag.
|
||||
- Added the ID3C_SetSongSize and ID3C_GetSongSize
|
||||
commands to the ID3_Tag class. These allow you to
|
||||
tell ID3Lib how big (in bytes) the song file is to
|
||||
which you intend attaching the tag. ID3Lib can then
|
||||
work out how much padding the tag requires to
|
||||
correctly make the entire resulting file fill an even
|
||||
multiple of 2Kb.
|
||||
- If the tag we are manipulating was read in as a
|
||||
binary tag before we started playing with it, then
|
||||
ID3Lib will record the size of tag before we started
|
||||
fooling around with it. This way, the padding system
|
||||
can pad the new tag out to the old size if the new
|
||||
tag will still fit inside the old one. This makes
|
||||
file manipulation much easier when writing tags to
|
||||
existing song files. If it won't fit, then the new
|
||||
tag will receive padding as per the 2K cluster
|
||||
method. All this talk of padding only applies if the
|
||||
tag's padding property is set to ID3PD_AUTOMATIC,
|
||||
which it is by default.
|
||||
|
||||
10 Aug 1998 2.11 - Replaced ID3C_SetID and GetID with proper field
|
||||
names, and the same with ID3C_SetComp and GetComp.
|
||||
This requires a change in source code for the
|
||||
application. Without quotes, do a search and
|
||||
replace...
|
||||
|
||||
"ID3C_SetID," replace with "ID3C_Set, ID3FN_ID,"
|
||||
"ID3C_GetID," replace with "ID3C_Get, ID3FN_ID,"
|
||||
"ID3C_SetComp," replace with "ID3C_Set, ID3FN_COMPRESSED,"
|
||||
"ID3C_GetComp," replace with "ID3C_Get, ID3FN_COMPRESSED,"
|
||||
|
||||
- Thanks to a suggestion by Ilana Rudnik, I added a
|
||||
generic frame type called 'ID3FID_UNSUPPORTED' which
|
||||
is only to be used by applications as a
|
||||
'place-holder' in lists and arrays while waiting for
|
||||
ID3Lib to support all the frames.
|
||||
|
||||
6 Aug 1998 2.11 - Created the ID3C_Locate and ID3C_GetNumFrames
|
||||
commands.
|
||||
- Made the documentation an HTML file instead of boring
|
||||
text.
|
||||
|
||||
5 Aug 1998 2.11 - Thanks to Eng-Keong Lee, I have located and fixed a
|
||||
bug which most-of-the-time caused a crash when
|
||||
performing an ID3C_SetID on a frame for the first
|
||||
time.
|
||||
|
||||
3 Aug 1998 2.10 - Fixed a few things to make ID3Lib compile completely
|
||||
cleanly under Linux - thanks to Carlos Puchol for
|
||||
finding the remaining hassles.
|
||||
- Added two commands to adjust the unsync facility -
|
||||
ID3C_SetUnsync and ID3C_GetUnsync. The default is
|
||||
ID3SY_AUTOMATIC.
|
||||
- Add support for the 2.01 extended tag header. By
|
||||
default, ID3Lib will NOT write an extended header to
|
||||
tags it creates. This can be adjusted by the
|
||||
ID3C_SetExtHeader command.
|
||||
- Changed the directory structure so that the required
|
||||
zlib source is now in the same directory as the
|
||||
ID3Lib source.
|
||||
|
||||
2 Aug 1998 2.10 - Fixed a small memory leak which occurred when
|
||||
clearing a tag of frames which were read in from an
|
||||
external binary tag.
|
||||
- Added a 'bugreport.txt' file to the documentation to
|
||||
improve effectiveness of bug reporting.
|
||||
|
||||
1 Aug 1998 2.10 - Adding support for tag padding. This results in two
|
||||
new commands which operate on ID3_Tag objects:
|
||||
ID3C_SetPadding and ID3C_GetPadding.
|
||||
|
||||
1 Aug 1998 2.09 - Fixed some bugs in the ID3C_ToFile and ID3C_FromFile
|
||||
commands.
|
||||
- Fixed a bug which prevented empty strings which were
|
||||
supposed to be NULL-terminated from doing so.
|
||||
|
||||
31 Jul 1998 2.09 - Changed the functionality of the error handling
|
||||
mechanism. The function interface to the error
|
||||
handler has changed - see the example source file
|
||||
'main.cpp' for details.
|
||||
- Improved frame verification somewhat.
|
||||
|
||||
28 July 1998 2.08 - Added ID3C_ToFile command to binary fields.
|
||||
- Changed the format of the ID3C_Size command when
|
||||
applied to frames. There is now a required second
|
||||
parameter which specifies which field you require the
|
||||
size of. If you request ID3FN_ALL, you will get the
|
||||
size of the frame itself.
|
||||
- The above change for ID3C_Size now also applies to
|
||||
the ID3C_Clear command (again, only when applied to
|
||||
frames).
|
||||
- Enhanced the ID3C_Find command so as to allow
|
||||
searches based on the ID3FN_LANGUAGE field and the
|
||||
ID3FN_DESCRIPTION field.
|
||||
|
||||
27 July 1998 2.07 - Fixed a bug which had the WXX and TXX frames
|
||||
including a language field which they shouldn't.
|
||||
- Fixed a bug in the string's ID3C_Get command which
|
||||
wrongly interpreted the presence of a '/' symbol in
|
||||
the string as meaning that the string was a textlist.
|
||||
|
||||
21 July 1998 2.06 - Added support for frame compression via zlib. This
|
||||
means that all frames have an extra attribute which
|
||||
specifies whether the frame should be compressed.
|
||||
- Changed some typedefs and macro names so as not to
|
||||
clash with some of Windows' pre-defined
|
||||
datatypes/names. Thanks to Chuck Zenkus for finding
|
||||
this.
|
||||
|
||||
14 July 1998 2.05 - Finished up Unicode support. All internal string
|
||||
handling is done with Unicode strings. Strings are
|
||||
converted as needed during rendering of the tag.
|
||||
|
||||
6 July 1998 2.05 - BINARY fields now support an 'ID3C_FromFile' command
|
||||
which fills the field with data from the specified
|
||||
file. The file is read and the contents placed in
|
||||
the field immediately on the field encountering this
|
||||
command.
|
||||
|
||||
2 July 1998 2.04 - Improved support for frame validation.
|
||||
- Repaired a cool bug in the error handling which
|
||||
prevented an application from finding further
|
||||
information about the error. This fix resulted in a
|
||||
new format for the application error handler
|
||||
function.
|
||||
|
||||
2.03 - Added support for the ID3C_Add, ID3C_Remove,
|
||||
ID3C_GetElement, ID3C_GetNumElements commands in the
|
||||
STRING field type. This allows easy use of the text
|
||||
lists as used in the 'TP1' frame.
|
||||
|
||||
- Improved error handling once more.
|
||||
- Added support for the ID3C_Increment command in the
|
||||
INT field type.
|
||||
- Added support for the CNT, POP, GEO, TCO, TCR and UFI
|
||||
frames.
|
||||
- Added preliminary validation checking for frames to
|
||||
ensure they meet the ID3v2 standard requirements.
|
||||
Not fully implemented.
|
||||
|
||||
2.02 - Adjusted the '::Do()' function slightly - you can now
|
||||
chain commands together. The last parameter to this
|
||||
call must now always be 'ID3C_DONE'.
|
||||
|
||||
1 July 1998 2.01 - Added the 'ID3_IsTagHeader()' function and an
|
||||
appropriately adjusted ID3C_Parse command.
|
||||
|
||||
30 June 1998 2.00 - First preliminary release of ID3Lib v2.00. Supports
|
||||
lots of frames (even PIC). Lots of work still
|
||||
needed.
|
||||
|
||||
25 June 1998 2.00 - Abandoned the v1.xx framework in favour of a more
|
||||
versatile and expandable one. This required a major
|
||||
re-write of most of the internals of the library as
|
||||
well as changes to any applications using the
|
||||
previous framework. The new framework is part of all
|
||||
ID3Libs which are 2.xx.
|
||||
|
||||
23 June 1998 1.01 - Released v1.01 which added support for four new
|
||||
frames. TXX, WXX, COM, ULT
|
||||
|
||||
21 June 1998 1.00 - Initial Release (v1.0)
|
|
@ -0,0 +1,84 @@
|
|||
# Copyright (C) 1999 Scott Thomas Haug <scott@id3.org>
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
# require automake 1.4
|
||||
AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
EXTRA_DIST = \
|
||||
HISTORY \
|
||||
config.h.win32 \
|
||||
config.h.win32.in \
|
||||
id3lib.spec \
|
||||
id3lib.spec.in \
|
||||
reconf
|
||||
if ID3_NEEDZLIB
|
||||
zlib_subdir = zlib
|
||||
else
|
||||
zlib_subdir =
|
||||
endif
|
||||
|
||||
SUBDIRS = . m4 $(zlib_subdir) doc include src examples
|
||||
DIST_SUBDIRS = . m4 zlib doc include src examples
|
||||
|
||||
INCLUDES = @ID3LIB_DEBUG_FLAGS@
|
||||
|
||||
config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
id3lib.spec: $(top_builddir)/config.status $(top_srcdir)/id3lib.spec.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
docsdistdir = $(PACKAGE)-doc-$(VERSION)
|
||||
|
||||
.PHONY: release snapshot docs-release docs
|
||||
|
||||
changelog:
|
||||
./cvs2cl.pl --tags --branches --revisions --day-of-week --prune --fsf -U AUTHORS -W 3600
|
||||
|
||||
docs:
|
||||
-cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
docs-release: docs
|
||||
-mv doc/$(docsdistdir).* .
|
||||
-cd examples && $(MAKE) $(AM_MAKEFLAGS) clean
|
||||
-mkdir $(docsdistdir)
|
||||
-cp -R examples $(docsdistdir)
|
||||
-cp doc/*.* $(docsdistdir)
|
||||
-cp -R doc/@DOX_DIR_HTML@ $(docsdistdir)
|
||||
-cp NEWS $(docsdistdir)/NEWS.txt
|
||||
-cp ChangeLog $(docsdistdir)/ChangeLog.txt
|
||||
-find $(docsdistdir) -name "Makefile*" -exec rm -f {} \;
|
||||
-find $(docsdistdir) -name "*.mp3" -exec rm -f {} \;
|
||||
GZIP=$(GZIP_ENV) $(TAR) zcf $(docsdistdir).tar.gz $(docsdistdir)
|
||||
-rm -rf $(docsdistdir)
|
||||
|
||||
release: config.h.win32 id3lib.spec
|
||||
-rm -rf .deps */.deps $(distdir).zip
|
||||
$(MAKE) $(AM_MAKEFLAGS) distcheck
|
||||
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
|
||||
-cp -R id3com/ prj/ libprj/ delphi/ $(distdir)
|
||||
-find $(distdir) -name "*~" -exec rm {} \;
|
||||
-find $(distdir) -type d -name CVS -exec rm -r {} \;
|
||||
-find $(distdir) -name .cvsignore -exec rm {} \;
|
||||
-find $(distdir) \( -name "*.dsp" -or -name "*.dsw" \) -exec unix2dos {} \;
|
||||
cd $(distdir) && cp config.h.win32 config.h
|
||||
cd $(distdir) && zip -r ../$(distdir).zip *
|
||||
cd $(distdir) && ./configure && $(MAKE) $(AM_MAKEFLAGS) docs-release
|
||||
mv $(distdir)/$(docsdistdir).* .
|
||||
-rm -rf $(distdir)
|
||||
|
||||
snapshot: config.h.win32
|
||||
ss_distdir=$(PACKAGE)-`date +"%Y%m%d"`; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir distdir=$$ss_distdir; \
|
||||
chmod -R a+r $$ss_distdir; \
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $${ss_distdir}.tar.gz $$ss_distdir; \
|
||||
cd $$ss_distdir && cp config.h.win32 config.h && cd ..; \
|
||||
cd $$ss_distdir && zip -r ../$${ss_distdir}.zip * && cd ..; \
|
||||
rm -rf $$ss_distdir
|
|
@ -0,0 +1,460 @@
|
|||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Copyright (C) 1999 Scott Thomas Haug <scott@id3.org>
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
# require automake 1.4
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOX_DIR_HTML = @DOX_DIR_HTML@
|
||||
DOX_DIR_LATEX = @DOX_DIR_LATEX@
|
||||
DOX_DIR_MAN = @DOX_DIR_MAN@
|
||||
DOX_DIR_RTF = @DOX_DIR_RTF@
|
||||
EXEEXT = @EXEEXT@
|
||||
ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
|
||||
ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
|
||||
ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
|
||||
ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
|
||||
ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
|
||||
ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
|
||||
ID3LIB_NAME = @ID3LIB_NAME@
|
||||
ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
|
||||
ID3LIB_VERSION = @ID3LIB_VERSION@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_RELEASE = @LT_RELEASE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
cxxflags_set = @cxxflags_set@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
EXTRA_DIST = HISTORY config.h.win32 config.h.win32.in id3lib.spec id3lib.spec.in reconf
|
||||
|
||||
@ID3_NEEDZLIB_TRUE@zlib_subdir = zlib
|
||||
@ID3_NEEDZLIB_FALSE@zlib_subdir =
|
||||
|
||||
SUBDIRS = . m4 $(zlib_subdir) doc include src examples
|
||||
DIST_SUBDIRS = . m4 zlib doc include src examples
|
||||
|
||||
INCLUDES = @ID3LIB_DEBUG_FLAGS@
|
||||
|
||||
docsdistdir = $(PACKAGE)-doc-$(VERSION)
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING INSTALL Makefile.am \
|
||||
Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 config.guess \
|
||||
config.h.in config.sub configure configure.in install-sh ltconfig \
|
||||
ltmain.sh missing mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h 2> /dev/null
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" = "." && dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist
|
||||
-rm -rf $(distdir)
|
||||
@banner="$(distdir).tar.gz is ready for distribution"; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(DIST_SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile config.h
|
||||
all-redirect: all-recursive-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
install-data-recursive uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
id3lib.spec: $(top_builddir)/config.status $(top_srcdir)/id3lib.spec.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
.PHONY: release snapshot docs-release docs
|
||||
|
||||
changelog:
|
||||
./cvs2cl.pl --tags --branches --revisions --day-of-week --prune --fsf -U AUTHORS -W 3600
|
||||
|
||||
docs:
|
||||
-cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
docs-release: docs
|
||||
-mv doc/$(docsdistdir).* .
|
||||
-cd examples && $(MAKE) $(AM_MAKEFLAGS) clean
|
||||
-mkdir $(docsdistdir)
|
||||
-cp -R examples $(docsdistdir)
|
||||
-cp doc/*.* $(docsdistdir)
|
||||
-cp -R doc/@DOX_DIR_HTML@ $(docsdistdir)
|
||||
-cp NEWS $(docsdistdir)/NEWS.txt
|
||||
-cp ChangeLog $(docsdistdir)/ChangeLog.txt
|
||||
-find $(docsdistdir) -name "Makefile*" -exec rm -f {} \;
|
||||
-find $(docsdistdir) -name "*.mp3" -exec rm -f {} \;
|
||||
GZIP=$(GZIP_ENV) $(TAR) zcf $(docsdistdir).tar.gz $(docsdistdir)
|
||||
-rm -rf $(docsdistdir)
|
||||
|
||||
release: config.h.win32 id3lib.spec
|
||||
-rm -rf .deps */.deps $(distdir).zip
|
||||
$(MAKE) $(AM_MAKEFLAGS) distcheck
|
||||
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
|
||||
-cp -R id3com/ prj/ libprj/ delphi/ $(distdir)
|
||||
-find $(distdir) -name "*~" -exec rm {} \;
|
||||
-find $(distdir) -type d -name CVS -exec rm -r {} \;
|
||||
-find $(distdir) -name .cvsignore -exec rm {} \;
|
||||
-find $(distdir) \( -name "*.dsp" -or -name "*.dsw" \) -exec unix2dos {} \;
|
||||
cd $(distdir) && cp config.h.win32 config.h
|
||||
cd $(distdir) && zip -r ../$(distdir).zip *
|
||||
cd $(distdir) && ./configure && $(MAKE) $(AM_MAKEFLAGS) docs-release
|
||||
mv $(distdir)/$(docsdistdir).* .
|
||||
-rm -rf $(distdir)
|
||||
|
||||
snapshot: config.h.win32
|
||||
ss_distdir=$(PACKAGE)-`date +"%Y%m%d"`; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir distdir=$$ss_distdir; \
|
||||
chmod -R a+r $$ss_distdir; \
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $${ss_distdir}.tar.gz $$ss_distdir; \
|
||||
cd $$ss_distdir && cp config.h.win32 config.h && cd ..; \
|
||||
cd $$ss_distdir && zip -r ../$${ss_distdir}.zip * && cd ..; \
|
||||
rm -rf $$ss_distdir
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,315 @@
|
|||
$Id: NEWS,v 1.1 2001-08-27 00:13:26 dmazzoni Exp $
|
||||
|
||||
2000-11-20 Version 3.8.0pre1
|
||||
|
||||
* First prerelease of 3.8.0 stable.
|
||||
* Clean separation of interface and implementation to help ensure interface and
|
||||
binary compatibility of future releases
|
||||
* Completely revamped implementation of tag reading and writing
|
||||
* Better debugging output in debug mode
|
||||
* New documentation (much more still needed)
|
||||
* Command-line options processing now more cross-platform
|
||||
* Removed all exception handling
|
||||
* Minor changes to public interface
|
||||
* Use of std::string and other STL classes in implementation
|
||||
* id3com source code removed from source distribution. It has moved to its own
|
||||
project at http://sourceforge.net/projects/id3com
|
||||
* Many more changes than can be mentioned here: see ChangeLog file
|
||||
|
||||
2000-09-07 Version 3.7.13
|
||||
|
||||
* id3com is broken; maintainer has disappeared; anyone care to fix it?
|
||||
* Complete reimplementation of ID3_Field: cleaner, safer, faster, clearer, more
|
||||
efficient
|
||||
* Much more robust MusicMatch parsing
|
||||
* Improved conversion from ID3v2 to ID3v1
|
||||
* Cleaner implementation of file processing
|
||||
* Examples now use popt for command-line processing
|
||||
* Improved portability for Macintosh
|
||||
* Improved build process for platforms without popt or zlib
|
||||
* New documentation about the MusicMatch tagging format
|
||||
* Minor updates to ID3_Field interface
|
||||
* New interface behavior:
|
||||
// copies entire string (same for unicode_t*)
|
||||
size_t ID3_Field::Get(const uchar*, size_t)
|
||||
// for lists, copies a specific item in string (0-based)
|
||||
size_t ID3_Field::Get(const uchar*, size_t, index_t);
|
||||
// returns the size in characters for strings, in bytes for all else
|
||||
size_t ID3_Field::Size() cosnt;
|
||||
// returns the rendered size of the field
|
||||
size_t ID3_Field::BinSize() cosnt;
|
||||
|
||||
2000-07-07 Version 3.7.12
|
||||
|
||||
* Removed debugging output left over from 3.7.11
|
||||
* Update() now updates all tag types by default, not just ID3v2
|
||||
* Added a second, optional parameter to ID3_GetComment to find a comment with
|
||||
a specific description
|
||||
* Converting an ID3v1 comment to an ID3v2 COMM frame now has the description
|
||||
"ID3v1 Comment"
|
||||
* An ID3v2 COMM frame will only be converted to an ID3v1 comment if it has a
|
||||
description of "ID3v1 Comment"
|
||||
|
||||
2000-07-05 Version 3.7.11
|
||||
|
||||
* Now parses and converts files with MusicMatch tags (beta - needs testing!)
|
||||
* New tag type enums: ID3TT_LYRICS3, ID3TT_LYRICS3V2, ID3TT_MUSICMATCH,
|
||||
ID3TT_PREPENDED, ID3TT_APPENDED. Deprecated ID3TT_LYRICS
|
||||
* Improved file processing routines; cleaned up interface w.r.t. files
|
||||
* Stripping one type of appended tag strips them all
|
||||
* New C function: ID3Tag_HasTagType
|
||||
* New methods for ID3_Tag: GetPrependedBytes(), GetAppendedBytes(),
|
||||
GetFileSize(), and GetFileName()
|
||||
* New function for calculating size of non-tag data in file: ID3_GetDataSize()
|
||||
* Render now parameterized on ID3_TagType
|
||||
* Bug fixes
|
||||
|
||||
2000-06-23 Version 3.7.10
|
||||
|
||||
* New and updated example tags
|
||||
* Corrected unicode parsing and rendering
|
||||
* Improved parsing/conversion of Lyrics3 v2.00 tags
|
||||
* Fixed errors with exception handling (thanks to Luca Leonardo Scorcia for the
|
||||
bug reports)
|
||||
* Fixed bugs/memory leaks with removing frames and updating tag (thanks to Luca
|
||||
Leonardo Scorcia for the bug reports)
|
||||
* Fixed finding of frames with empty text fields (thanks to Luca Leonardo
|
||||
Scorcia for the bug reports)
|
||||
* Improved documentation/implementation for uint28
|
||||
* Added GetTextID() method for ID3_Frame objects
|
||||
* Tag doesn't render if there aren't any frames; frame doesn't render if there
|
||||
aren't any fields
|
||||
* Reordered ID3_AddSyncLyrics() parameters for better consistency with other
|
||||
helper functions
|
||||
* ID3_GetSyncLyricsInfo() parameters updated to be more specific
|
||||
* Several other minor bug fixes
|
||||
|
||||
2000-05-28 Version 3.7.9
|
||||
|
||||
* Added new test programs in examples/ for creating example tag files
|
||||
* Further improvements to compile on (Unix) systems that don't have zlib
|
||||
* Fixed a bug when parsing compressed frames (thanks to Christian Becker for
|
||||
the bug report and example file)
|
||||
* Fixed several bugs when writing to files (thanks to Lothar Egger and Peter
|
||||
Thorstenson for the bug reports)
|
||||
* New delphi example code for use with id3com (thanks Michael Little)
|
||||
* Bugfixes for id3com (thanks John Adcock)
|
||||
* Changed behavior of Link() and Clear() in ID3_Tag: Clear() doesn't remove
|
||||
file reference, and Link'ing to an already-linked tag just changes the file
|
||||
reference
|
||||
* Cleaned up the class interfaces to use size_t, flags_t, and index_t rather
|
||||
than luint, so as to be more descriptive
|
||||
* ID3_Tag::RemoveFrame() now returns the pointer to the frame removed (NULL if
|
||||
not present), thus releasing the tag from its repsonsibility of managing that
|
||||
frame's memory
|
||||
* Cleaned up C interface so that appropriate function parameters are const
|
||||
* Cleaned up implementation of ID3_Tag::Clear() to fix inconsistencies
|
||||
* Deprecated ID3_Tag's HasV2Tag(), HasV1Tag(), and HasLyrics() methods in
|
||||
favor of ID3_Tag::HasTagType() method
|
||||
* All Render() methods now const
|
||||
* Added GetUnsync() method to ID3_Tag
|
||||
* Cleaned up internal class definitions (thereby destroying binary
|
||||
compatibility)
|
||||
* ID3v2 tag now won't render (and its reported size is 0) if there aren't any
|
||||
frames (per the spec)
|
||||
* Fixed a bug when copying frames that prevented rendering compressed frames in
|
||||
certain situations
|
||||
* Fixed a bug with resyncing that caused it to improperly handle the last byte
|
||||
* Fixed a bug with recognizing certain sync signals
|
||||
* Lots of other minor changes
|
||||
|
||||
2000-05-11 Version 3.7.8
|
||||
|
||||
* Major bug fix that caused all string frames to be written out as unicode, yet
|
||||
with the wrong encoding information given
|
||||
* Bug fix for stripping id3v2 tags that wouldn't remove enough data
|
||||
* Bug fix for writing id3v1 tags that might add extraneous data to the tag
|
||||
|
||||
2000-05-10 Version 3.7.7
|
||||
|
||||
* As part of the major rewrite of underlying codebase started with previous
|
||||
release, this release features near-complete reimplementation of most of the
|
||||
ID3v2 parsing code - smaller, faster, and better organized
|
||||
* Much imporved Lyrics3 v2 tag support, along with much improved synchronized
|
||||
lyrics (SYLT) support (thanks Severino Delaurenti)
|
||||
* Updated id3com to reflect changes to compression strategy introduced in last
|
||||
release (thanks John Adcock)
|
||||
* Cleaned up the parameters to several functions/methods with regards to
|
||||
constness
|
||||
* Several new methods to several classes
|
||||
* A variety of bugfixes
|
||||
|
||||
2000-05-03 Version 3.7.6
|
||||
|
||||
* Beginning of major rewrite of underlying codebase to improve efficiency,
|
||||
expandability; the interface will need minor updates through this endeavor
|
||||
(sorry!)
|
||||
* Major bugfix in ID3_Tag::Strip which was deleting too much info from a file
|
||||
in certain circumstances
|
||||
* Add descriptions to frames; can access either through a ID3_Frame method for
|
||||
a frame object, or via the static method on the class (w/ ID3_FrameID param)
|
||||
(thanks John Adcock for descriptions, Daryl Pawluk for spotting misorder)
|
||||
* Frame compression is determined frame by frame, so deprecated
|
||||
ID3_Tag::SetCompression() for ID3_Frame::SetCompression().
|
||||
ID3_Tag::SetCompression() is now a no-op (updated C interface accordingly)
|
||||
* New method ID3_Frame::Contains(ID3_FieldID) for determining if a frame
|
||||
contains a particular field
|
||||
* New static method ID3_Tag::IsV2Tag() deprecates ID3_IsTagHeader()
|
||||
* Other minor bugfixes
|
||||
|
||||
2000-04-28 Version 3.7.5
|
||||
|
||||
* Fixed nasty bug with rewriting tags to windows files (thanks John Adcock)
|
||||
* More fixes, improvements to id3com files (thanks John Adcock)
|
||||
* Added parsing of Lyrics3 v1.00 tags (thanks Severino Delaurenti)
|
||||
* Updated documentation, but still in flux
|
||||
* Other minor bugfixes
|
||||
|
||||
2000-04-26 Version 3.7.4
|
||||
|
||||
* Fixed windows project files so that they all work correctly with new release
|
||||
(thanks John Adcock, Robert Moon, and Lothar Egger)
|
||||
* Added a simple VB app to test id3lib using id3com.dll (thanks John Adcock)
|
||||
* Added better implementation of PRIV (Private) frame (thanks John Adcock)
|
||||
* Fixed padding logic (thanks John Adcock)
|
||||
* New "Spec Versioning" system under the hood produces minor interface change
|
||||
- Defined new enum: ID3_V2Spec (ID3V2_2_0, ID3V2_2_1, ID3V2_3_0, etc.)
|
||||
- {Get,Set}Spec now used in favor of deprected {Get,Set}Version, GetRevision
|
||||
- Field definitions updated accordingly; now smaller and more exact
|
||||
|
||||
2000-04-24 Version 3.7.3
|
||||
|
||||
* C/C++ interface changes:
|
||||
- Moved V1_LEN* constants into an enumeration so that they can be used as
|
||||
array size initializers in C. Renamed the constants for consistency
|
||||
(LEN_V1 -> ID3_V1_LEN, LEN_V1_TITLE -> ID3_V1_LEN_TITLE, etc.)
|
||||
- Renamed ID3_TagType's enums to be more consistent with rest of library's
|
||||
enums (V1_TAG -> ID3TT_ID3V1, V2_TAG -> ID3TT_ID3V2, etc.)
|
||||
- ID3_Err enumeration now defines ID3E_NoError
|
||||
* C++ interface changes:
|
||||
- ID3_Frame now has a copy constructor
|
||||
- ID3_Tag::AddNewFrame deprecated for AttachFrame (no other difference in
|
||||
behavior)
|
||||
- ID3_Tag::Link(char *, bool, bool) deprecated for
|
||||
ID3_Tag::Link(char *, luint). Now accepts ID3_TagTypes to determine which
|
||||
tags to parse. i.e, mytag.Link("myfile.mp3", ID3TT_ID3V2 | ID3TT_LYRICS);
|
||||
- ID3_Tag::operator<<, ID3_Tag::AddFrame: relevant parameters now const
|
||||
* C interface changes:
|
||||
- ID3Tag_Parse, ID3Tag_Update, ID3Tag_Strip now return an ID3_Err
|
||||
- Added functions ID3Tag_UpdateByTagType, ID3Frame_New, ID3Frame_NewID,
|
||||
ID3Frame_Delete
|
||||
* Implementation changes:
|
||||
- AddFrame, AddFrames now add copies of the frames passed in.
|
||||
- AttachFrame adds the actual frame passed to it.
|
||||
- The tag takes responsibility for managing its frames' memory in all cases.
|
||||
* Miscellaneous changes:
|
||||
- Moved most enum and struct declarations to include/id3/globals.h so they
|
||||
are accessible to C interface
|
||||
- id3com.dsp file is 'fixed', but the project still doesn't compile w/o
|
||||
errors
|
||||
- Most doxygen comments moved from tag.h to respective files
|
||||
- Fixed a bug in id3lib.spec which caused rpm binaries to be compiled without
|
||||
exception handling
|
||||
- examples, include/id3/* header files no longer include config.h
|
||||
- Other minor bugfixes
|
||||
|
||||
2000-04-21 Version 3.7.2
|
||||
|
||||
* Implementation of C interface for all platforms (in src/c_wrapper.cpp, which
|
||||
replaces dll_wrapper.cpp)
|
||||
* Added examples/demo_simple.c which demonstrates basic use of C interface
|
||||
* Auto-generated documentation no longer shipped with main tarball distribution
|
||||
* mp3 example files no longer included (still available via CVS)
|
||||
* Updated Windows project files so that they'll (hopefully) compile cleanly
|
||||
again
|
||||
|
||||
2000-04-19 Version 3.7.1
|
||||
|
||||
* Interface changed: functions in version.{h,cpp} replaced with constants
|
||||
defined in globals.h
|
||||
* Added a spec file for creating rpm's
|
||||
* C interface now defined in include/id3.h, replaces include/src/dll.h;
|
||||
* Lots of file movement. src/id3/* to src/; src/examples to examples;
|
||||
* Examples now compiled as installable binaries, rather than 'checks'
|
||||
* Removed unnecessary files: externals.h, types.h, version.{h,cpp}, dll.h
|
||||
|
||||
2000-04-15 Version 3.7.0
|
||||
|
||||
* New project management: MusicMatch handed reigns over to Scott Thomas Haug
|
||||
* New project licensing: LGPL (http://www.gnu.org/copyleft/lesser.html)
|
||||
* New versioning: 3.7.x is unstable series leading up to 3.8.x stable
|
||||
* Many bug fixes
|
||||
* Better windows compatibility, with new windows project files
|
||||
* Improved documentation, using the Doxygen documentation system
|
||||
(http://www.stack.nl/~dimitri/doxygen/)
|
||||
* Extended API, improved implementation
|
||||
* More supported frames
|
||||
* Now parses and rerenders unrecognized frame types
|
||||
* Better version handling in configuration files, similar to the glib library
|
||||
(http://www.gtk.org)
|
||||
|
||||
1999-12-02 Version 3.6.2
|
||||
|
||||
* Improved portability: another minor portability fixes, along with the
|
||||
inclusion of zlib sources and project files for windows compilation.
|
||||
|
||||
1999-12-01 Version 3.6.1
|
||||
|
||||
* Code movement: moved the header files from src/id3 to include/id3 to allow
|
||||
for easier windows compilation.
|
||||
* Improved portability: made changes in several files to improve compilation
|
||||
on windows. (thanks to elrod for the fixes)
|
||||
* Random cleanup: some spelling errors fixed, some minor file administration,
|
||||
etc.
|
||||
|
||||
1999-11-30 Version 3.6.0
|
||||
|
||||
* Code overhaul: more descriptive variable naming, streamlined implementation
|
||||
logic, cleaner interface specification, generalization of magic numbers and
|
||||
strings.
|
||||
* Better documentation: transcribed the the "Documentation for ID3Lib 3.05"
|
||||
document (written by Dirk Mahoney, 22 Nov 1998) into the actual source, using
|
||||
javadoc-like tags so as to create documentation with the application doc++.
|
||||
Using this program (and ones like it) allows for creating the documentation
|
||||
in many different formats, including html, texinfo, man, latex, and the like.
|
||||
* Added functionality: Added additional functions for simplified access to
|
||||
common tags, such as artist, title, and album.
|
||||
* More robust error checking: Improved upon the exception handling already in
|
||||
place to better handle error conditions, such as invalid tags, unrecognized
|
||||
frames, and the like. Work is still needed to ensure the library can handle
|
||||
error situations gracefully.
|
||||
* Improved portability: restructured the code into a GNU-like directory.
|
||||
hierarchy. By making use of the GNU tools automake and autoconf, a wide
|
||||
variety of platforms can be easily supported. This allows for a standard
|
||||
"./configure; make; make install" installation process, as well as an
|
||||
equally trivial method for uninstallation: "make uninstall". Likewise,
|
||||
"make check" builds the example applications (see below).
|
||||
* Enhanced examples: the src/examples/ subdirectory has both new and improved
|
||||
examples demonstrating how to make use of id3lib. The original "id3convert"
|
||||
example now can convert both ways between id3v1 and id3v2 tags, as well as
|
||||
strip both types of tags off of files via command-line switches.
|
||||
Additionally, an "id3info" app has been added for displaying id3v1/v2 tag
|
||||
information about a file.
|
||||
* Bug fixing: Fixes, fixes, and more fixes. A continual process.
|
||||
* The zlib library files were removed from the project. The need for zlib
|
||||
was instead made a requirement through the configuration process via autoconf
|
||||
and automake.
|
||||
* All of the id3lib library files were renamed by removing the "id3_" prefix.
|
||||
Instead, the library files were placed in an id3 subdirectory in the src
|
||||
directory. Likewise, when the library is installed on a system, an "id3"
|
||||
subdirectory is created in the indicated include directory, and the header
|
||||
files are placed there. Pragmatically, this means that code that makes use
|
||||
of id3lib needs to "#include <id3/tag.h>" rather than "#include <id3_tag.h>".
|
||||
This was done to create more structure and to avoid clutter in the include
|
||||
directory.
|
||||
* The versioning strategy has been updated to be more in line with the
|
||||
"libtool" way. However, in order to be more compatible with how versions
|
||||
progressed previously, I've taken the approach that many other libraries have
|
||||
taken: I've "massaged" the version:revision:age numbers so that the resulting
|
||||
compiled library shows up as id3lib.so.3.6.0 (or whatever the current release
|
||||
is). This is /strongly/ advised against in the libtool documentation, so I'm
|
||||
considering going to a more "traditional" libtool versioning approach (see
|
||||
the libtool info page for more information).
|
||||
|
||||
There is yet much to do! Please see the TODO file for known bugs and lacking
|
||||
features...
|
|
@ -0,0 +1,98 @@
|
|||
General Information
|
||||
===================
|
||||
|
||||
id3lib is a software library for manipulating ID3v1/v1.1 and ID3v2 tags.
|
||||
id3lib 3.0.x conforms to all ID3v2 standards up to and including the ID3v2.3.0
|
||||
informal standard.
|
||||
|
||||
The id3lib project makes use of the resources available through
|
||||
SourceForge.net. Using SourceForge, the id3lib project is able to provide
|
||||
several tools for developers, including a project homepage, a mailing list, a
|
||||
patch manager, bug tracking, and cvs access, among other things.
|
||||
|
||||
The id3lib project page, which includes links to all of the above, is:
|
||||
http://sourceforge.net/project/?group_id=979
|
||||
|
||||
The official id3lib homepage is:
|
||||
http://id3lib.sourceforge.net
|
||||
|
||||
The id3lib developers' mailing list's address is:
|
||||
id3lib-devel@lists.sourceforge.net
|
||||
|
||||
You can subscribe, unsubscribe, and view mailing list archives at:
|
||||
http://lists.sourceforge.net/mailman/listinfo/id3lib-devel
|
||||
|
||||
Information about ID3v2 and related standards can be found at:
|
||||
http://www.id3.org
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
See the file 'INSTALL'
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
In order to successfully compile and use id3lib, the following programs and
|
||||
libraries are needed:
|
||||
|
||||
Compiling:
|
||||
----------
|
||||
g++ 2.8/egcs 1.0.3 (or compatible)
|
||||
GNU make
|
||||
autoconf 2.13
|
||||
automake 1.4
|
||||
zlib
|
||||
doxygen (optional, for creating documentation)
|
||||
|
||||
Using:
|
||||
----------
|
||||
zlib
|
||||
|
||||
How to report bugs
|
||||
==================
|
||||
|
||||
To report a bug, submit it to the bug tracker, linked to from the id3lib
|
||||
project page, or send mail to the id3lib-devel mailing list.
|
||||
|
||||
If you send it to the mailing list, please include the following:
|
||||
|
||||
* The version of id3lib
|
||||
|
||||
* Information about your system. For instance:
|
||||
|
||||
- What operating system and version
|
||||
- For Linux, what version of the C library
|
||||
|
||||
And anything else you think is relevant.
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
Please include either a short test program that exhibits the
|
||||
behavior or an example tag that isn't correctly parsed/rendered by
|
||||
the library. As a last resort, you can also provide a pointer to
|
||||
a larger piece of software or tagged file that can be downloaded.
|
||||
|
||||
* If the bug was a crash, the exact text that was printed out
|
||||
when the crash occured.
|
||||
|
||||
* Further information such as stack traces may be useful, but
|
||||
is not necessary.
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
Patches can be submitted to the patch manager at the id3lib project page, as
|
||||
mentioned above. Please follow the instructions there. So as not to annoy
|
||||
uniterested parties with large email messages, it is preferable that you not
|
||||
send such patches to the mailing list.
|
||||
|
||||
For Further Reading
|
||||
===================
|
||||
|
||||
id3lib is free software. Please see the COPYING file for details.
|
||||
For documentation, please see the files in the doc subdirectory.
|
||||
See the HISTORY file for information about development up to version 3.05a.
|
||||
See the NEWS file for information about development since 3.05a.
|
||||
See the ChangeLog file for an account of changes made to files in the library.
|
||||
See the AUTHORS and THANKS files to see who has contributed to id3lib.
|
|
@ -0,0 +1,106 @@
|
|||
$Id: THANKS,v 1.1 2001-08-27 00:13:41 dmazzoni Exp $
|
||||
|
||||
id3lib THANKS file
|
||||
|
||||
See the AUTHORS file for a list of past and current project maintainers.
|
||||
|
||||
Since version 3.05a, several individuals have helped further the development of
|
||||
id3lib. They are listed below, in no particular order. Please inform the
|
||||
current project maintainer if anyone has been missed.
|
||||
|
||||
* Kamran (kamran@musicmatch.com) fixed several bugs in MusicMatch's internal
|
||||
version of ID3Lib which were merged into the current public version of
|
||||
id3lib.
|
||||
* Alexander Voronin (av@oskarsb.ru) has submitted several patches to fix a
|
||||
variety of bugs.
|
||||
* John Adcock (johnadcock@hotmail.com) provided the COM wrapper and lib
|
||||
projects for id3lib, the VB test app for id3com.dll, as well as several
|
||||
bugfixes and improvements.
|
||||
* Myers W. Carpenter (myers@fil.org) has submitted a patch for improving the
|
||||
interface and functionality of the library.
|
||||
* Justin Rogers (justin@mlstoday.com) has provided much valuable conversation
|
||||
as to the design and implementation of id3lib.
|
||||
* Mark B. Elrod (elrod@liquidmetal.com) has provided several patches for better
|
||||
win32 functionality.
|
||||
* Scott Moser (smoser@brickies.net) provided the php translation of the
|
||||
original ID3Lib manual
|
||||
* Robert Moon (rob@emusic.com) provided tremendous help getting the C interface
|
||||
up to speed, as well as providing bugfixes for the Windows projects.
|
||||
* Lothar Egger (lothar.egger@chello.at) also assisted in fixing the Windows
|
||||
projects, as well as providing assistance for testing the dlls under Windows
|
||||
* Severino Delaurenti (id3lib@castlems.com) added functionality for parsing
|
||||
Lyrics3 v1.0 and v2.0 tags, as well as improving synchronized lyric frame
|
||||
(SYLT) dramatically.
|
||||
* Michael Little (mike@netlinear.com) provided the delphi code for use with
|
||||
id3com.
|
||||
* Peter Luijer (videoripper@hotmail.com) provided much useful documentation
|
||||
on the MusicMatch tagging format.
|
||||
* Steven Frank (stevenf@users.sourceforge.net) provided invaluable help in
|
||||
tracking down runtime bugs for the Macintosh port.
|
||||
* The following individuals have assisted by providing bug reports and (often)
|
||||
suggestions for fixes:
|
||||
- Ben Noblet (Ben.Noblet@xt3.com.au)
|
||||
- Benedikt Roth (Benedikt.Roth@gmx.net)
|
||||
- Christian Becker (chris@craze.de)
|
||||
- Daryl Pawluk (dpawluk@home.com)
|
||||
- John Firebaugh (jfirebaugh@mac.com)
|
||||
- John Southerland (jbsouthe@home.com)
|
||||
- Luca Leonardo Scorcia (scrlln@tin.it)
|
||||
- Peter Thorstenson (swede@openlink.com.br)
|
||||
- Sasa Ðolic (sasad@moderngroove.com)
|
||||
- Steven Frank (stevenf@users.sourceforge.net)
|
||||
- Tim Newsome (nuisance@cmu.edu)
|
||||
|
||||
Dirk Mahoney included the following at the end of his documentation on ID3Lib
|
||||
3.05a. It is included in verbatim here.
|
||||
|
||||
Special Thanks and Credits
|
||||
|
||||
I would like to extend my many thanks to the people who have contributed to
|
||||
the ID3Lib project. The show of support has been tremendous. I consider
|
||||
ID3Lib to be a very 'international' product, as contributions have come from
|
||||
almost literally every corner of the globe. If I have missed you, please
|
||||
forgive my lapse of memory.
|
||||
|
||||
* Jean-loup Gailly and Mark Adler - for their great zlib compression library
|
||||
and for making it free.
|
||||
* Tord Jansson - for much help with teaching me how to make and use DLLs.
|
||||
* Slava Karpenko for creating the MacOS static link libraries for the PowerPC
|
||||
and CodeWarrior.
|
||||
* Bob Kohn - for his advice, input, and generally creating the ID3Lib license
|
||||
agreement.
|
||||
* Eng-Keong Lee - for finding a few bugs and for extensively testing ID3Lib
|
||||
2.xx.
|
||||
* James Lin - for his 'ID3v2 Programming Guidelines', and many helpful
|
||||
suggestions
|
||||
* Michael Mutschler - for prompting me to write the Unicode support and for
|
||||
his input on the ID3Lib calling convention.
|
||||
* Martin Nilsson - for ID3v2, his support of the ID3Lib web page, for many,
|
||||
many suggestions, debates, pointers, URLs, documents, and brightly coloured
|
||||
fish.
|
||||
* Chris Nunn - for the 3D animated ID3v2 logos which appear in the ID3Lib web
|
||||
page and in the distribution.
|
||||
* Lachlan Pitts - for general implementation ideas and his brief but helpful
|
||||
work on the up-coming genre tree.
|
||||
* Jukka Poikolainen - for prompting to implement error handling via the C++
|
||||
exception handling mechanism instead of the old 2.xx-style of using an
|
||||
error handling function.
|
||||
* Carson Puchol - for his help with some minor Linux compilation hassles.
|
||||
* Andreas Sigfridsson - for his initial code for the unsync/resync support
|
||||
and for his very valuable input in long brainstorming sessions.
|
||||
* Michael Robertson - for helping support ID3Lib by posting announcements on
|
||||
MP3.com.
|
||||
* Ilana Rudnik - for bug finding and suggestions.
|
||||
* Chuck Zenkus - for his support of ID3v2 and ID3Lib by providing us with a
|
||||
mirror in the United States and for his bug finding and suggestions.
|
||||
* And last but by no means least, all the others who support ID3Lib by
|
||||
subscribing to the mailing list and to the contributors to the discussions
|
||||
and debates in the ID3v2 discussion group.
|
||||
|
||||
Without the help of all these people, ID3Lib would not be as good as it is,
|
||||
and I dare say might not even exist if they all weren't around to provide
|
||||
motivation to continue to write the thing!
|
||||
|
||||
- Dirk Mahoney
|
||||
22 November 1998
|
||||
Brisbane, Australia
|
|
@ -0,0 +1,42 @@
|
|||
$Id: TODO,v 1.1 2001-08-27 00:13:43 dmazzoni Exp $
|
||||
|
||||
id3lib still requires the following work:
|
||||
|
||||
* testing testing testing
|
||||
* The interface for file access is muddled. It has been separated out from the
|
||||
next unstable release (3.9.x), but perhaps it can be cleaned up for 3.7.x
|
||||
* id3lib needs a C interface. Badly.
|
||||
* Some of the limitations present in 3.05a have been fixed, but many still
|
||||
exist. See below for the original list and what has been updated.
|
||||
|
||||
Version 3.05a of ID3Lib has some known limitations...
|
||||
|
||||
* Firstly, contrary to good programming ideas and contrary to the 'ID3v2
|
||||
Programming Guidelines', ID3Lib will explode in a ball of brilliant blue
|
||||
flame if asked to parse an invalid ID3v2 tag. This will change.
|
||||
+ Update for 3.7.0: this has been improved, but still requires more testing.
|
||||
|
||||
* Incorrect handling of unknown frames. This means that when ID3Lib encounters
|
||||
an unknown frame, it is currently ignored. It is neither re-written to the
|
||||
tag when re-rendered nor are the file or tag alter frame flags observed.
|
||||
+ 3.7.0 adds nominal support for all remaining known frames (as defined in
|
||||
the spec for id3v2.2.0 and id3v2.3.0 at www.id3.org). Unknown frames are
|
||||
now parsed and re-rendered, but the file and tag alter frame flags are not
|
||||
yet observed
|
||||
|
||||
* No support for the read-only frame flag. It is currently ignored---such
|
||||
frames can be altered at will.
|
||||
|
||||
* No support as yet for the verification of frames before rendering.
|
||||
|
||||
* Does not yet render 3.0 extended headers. Although the functionality for
|
||||
selecting this is present, the setting is ignored for now.
|
||||
|
||||
* Does not yet parse 3.0 extended headers. They are quite adequately ignored
|
||||
and the rest of the tag is parsed correctly.
|
||||
|
||||
* ID3Lib currently has no direct support for things like the language and
|
||||
currency fields. It is up to the application to generate the data for these
|
||||
fields manually. Soon, ID3Lib will have these things assigned to IDs so that
|
||||
the applications programmer will not have to remember the ISO tables for the
|
||||
actual strings.
|
|
@ -0,0 +1,204 @@
|
|||
#! /usr/bin/perl
|
||||
$VERSION="0.10";
|
||||
$PREFIX="/usr/local";
|
||||
# -* perl *-
|
||||
# Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
#
|
||||
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a configuration
|
||||
# script generated by Autoconf, you may include it under the same
|
||||
# distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# =======================
|
||||
# == Usage information ==
|
||||
# =======================
|
||||
|
||||
sub usage
|
||||
{
|
||||
print <<"EOF";
|
||||
Usage:
|
||||
% acconfig
|
||||
|
||||
Options:
|
||||
--help Print this message
|
||||
--version Show version information
|
||||
|
||||
Purpose:
|
||||
This utility parses aclocal.m4 and creates an appropriate acconfig.h.
|
||||
In your m4 files put the following lines:
|
||||
dnl ACCONFIG [BOTTOM | TOP | TEMPLATE]
|
||||
dnl .....
|
||||
dnl END ACCONFIG
|
||||
Everything that appears in ... will be included in acconfig.h
|
||||
The parameter [bottom|top|template] determines where in acconfig.h
|
||||
the enclosed text is meant to appear.
|
||||
EOF
|
||||
exit(0);
|
||||
}
|
||||
|
||||
sub version
|
||||
{
|
||||
print <<"EOF";
|
||||
acconfig $VERSION - Automatic generator for acconfig.h
|
||||
Copyright (C) 1998 Eleftherios Gkioulekas <lf\@amath.washington.edu>
|
||||
This is free software, and you are welcome to redistribute it and modify
|
||||
it under certain conditions. There is ABSOLUTELY NO WARRANTY for this
|
||||
software. For details refer to version 2 of the GNU General Public License.
|
||||
EOF
|
||||
exit(0);
|
||||
}
|
||||
|
||||
sub invalid
|
||||
{
|
||||
print "Invalid usage. For help:\n";
|
||||
print "% acconfig --help\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sub throw_error
|
||||
{
|
||||
local($errormsg) = @_;
|
||||
print "line $line: $errormsg \n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
# ==================
|
||||
# == The main fun ==
|
||||
# ==================
|
||||
|
||||
# No more than one argument
|
||||
do invalid() if ($#ARGV > 0);
|
||||
|
||||
# If there is one argument then check for --version or --help
|
||||
if ($#ARGV == 0)
|
||||
{
|
||||
do version() if ($ARGV[0] eq "--version");
|
||||
do usage() if ($ARGV[0] eq "--help");
|
||||
# else, invalid usage
|
||||
do invalid();
|
||||
}
|
||||
|
||||
# Load the aclocal.m4 file in memory
|
||||
open(FILE,"aclocal.m4") || die "Can't open aclocal.m4: $!";
|
||||
@aclocal_content = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
# Load the configure.in file in memory
|
||||
open(FILE,"configure.in") || die "Can't open configure.in: $!";
|
||||
@configure_in_content = <FILE>;
|
||||
@aclocal_content = (@aclocal_content, @configure_in_content);
|
||||
close(FILE);
|
||||
|
||||
# Strip the carriage returns for each line
|
||||
chop(@aclocal_content);
|
||||
|
||||
# Initialize contents of acconfig.h
|
||||
$bottom_content = "";
|
||||
$top_content = "";
|
||||
$template_content = "";
|
||||
|
||||
# Initialize the state of the parser
|
||||
# 0 if outside @acconfig
|
||||
# 1 if inside and it is bottom
|
||||
# 2 if inside and it is top
|
||||
# 3 if inside and it is template
|
||||
$inside_acconfig = 0;
|
||||
|
||||
# Now loop over the contents of aclocal.m4 and do it
|
||||
$line = 0;
|
||||
foreach (@aclocal_content)
|
||||
{
|
||||
#
|
||||
# Do these things if we are in state 0
|
||||
#
|
||||
if ($inside_acconfig == 0)
|
||||
{
|
||||
# Detect whether the current line is a directive to switch state
|
||||
if (/^dnl ACCONFIG BOTTOM/) { $inside_acconfig = 1; }
|
||||
elsif (/^dnl ACCONFIG TOP/) { $inside_acconfig = 2; }
|
||||
elsif (/^dnl ACCONFIG TEMPLATE/) { $inside_acconfig = 3; }
|
||||
|
||||
# Catch a couple of possible errors
|
||||
elsif (/^dnl ACCONFIG/) { throw_error("invalid ACCONFIG directive."); }
|
||||
elsif (/^dnl END/) { throw_error("unmatched END directive."); }
|
||||
}
|
||||
#
|
||||
# Do these things if we are in state 1, 2 or 3
|
||||
#
|
||||
elsif ($inside_acconfig == 1 ||
|
||||
$inside_acconfig == 2 ||
|
||||
$inside_acconfig == 3)
|
||||
{
|
||||
# Detect whether we go back to state 0
|
||||
if (/^dnl END ACCONFIG/) { $inside_acconfig = 0; }
|
||||
# If this is an ordinary dnl line then add it to bottom_content
|
||||
elsif (/^dnl/)
|
||||
{
|
||||
# Get rid of the dnl prefix
|
||||
s/^dnl //g;
|
||||
|
||||
# Add the line to the appropriate content variable
|
||||
if ($inside_acconfig == 1)
|
||||
{ $bottom_content = $bottom_content . $_ . "\n"; }
|
||||
if ($inside_acconfig == 2)
|
||||
{ $top_content = $top_content . $_ . "\n"; }
|
||||
if ($inside_acconfig == 3)
|
||||
{ $template_content = $template_content . $_ . "\n"; }
|
||||
}
|
||||
# If this is something else, then that's an error!
|
||||
else { throw_error("non-dnl line while inside ACCONFIG."); }
|
||||
}
|
||||
else
|
||||
{ throw_error("INTERNAL ERROR: invalid value for inside_acconfig."); }
|
||||
|
||||
# Increase the line number by one
|
||||
$line = $line + 1;
|
||||
}
|
||||
|
||||
# Now generate acconfig.h
|
||||
open(OUT,">acconfig.h");
|
||||
print OUT <<"END";
|
||||
/*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf\@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
$top_content
|
||||
\@TOP\@
|
||||
/* This is the template section */
|
||||
|
||||
/* These are standard for all packages using Automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
/* And now the rest of the boys */
|
||||
$template_content
|
||||
\@BOTTOM\@
|
||||
/* This is the bottom section */
|
||||
$bottom_content
|
||||
END
|
||||
close(OUT);
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
|
||||
@TOP@
|
||||
/* This is the template section */
|
||||
|
||||
/* These are standard for all packages using Automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
/* And now the rest of the boys */
|
||||
#undef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
#undef CXX_HAS_NO_BOOL
|
||||
#undef ID3_ENABLE_DEBUG
|
||||
#undef ID3_DISABLE_ASSERT
|
||||
#undef ID3_DISABLE_CHECKS
|
||||
#undef ID3_ICONV_FORMAT_UTF16BE
|
||||
#undef ID3_ICONV_FORMAT_UTF16
|
||||
#undef ID3_ICONV_FORMAT_UTF8
|
||||
#undef ID3_ICONV_FORMAT_ASCII
|
||||
|
||||
/* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
* determining internal versioning information. The intent is that these
|
||||
* macros will be made available in the library via constants, functions,
|
||||
* or static methods.
|
||||
*/
|
||||
#undef HAVE_ZLIB
|
||||
#undef HAVE_GETOPT_LONG
|
||||
#undef _ID3LIB_NAME
|
||||
#undef _ID3LIB_VERSION
|
||||
#undef _ID3LIB_FULLNAME
|
||||
#undef _ID3LIB_MAJOR_VERSION
|
||||
#undef _ID3LIB_MINOR_VERSION
|
||||
#undef _ID3LIB_PATCH_VERSION
|
||||
#undef _ID3LIB_INTERFACE_AGE
|
||||
#undef _ID3LIB_BINARY_AGE
|
||||
#undef _ID3_COMPILED_WITH_DEBUGGING
|
||||
/* */
|
||||
|
||||
@BOTTOM@
|
||||
/* This is the bottom section */
|
||||
|
||||
// This file defines portability work-arounds for various proprietory
|
||||
// C++ compilers
|
||||
|
||||
// Workaround for compilers with buggy for-loop scoping
|
||||
// That's quite a few compilers actually including recent versions of
|
||||
// Dec Alpha cxx, HP-UX CC and SGI CC.
|
||||
// The trivial "if" statement provides the correct scoping to the
|
||||
// for loop
|
||||
|
||||
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
#undef for
|
||||
#define for if(1) for
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the C++ compiler we use doesn't have bool, then
|
||||
// the following is a near-perfect work-around.
|
||||
// You must make sure your code does not depend on "int" and "bool"
|
||||
// being two different types, in overloading for instance.
|
||||
//
|
||||
|
||||
#ifdef CXX_HAS_NO_BOOL
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
#if defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) && defined (__cplusplus)
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#include <libcw/sys.h>
|
||||
#include <libcw/debug.h>
|
||||
|
||||
#define ID3D_INIT_DOUT() Debug( libcw_do.on() )
|
||||
#define ID3D_INIT_WARNING() Debug( dc::warning.on() )
|
||||
#define ID3D_INIT_NOTICE() Debug( dc::notice.on() )
|
||||
#define ID3D_NOTICE(x) Dout( dc::notice, x )
|
||||
#define ID3D_WARNING(x) Dout( dc::warning, x )
|
||||
|
||||
#else
|
||||
|
||||
# define ID3D_INIT_DOUT()
|
||||
# define ID3D_INIT_WARNING()
|
||||
# define ID3D_INIT_NOTICE()
|
||||
# define ID3D_NOTICE(x)
|
||||
# define ID3D_WARNING(x)
|
||||
|
||||
#endif /* defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) */
|
||||
|
||||
|
|
@ -0,0 +1,997 @@
|
|||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit system type (host/target name).
|
||||
#
|
||||
# Only a few systems have been added to this list; please add others
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
PATH=$PATH:/.attbin ; export PATH
|
||||
fi
|
||||
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
dummy=dummy-$$
|
||||
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
fi
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
${CC-cc} $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
exit 0 ;;
|
||||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-cbm-sysv4
|
||||
exit 0;;
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:[Aa]miga[Oo][Ss]:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-amigaos
|
||||
exit 0 ;;
|
||||
arc64:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hkmips:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
arm32:NetBSD:*:*)
|
||||
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
else
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
||||
# it's likely to be more like Solaris than SunOS4.
|
||||
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:*:*)
|
||||
case "`/usr/bin/arch -k`" in
|
||||
Series*|S4*)
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
|
||||
exit 0 ;;
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun*:*:4.2BSD:*)
|
||||
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
|
||||
case "`/bin/arch`" in
|
||||
sun3)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
;;
|
||||
sun4)
|
||||
echo sparc-sun-sunos${UNAME_RELEASE}
|
||||
;;
|
||||
esac
|
||||
exit 0 ;;
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
macppc:NetBSD:*:*)
|
||||
echo powerpc-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:Mach:*:*)
|
||||
echo mips-dec-mach_bsd4.3
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
2020:CLIX:*:*)
|
||||
echo clipper-intergraph-clix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#if defined (host_mips) && defined (MIPSEB)
|
||||
#if defined (SYSTYPE_SYSV)
|
||||
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_SVR4)
|
||||
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
|
||||
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy \
|
||||
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
echo powerpc-harris-powerunix
|
||||
exit 0 ;;
|
||||
m88k:CX/UX:7*:*)
|
||||
echo m88k-harris-cxux7
|
||||
exit 0 ;;
|
||||
m88k:*:4*:R4*)
|
||||
echo m88k-motorola-sysv4
|
||||
exit 0 ;;
|
||||
m88k:*:3*:R3*)
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
||||
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
else
|
||||
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
||||
fi
|
||||
else echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit 0 ;;
|
||||
M88*:*:R3*:*)
|
||||
# Delta 88k system running SVR3
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
||||
echo m88k-tektronix-sysv3
|
||||
exit 0 ;;
|
||||
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
||||
echo m68k-tektronix-bsd
|
||||
exit 0 ;;
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
||||
exit 0 ;;
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
||||
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
||||
i?86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
puts("powerpc-ibm-aix3.2.5");
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
else
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:4)
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
IBM_ARCH=powerpc
|
||||
fi
|
||||
if [ -x /usr/bin/oslevel ] ; then
|
||||
IBM_REV=`/usr/bin/oslevel`
|
||||
else
|
||||
IBM_REV=4.${UNAME_RELEASE}
|
||||
fi
|
||||
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
|
||||
exit 0 ;;
|
||||
*:AIX:*:*)
|
||||
echo rs6000-ibm-aix
|
||||
exit 0 ;;
|
||||
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
||||
echo romp-ibm-bsd4.4
|
||||
exit 0 ;;
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
||||
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
||||
exit 0 ;; # report: romp-ibm BSD 4.3
|
||||
*:BOSX:*:*)
|
||||
echo rs6000-bull-bosx
|
||||
exit 0 ;;
|
||||
DPX/2?00:B.O.S.:*:*)
|
||||
echo m68k-bull-sysv3
|
||||
exit 0 ;;
|
||||
9000/[34]??:4.3bsd:1.*:*)
|
||||
echo m68k-hp-bsd
|
||||
exit 0 ;;
|
||||
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
||||
echo m68k-hp-bsd4.4
|
||||
exit 0 ;;
|
||||
9000/[34678]??:HP-UX:*:*)
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[136790] | 9000/892 )
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
rm -f $dummy.c $dummy
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
|
||||
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
|
||||
results, however. */
|
||||
if (CPU_IS_PA_RISC (cpu))
|
||||
{
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
||||
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
||||
}
|
||||
}
|
||||
else if (CPU_IS_HP_MC68K (cpu))
|
||||
puts ("m68k-hitachi-hiuxwe2");
|
||||
else puts ("unknown-hitachi-hiuxwe2");
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
echo hppa1.1-hp-bsd
|
||||
exit 0 ;;
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
*9??*:MPE*:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
*9??*:MPE*:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
hp8??:OSF1:*:*)
|
||||
echo hppa1.0-hp-osf
|
||||
exit 0 ;;
|
||||
i?86:OSF1:*:*)
|
||||
if [ -x /usr/sbin/sysversion ] ; then
|
||||
echo ${UNAME_MACHINE}-unknown-osf1mk
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-osf1
|
||||
fi
|
||||
exit 0 ;;
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*[A-Z]90:*:*:*)
|
||||
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
|
||||
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo t3e-cray-unicosmk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
F301:UNIX_System_V:*:*)
|
||||
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:BSD/OS:*:*)
|
||||
echo sparc-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
if test -x /usr/bin/objformat; then
|
||||
if test "elf" = "`/usr/bin/objformat`"; then
|
||||
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit 0 ;;
|
||||
i*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin
|
||||
exit 0 ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# # uname on the ARM produces all sorts of strangeness, and we need to
|
||||
# # filter it out.
|
||||
# case "$UNAME_MACHINE" in
|
||||
# armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
|
||||
# arm* | sa110*) UNAME_MACHINE="arm" ;;
|
||||
# esac
|
||||
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
ld_supported_emulations=`echo $ld_help_string \
|
||||
| sed -ne '/supported emulations:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported emulations: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_emulations" in
|
||||
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
|
||||
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
|
||||
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;;
|
||||
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
sed 's/^ //' <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
${CC-cc} $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
|
||||
objdump --private-headers $dummy | \
|
||||
grep ld.so.1 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "mips" ; then
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __MIPSEB__
|
||||
printf ("%s-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
#ifdef __MIPSEL__
|
||||
printf ("%sel-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld)
|
||||
# or one that does not give us useful --help.
|
||||
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
|
||||
# If ld does not provide *any* "supported emulations:"
|
||||
# that means it is gnuoldld.
|
||||
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
|
||||
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
||||
|
||||
case "${UNAME_MACHINE}" in
|
||||
i?86)
|
||||
VENDOR=pc;
|
||||
;;
|
||||
*)
|
||||
VENDOR=unknown;
|
||||
;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
#else
|
||||
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
i?86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i?86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# I just have to hope. -- rms.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:UnixWare:*:*)
|
||||
if /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
echo i386-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit 0 ;;
|
||||
paragon:*:*:*)
|
||||
echo i860-intel-osf1
|
||||
exit 0 ;;
|
||||
i860:*:4.*:*) # i860-SVR4
|
||||
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
|
||||
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
|
||||
else # Add other i860-SVR4 vendors below as they are discovered.
|
||||
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
|
||||
fi
|
||||
exit 0 ;;
|
||||
mini*:CTIX:SYS*5:*)
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4 && exit 0 ;;
|
||||
m68*:LynxOS:2.*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:ReliantUNIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
*:SINIX-*:*:*)
|
||||
if uname -p 2>/dev/null >/dev/null ; then
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
echo ${UNAME_MACHINE}-sni-sysv4
|
||||
else
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit 0 ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
echo hppa1.1-stratus-sysv4
|
||||
exit 0 ;;
|
||||
*:*:*:FTX*)
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
mc68*:A/UX:*:*)
|
||||
echo m68k-apple-aux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
news*:NEWS-OS:*:6*)
|
||||
echo mips-sony-newsos6
|
||||
exit 0 ;;
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
|
||||
echo powerpc-be-beos
|
||||
exit 0 ;;
|
||||
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
|
||||
echo powerpc-apple-beos
|
||||
exit 0 ;;
|
||||
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
|
||||
echo i586-pc-beos
|
||||
exit 0 ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SX-5:SUPER-UX:*:*)
|
||||
echo sx5-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Rhapsody:*:*)
|
||||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
if (version < 4)
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
else
|
||||
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
#if !defined (ultrix)
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
#else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#echo '(Unable to guess system type)' 1>&2
|
||||
|
||||
exit 1
|
|
@ -0,0 +1,177 @@
|
|||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* And now the rest of the boys */
|
||||
#undef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
#undef CXX_HAS_NO_BOOL
|
||||
#undef ID3_ENABLE_DEBUG
|
||||
#undef ID3_DISABLE_ASSERT
|
||||
#undef ID3_DISABLE_CHECKS
|
||||
#undef ID3_ICONV_FORMAT_UTF16BE
|
||||
#undef ID3_ICONV_FORMAT_UTF16
|
||||
#undef ID3_ICONV_FORMAT_UTF8
|
||||
#undef ID3_ICONV_FORMAT_ASCII
|
||||
|
||||
/* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
* determining internal versioning information. The intent is that these
|
||||
* macros will be made available in the library via constants, functions,
|
||||
* or static methods.
|
||||
*/
|
||||
#undef HAVE_ZLIB
|
||||
#undef HAVE_GETOPT_LONG
|
||||
#undef _ID3LIB_NAME
|
||||
#undef _ID3LIB_VERSION
|
||||
#undef _ID3LIB_FULLNAME
|
||||
#undef _ID3LIB_MAJOR_VERSION
|
||||
#undef _ID3LIB_MINOR_VERSION
|
||||
#undef _ID3LIB_PATCH_VERSION
|
||||
#undef _ID3LIB_INTERFACE_AGE
|
||||
#undef _ID3LIB_BINARY_AGE
|
||||
#undef _ID3_COMPILED_WITH_DEBUGGING
|
||||
/* */
|
||||
|
||||
/* Define if you have the getopt_long function. */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the truncate function. */
|
||||
#undef HAVE_TRUNCATE
|
||||
|
||||
/* Define if you have the <cctype> header file. */
|
||||
#undef HAVE_CCTYPE
|
||||
|
||||
/* Define if you have the <climits> header file. */
|
||||
#undef HAVE_CLIMITS
|
||||
|
||||
/* Define if you have the <cstdio> header file. */
|
||||
#undef HAVE_CSTDIO
|
||||
|
||||
/* Define if you have the <cstdlib> header file. */
|
||||
#undef HAVE_CSTDLIB
|
||||
|
||||
/* Define if you have the <cstring> header file. */
|
||||
#undef HAVE_CSTRING
|
||||
|
||||
/* Define if you have the <fstream> header file. */
|
||||
#undef HAVE_FSTREAM
|
||||
|
||||
/* Define if you have the <fstream.h> header file. */
|
||||
#undef HAVE_FSTREAM_H
|
||||
|
||||
/* Define if you have the <iconv.h> header file. */
|
||||
#undef HAVE_ICONV_H
|
||||
|
||||
/* Define if you have the <iomanip> header file. */
|
||||
#undef HAVE_IOMANIP
|
||||
|
||||
/* Define if you have the <iomanip.h> header file. */
|
||||
#undef HAVE_IOMANIP_H
|
||||
|
||||
/* Define if you have the <iostream> header file. */
|
||||
#undef HAVE_IOSTREAM
|
||||
|
||||
/* Define if you have the <iostream.h> header file. */
|
||||
#undef HAVE_IOSTREAM_H
|
||||
|
||||
/* Define if you have the <libcw/sys.h> header file. */
|
||||
#undef HAVE_LIBCW_SYS_H
|
||||
|
||||
/* Define if you have the <string> header file. */
|
||||
#undef HAVE_STRING
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <wchar.h> header file. */
|
||||
#undef HAVE_WCHAR_H
|
||||
|
||||
/* Define if you have the <zlib.h> header file. */
|
||||
#undef HAVE_ZLIB_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* This is the bottom section */
|
||||
|
||||
// This file defines portability work-arounds for various proprietory
|
||||
// C++ compilers
|
||||
|
||||
// Workaround for compilers with buggy for-loop scoping
|
||||
// That's quite a few compilers actually including recent versions of
|
||||
// Dec Alpha cxx, HP-UX CC and SGI CC.
|
||||
// The trivial "if" statement provides the correct scoping to the
|
||||
// for loop
|
||||
|
||||
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
#undef for
|
||||
#define for if(1) for
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the C++ compiler we use doesn't have bool, then
|
||||
// the following is a near-perfect work-around.
|
||||
// You must make sure your code does not depend on "int" and "bool"
|
||||
// being two different types, in overloading for instance.
|
||||
//
|
||||
|
||||
#ifdef CXX_HAS_NO_BOOL
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
#if defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) && defined (__cplusplus)
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#include <libcw/sys.h>
|
||||
#include <libcw/debug.h>
|
||||
|
||||
#define ID3D_INIT_DOUT() Debug( libcw_do.on() )
|
||||
#define ID3D_INIT_WARNING() Debug( dc::warning.on() )
|
||||
#define ID3D_INIT_NOTICE() Debug( dc::notice.on() )
|
||||
#define ID3D_NOTICE(x) Dout( dc::notice, x )
|
||||
#define ID3D_WARNING(x) Dout( dc::warning, x )
|
||||
|
||||
#else
|
||||
|
||||
# define ID3D_INIT_DOUT()
|
||||
# define ID3D_INIT_WARNING()
|
||||
# define ID3D_INIT_NOTICE()
|
||||
# define ID3D_NOTICE(x)
|
||||
# define ID3D_WARNING(x)
|
||||
|
||||
#endif /* defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) */
|
||||
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* And now the rest of the boys */
|
||||
#define CXX_HAS_BUGGY_FOR_LOOPS 1
|
||||
/* #undef CXX_HAS_NO_BOOL */
|
||||
/* #undef ID3_ENABLE_DEBUG */
|
||||
/* #undef ID3_DISABLE_ASSERT */
|
||||
/* #undef ID3_DISABLE_CHECKS */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF16BE */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF16 */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF8 */
|
||||
/* #undef ID3_ICONV_FORMAT_ASCII */
|
||||
|
||||
/* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
* determining internal versioning information. The intent is that these
|
||||
* macros will be made available in the library via constants, functions,
|
||||
* or static methods.
|
||||
*/
|
||||
/* #undef HAVE_ZLIB */
|
||||
/* #undef HAVE_GETOPT_LONG */
|
||||
#define _ID3LIB_NAME "id3lib"
|
||||
#define _ID3LIB_VERSION "3.8.0pre1"
|
||||
#define _ID3LIB_FULLNAME "id3lib-3.8.0pre1"
|
||||
#define _ID3LIB_MAJOR_VERSION 3
|
||||
#define _ID3LIB_MINOR_VERSION 8
|
||||
#define _ID3LIB_PATCH_VERSION 0
|
||||
#define _ID3LIB_INTERFACE_AGE 0
|
||||
#define _ID3LIB_BINARY_AGE 0
|
||||
/* #undef ID3_COMPILED_WITH_DEBUGGING */
|
||||
/* */
|
||||
|
||||
/* Define if you have the getopt_long function. */
|
||||
#define HAVE_GETOPT_LONG 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
/* #undef HAVE_MKSTEMP */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
/* #undef HAVE_TRUNCATE */
|
||||
|
||||
/* Define if you have the <cctype> header file. */
|
||||
#define HAVE_CCTYPE 1
|
||||
|
||||
/* Define if you have the <climits> header file. */
|
||||
#define HAVE_CLIMITS 1
|
||||
|
||||
/* Define if you have the <cstdio> header file. */
|
||||
#define HAVE_CSTDIO 1
|
||||
|
||||
/* Define if you have the <cstdlib> header file. */
|
||||
#define HAVE_CSTDLIB 1
|
||||
|
||||
/* Define if you have the <cstring> header file. */
|
||||
#define HAVE_CSTRING 1
|
||||
|
||||
/* Define if you have the <fstream> header file. */
|
||||
#define HAVE_FSTREAM 1
|
||||
|
||||
/* Define if you have the <fstream.h> header file. */
|
||||
#define HAVE_FSTREAM_H 1
|
||||
|
||||
/* Define if you have the <iconv.h> header file. */
|
||||
/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define if you have the <iomanip> header file. */
|
||||
#define HAVE_IOMANIP 1
|
||||
|
||||
/* Define if you have the <iomanip.h> header file. */
|
||||
#define HAVE_IOMANIP_H 1
|
||||
|
||||
/* Define if you have the <iostream> header file. */
|
||||
#define HAVE_IOSTREAM 1
|
||||
|
||||
/* Define if you have the <iostream.h> header file. */
|
||||
#define HAVE_IOSTREAM_H 1
|
||||
|
||||
/* Define if you have the <libcw/sys.h> header file. */
|
||||
/* #undef HAVE_LIBCW_SYS_H */
|
||||
|
||||
/* Define if you have the <string> header file. */
|
||||
#define HAVE_STRING 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you have the <zlib.h> header file. */
|
||||
/* #undef HAVE_ZLIB_H */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "id3lib"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "3.8.0pre1"
|
||||
|
||||
/* This is the bottom section */
|
||||
|
||||
// This file defines portability work-arounds for various proprietory
|
||||
// C++ compilers
|
||||
|
||||
// Workaround for compilers with buggy for-loop scoping
|
||||
// That's quite a few compilers actually including recent versions of
|
||||
// Dec Alpha cxx, HP-UX CC and SGI CC.
|
||||
// The trivial "if" statement provides the correct scoping to the
|
||||
// for loop
|
||||
|
||||
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
/* #undef for */
|
||||
#define for if(1) for
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the C++ compiler we use doesn't have bool, then
|
||||
// the following is a near-perfect work-around.
|
||||
// You must make sure your code does not depend on "int" and "bool"
|
||||
// being two different types, in overloading for instance.
|
||||
//
|
||||
|
||||
#ifdef CXX_HAS_NO_BOOL
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
#if defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) && defined (__cplusplus)
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#include <libcw/sys.h>
|
||||
#include <libcw/debug.h>
|
||||
|
||||
#define ID3D_INIT_DOUT() Debug( libcw_do.on() )
|
||||
#define ID3D_INIT_WARNING() Debug( dc::warning.on() )
|
||||
#define ID3D_INIT_NOTICE() Debug( dc::notice.on() )
|
||||
#define ID3D_NOTICE(x) Dout( dc::notice, x )
|
||||
#define ID3D_WARNING(x) Dout( dc::warning, x )
|
||||
|
||||
#else
|
||||
|
||||
# define ID3D_INIT_DOUT()
|
||||
# define ID3D_INIT_WARNING()
|
||||
# define ID3D_INIT_NOTICE()
|
||||
# define ID3D_NOTICE(x)
|
||||
# define ID3D_WARNING(x)
|
||||
|
||||
#endif /* defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) */
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* And now the rest of the boys */
|
||||
#define CXX_HAS_BUGGY_FOR_LOOPS 1
|
||||
/* #undef CXX_HAS_NO_BOOL */
|
||||
/* #undef ID3_ENABLE_DEBUG */
|
||||
/* #undef ID3_DISABLE_ASSERT */
|
||||
/* #undef ID3_DISABLE_CHECKS */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF16BE */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF16 */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF8 */
|
||||
/* #undef ID3_ICONV_FORMAT_ASCII */
|
||||
|
||||
/* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
* determining internal versioning information. The intent is that these
|
||||
* macros will be made available in the library via constants, functions,
|
||||
* or static methods.
|
||||
*/
|
||||
/* #undef HAVE_ZLIB */
|
||||
/* #undef HAVE_GETOPT_LONG */
|
||||
#define _ID3LIB_NAME "@ID3LIB_NAME@"
|
||||
#define _ID3LIB_VERSION "@ID3LIB_VERSION@"
|
||||
#define _ID3LIB_FULLNAME "@ID3LIB_FULLNAME@"
|
||||
#define _ID3LIB_MAJOR_VERSION @ID3LIB_MAJOR_VERSION@
|
||||
#define _ID3LIB_MINOR_VERSION @ID3LIB_MINOR_VERSION@
|
||||
#define _ID3LIB_PATCH_VERSION @ID3LIB_PATCH_VERSION@
|
||||
#define _ID3LIB_INTERFACE_AGE @ID3LIB_INTERFACE_AGE@
|
||||
#define _ID3LIB_BINARY_AGE @ID3LIB_BINARY_AGE@
|
||||
/* #undef ID3_COMPILED_WITH_DEBUGGING */
|
||||
/* */
|
||||
|
||||
/* Define if you have the getopt_long function. */
|
||||
#define HAVE_GETOPT_LONG 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
/* #undef HAVE_MKSTEMP */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
/* #undef HAVE_TRUNCATE */
|
||||
|
||||
/* Define if you have the <cctype> header file. */
|
||||
#define HAVE_CCTYPE 1
|
||||
|
||||
/* Define if you have the <climits> header file. */
|
||||
#define HAVE_CLIMITS 1
|
||||
|
||||
/* Define if you have the <cstdio> header file. */
|
||||
#define HAVE_CSTDIO 1
|
||||
|
||||
/* Define if you have the <cstdlib> header file. */
|
||||
#define HAVE_CSTDLIB 1
|
||||
|
||||
/* Define if you have the <cstring> header file. */
|
||||
#define HAVE_CSTRING 1
|
||||
|
||||
/* Define if you have the <fstream> header file. */
|
||||
#define HAVE_FSTREAM 1
|
||||
|
||||
/* Define if you have the <fstream.h> header file. */
|
||||
#define HAVE_FSTREAM_H 1
|
||||
|
||||
/* Define if you have the <iconv.h> header file. */
|
||||
/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define if you have the <iomanip> header file. */
|
||||
#define HAVE_IOMANIP 1
|
||||
|
||||
/* Define if you have the <iomanip.h> header file. */
|
||||
#define HAVE_IOMANIP_H 1
|
||||
|
||||
/* Define if you have the <iostream> header file. */
|
||||
#define HAVE_IOSTREAM 1
|
||||
|
||||
/* Define if you have the <iostream.h> header file. */
|
||||
#define HAVE_IOSTREAM_H 1
|
||||
|
||||
/* Define if you have the <libcw/sys.h> header file. */
|
||||
/* #undef HAVE_LIBCW_SYS_H */
|
||||
|
||||
/* Define if you have the <string> header file. */
|
||||
#define HAVE_STRING 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you have the <zlib.h> header file. */
|
||||
/* #undef HAVE_ZLIB_H */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "@PACKAGE@"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "@VERSION@"
|
||||
|
||||
/* This is the bottom section */
|
||||
|
||||
// This file defines portability work-arounds for various proprietory
|
||||
// C++ compilers
|
||||
|
||||
// Workaround for compilers with buggy for-loop scoping
|
||||
// That's quite a few compilers actually including recent versions of
|
||||
// Dec Alpha cxx, HP-UX CC and SGI CC.
|
||||
// The trivial "if" statement provides the correct scoping to the
|
||||
// for loop
|
||||
|
||||
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
/* #undef for */
|
||||
#define for if(1) for
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the C++ compiler we use doesn't have bool, then
|
||||
// the following is a near-perfect work-around.
|
||||
// You must make sure your code does not depend on "int" and "bool"
|
||||
// being two different types, in overloading for instance.
|
||||
//
|
||||
|
||||
#ifdef CXX_HAS_NO_BOOL
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
#if defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) && defined (__cplusplus)
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#include <libcw/sys.h>
|
||||
#include <libcw/debug.h>
|
||||
|
||||
#define ID3D_INIT_DOUT() Debug( libcw_do.on() )
|
||||
#define ID3D_INIT_WARNING() Debug( dc::warning.on() )
|
||||
#define ID3D_INIT_NOTICE() Debug( dc::notice.on() )
|
||||
#define ID3D_NOTICE(x) Dout( dc::notice, x )
|
||||
#define ID3D_WARNING(x) Dout( dc::warning, x )
|
||||
|
||||
#else
|
||||
|
||||
# define ID3D_INIT_DOUT()
|
||||
# define ID3D_INIT_WARNING()
|
||||
# define ID3D_INIT_NOTICE()
|
||||
# define ID3D_NOTICE(x)
|
||||
# define ID3D_WARNING(x)
|
||||
|
||||
#endif /* defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) */
|
||||
|
|
@ -0,0 +1,979 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
# Each package is responsible for reporting which valid configurations
|
||||
# it does not support. The user should be able to distinguish
|
||||
# a failure to support a valid configuration from a meaningless
|
||||
# configuration.
|
||||
|
||||
# The goal of this file is to map all the various variations of a given
|
||||
# machine specification into a single specification in the form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or in some cases, the newer four-part form:
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
then
|
||||
echo Configuration name missing. 1>&2
|
||||
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
|
||||
echo "or $0 ALIAS" 1>&2
|
||||
echo where ALIAS is a recognized configuration type. 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# First pass through any local machine types.
|
||||
case $1 in
|
||||
*local*)
|
||||
echo $1
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
linux-gnu*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
then os=`echo $1 | sed 's/.*-/-/'`
|
||||
else os=; fi
|
||||
;;
|
||||
esac
|
||||
|
||||
### Let's recognize common machines as not being operating systems so
|
||||
### that things like config.sub decstation-3100 work. We also
|
||||
### recognize some manufacturers as not being operating systems, so we
|
||||
### can provide default operating systems below.
|
||||
case $os in
|
||||
-sun*os*)
|
||||
# Prevent following clause from handling this invalid input.
|
||||
;;
|
||||
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
|
||||
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
|
||||
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
os=-sco3.2v4
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2.[4-9]*)
|
||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2v[4-9]*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-clix*)
|
||||
basic_machine=clipper-intergraph
|
||||
;;
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
-ptx*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
|
||||
;;
|
||||
-windowsnt*)
|
||||
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||
;;
|
||||
-psos*)
|
||||
os=-psos
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode aliases for certain CPU-COMPANY combinations.
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
|
||||
| hppa2.0w \
|
||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||
| mipstx39 | mipstx39el | armv[34][lb] \
|
||||
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[34567]86)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
*-*-*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
|
||||
| hppa2.0w-* \
|
||||
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
|
||||
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* | armv[34][lb]-*\
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-* | armv*-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
altos | altos3068)
|
||||
basic_machine=m68k-altos
|
||||
;;
|
||||
am29k)
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
;;
|
||||
amiga | amiga-*)
|
||||
basic_machine=m68k-cbm
|
||||
;;
|
||||
amigaos | amigados)
|
||||
basic_machine=m68k-cbm
|
||||
os=-amigaos
|
||||
;;
|
||||
amigaunix | amix)
|
||||
basic_machine=m68k-cbm
|
||||
os=-sysv4
|
||||
;;
|
||||
apollo68)
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
;;
|
||||
balance)
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c2)
|
||||
basic_machine=c2-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c32)
|
||||
basic_machine=c32-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c34)
|
||||
basic_machine=c34-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c38)
|
||||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[ctj]90-cray)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
basic_machine=mips-dec
|
||||
;;
|
||||
delta | 3300 | motorola-3300 | motorola-delta \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
;;
|
||||
delta88)
|
||||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dpx20 | dpx20-*)
|
||||
basic_machine=rs6000-bull
|
||||
os=-bosx
|
||||
;;
|
||||
dpx2* | dpx2*-bull)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv3
|
||||
;;
|
||||
ebmon29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-ebmon
|
||||
;;
|
||||
elxsi)
|
||||
basic_machine=elxsi-elxsi
|
||||
os=-bsd
|
||||
;;
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
genix)
|
||||
basic_machine=ns32k-ns
|
||||
;;
|
||||
gmicro)
|
||||
basic_machine=tron-gmicro
|
||||
os=-sysv
|
||||
;;
|
||||
h3050r* | hiux*)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
h8300hms)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
;;
|
||||
hp300-*)
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp300bsd)
|
||||
basic_machine=m68k-hp
|
||||
os=-bsd
|
||||
;;
|
||||
hp300hpux)
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp9k2[0-9][0-9] | hp9k31[0-9])
|
||||
basic_machine=m68000-hp
|
||||
;;
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
os=-mpeix
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
os=-mpeix
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[34567]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[34567]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[34567]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[34567]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
-irix*)
|
||||
;;
|
||||
*)
|
||||
os=-irix4
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
isi68 | isi)
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
magnum | m3230)
|
||||
basic_machine=mips-mips
|
||||
os=-sysv
|
||||
;;
|
||||
merlin)
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
netwinder)
|
||||
basic_machine=armv4l-corel
|
||||
os=-linux
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
basic_machine=m68k-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news1000)
|
||||
basic_machine=m68030-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news-3600 | risc-news)
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
-nextstep* )
|
||||
;;
|
||||
-ns2*)
|
||||
os=-nextstep2
|
||||
;;
|
||||
*)
|
||||
os=-nextstep3
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
nh3000)
|
||||
basic_machine=m68k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nh[45]000)
|
||||
basic_machine=m88k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nindy960)
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
paragon)
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | nexen)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | k6 | 6x86)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | nexen-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | k6-* | 6x86-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=rs6000-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
sh)
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
;;
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
sun2os3)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun2os4)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun3os3)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun3os4)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4os3)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun4os4)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4sol2)
|
||||
basic_machine=sparc-sun
|
||||
os=-solaris2
|
||||
;;
|
||||
sun3 | sun3-*)
|
||||
basic_machine=m68k-sun
|
||||
;;
|
||||
sun4)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
symmetry)
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
ultra3)
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
;;
|
||||
vms)
|
||||
basic_machine=vax-dec
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks68)
|
||||
basic_machine=m68k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks29k)
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
;;
|
||||
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
rs6000)
|
||||
basic_machine=rs6000-ibm
|
||||
;;
|
||||
vax)
|
||||
basic_machine=vax-dec
|
||||
;;
|
||||
pdp11)
|
||||
basic_machine=pdp11-dec
|
||||
;;
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
basic_machine=orion-highlevel
|
||||
;;
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Here we canonicalize certain aliases for manufacturers.
|
||||
case $basic_machine in
|
||||
*-digital*)
|
||||
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
|
||||
;;
|
||||
*-commodore*)
|
||||
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode manufacturer-specific aliases for certain operating systems.
|
||||
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
-solaris)
|
||||
os=-solaris2
|
||||
;;
|
||||
-svr4*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-unixware*)
|
||||
os=-sysv4.2uw
|
||||
;;
|
||||
-gnu/linux*)
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||
;;
|
||||
# First accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
|
||||
| -openstep* | -mpeix* | -oskit*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
-sunos6*)
|
||||
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||
;;
|
||||
-osfrose*)
|
||||
os=-osfrose
|
||||
;;
|
||||
-osf*)
|
||||
os=-osf
|
||||
;;
|
||||
-utek*)
|
||||
os=-bsd
|
||||
;;
|
||||
-dynix*)
|
||||
os=-bsd
|
||||
;;
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
;;
|
||||
# Preserve the version number of sinix5.
|
||||
-sinix5.*)
|
||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||
;;
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-oss*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-svr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
-svr3)
|
||||
os=-sysv3
|
||||
;;
|
||||
-sysvr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
# Get rid of the `-' at the beginning of $os.
|
||||
os=`echo $os | sed 's/[^-]*-//'`
|
||||
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
||||
# Here we handle the default operating systems that come with various machines.
|
||||
# The value should be what the vendor currently ships out the door with their
|
||||
# machine or put another way, the most popular os provided with the machine.
|
||||
|
||||
# Note that if you're going to try to match "-MANUFACTURER" here (say,
|
||||
# "-sun"), then you have to tell the case statement up towards the top
|
||||
# that MANUFACTURER isn't an operating system. Otherwise, code above
|
||||
# will signal an error saying that MANUFACTURER isn't an operating
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-corel)
|
||||
os=-linux
|
||||
;;
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
os=-ultrix4.2
|
||||
;;
|
||||
m68*-apollo)
|
||||
os=-domain
|
||||
;;
|
||||
i386-sun)
|
||||
os=-sunos4.0.2
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
sparc-* | *-sun)
|
||||
os=-sunos4.1.1
|
||||
;;
|
||||
*-be)
|
||||
os=-beos
|
||||
;;
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
*-hitachi)
|
||||
os=-hiux
|
||||
;;
|
||||
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
|
||||
os=-sysv
|
||||
;;
|
||||
*-cbm)
|
||||
os=-amigaos
|
||||
;;
|
||||
*-dg)
|
||||
os=-dgux
|
||||
;;
|
||||
*-dolphin)
|
||||
os=-sysv3
|
||||
;;
|
||||
m68k-ccur)
|
||||
os=-rtu
|
||||
;;
|
||||
m88k-omron*)
|
||||
os=-luna
|
||||
;;
|
||||
*-next )
|
||||
os=-nextstep
|
||||
;;
|
||||
*-sequent)
|
||||
os=-ptx
|
||||
;;
|
||||
*-crds)
|
||||
os=-unos
|
||||
;;
|
||||
*-ns)
|
||||
os=-genix
|
||||
;;
|
||||
i370-*)
|
||||
os=-mvs
|
||||
;;
|
||||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
os=-rtu
|
||||
;;
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Here we handle the case where we know the os, and the CPU type, but not the
|
||||
# manufacturer. We pick the logical manufacturer.
|
||||
vendor=unknown
|
||||
case $basic_machine in
|
||||
*-unknown)
|
||||
case $os in
|
||||
-riscix*)
|
||||
vendor=acorn
|
||||
;;
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-mpeix*)
|
||||
vendor=hp
|
||||
;;
|
||||
-mpeix*)
|
||||
vendor=hp
|
||||
;;
|
||||
-hiux*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-unos*)
|
||||
vendor=crds
|
||||
;;
|
||||
-dgux*)
|
||||
vendor=dg
|
||||
;;
|
||||
-luna*)
|
||||
vendor=omron
|
||||
;;
|
||||
-genix*)
|
||||
vendor=ns
|
||||
;;
|
||||
-mvs*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $basic_machine$os
|
|
@ -0,0 +1,115 @@
|
|||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* And now the rest of the boys */
|
||||
#define CXX_HAS_BUGGY_FOR_LOOPS 1
|
||||
/* #undef CXX_HAS_NO_BOOL */
|
||||
|
||||
/* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
* determining internal versioning information. The intent is that these
|
||||
* macros will be made available in the library via constants, functions,
|
||||
* or static methods.
|
||||
*/
|
||||
#define __ID3LIB_NAME "id3lib"
|
||||
#define __ID3LIB_DATE ": 2000/05/29 15:53:26 "
|
||||
#define __ID3LIB_VERSION "3.7.9"
|
||||
#define __ID3LIB_FULLNAME "id3lib-3.7.9"
|
||||
#define __ID3LIB_MAJOR_VERSION 3
|
||||
#define __ID3LIB_MINOR_VERSION 7
|
||||
#define __ID3LIB_PATCH_VERSION 9
|
||||
#define __ID3LIB_INTERFACE_AGE 2
|
||||
#define __ID3LIB_BINARY_AGE 3
|
||||
#define __ID3_COMPILED_WITH_DEBUGGING "yes"
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
/* #undef HAVE_MKSTEMP */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
/* #undef HAVE_TRUNCATE */
|
||||
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define if you have the <iostream.h> header file. */
|
||||
#define HAVE_IOSTREAM_H 1
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the <stdio.h> header file. */
|
||||
#define HAVE_STDIO_H 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you have the <zlib.h> header file. */
|
||||
#define HAVE_ZLIB_H 1
|
||||
|
||||
/* Define if you have the z library (-lz). */
|
||||
/* #undef HAVE_LIBZ */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "id3lib"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "3.7.9"
|
||||
|
||||
/* This is the bottom section */
|
||||
|
||||
// This file defines portability work-arounds for various proprietory
|
||||
// C++ compilers
|
||||
|
||||
// Workaround for compilers with buggy for-loop scoping
|
||||
// That's quite a few compilers actually including recent versions of
|
||||
// Dec Alpha cxx, HP-UX CC and SGI CC.
|
||||
// The trivial "if" statement provides the correct scoping to the
|
||||
// for loop
|
||||
|
||||
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
/* #undef for */
|
||||
#define for if(1) for
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the C++ compiler we use doesn't have bool, then
|
||||
// the following is a near-perfect work-around.
|
||||
// You must make sure your code does not depend on "int" and "bool"
|
||||
// being two different types, in overloading for instance.
|
||||
//
|
||||
|
||||
#ifdef CXX_HAS_NO_BOOL
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,226 @@
|
|||
# $Id: configure.in,v 1.1 2001-08-27 00:12:02 dmazzoni Exp $
|
||||
|
||||
# Copyright 1999, 2000 Scott Thomas Haug <eldamitri@users.sourceforge.net>
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
# require autoconf 2.13
|
||||
AC_PREREQ(2.13)
|
||||
|
||||
# init autoconf (and check for presence fo reconf)
|
||||
AC_INIT(reconf)
|
||||
|
||||
ID3LIB_NAME=id3lib
|
||||
|
||||
dnl The following has been adapted from glib (http://www.gtk.org)
|
||||
dnl
|
||||
dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
|
||||
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
|
||||
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
||||
|
||||
# Making releases:
|
||||
# ID3LIB_PATCH_VERSION += 1;
|
||||
# ID3LIB_INTERFACE_AGE += 1;
|
||||
# ID3LIB_BINARY_AGE += 1;
|
||||
# if any functions have been added, set ID3LIB_INTERFACE_AGE to 0.
|
||||
# if backwards compatibility has been broken,
|
||||
# set ID3LIB_BINARY_AGE _and_ ID3LIB_INTERFACE_AGE to 0.
|
||||
#
|
||||
|
||||
ID3LIB_MAJOR_VERSION=3
|
||||
ID3LIB_MINOR_VERSION=8
|
||||
ID3LIB_PATCH_VERSION=0
|
||||
ID3LIB_ADDED_VERSION=pre1
|
||||
ID3LIB_VERSION=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION.$ID3LIB_PATCH_VERSION$ID3LIB_ADDED_VERSION
|
||||
|
||||
ID3LIB_INTERFACE_AGE=0
|
||||
ID3LIB_BINARY_AGE=0
|
||||
AC_DIVERT_POP()dnl
|
||||
|
||||
AC_SUBST(ID3LIB_NAME)
|
||||
AC_SUBST(ID3LIB_MAJOR_VERSION)
|
||||
AC_SUBST(ID3LIB_MINOR_VERSION)
|
||||
AC_SUBST(ID3LIB_PATCH_VERSION)
|
||||
AC_SUBST(ID3LIB_VERSION)
|
||||
AC_SUBST(ID3LIB_INTERFACE_AGE)
|
||||
AC_SUBST(ID3LIB_BINARY_AGE)
|
||||
|
||||
# for documentation purposes
|
||||
DOX_DIR_HTML=api
|
||||
DOX_DIR_LATEX=latex
|
||||
DOX_DIR_MAN=man
|
||||
DOX_DIR_RTF=rtf
|
||||
|
||||
AC_SUBST(DOX_DIR_HTML)
|
||||
AC_SUBST(DOX_DIR_LATEX)
|
||||
AC_SUBST(DOX_DIR_MAN)
|
||||
AC_SUBST(DOX_DIR_RTF)
|
||||
|
||||
# libtool versioning
|
||||
LT_RELEASE=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION
|
||||
LT_CURRENT=`expr $ID3LIB_PATCH_VERSION - $ID3LIB_INTERFACE_AGE`
|
||||
LT_REVISION=$ID3LIB_INTERFACE_AGE
|
||||
LT_AGE=`expr $ID3LIB_BINARY_AGE - $ID3LIB_INTERFACE_AGE`
|
||||
AC_SUBST(LT_RELEASE)
|
||||
AC_SUBST(LT_CURRENT)
|
||||
AC_SUBST(LT_REVISION)
|
||||
AC_SUBST(LT_AGE)
|
||||
|
||||
VERSION=$ID3LIB_VERSION
|
||||
PACKAGE=$ID3LIB_NAME
|
||||
|
||||
dnl This is a hack to get the release date using cvs checkin macros
|
||||
ID3LIB_FULLNAME=$ID3LIB_NAME-$ID3LIB_VERSION
|
||||
|
||||
AC_SUBST(ID3LIB_FULLNAME)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
|
||||
|
||||
dnl Initialize libtool
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
dnl Initialize maintainer mode
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
dnl figure debugging default, prior to $ac_help setup
|
||||
dnl
|
||||
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
||||
if test `expr $ID3LIB_MINOR_VERSION \% 2` = 1 ; then
|
||||
debug_default=yes
|
||||
else
|
||||
debug_default=minimum
|
||||
fi
|
||||
AC_DIVERT_POP()dnl
|
||||
|
||||
dnl declare --enable-* args and collect ac_help strings
|
||||
AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]], , enable_ansi=no)
|
||||
dnl
|
||||
AC_SUBST(ID3LIB_DEBUG_FLAGS)
|
||||
|
||||
dnl Checks for programs
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_ISC_POSIX
|
||||
AC_PROG_CXXCPP
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl for executable extensions
|
||||
AC_EXEEXT
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_CHECK_LIB(z,uncompress,AC_DEFINE_UNQUOTED(HAVE_ZLIB))#,,
|
||||
# AC_MSG_ERROR([id3lib requires zlib to process compressed frames]))
|
||||
|
||||
AM_CONDITIONAL(ID3_NEEDZLIB, test x$ac_cv_lib_z_uncompress = xno)
|
||||
AM_CONDITIONAL(ID3_NEEDDEBUG, test x$enable_debug = xyes)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(zlib.h wchar.h sys/param.h unistd.h iconv.h)
|
||||
|
||||
dnl Check for c++ features
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_CHECK_HEADERS(libcw/sys.h)
|
||||
AC_CHECK_HEADERS(cctype climits cstdio cstdlib cstring)
|
||||
AC_CHECK_HEADERS(fstream iostream iomanip)
|
||||
AC_CHECK_HEADERS( \
|
||||
string \
|
||||
fstream.h \
|
||||
iostream.h \
|
||||
iomanip.h \
|
||||
,,AC_MSG_ERROR([Missing a vital header file for id3lib])
|
||||
)
|
||||
|
||||
dnl Checks for the portability of certain c++ features: the bool type and
|
||||
dnl for-loop scoping
|
||||
ID3_CXX_PORTABILITY
|
||||
|
||||
ID3_CXX_WARNINGS
|
||||
|
||||
AC_LANG_RESTORE
|
||||
|
||||
ID3_DEBUG
|
||||
ID3_UNICODE
|
||||
|
||||
dnl Check for functions.
|
||||
|
||||
# AC_FUNC_MEMCMP
|
||||
AC_CHECK_FUNCS(getopt_long)
|
||||
AM_CONDITIONAL(ID3_NEEDGETOPT_LONG, test x$ac_cv_func_getopt_long = xno)
|
||||
|
||||
AC_CHECK_FUNCS(mkstemp)
|
||||
AC_CHECK_FUNCS(
|
||||
truncate \
|
||||
,,AC_MSG_ERROR([Missing a vital function for id3lib])
|
||||
)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
dnl
|
||||
dnl Checks with local macros
|
||||
dnl
|
||||
|
||||
dnl Provides a --honor-std option to the configure script that honors the
|
||||
dnl std namespace. Must be used AFTER configuring ALL compilers.
|
||||
dnl LF_HONOR_STD
|
||||
|
||||
dnl ACCONFIG TEMPLATE
|
||||
dnl
|
||||
dnl /* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
dnl * determining internal versioning information. The intent is that these
|
||||
dnl * macros will be made available in the library via constants, functions,
|
||||
dnl * or static methods.
|
||||
dnl */
|
||||
dnl #undef HAVE_ZLIB
|
||||
dnl #undef HAVE_GETOPT_LONG
|
||||
dnl #undef _ID3LIB_NAME
|
||||
dnl #undef _ID3LIB_VERSION
|
||||
dnl #undef _ID3LIB_FULLNAME
|
||||
dnl #undef _ID3LIB_MAJOR_VERSION
|
||||
dnl #undef _ID3LIB_MINOR_VERSION
|
||||
dnl #undef _ID3LIB_PATCH_VERSION
|
||||
dnl #undef _ID3LIB_INTERFACE_AGE
|
||||
dnl #undef _ID3LIB_BINARY_AGE
|
||||
dnl #undef _ID3_COMPILED_WITH_DEBUGGING
|
||||
dnl /* */
|
||||
dnl END ACCONFIG
|
||||
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_NAME, "$ID3LIB_NAME")
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_VERSION, "$ID3LIB_VERSION")
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_FULLNAME, "$ID3LIB_FULLNAME")
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_MAJOR_VERSION, $ID3LIB_MAJOR_VERSION)
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_MINOR_VERSION, $ID3LIB_MINOR_VERSION)
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_PATCH_VERSION, $ID3LIB_PATCH_VERSION)
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_INTERFACE_AGE, $ID3LIB_INTERFACE_AGE)
|
||||
AC_DEFINE_UNQUOTED(_ID3LIB_BINARY_AGE, $ID3LIB_BINARY_AGE)
|
||||
AC_DEFINE_UNQUOTED(_ID3_COMPILED_WITH_DEBUGGING, "${enable_debug}")
|
||||
|
||||
CONDITIONAL_SUBDIRS=
|
||||
if test "x$ac_cv_lib_z_uncompress" = "xno"; then
|
||||
CONDITIONAL_SUBDIRS="$CONDITIONAL_SUBDIRS zlib"
|
||||
fi
|
||||
AC_CONFIG_SUBDIRS(zlib)
|
||||
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
|
||||
AC_OUTPUT( \
|
||||
Makefile \
|
||||
doc/Makefile \
|
||||
m4/Makefile \
|
||||
include/Makefile \
|
||||
include/id3/Makefile \
|
||||
src/Makefile \
|
||||
examples/Makefile \
|
||||
)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,583 @@
|
|||
# KDE Config File
|
||||
[m4/lf_local.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[include/Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=include/id3.h,include/Makefile.am,
|
||||
install=false
|
||||
sub_dirs=id3,
|
||||
type=DATA
|
||||
[include/id3/header.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[include/id3/field.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[src/int28.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/field_binary.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[Workspace_1]
|
||||
openfiles=Untitled.cpp,Untitled.h,/home/scott/devel/id3lib/id3lib/include/id3.h,/home/scott/devel/id3lib/id3lib/Makefile.am,/home/scott/devel/id3lib/id3lib/aclocal.m4,/home/scott/devel/id3lib/id3lib/acconfig.h,/home/scott/devel/id3lib/id3lib/config.h.win32,/home/scott/devel/id3lib/id3lib/config.h.win32.in,/home/scott/devel/id3lib/id3lib/id3com/Makefile.am,/home/scott/devel/id3lib/id3lib/src/tag_parse_musicmatch.cpp,
|
||||
show_outputview=true
|
||||
show_treeview=true
|
||||
header_file=/home/scott/devel/id3lib/id3lib/id3com/Makefile.am
|
||||
cpp_file=/home/scott/devel/id3lib/id3lib/src/tag_parse_musicmatch.cpp
|
||||
browser_file=file:/usr/doc/kde/HTML/default/kdevelop/addendum/index.html
|
||||
[m4/lf_cc.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[include/id3/flags.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[src/tag_find.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/header_tag.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[COPYING]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[include/id3/header_tag.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[id3com/EnumFields.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[id3com/ID3COM.def]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[id3lib.spec.in]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[libprj/id3lib.dsw]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/demo_info.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/spec.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[Config for BinMakefileAm]
|
||||
ldflags=
|
||||
bin_program=id3lib
|
||||
cxxflags=-O0 -g3 -Wall
|
||||
[id3lib.kdevprj]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[reconf]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[src/error.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[po/Makefile.am]
|
||||
type=po
|
||||
sub_dirs=
|
||||
[prj/id3lib.dsw]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/demo_convert.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/tag_parse_v1.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[README]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[include/id3/sized_types.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[src/tag_sync.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/tag_parse.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/frame_parse.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[id3com/id3com.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/frame_render.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[m4/lf_texidoc.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[prj/Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=prj/id3lib.dsp,prj/id3lib.dsw,prj/id3lib.mak,prj/Makefile.am,
|
||||
install=false
|
||||
sub_dirs=
|
||||
type=DATA
|
||||
[m4/lf_cxx.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[src/field_string_unicode.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[id3com/id3com.dsp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/get_pic.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/utils.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[LFV Groups]
|
||||
Dialogs=*.kdevdlg,
|
||||
GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS,
|
||||
Others=*,
|
||||
Translations=*.po,
|
||||
groups=Headers,Sources,Dialogs,Translations,GNU,Others,
|
||||
Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
|
||||
Headers=*.h,*.hxx,*.hpp,*.H,
|
||||
[m4/lf_lisp.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[THANKS]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/demo_copy.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[examples/Makefile.am]
|
||||
files=examples/demo_convert.cpp,examples/demo_copy.cpp,examples/demo_info.cpp,examples/demo_main.cpp,examples/demo_tag.cpp,examples/findeng.cpp,examples/findstr.cpp,examples/get_pic.cpp,examples/test_compression.cpp,examples/test_remove.cpp,
|
||||
sub_dirs=
|
||||
type=static_library
|
||||
[src/header_frame.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/docs/en/Makefile.am]
|
||||
type=normal
|
||||
sub_dirs=
|
||||
[m4/lf_fortran.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/test_remove.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/field.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[id3lib.lsm]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[id3com/dlldata.c]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[acconfig]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[m4/lf_txtc.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[include/id3/error.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[id3com/id3com.dsw]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/test_compression.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/globals.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[src/c_wrapper.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/misc_support.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[src/tag.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[examples/findeng.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/spec.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[m4/lf_cxx_convenience.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/findstr.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/utils.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/uint28.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/misc_support.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/field_string_ascii.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/field_integer.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=src/c_wrapper.cpp,src/error.cpp,src/field.cpp,src/field_binary.cpp,src/field_integer.cpp,src/field_string_ascii.cpp,src/field_string_unicode.cpp,src/frame.cpp,src/frame_parse.cpp,src/frame_render.cpp,src/globals.cpp,src/header.cpp,src/header_frame.cpp,src/header_tag.cpp,src/int28.cpp,src/Makefile.am,src/misc_support.cpp,src/spec.cpp,src/tag.cpp,src/tag_file.cpp,src/tag_find.cpp,src/tag_parse.cpp,src/tag_parse_lyrics3.cpp,src/tag_parse_musicmatch.cpp,src/tag_parse_v1.cpp,src/tag_render.cpp,src/tag_sync.cpp,src/uint28.cpp,src/utils.cpp,
|
||||
install=false
|
||||
type=DATA
|
||||
sub_dirs=
|
||||
[NEWS]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[src/frame.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/frame.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[ChangeLog]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[id3com/frmID3Test.frm]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[m4/lf_warnings.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[include/id3/tag.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[General]
|
||||
makefiles=Makefile.am,src/Makefile.am,src/docs/Makefile.am,src/docs/en/Makefile.am,po/Makefile.am,include/Makefile.am,include/id3/Makefile.am,examples/Makefile.am,libprj/Makefile.am,m4/Makefile.am,prj/Makefile.am,id3com/Makefile.am,
|
||||
version_control=None
|
||||
project_type=normal_empty
|
||||
author=Scott Thomas Haug
|
||||
sub_dir=src/
|
||||
lfv_open_groups=
|
||||
workspace=1
|
||||
project_name=id3lib
|
||||
version=3.7.12
|
||||
AMChanged=false
|
||||
email=scott@id3.org
|
||||
kdevprj_version=1.1 beta1
|
||||
configure_args=
|
||||
[m4/lf_x11.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[m4/lf_bash.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[m4/Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=m4/lf_bash.m4,m4/lf_cc.m4,m4/lf_cxx.m4,m4/lf_cxx_convenience.m4,m4/lf_fortran.m4,m4/lf_host_type.m4,m4/lf_lisp.m4,m4/lf_local.m4,m4/lf_nm.m4,m4/lf_texidoc.m4,m4/lf_txtc.m4,m4/lf_warnings.m4,m4/lf_x11.m4,m4/Makefile.am,
|
||||
install=false
|
||||
sub_dirs=
|
||||
type=DATA
|
||||
[include/id3/header_frame.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[include/id3/Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=include/id3/error.h,include/id3/field.h,include/id3/flags.h,include/id3/frame.h,include/id3/globals.h,include/id3/header.h,include/id3/header_frame.h,include/id3/header_tag.h,include/id3/int28.h,include/id3/Makefile.am,include/id3/misc_support.h,include/id3/sized_types.h,include/id3/spec.h,include/id3/tag.h,include/id3/uint28.h,include/id3/utils.h,
|
||||
install=false
|
||||
sub_dirs=
|
||||
type=DATA
|
||||
[INSTALL]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[TODO]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[libprj/Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=libprj/id3lib.dsp,libprj/id3lib.dsw,libprj/Makefile.am,
|
||||
install=false
|
||||
sub_dirs=
|
||||
type=DATA
|
||||
[src/tag_render.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/tag_parse_musicmatch.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/header.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/int28.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[src/globals.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[src/tag_parse_lyrics3.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[id3com/ID3COM.rc]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[config.h.win32.in]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/demo_main.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3/uint28.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[Makefile.am]
|
||||
install_location=
|
||||
dist=true
|
||||
files=id3lib.kdevprj,AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,id3lib.lsm,Makefile.am,NEWS,THANKS,acconfig,config.h.win32.in,id3lib.spec.in,reconf,
|
||||
install=false
|
||||
type=DATA
|
||||
sub_dirs=id3lib,src,include,examples,libprj,m4,prj,id3com,
|
||||
[id3com/Makefile.am]
|
||||
install_location=
|
||||
files=id3com/dlldata.c,id3com/EnumFields.cpp,id3com/EnumFields.h,id3com/frmID3Test.frm,id3com/id3com.cpp,id3com/ID3COM.def,id3com/id3com.dsp,id3com/id3com.dsw,id3com/id3com.idl,id3com/Makefile.am,id3com/ID3COM.rc,
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
sub_dirs=
|
||||
[prj/id3lib.mak]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[m4/lf_host_type.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[libprj/id3lib.dsp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[AUTHORS]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[src/docs/Makefile.am]
|
||||
type=normal
|
||||
sub_dirs=
|
||||
[id3com/id3com.idl]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=CORBA_SOURCE
|
||||
[m4/lf_nm.m4]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[src/tag_file.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[prj/id3lib.dsp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=DATA
|
||||
[examples/demo_tag.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
||||
[include/id3.h]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=HEADER
|
||||
[id3com/EnumFields.cpp]
|
||||
install_location=
|
||||
dist=true
|
||||
install=false
|
||||
type=SOURCE
|
|
@ -0,0 +1,15 @@
|
|||
Begin4
|
||||
Title: id3lib
|
||||
Version: 3.7.12
|
||||
Entered-date: 2000-08-27
|
||||
Description: C/C++/COM development library for handling meta-information in
|
||||
digital audio files.
|
||||
Keywords: id3,id3v1,id3v2,mp3,musicmatch,lyrics3
|
||||
Author: dirk@id3.org (Dirk Mahoney)
|
||||
Maintained-by: scott@id3.org (Scott Haug)
|
||||
Primary-site:
|
||||
Home-page: http://id3lib.sourceforge.net
|
||||
Original-site: http://www.id3lib.org
|
||||
Platforms: Linux and other Unices, Windows, Mac
|
||||
Copying-policy: GNU Library General Public License (LGPL)
|
||||
End
|
|
@ -0,0 +1,189 @@
|
|||
# $Id: id3lib.spec.in,v 1.1 2001-08-27 00:12:27 dmazzoni Exp $
|
||||
|
||||
%define name @PACKAGE@
|
||||
%define version @VERSION@
|
||||
%define release 1
|
||||
%define prefix /usr
|
||||
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Summary: A software library for manipulating ID3v1 and ID3v2 tags.
|
||||
Source: http://download.sourceforge.net/id3lib/%{name}-%{version}.tar.gz
|
||||
URL: http://id3lib.sourceforge.net
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||
Copyright: LGPL
|
||||
Prefix: %{_prefix}
|
||||
Docdir: %{prefix}/doc
|
||||
Requires: zlib
|
||||
|
||||
%description
|
||||
This package provides a software library for manipulating ID3v1 and ID3v2 tags.
|
||||
It provides a convenient interface for software developers to include
|
||||
standards-compliant ID3v1/2 tagging capabilities in their applications.
|
||||
Features include identification of valid tags, automatic size conversions,
|
||||
(re)synchronisation of tag frames, seamless tag (de)compression, and optional
|
||||
padding facilities.
|
||||
|
||||
%package devel
|
||||
Summary: Headers for developing programs that will use id3lib
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}
|
||||
|
||||
%description devel
|
||||
This package contains the headers that programmers will need to develop
|
||||
applications which will use id3lib, the software library for ID3v1 and ID3v2
|
||||
tag manipulation.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for developing programs that will use id3lib
|
||||
Group: Documentation
|
||||
|
||||
%description doc
|
||||
This package contains the documentation of the id3lib API that programmers will
|
||||
need to develop applications which will use id3lib, the software library for ID3v1
|
||||
and ID3v2 tag manipulation.
|
||||
|
||||
%package examples
|
||||
Summary: Example applications that make use of the id3lib library
|
||||
Group: Applications/File
|
||||
Requires: %{name}
|
||||
|
||||
%description examples
|
||||
This package contains simple example applications that make use of id3lib, a
|
||||
software library for ID3v1 and ID3v2 tag maniuplation.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
|
||||
CXXFLAGS="$RPM_OPT_FLAGS -fnoexceptions" ./configure --prefix=%prefix --enable-debug=no
|
||||
|
||||
%ifnarch noarch
|
||||
|
||||
uname -a|grep SMP && make -j 2 || make
|
||||
|
||||
%endif
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%ifnarch noarch
|
||||
|
||||
make prefix=$RPM_BUILD_ROOT%{prefix} install
|
||||
|
||||
%else
|
||||
|
||||
make docs
|
||||
|
||||
# strip down the doc and examples directories so we can copy w/impunity
|
||||
for i in doc/ examples/; do \
|
||||
find $i \
|
||||
\( -name 'Makefile*' -or \
|
||||
-name '*.ps.gz' -or \
|
||||
-name '*.pdf' \
|
||||
\) -exec rm {} \; ; done
|
||||
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%ifnarch noarch
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
|
||||
%{prefix}/lib/*.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
|
||||
%{prefix}/include/id3*.h
|
||||
%{prefix}/include/id3
|
||||
%{prefix}/lib/*.la
|
||||
%{prefix}/lib/*.a
|
||||
%{prefix}/lib/*.so
|
||||
|
||||
%files examples
|
||||
%defattr(-, root, root)
|
||||
%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
|
||||
%{prefix}/bin/id3*
|
||||
|
||||
%else
|
||||
|
||||
%files doc
|
||||
%defattr(-, root, root)
|
||||
%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
|
||||
%doc doc/*.* doc/@DOX_DIR_HTML@ examples
|
||||
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Nov 20 2000 Scott Thomas Haug <scott@id3.org> 3.8.0pre1-1
|
||||
- Version 3.8.0pre1
|
||||
|
||||
* Thu Sep 14 2000 Scott Thomas Haug <scott@id3.org> 3.7.13-1
|
||||
- Version 3.7.13
|
||||
|
||||
* Sat Aug 26 2000 Scott Thomas Haug <scott@id3.org> 3.7.12-2
|
||||
- Removed -mpreferred-stack-boundary option from RPM_OPT_FLAGS for RedHat 6.2
|
||||
|
||||
* Fri Jul 07 2000 Scott Thomas Haug <scott@id3.org> 3.7.12-1
|
||||
- Version 3.7.12
|
||||
|
||||
* Fri Jul 05 2000 Scott Thomas Haug <scott@id3.org> 3.7.11-1
|
||||
- Version 3.7.11
|
||||
|
||||
* Fri Jun 23 2000 Scott Thomas Haug <scott@id3.org> 3.7.10-1
|
||||
- Version 3.7.10
|
||||
|
||||
* Wed May 24 2000 Scott Thomas Haug <scott@id3.org> 3.7.9-1
|
||||
- Version 3.7.9
|
||||
|
||||
* Wed May 10 2000 Scott Thomas Haug <scott@id3.org> 3.7.8-1
|
||||
- Version 3.7.8
|
||||
|
||||
* Wed May 10 2000 Scott Thomas Haug <scott@id3.org> 3.7.7-1
|
||||
- Version 3.7.7
|
||||
|
||||
* Wed May 03 2000 Scott Thomas Haug <scott@id3.org> 3.7.6-1
|
||||
- Version 3.7.6
|
||||
|
||||
* Fri Apr 28 2000 Scott Thomas Haug <scott@id3.org> 3.7.5-1
|
||||
- Version 3.7.5
|
||||
|
||||
* Wed Apr 26 2000 Scott Thomas Haug <scott@id3.org> 3.7.4-1
|
||||
- Version 3.7.4
|
||||
|
||||
* Mon Apr 24 2000 Scott Thomas Haug <scott@id3.org> 3.7.3-1
|
||||
- Version 3.7.3
|
||||
- Added explicit RPM_OPT_FLAGS def based on arch, since -fno-exceptions and
|
||||
-fno-rtti are part of the default flags in rpmrc and we need both exceptions
|
||||
and rtti (exceptions uses rtti)
|
||||
|
||||
* Fri Apr 21 2000 Scott Thomas Haug <scott@id3.org> 3.7.2-1
|
||||
- Version 3.7.2
|
||||
- More conditional blocks for noarch
|
||||
- More thorough cleaning of files for documentation
|
||||
- Updated html directory
|
||||
|
||||
* Thu Apr 20 2000 Scott Thomas Haug <scott@id3.org> 3.7.1-2
|
||||
- Fixed date of changelog entry for 3.7.1-1
|
||||
- Added conditional blocks so docs only get built for noarch target
|
||||
|
||||
* Wed Apr 19 2000 Scott Thomas Haug <scott@id3.org> 3.7.1-1
|
||||
- Version 3.7.1
|
||||
- Removed zlib-devel requirement from devel
|
||||
- Added doc package to distribute documentation
|
||||
- Added examples package to distribute binary examples (id3tag, id3info, ...)
|
||||
- Moved doc/ and examples/ source files from devel to doc package
|
||||
|
||||
* Mon Apr 17 2000 Scott Thomas Haug <scott@id3.org> 3.7.0-1
|
||||
- First (s)rpm build
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
* Based on acconfig
|
||||
*
|
||||
* By Dominic Mazzoni
|
||||
*
|
||||
** This file has been automatically generated by 'acconfig' from aclocal.m4
|
||||
** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
|
||||
**
|
||||
** This file is free software; as a special exception the author gives
|
||||
** unlimited permission to copy and/or distribute it, with or without
|
||||
** modifications, as long as this notice is preserved.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful, but
|
||||
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* This is the top section */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* And now the rest of the boys */
|
||||
#define CXX_HAS_BUGGY_FOR_LOOPS 1
|
||||
/* #undef CXX_HAS_NO_BOOL */
|
||||
/* #undef ID3_ENABLE_DEBUG */
|
||||
/* #undef ID3_DISABLE_ASSERT */
|
||||
/* #undef ID3_DISABLE_CHECKS */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF16BE */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF16 */
|
||||
/* #undef ID3_ICONV_FORMAT_UTF8 */
|
||||
/* #undef ID3_ICONV_FORMAT_ASCII */
|
||||
|
||||
/* config.h defines these preprocesser symbols to be used by id3lib for
|
||||
* determining internal versioning information. The intent is that these
|
||||
* macros will be made available in the library via constants, functions,
|
||||
* or static methods.
|
||||
*/
|
||||
/* #undef HAVE_ZLIB */
|
||||
/* #undef HAVE_GETOPT_LONG */
|
||||
#define _ID3LIB_NAME "id3lib"
|
||||
#define _ID3LIB_VERSION "3.8.0pre1"
|
||||
#define _ID3LIB_FULLNAME "id3lib-3.8.0pre1"
|
||||
#define _ID3LIB_MAJOR_VERSION 3
|
||||
#define _ID3LIB_MINOR_VERSION 8
|
||||
#define _ID3LIB_PATCH_VERSION 0
|
||||
#define _ID3LIB_INTERFACE_AGE 0
|
||||
#define _ID3LIB_BINARY_AGE 0
|
||||
/* #undef ID3_COMPILED_WITH_DEBUGGING */
|
||||
/* */
|
||||
|
||||
/* Define if you have the getopt_long function. */
|
||||
#define HAVE_GETOPT_LONG 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
/* #undef HAVE_MKSTEMP */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
/* #undef HAVE_TRUNCATE */
|
||||
|
||||
/* Define if you have the <cctype> header file. */
|
||||
#define HAVE_CCTYPE 1
|
||||
|
||||
/* Define if you have the <climits> header file. */
|
||||
#define HAVE_CLIMITS 1
|
||||
|
||||
/* Define if you have the <cstdio> header file. */
|
||||
#define HAVE_CSTDIO 1
|
||||
|
||||
/* Define if you have the <cstdlib> header file. */
|
||||
#define HAVE_CSTDLIB 1
|
||||
|
||||
/* Define if you have the <cstring> header file. */
|
||||
#define HAVE_CSTRING 1
|
||||
|
||||
/* Define if you have the <fstream> header file. */
|
||||
#define HAVE_FSTREAM 1
|
||||
|
||||
/* Define if you have the <fstream.h> header file. */
|
||||
#define HAVE_FSTREAM_H 1
|
||||
|
||||
/* Define if you have the <iconv.h> header file. */
|
||||
/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define if you have the <iomanip> header file. */
|
||||
#define HAVE_IOMANIP 1
|
||||
|
||||
/* Define if you have the <iomanip.h> header file. */
|
||||
#define HAVE_IOMANIP_H 1
|
||||
|
||||
/* Define if you have the <iostream> header file. */
|
||||
#define HAVE_IOSTREAM 1
|
||||
|
||||
/* Define if you have the <iostream.h> header file. */
|
||||
#define HAVE_IOSTREAM_H 1
|
||||
|
||||
/* Define if you have the <libcw/sys.h> header file. */
|
||||
/* #undef HAVE_LIBCW_SYS_H */
|
||||
|
||||
/* Define if you have the <string> header file. */
|
||||
#define HAVE_STRING 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you have the <zlib.h> header file. */
|
||||
/* #undef HAVE_ZLIB_H */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "id3lib"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "3.8.0pre1"
|
||||
|
||||
/* This is the bottom section */
|
||||
|
||||
// This file defines portability work-arounds for various proprietory
|
||||
// C++ compilers
|
||||
|
||||
// Workaround for compilers with buggy for-loop scoping
|
||||
// That's quite a few compilers actually including recent versions of
|
||||
// Dec Alpha cxx, HP-UX CC and SGI CC.
|
||||
// The trivial "if" statement provides the correct scoping to the
|
||||
// for loop
|
||||
|
||||
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
|
||||
/* #undef for */
|
||||
#define for if(1) for
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the C++ compiler we use doesn't have bool, then
|
||||
// the following is a near-perfect work-around.
|
||||
// You must make sure your code does not depend on "int" and "bool"
|
||||
// being two different types, in overloading for instance.
|
||||
//
|
||||
|
||||
#ifdef CXX_HAS_NO_BOOL
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
#if defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) && defined (__cplusplus)
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#include <libcw/sys.h>
|
||||
#include <libcw/debug.h>
|
||||
|
||||
#define ID3D_INIT_DOUT() Debug( libcw_do.on() )
|
||||
#define ID3D_INIT_WARNING() Debug( dc::warning.on() )
|
||||
#define ID3D_INIT_NOTICE() Debug( dc::notice.on() )
|
||||
#define ID3D_NOTICE(x) Dout( dc::notice, x )
|
||||
#define ID3D_WARNING(x) Dout( dc::warning, x )
|
||||
|
||||
#else
|
||||
|
||||
# define ID3D_INIT_DOUT()
|
||||
# define ID3D_INIT_WARNING()
|
||||
# define ID3D_INIT_NOTICE()
|
||||
# define ID3D_NOTICE(x)
|
||||
# define ID3D_WARNING(x)
|
||||
|
||||
#endif /* defined (ID3_ENABLE_DEBUG) && defined (HAVE_LIBCW_SYS_H) */
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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, 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 test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing - GNU libit 0.0"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`configure.in'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`configure.in'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`configure.in'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,40 @@
|
|||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id: mkinstalldirs,v 1.1 2001-08-27 00:13:22 dmazzoni Exp $
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 1999 Scott Thomas Haug <scott@id3.org>
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
#!/bin/sh
|
||||
rm -f config.cache
|
||||
rm -f acconfig.h
|
||||
echo "- aclocal."
|
||||
aclocal -I m4
|
||||
echo "- autoconf."
|
||||
autoconf
|
||||
echo "- acconfig."
|
||||
./acconfig
|
||||
echo "- autoheader."
|
||||
autoheader
|
||||
echo "- automake."
|
||||
automake -a
|
||||
exit
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
%vars =
|
||||
(
|
||||
"__pFrameList" => "__frames",
|
||||
"__pBinaryList" => "__binaries",
|
||||
"__pFindCursor" => "__cursor",
|
||||
"__bSyncOn" => "__is_unsync",
|
||||
"__bCompression" => "__is_compressed",
|
||||
"__bPadding" => "__is_padded",
|
||||
"__bExtendedHeader" => "__is_extended",
|
||||
"__bHasChanged" => "__changed",
|
||||
"__bFileWritable" => "__is_file_writable",
|
||||
"__fFileHandle" => "__file_handle",
|
||||
"__ulFileSize" => "__file_size",
|
||||
"__ulOldTagSize" => "__orig_tag_size",
|
||||
"__ulExtraBytes" => "__extra_bytes",
|
||||
"__bHasV1Tag" => "__has_v1_tag",
|
||||
"__ulTagsToParse" => "__tags_to_parse",
|
||||
"__sFileName" => "__file_name",
|
||||
"s_ulInstances" => "__instances",
|
||||
"__sEncryptionID" => "__encryption_id",
|
||||
"__sGroupingID" => "__grouping_id",
|
||||
"__bHasChanged" => "__changed",
|
||||
"__auiFieldBits" => "__field_bitset",
|
||||
"__ulNumFields" => "__num_fields",
|
||||
"__apFields" => "__fields",
|
||||
"__FrmHdr" => "__hdr",
|
||||
"__eName" => "__id",
|
||||
"__eType" => "__type",
|
||||
"__ulFixedLength" => "__length",
|
||||
"__eSpecBegin" => "__spec_begin",
|
||||
"__eSpecEnd" => "__spec_end",
|
||||
"__ulFlags" => "__flags",
|
||||
"__bHasChanged" => "__changed",
|
||||
"__sData" => "__data",
|
||||
"__ulSize" => "__size",
|
||||
"__eError" => "__error",
|
||||
"__nErrLine" => "__line_num",
|
||||
"__sErrFileName" => "__file_name",
|
||||
"__sErrDesc" => "__description",
|
||||
);
|
||||
|
||||
#open(VARIABLES, "variables.txt") or die "Can't open variables.txt: $!\n";
|
||||
#while ($line = <VARIABLES>)
|
||||
# {
|
||||
# ($oldname, $newname) = split(" ", $line);
|
||||
# $vars{$oldname} = $newname;
|
||||
# }
|
||||
|
||||
while (<>)
|
||||
{
|
||||
foreach $oldvar (sort keys %vars)
|
||||
{
|
||||
s/$oldvar/$vars{$oldvar}/g;
|
||||
}
|
||||
print;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
timestamp
|
|
@ -0,0 +1,7 @@
|
|||
Makefile
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.log
|
||||
config.status
|
||||
libwidgetextra-uninstalled.pc
|
||||
libwidgetextra.pc
|
|
@ -0,0 +1,9 @@
|
|||
This file contains extra notes on compiling and installing lib-widget-extra on
|
||||
*nix platforms using the Autotools build system.
|
||||
|
||||
Additional macros needed by the configure script can be found in the m4
|
||||
directory. Thus if you run aclocal manually, you need to do so as
|
||||
$ aclocal -I m4
|
||||
If you use autoreconf, then you can ignore this because it reads the relevant
|
||||
line from configure.in which tells it to include the content of the m4
|
||||
directory.
|
|
@ -0,0 +1,102 @@
|
|||
########################################
|
||||
#
|
||||
# lib-widget-extra Makefile
|
||||
#
|
||||
# Dominic Mazzoni, Richard Ash
|
||||
#
|
||||
# Run configure to generate Makefile
|
||||
# from Makefile.in
|
||||
#
|
||||
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
INSTALL = @INSTALL@
|
||||
LIBS = @LIBS@
|
||||
|
||||
srcdir=@srcdir@
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=@top_builddir@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
includedir=@includedir@
|
||||
libdir=@libdir@
|
||||
|
||||
# CFLAGS are specific to C.
|
||||
override CFLAGS += @CFLAGS@
|
||||
|
||||
# CXXFLAGS are specific to C++.
|
||||
override CXXFLAGS += @CXXFLAGS@
|
||||
|
||||
# CPPFLAGS are for both C and C++.
|
||||
override CPPFLAGS += -fno-strict-aliasing @CPPFLAGS@
|
||||
|
||||
# LDFLAGS are for linking
|
||||
override LDFLAGS += @LDFLAGS@
|
||||
|
||||
# name of the output library file
|
||||
LIBFILE = libwidgetextra.a
|
||||
# other generated files
|
||||
EXTRAS = libwidgetextra.pc libwidgetextra-uninstalled.pc
|
||||
|
||||
########################################
|
||||
# ALL OBJECT FILES
|
||||
|
||||
OBJS = NonGuiThread.o
|
||||
|
||||
########################################
|
||||
# Public headers, i.e. ones that get installed on the system
|
||||
|
||||
HEADERS = NonGuiThread.h
|
||||
|
||||
########################################
|
||||
# DEPENDENCIES
|
||||
|
||||
SOURCES = $(OBJS:%.o=%.cpp)
|
||||
|
||||
########################################
|
||||
|
||||
.PHONY: all
|
||||
all: $(LIBFILE)
|
||||
|
||||
.PHONY: install
|
||||
install: $(LIBFILE) $(HEADERS)
|
||||
# install the library file
|
||||
$(INSTALL) -d $(DESTDIR)$(LIBDIR)
|
||||
$(INSTALL) -m 644 $(LIBFILE) $(DESTDIR)$(LIBDIR)/$(LIBFILE)
|
||||
# install the header files
|
||||
|
||||
libwidgetextra.a: $(OBJS)
|
||||
ar rcs $@ $(OBJS)
|
||||
|
||||
#
|
||||
# You can optionally "make dep" to make dependencies.
|
||||
# The sed script turns "Foo.o: bar/Foo.cpp" into "bar/Foo.o: bar/Foo.cpp".
|
||||
#
|
||||
|
||||
dep:
|
||||
$(CXX) -MM $(CXXFLAGS) $(CPPFLAGS) $(SOURCES) | \
|
||||
sed -e 's/^.*\.o: \([^ ]*\)\.cpp/\1.o: \1.cpp/' \
|
||||
> .depend
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJS)
|
||||
rm -f $(LIBFILE) $(EXTRAS)
|
||||
|
||||
distclean: clean
|
||||
rm -f config.log config.status Makefile
|
||||
|
||||
#
|
||||
# Rule for compiling C++ files
|
||||
#
|
||||
|
||||
$(OBJS): %.o: $(srcdir)/%.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@
|
||||
|
||||
#
|
||||
# Include ".depend" if it exists (run "make dep" to generate it)
|
||||
#
|
||||
|
||||
ifeq (.depend,$(wildcard .depend))
|
||||
include .depend
|
||||
endif
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
/*************************************************************************
|
||||
|
||||
NonGuiThread.cpp
|
||||
|
||||
James Crook
|
||||
(C) Audacity Developers, 2007
|
||||
|
||||
wxWidgets license. See Licensing.txt
|
||||
|
||||
**********************************************************************//**
|
||||
|
||||
\class NonGuiThread
|
||||
\brief NonGuiThread a thread class that allows non-GUI activities to
|
||||
take place in the background without killing the GUI.
|
||||
|
||||
*//**********************************************************************/
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/apptrait.h>
|
||||
#include "NonGuiThread.h"
|
||||
|
||||
bool NonGuiThread::IsLive=false;
|
||||
|
||||
NonGuiThread::NonGuiThread(tGenericFn pFn)
|
||||
{
|
||||
mpFn = pFn;
|
||||
IsLive=true;
|
||||
mbExit = false;
|
||||
}
|
||||
|
||||
NonGuiThread::~NonGuiThread()
|
||||
{
|
||||
IsLive=false;
|
||||
}
|
||||
|
||||
NonGuiThread::ExitCode NonGuiThread::Entry()
|
||||
{
|
||||
// The while isn't needed here, but may be later if we break the function
|
||||
// up...
|
||||
while( !TestDestroy() && !mbExit )
|
||||
{
|
||||
mbExit=true;
|
||||
(*mpFn)();
|
||||
}
|
||||
return (ExitCode)0;
|
||||
}
|
||||
|
||||
// This one runs the function and only returns when function
|
||||
// has run to completion.
|
||||
void NonGuiThread::RunInThread(tGenericFn pFn)
|
||||
{
|
||||
#ifdef WXMSW
|
||||
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
|
||||
wxASSERT( traits );//"no wxAppTraits in RunInThread()?"
|
||||
|
||||
void *cookie = NULL;
|
||||
// disable all app windows while waiting for the child process to finish
|
||||
cookie = traits->BeforeChildWaitLoop();
|
||||
#endif
|
||||
|
||||
NonGuiThread * mpThread = new NonGuiThread(pFn);
|
||||
mpThread->Create();
|
||||
mpThread->Resume();
|
||||
wxLogDebug(wxT("Into the thread..."));
|
||||
while( mpThread->IsLive )
|
||||
{
|
||||
wxMilliSleep( 100 );
|
||||
//traits->AlwaysYield();
|
||||
wxYield();
|
||||
}
|
||||
#ifdef WXMSW
|
||||
traits->AfterChildWaitLoop(cookie);
|
||||
#endif
|
||||
}
|
||||
|
||||
// This function starts the thread and returns immediately.
|
||||
NonGuiThread * NonGuiThread::StartChild( tGenericFn pFn )
|
||||
{
|
||||
NonGuiThread * pThread = new NonGuiThread(pFn);
|
||||
//pThread->mpFn = pFn;
|
||||
pThread->Create();
|
||||
pThread->Run();
|
||||
return pThread;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*************************************************************************
|
||||
|
||||
NonGuiThread.h
|
||||
|
||||
James Crook
|
||||
(C) Audacity Developers, 2007
|
||||
|
||||
wxWidgets license. See Licensing.txt
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
#if !defined(AFX_NONGUITHREAD_H__E8F7FC2B_CB13_497B_A556_18551596AFD9__INCLUDED_)
|
||||
#define AFX_NONGUITHREAD_H__E8F7FC2B_CB13_497B_A556_18551596AFD9__INCLUDED_
|
||||
|
||||
typedef void (*tGenericFn)(void);
|
||||
//#include "AllCommands.h" // for tGenericFn
|
||||
//#include "WidgetExtra.h"
|
||||
|
||||
class /*WIDGET_EXTRA_DLL*/ NonGuiThread : public wxThread
|
||||
{
|
||||
public:
|
||||
NonGuiThread(tGenericFn pFn);
|
||||
virtual ~NonGuiThread();
|
||||
NonGuiThread::ExitCode Entry();
|
||||
static void RunInThread(tGenericFn pFn);
|
||||
static NonGuiThread * StartChild( tGenericFn pFn );
|
||||
|
||||
public:
|
||||
bool mbExit;
|
||||
tGenericFn mpFn;
|
||||
static bool IsLive;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_NONGUITHREAD_H__E8F7FC2B_CB13_497B_A556_18551596AFD9__INCLUDED_)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,184 @@
|
|||
dnl
|
||||
dnl libwidgetextra configure.in script
|
||||
dnl
|
||||
dnl Joshua Haberman
|
||||
dnl Dominic Mazzoni
|
||||
dnl Richard Ash
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl Instructions: to create "configure" from "configure.in", run:
|
||||
dnl
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
dnl Require autoconf >= 2.60
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
dnl Init autoconf
|
||||
AC_INIT
|
||||
dnl check we have some source (are in the right directory)
|
||||
AC_CONFIG_SRCDIR([NonGuiThread.h])
|
||||
dnl we have some extra macros in m4/
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
dnl -------------------------------------------------------
|
||||
dnl Checks for programs.
|
||||
dnl -------------------------------------------------------
|
||||
dnl save $CFLAGS etc. since AC_PROG_CC likes to insert "-g -O2"
|
||||
dnl if $CFLAGS is blank and it finds GCC
|
||||
cflags_save="$CFLAGS"
|
||||
cppflags_save="$CPPFLAGS"
|
||||
cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CC
|
||||
AC_LANG([C++])
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
CFLAGS="$cflags_save"
|
||||
CPPFLAGS="$cppflags_save"
|
||||
CXXFLAGS="$cxxflags_save"
|
||||
|
||||
dnl we will need an "install" program to be available
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl We have some extra variables which we need to subsitute into output files
|
||||
AC_SUBST(INSTALL_PREFIX)
|
||||
|
||||
dnl Make the install prefix available to the program so that the pkg-config file
|
||||
dnl can be created correctly
|
||||
AC_PREFIX_DEFAULT(/usr/local)
|
||||
if [[ $prefix = "NONE" ]] ; then
|
||||
AC_DEFINE(INSTALL_PREFIX, "/usr/local",
|
||||
[define as prefix where Audacity is installed])
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix")
|
||||
fi
|
||||
|
||||
dnl Build Options
|
||||
|
||||
AC_ARG_ENABLE(static,
|
||||
[AS_HELP_STRING([--enable-static],
|
||||
[link wx statically [default=no]])],
|
||||
static_preference="--static=$enableval",
|
||||
static_preference="")
|
||||
|
||||
AC_ARG_ENABLE(unicode,
|
||||
[AS_HELP_STRING([--enable-unicode],
|
||||
[enable unicode support [default=yes]])],
|
||||
unicode_preference="--unicode=$enableval",
|
||||
unicode_preference="--unicode=yes")
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[AS_HELP_STRING([--enable-debug],
|
||||
[enable debug support [default=no]])],
|
||||
debug_preference="$enableval",
|
||||
debug_preference="no")
|
||||
|
||||
dnl AC_ARG_WITH(wx-version,
|
||||
dnl [AS_HELP_STRING([--with-wx-version],
|
||||
dnl [select wxWidgets version (if both installed) [2.8,]])],
|
||||
dnl wx_preference="--version=$withval",
|
||||
dnl wx_preference="")
|
||||
dnl Right now only support wx 2.8
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl If user asked for debug, put debug in compiler flags
|
||||
dnl ----------------------------------------------------
|
||||
|
||||
if test x"$debug_preference" = "xyes" ; then
|
||||
dnl we want debuging on
|
||||
AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
|
||||
CFLAGS="${CFLAGS} -g "
|
||||
CXXFLAGS="${CXXFLAGS} -g "
|
||||
fi
|
||||
|
||||
dnl --------------------------------------------------------------------------
|
||||
dnl We would like warnings enabled on the builds, but different compilers need
|
||||
dnl different options for these. This bit tries to work out what flags we
|
||||
dnl should add to the compiler we are using.
|
||||
dnl --------------------------------------------------------------------------
|
||||
|
||||
dnl Strict prototypes flags for C (only C because doesn't work for C++)
|
||||
AX_CFLAGS_STRICT_PROTOTYPES(CFLAGS)
|
||||
|
||||
dnl Sensible warnings for C
|
||||
AX_CFLAGS_WARN_ALL(wall_flags)
|
||||
CFLAGS="${CFLAGS} $wall_flags"
|
||||
dnl try and use it on C++ as well
|
||||
AX_CXX_CHECK_FLAG([$wall_flags], [[int foo;]], [[foo = 1;]], cxx_does_wall="yes", cxx_does_wall="no")
|
||||
if test "x$cxx_does_wall" = "xyes" ; then
|
||||
dnl can use all warnings flag on the C++ compiler
|
||||
CXXFLAGS="${CXXFLAGS} $wall_flags"
|
||||
fi
|
||||
AX_CXXCPP_CHECK_FLAG([$wall_flags], [[int foo;]], [[foo = 1;]], cpp_does_wall="yes", cpp_does_wall="no")
|
||||
if test "x$cpp_does_wall" = "xyes" ; then
|
||||
dnl can use all warnings flag on the C++ pre-processor
|
||||
CPPFLAGS="${CPPFLAGS} $wall_flags"
|
||||
fi
|
||||
|
||||
dnl --- check for required libraries ---
|
||||
|
||||
dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
|
||||
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
|
||||
if [[ "$WX_CONFIG" = "no" ]] ; then
|
||||
AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
|
||||
fi
|
||||
|
||||
dnl --- Check that the wx version is at least 2.8.x ---
|
||||
|
||||
if test "x$debug_preference" = "xyes"; then
|
||||
dnl want debug wx as well
|
||||
wxconfigargs="--debug=yes"
|
||||
else
|
||||
dnl normal wx
|
||||
wxconfigargs=""
|
||||
fi
|
||||
|
||||
dnl more things we always pass to wx-config
|
||||
wxconfigargs="$static_preference $unicode_preference $wxconfigargs $wx_preference"
|
||||
|
||||
wx_version=`${WX_CONFIG} $wxconfigargs --version`
|
||||
|
||||
AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
|
||||
|
||||
case "${wx_version}" in
|
||||
2.8.*)
|
||||
echo "Great, you're using wxWidgets ${wx_version}!"
|
||||
;;
|
||||
*)
|
||||
wx_list=`${WX_CONFIG} --list`
|
||||
AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
|
||||
The currently available configurations are listed below. If necessary, either
|
||||
install the package for your distribution or download the latest version of
|
||||
wxWidgets
|
||||
from http://wxwidgets.org.
|
||||
${wx_list}])
|
||||
esac
|
||||
|
||||
dnl Gather wx arguments
|
||||
|
||||
LIBS="$LIBS `$WX_CONFIG $wxconfigargs --libs`"
|
||||
CPPFLAGS="$CPPFLAGS `$WX_CONFIG $wxconfigargs --cxxflags`"
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
AC_CONFIG_FILES([Makefile libwidgetextra.pc libwidgetextra-uninstalled.pc])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
echo ""
|
||||
echo "Run 'configure --help' for an explanation of the possible options,"
|
||||
echo "otherwise run 'make' to build libwidgetextra."
|
||||
|
||||
dnl Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
dnl version control system. Please do not modify past this point.
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# c-basic-offset: 3
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
#
|
||||
# vim: et sts=3 sw=3
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue