Recovered from cvs revision 2007-04-29 16:11:00
This commit is contained in:
@ -1,40 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Reflection;
|
||||
using namespace System::Runtime::CompilerServices;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using namespace System::Security::Permissions;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly:AssemblyTitleAttribute("asenet")];
|
||||
[assembly:AssemblyDescriptionAttribute("")];
|
||||
[assembly:AssemblyConfigurationAttribute("")];
|
||||
[assembly:AssemblyCompanyAttribute("")];
|
||||
[assembly:AssemblyProductAttribute("asenet")];
|
||||
[assembly:AssemblyCopyrightAttribute("Copyright (c) 2007")];
|
||||
[assembly:AssemblyTrademarkAttribute("")];
|
||||
[assembly:AssemblyCultureAttribute("")];
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the value or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly:AssemblyVersionAttribute("1.0.*")];
|
||||
|
||||
[assembly:ComVisible(false)];
|
||||
|
||||
[assembly:CLSCompliantAttribute(true)];
|
||||
|
||||
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
|
139
ase/net/Awk.cpp
139
ase/net/Awk.cpp
@ -1,139 +0,0 @@
|
||||
/*
|
||||
* $Id: Awk.cpp,v 1.1 2007/05/15 08:29:30 bacon Exp $
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Awk.hpp"
|
||||
|
||||
#include <ase/utl/ctype.h>
|
||||
#include <ase/utl/stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <msclr/auto_gcroot.h>
|
||||
|
||||
|
||||
namespace ASE
|
||||
{
|
||||
|
||||
class StubAwk: public Awk
|
||||
{
|
||||
public:
|
||||
StubAwk (NET::Awk^ wrapper): wrapper(wrapper)
|
||||
{
|
||||
}
|
||||
|
||||
int openSource (Source& io)
|
||||
{
|
||||
NET::Awk::Source^ nio = gcnew NET::Awk::Source ();
|
||||
int n = wrapper->OpenSource (nio);
|
||||
// TODO: put nio back to io.
|
||||
return n;
|
||||
}
|
||||
|
||||
int closeSource (Source& io)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t readSource (Source& io, char_t* buf, size_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t writeSource (Source& io, char_t* buf, size_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int openPipe (Pipe& io) {return 0; }
|
||||
int closePipe (Pipe& io) {return 0; }
|
||||
ssize_t readPipe (Pipe& io, char_t* buf, size_t len) {return 0; }
|
||||
ssize_t writePipe (Pipe& io, char_t* buf, size_t len) {return 0; }
|
||||
int flushPipe (Pipe& io) {return 0; }
|
||||
|
||||
int openFile (File& io) {return 0; }
|
||||
int closeFile (File& io) {return 0; }
|
||||
ssize_t readFile (File& io, char_t* buf, size_t len) {return 0; }
|
||||
ssize_t writeFile (File& io, char_t* buf, size_t len) {return 0; }
|
||||
int flushFile (File& io) {return 0; }
|
||||
|
||||
int openConsole (Console& io) {return 0; }
|
||||
int closeConsole (Console& io) {return 0; }
|
||||
ssize_t readConsole (Console& io, char_t* buf, size_t len) {return 0; }
|
||||
ssize_t writeConsole (Console& io, char_t* buf, size_t len) {return 0; }
|
||||
int flushConsole (Console& io) {return 0; }
|
||||
int nextConsole (Console& io) {return 0; }
|
||||
|
||||
// primitive operations
|
||||
void* allocMem (size_t n) { return ::malloc (n); }
|
||||
void* reallocMem (void* ptr, size_t n) { return ::realloc (ptr, n); }
|
||||
void freeMem (void* ptr) { ::free (ptr); }
|
||||
|
||||
bool_t isUpper (cint_t c) { return ase_isupper (c); }
|
||||
bool_t isLower (cint_t c) { return ase_islower (c); }
|
||||
bool_t isAlpha (cint_t c) { return ase_isalpha (c); }
|
||||
bool_t isDigit (cint_t c) { return ase_isdigit (c); }
|
||||
bool_t isXdigit (cint_t c) { return ase_isxdigit (c); }
|
||||
bool_t isAlnum (cint_t c) { return ase_isalnum (c); }
|
||||
bool_t isSpace (cint_t c) { return ase_isspace (c); }
|
||||
bool_t isPrint (cint_t c) { return ase_isprint (c); }
|
||||
bool_t isGraph (cint_t c) { return ase_isgraph (c); }
|
||||
bool_t isCntrl (cint_t c) { return ase_iscntrl (c); }
|
||||
bool_t isPunct (cint_t c) { return ase_ispunct (c); }
|
||||
cint_t toUpper (cint_t c) { return ase_toupper (c); }
|
||||
cint_t toLower (cint_t c) { return ase_tolower (c); }
|
||||
|
||||
real_t pow (real_t x, real_t y)
|
||||
{
|
||||
return ::pow (x, y);
|
||||
}
|
||||
|
||||
int vsprintf (char_t* buf, size_t size, const char_t* fmt, va_list arg)
|
||||
{
|
||||
return ase_vsprintf (buf, size, fmt, arg);
|
||||
}
|
||||
|
||||
void vdprintf (const char_t* fmt, va_list arg)
|
||||
{
|
||||
ase_vfprintf (stderr, fmt, arg);
|
||||
}
|
||||
|
||||
private:
|
||||
msclr::auto_gcroot<NET::Awk^> wrapper;
|
||||
};
|
||||
|
||||
namespace NET
|
||||
{
|
||||
|
||||
Awk::Awk ()
|
||||
{
|
||||
awk = new ASE::StubAwk (this);
|
||||
}
|
||||
|
||||
Awk::~Awk ()
|
||||
{
|
||||
delete awk;
|
||||
}
|
||||
|
||||
bool Awk::Parse ()
|
||||
{
|
||||
return awk->parse () == 0;
|
||||
}
|
||||
|
||||
bool Awk::Run ()
|
||||
{
|
||||
return awk->run () == 0;
|
||||
}
|
||||
|
||||
bool Awk::AddFunction (System::String^ name, int minArgs, int maxArgs, FunctionHandler^ handler)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Awk::DeleteFunction (System::String^ name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
123
ase/net/Awk.hpp
123
ase/net/Awk.hpp
@ -1,123 +0,0 @@
|
||||
/*
|
||||
* $Id: Awk.hpp,v 1.1 2007/05/15 08:29:30 bacon Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ase/awk/Awk.hpp>
|
||||
|
||||
using namespace System;
|
||||
|
||||
namespace ASE
|
||||
{
|
||||
namespace NET
|
||||
{
|
||||
|
||||
public ref class Awk abstract
|
||||
{
|
||||
public:
|
||||
|
||||
ref class Source
|
||||
{
|
||||
public:
|
||||
enum class MODE
|
||||
{
|
||||
READ = ASE::Awk::Source::READ,
|
||||
WRITE = ASE::Awk::Source::WRITE
|
||||
};
|
||||
|
||||
property MODE^ Mode
|
||||
{
|
||||
MODE^ get () { return this->mode; }
|
||||
void set (MODE^ mode) { this->mode = mode; }
|
||||
};
|
||||
|
||||
private:
|
||||
MODE^ mode;
|
||||
};
|
||||
|
||||
ref class Extio
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
ref class Pipe: public Extio
|
||||
{
|
||||
public:
|
||||
enum class MODE
|
||||
{
|
||||
READ = ASE::Awk::Pipe::READ,
|
||||
WRITE = ASE::Awk::Pipe::WRITE
|
||||
};
|
||||
|
||||
property MODE^ Mode
|
||||
{
|
||||
MODE^ get () { return this->mode; }
|
||||
void set (MODE^ mode) { this->mode = mode; }
|
||||
};
|
||||
|
||||
private:
|
||||
MODE^ mode;
|
||||
};
|
||||
|
||||
ref class File: public Extio
|
||||
{
|
||||
public:
|
||||
enum class MODE
|
||||
{
|
||||
READ = ASE::Awk::File::READ,
|
||||
WRITE = ASE::Awk::File::WRITE,
|
||||
APPEND = ASE::Awk::File::APPEND
|
||||
};
|
||||
|
||||
property MODE^ Mode
|
||||
{
|
||||
MODE^ get () { return this->mode; }
|
||||
void set (MODE^ mode) { this->mode = mode; }
|
||||
};
|
||||
|
||||
private:
|
||||
MODE^ mode;
|
||||
};
|
||||
|
||||
ref class Console: public Extio
|
||||
{
|
||||
public:
|
||||
enum class MODE
|
||||
{
|
||||
READ = ASE::Awk::Console::READ,
|
||||
WRITE = ASE::Awk::Console::WRITE
|
||||
};
|
||||
|
||||
property MODE^ Mode
|
||||
{
|
||||
MODE^ get () { return this->mode; }
|
||||
void set (MODE^ mode) { this->mode = mode; }
|
||||
};
|
||||
|
||||
private:
|
||||
MODE^ mode;
|
||||
};
|
||||
|
||||
Awk ();
|
||||
virtual ~Awk ();
|
||||
|
||||
bool Parse ();
|
||||
bool Run ();
|
||||
|
||||
delegate System::Object^ FunctionHandler (array<System::Object^>^ args);
|
||||
|
||||
bool AddFunction (System::String^ name, int minArgs, int maxArgs, FunctionHandler^ handler);
|
||||
bool DeleteFunction (System::String^ name);
|
||||
|
||||
virtual int OpenSource (Source^ io) = 0;
|
||||
virtual int CloseSource (Source^ io) = 0;
|
||||
virtual int ReadSource (Source^ io, ASE::Awk::char_t* buf, ASE::Awk::size_t len) = 0;
|
||||
virtual int WriteSource (Source^ io, ASE::Awk::char_t* buf, ASE::Awk::size_t len) = 0;
|
||||
|
||||
private:
|
||||
ASE::Awk* awk;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
/*
|
||||
* $Id: StdAwk.cpp,v 1.1 2007/07/15 16:31:59 bacon Exp $
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <ase/net/StdAwk.hpp>
|
||||
|
||||
namespace ASE
|
||||
{
|
||||
namespace Net
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
* $Id: StdAwk.hpp,v 1.1 2007/07/15 16:31:59 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/net/Awk.hpp>
|
||||
|
||||
namespace ASE
|
||||
{
|
||||
namespace Net
|
||||
{
|
||||
public ref class StdAwk: Awk
|
||||
{
|
||||
public:
|
||||
};
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// asenet.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
@ -1,7 +0,0 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#pragma once
|
||||
|
||||
|
BIN
ase/net/app.ico
BIN
ase/net/app.ico
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
@ -1,63 +0,0 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon placed first or with lowest ID value becomes application icon
|
||||
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
1 ICON "app.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
"\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -1,7 +0,0 @@
|
||||
/*
|
||||
* $Id: asenet.cpp,v 1.1 2007/05/15 08:29:30 bacon Exp $
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "asenet.h"
|
||||
|
@ -1,15 +0,0 @@
|
||||
/*
|
||||
* $Id: asenet.h,v 1.1 2007/05/15 08:29:30 bacon Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
using namespace System;
|
||||
|
||||
namespace ASE
|
||||
{
|
||||
namespace NET
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,242 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="asenet"
|
||||
ProjectGUID="{4CBF0E86-D018-49D7-A6B8-0CDA698203F7}"
|
||||
RootNamespace="asenet"
|
||||
Keyword="ManagedCProj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)\lib"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
ManagedExtensions="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(NoInherit)"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
AssemblyDebug="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)\lib"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
ManagedExtensions="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(NoInherit)"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
<AssemblyReference
|
||||
RelativePath="System.dll"
|
||||
AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
|
||||
/>
|
||||
<AssemblyReference
|
||||
RelativePath="System.Data.dll"
|
||||
AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
|
||||
/>
|
||||
<AssemblyReference
|
||||
RelativePath="System.XML.dll"
|
||||
AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
|
||||
/>
|
||||
</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=".\AssemblyInfo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Stdafx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\app.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\app.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* $Id: assert.cpp,v 1.1 2007/07/15 16:31:59 bacon Exp $
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
#include <ase/cmn/types.h>
|
||||
#include <ase/cmn/macros.h>
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <tchar.h>
|
||||
|
||||
void ase_assert_abort (void)
|
||||
{
|
||||
::abort ();
|
||||
}
|
||||
|
||||
void ase_assert_printf (const ase_char_t* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
#ifdef _WIN32
|
||||
int n;
|
||||
ase_char_t buf[1024];
|
||||
#endif
|
||||
|
||||
va_start (ap, fmt);
|
||||
|
||||
n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap);
|
||||
if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0');
|
||||
|
||||
//ase_vprintf (fmt, ap);
|
||||
::MessageBox (NULL, buf,
|
||||
ASE_T("ASSERTION FAILURE"), MB_OK|MB_ICONERROR);
|
||||
|
||||
va_end (ap);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* $Id: misc.cpp,v 1.1 2007/07/20 09:23:37 bacon Exp $
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "misc.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
#include <ase/cmn/types.h>
|
||||
#include <ase/cmn/macros.h>
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#pragma warning(disable:4996)
|
||||
#pragma unmanaged
|
||||
|
||||
void ase_assert_abort (void)
|
||||
{
|
||||
::abort ();
|
||||
}
|
||||
|
||||
void ase_assert_printf (const ase_char_t* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
#ifdef _WIN32
|
||||
int n;
|
||||
ase_char_t buf[1024];
|
||||
#endif
|
||||
|
||||
va_start (ap, fmt);
|
||||
|
||||
n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap);
|
||||
if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0');
|
||||
|
||||
//ase_vprintf (fmt, ap);
|
||||
::MessageBox (NULL, buf,
|
||||
ASE_T("ASSERTION FAILURE"), MB_OK|MB_ICONERROR);
|
||||
|
||||
va_end (ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
char* unicode_to_multibyte (const wchar_t* in, int inlen, int* outlen)
|
||||
{
|
||||
int n;
|
||||
n = WideCharToMultiByte (CP_UTF8, 0, in, inlen, NULL, 0, NULL, 0);
|
||||
|
||||
char* ptr = (char*)::malloc (sizeof(char)*n);
|
||||
if (ptr == NULL) return NULL;
|
||||
|
||||
*outlen = WideCharToMultiByte (CP_UTF8, 0, in, inlen, ptr, n, NULL, 0);
|
||||
return ptr;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* $Id: misc.h,v 1.1 2007/07/20 09:23:37 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MISC_H_
|
||||
#define _MISC_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char* unicode_to_multibyte (const wchar_t* in, int inlen, int* outlen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by app.rc
|
Reference in New Issue
Block a user