From 0f87fb5842be03e00add738e62c32168b5660fb8 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 16 Jul 2007 20:16:00 +0000 Subject: [PATCH] Recovered from cvs revision 2007-07-16 11:12:00 --- ase/ase.sln | 34 ++--- ase/awk/Awk.cpp | 4 +- ase/awk/Awk.hpp | 5 +- ase/awk/StdAwk.cpp | 64 ++++++---- ase/awk/StdAwk.hpp | 44 ++++--- ase/net/Awk.cpp | 53 ++++++-- ase/net/Awk.hpp | 38 +++++- ase/net/StdAwk.cpp | 15 +++ ase/net/StdAwk.hpp | 16 +++ ase/net/asenet.h | 4 +- ase/net/asenet.vcproj | 14 +- ase/net/assert.cpp | 40 ++++++ ase/test/awk/Awk.cpp | 5 +- ase/test/net/Form1.Designer.cs | 61 +++++++++ ase/test/net/Form1.cs | 23 ++++ ase/test/net/Form1.resx | 120 ++++++++++++++++++ ase/test/net/Program.cs | 20 +++ ase/test/net/Properties/AssemblyInfo.cs | 33 +++++ ase/test/net/Properties/Resources.Designer.cs | 71 +++++++++++ ase/test/net/Properties/Resources.resx | 117 +++++++++++++++++ ase/test/net/Properties/Settings.Designer.cs | 30 +++++ ase/test/net/Properties/Settings.settings | 7 + ase/test/net/asetestnet.csproj | 84 ++++++++++++ 23 files changed, 818 insertions(+), 84 deletions(-) create mode 100644 ase/net/StdAwk.cpp create mode 100644 ase/net/StdAwk.hpp create mode 100644 ase/net/assert.cpp create mode 100644 ase/test/net/Form1.Designer.cs create mode 100644 ase/test/net/Form1.cs create mode 100644 ase/test/net/Form1.resx create mode 100644 ase/test/net/Program.cs create mode 100644 ase/test/net/Properties/AssemblyInfo.cs create mode 100644 ase/test/net/Properties/Resources.Designer.cs create mode 100644 ase/test/net/Properties/Resources.resx create mode 100644 ase/test/net/Properties/Settings.Designer.cs create mode 100644 ase/test/net/Properties/Settings.settings create mode 100644 ase/test/net/asetestnet.csproj diff --git a/ase/ase.sln b/ase/ase.sln index 210d51f0..3e815a65 100644 --- a/ase/ase.sln +++ b/ase/ase.sln @@ -50,6 +50,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestawk++", "test\awk\as {57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F} = {57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asenet", "net\asenet.vcproj", "{A63E9DF9-1D47-4D81-834C-1D40406C18C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asetestnet", "test\net\asetestnet.csproj", "{7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -140,26 +144,6 @@ Global {868702B0-CB6B-4F1D-B98A-32193347EFAF}.Release|Mixed Platforms.Build.0 = Release|Win32 {868702B0-CB6B-4F1D-B98A-32193347EFAF}.Release|Win32.ActiveCfg = Release|Win32 {868702B0-CB6B-4F1D-B98A-32193347EFAF}.Release|Win32.Build.0 = Release|Win32 - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Debug|Win32.ActiveCfg = Debug|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Release|Any CPU.Build.0 = Release|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F14B75D8-3ED7-4621-B5B9-E96A80B5D809}.Release|Win32.ActiveCfg = Release|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Debug|Win32.ActiveCfg = Debug|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Release|Any CPU.Build.0 = Release|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {7F679165-41FB-4E1E-B3F5-23C5EE94166A}.Release|Win32.ActiveCfg = Release|Any CPU {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}.Debug|Any CPU.ActiveCfg = Debug|Win32 {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 @@ -190,6 +174,16 @@ Global {A63E9DF9-1D47-4D81-834C-1D40406C18C4}.Release|Mixed Platforms.Build.0 = Release|Win32 {A63E9DF9-1D47-4D81-834C-1D40406C18C4}.Release|Win32.ActiveCfg = Release|Win32 {A63E9DF9-1D47-4D81-834C-1D40406C18C4}.Release|Win32.Build.0 = Release|Win32 + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Debug|Win32.ActiveCfg = Debug|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Release|Any CPU.Build.0 = Release|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}.Release|Win32.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ase/awk/Awk.cpp b/ase/awk/Awk.cpp index c54d74a7..2b586c6a 100644 --- a/ase/awk/Awk.cpp +++ b/ase/awk/Awk.cpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.cpp,v 1.45 2007/06/28 15:45:57 bacon Exp $ + * $Id: Awk.cpp,v 1.46 2007/07/15 16:31:59 bacon Exp $ */ #include @@ -734,7 +734,7 @@ namespace ASE } Return ret (run); - int n = (this->*handler) (&ret, args, nargs); + int n = (this->*handler) (&ret, args, nargs, name, len); delete[] args; diff --git a/ase/awk/Awk.hpp b/ase/awk/Awk.hpp index ab23da67..1e888d26 100644 --- a/ase/awk/Awk.hpp +++ b/ase/awk/Awk.hpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.hpp,v 1.44 2007/06/29 11:36:45 bacon Exp $ + * $Id: Awk.hpp,v 1.45 2007/07/15 16:31:59 bacon Exp $ */ #ifndef _ASE_AWK_AWK_HPP_ @@ -429,7 +429,8 @@ namespace ASE const char_t** args = ASE_NULL, size_t nargs = 0); typedef int (Awk::*FunctionHandler) ( - Return* ret, const Argument* args, size_t nargs); + Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); virtual int addFunction ( const char_t* name, size_t minArgs, size_t maxArgs, diff --git a/ase/awk/StdAwk.cpp b/ase/awk/StdAwk.cpp index ec81d886..a3e05524 100644 --- a/ase/awk/StdAwk.cpp +++ b/ase/awk/StdAwk.cpp @@ -1,5 +1,5 @@ /* - * $Id: StdAwk.cpp,v 1.21 2007/05/23 14:15:16 bacon Exp $ + * $Id: StdAwk.cpp,v 1.22 2007/07/15 16:31:59 bacon Exp $ */ #include @@ -59,52 +59,62 @@ namespace ASE return 0; } - int StdAwk::sin (Return* ret, const Argument* args, size_t nargs) + int StdAwk::sin (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::sin(args[0].toReal())); } - int StdAwk::cos (Return* ret, const Argument* args, size_t nargs) + int StdAwk::cos (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::cos(args[0].toReal())); } - int StdAwk::tan (Return* ret, const Argument* args, size_t nargs) + int StdAwk::tan (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::tan(args[0].toReal())); } - int StdAwk::atan2 (Return* ret, const Argument* args, size_t nargs) + int StdAwk::atan2 (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::atan2(args[0].toReal(), args[1].toReal())); } - int StdAwk::log (Return* ret, const Argument* args, size_t nargs) + int StdAwk::log (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::log(args[0].toReal())); } - int StdAwk::exp (Return* ret, const Argument* args, size_t nargs) + int StdAwk::exp (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::exp(args[0].toReal())); } - int StdAwk::sqrt (Return* ret, const Argument* args, size_t nargs) + int StdAwk::sqrt (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((real_t)::sqrt(args[0].toReal())); } - int StdAwk::fnint (Return* ret, const Argument* args, size_t nargs) + int StdAwk::fnint (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set (args[0].toInt()); } - int StdAwk::rand (Return* ret, const Argument* args, size_t nargs) + int StdAwk::rand (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((long_t)::rand()); } - int StdAwk::srand (Return* ret, const Argument* args, size_t nargs) + int StdAwk::srand (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { unsigned int prevSeed = seed; seed = (unsigned int)args[0].toInt(); @@ -112,12 +122,14 @@ namespace ASE return ret->set ((long_t)prevSeed); } - int StdAwk::systime (Return* ret, const Argument* args, size_t nargs) + int StdAwk::systime (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { return ret->set ((long_t)::time(NULL)); } - int StdAwk::strftime (Return* ret, const Argument* args, size_t nargs) + int StdAwk::strftime (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { const char_t* fmt; size_t fln; @@ -135,15 +147,16 @@ namespace ASE #endif #ifdef ASE_CHAR_IS_MCHAR - size_t len = ::strftime (buf, ASE_COUNTOF(buf), fmt, tm); + size_t l = ::strftime (buf, ASE_COUNTOF(buf), fmt, tm); #else - size_t len = ::wcsftime (buf, ASE_COUNTOF(buf), fmt, tm); + size_t l = ::wcsftime (buf, ASE_COUNTOF(buf), fmt, tm); #endif - return ret->set (buf, len); + return ret->set (buf, l); } - int StdAwk::strfgmtime (Return* ret, const Argument* args, size_t nargs) + int StdAwk::strfgmtime (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { const char_t* fmt; size_t fln; @@ -161,28 +174,29 @@ namespace ASE #endif #ifdef ASE_CHAR_IS_MCHAR - size_t len = ::strftime (buf, ASE_COUNTOF(buf), fmt, tm); + size_t l = ::strftime (buf, ASE_COUNTOF(buf), fmt, tm); #else - size_t len = ::wcsftime (buf, ASE_COUNTOF(buf), fmt, tm); + size_t l = ::wcsftime (buf, ASE_COUNTOF(buf), fmt, tm); #endif - return ret->set (buf, len); + return ret->set (buf, l); } - int StdAwk::system (Return* ret, const Argument* args, size_t nargs) + int StdAwk::system (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { - size_t len; - const char_t* ptr = args[0].toStr(&len); + size_t l; + const char_t* ptr = args[0].toStr(&l); #ifdef _WIN32 return ret->set ((long_t)::_tsystem(ptr)); #elif defined(ASE_CHAR_IS_MCHAR) return ret->set ((long_t)::system(ptr)); #else - char* mbs = (char*)ase_awk_malloc (awk, len*5+1); + char* mbs = (char*)ase_awk_malloc (awk, l*5+1); if (mbs == ASE_NULL) return -1; - ::size_t mbl = ::wcstombs (mbs, ptr, len*5); + ::size_t mbl = ::wcstombs (mbs, ptr, l*5); if (mbl == (::size_t)-1) return -1; mbs[mbl] = '\0'; int n = ret->set ((long_t)::system(mbs)); diff --git a/ase/awk/StdAwk.hpp b/ase/awk/StdAwk.hpp index 3cd5231e..ccfcebd5 100644 --- a/ase/awk/StdAwk.hpp +++ b/ase/awk/StdAwk.hpp @@ -1,5 +1,5 @@ /* - * $Id: StdAwk.hpp,v 1.11 2007/05/23 14:15:16 bacon Exp $ + * $Id: StdAwk.hpp,v 1.12 2007/07/15 16:31:59 bacon Exp $ */ #ifndef _ASE_AWK_STDAWK_HPP_ @@ -19,20 +19,34 @@ namespace ASE protected: // builtin functions - int sin (Return* ret, const Argument* args, size_t nargs); - int cos (Return* ret, const Argument* args, size_t nargs); - int tan (Return* ret, const Argument* args, size_t nargs); - int atan2 (Return* ret, const Argument* args, size_t nargs); - int log (Return* ret, const Argument* args, size_t nargs); - int exp (Return* ret, const Argument* args, size_t nargs); - int sqrt (Return* ret, const Argument* args, size_t nargs); - int fnint (Return* ret, const Argument* args, size_t nargs); - int rand (Return* ret, const Argument* args, size_t nargs); - int srand (Return* ret, const Argument* args, size_t nargs); - int systime (Return* ret, const Argument* args, size_t nargs); - int strftime (Return* ret, const Argument* args, size_t nargs); - int strfgmtime (Return* ret, const Argument* args, size_t nargs); - int system (Return* ret, const Argument* args, size_t nargs); + int sin (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int cos (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int tan (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int atan2 (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int log (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int exp (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int sqrt (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int fnint (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int rand (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int srand (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int systime (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int strftime (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int strfgmtime (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); + int system (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len); // pipe io handlers int openPipe (Pipe& io); diff --git a/ase/net/Awk.cpp b/ase/net/Awk.cpp index 54dc421a..8b657a67 100644 --- a/ase/net/Awk.cpp +++ b/ase/net/Awk.cpp @@ -1,5 +1,5 @@ /* -* $Id: Awk.cpp,v 1.2 2007/07/09 16:07:30 bacon Exp $ +* $Id: Awk.cpp,v 1.3 2007/07/15 16:31:59 bacon Exp $ */ #include "stdafx.h" @@ -12,37 +12,57 @@ #include - namespace ASE { - class StubAwk: public Awk { public: - StubAwk (NET::Awk^ wrapper): wrapper(wrapper) + StubAwk (Net::Awk^ wrapper): wrapper(wrapper) { } + int stubFunctionHandler ( + Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) + { + System::String^ nm = gcnew System::String (name, 0, len); + return wrapper->DispatchFunction (nm); + } + int openSource (Source& io) { - NET::Awk::Source^ nio = gcnew NET::Awk::Source (); + /* + Net::Awk::Source^ nio = gcnew Net::Awk::Source (); int n = wrapper->OpenSource (nio); - // TODO: put nio back to io. return n; + */ + if (io.getMode() == Source::READ) + { + //wrapper->SourceInputStream->BeginRead (); + } + else + { + //wrapper->SourceOutputStream->BeginWrite (); + } + return 1; } int closeSource (Source& io) { + //System::IO::Stream^ stream = io.getHandle(); + //stream->Close (); return 0; } ssize_t readSource (Source& io, char_t* buf, size_t len) { + //System::IO::Stream^ stream = io.getHandle(); return 0; } ssize_t writeSource (Source& io, char_t* buf, size_t len) { + //System::IO::Stream^ stream = io.getHandle(); return 0; } @@ -100,10 +120,10 @@ namespace ASE } private: - msclr::auto_gcroot wrapper; + msclr::auto_gcroot wrapper; }; - namespace NET + namespace Net { Awk::Awk () @@ -126,14 +146,25 @@ namespace ASE return awk->run () == 0; } - bool Awk::AddFunction (System::String^ name, int minArgs, int maxArgs, FunctionHandler^ handler) + bool Awk::AddFunction ( + System::String^ name, int minArgs, int maxArgs, + FunctionHandler^ handler) { - return false; + cli::pin_ptr nptr = PtrToStringChars(name); + return awk->addFunction (nptr, minArgs, maxArgs, + (ASE::Awk::FunctionHandler)&StubAwk::stubFunctionHandler) == 0; } bool Awk::DeleteFunction (System::String^ name) { - return false; + pin_ptr nptr = PtrToStringChars(name); + return awk->deleteFunction (nptr) == 0; + } + + int Awk::DispatchFunction (System::String^ name) + { + return 0; } } } + diff --git a/ase/net/Awk.hpp b/ase/net/Awk.hpp index 9689b26b..cb62f9c3 100644 --- a/ase/net/Awk.hpp +++ b/ase/net/Awk.hpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.hpp,v 1.1 2007/05/15 08:29:30 bacon Exp $ + * $Id: Awk.hpp,v 1.2 2007/07/15 16:31:59 bacon Exp $ */ #pragma once @@ -10,13 +10,12 @@ using namespace System; namespace ASE { - namespace NET + namespace Net { public ref class Awk abstract { public: - ref class Source { public: @@ -115,8 +114,39 @@ namespace ASE 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: + property System::IO::Stream^ SourceInputStream + { + System::IO::Stream^ get () + { + return this->sourceInputStream; + } + + void set (System::IO::Stream^ stream) + { + this->sourceInputStream = stream; + } + } + + property System::IO::Stream^ SourceOutputStream + { + System::IO::Stream^ get () + { + return this->sourceOutputStream; + } + + void set (System::IO::Stream^ stream) + { + this->sourceOutputStream = stream; + } + } + + protected: ASE::Awk* awk; + System::IO::Stream^ sourceInputStream; + System::IO::Stream^ sourceOutputStream; + + public protected: + int Awk::DispatchFunction (System::String^ name); }; } diff --git a/ase/net/StdAwk.cpp b/ase/net/StdAwk.cpp new file mode 100644 index 00000000..9c4d5a54 --- /dev/null +++ b/ase/net/StdAwk.cpp @@ -0,0 +1,15 @@ +/* + * $Id: StdAwk.cpp,v 1.1 2007/07/15 16:31:59 bacon Exp $ + */ + +#include "stdafx.h" + +#include + +namespace ASE +{ + namespace Net + { + + } +} \ No newline at end of file diff --git a/ase/net/StdAwk.hpp b/ase/net/StdAwk.hpp new file mode 100644 index 00000000..aab5b87c --- /dev/null +++ b/ase/net/StdAwk.hpp @@ -0,0 +1,16 @@ +/* + * $Id: StdAwk.hpp,v 1.1 2007/07/15 16:31:59 bacon Exp $ + */ + +#include + +namespace ASE +{ + namespace Net + { + public ref class StdAwk: Awk + { + public: + }; + } +} \ No newline at end of file diff --git a/ase/net/asenet.h b/ase/net/asenet.h index 42f2954b..4b385f7f 100644 --- a/ase/net/asenet.h +++ b/ase/net/asenet.h @@ -1,5 +1,5 @@ /* - * $Id: asenet.h,v 1.1 2007/05/15 08:29:30 bacon Exp $ + * $Id: asenet.h,v 1.2 2007/07/15 16:31:59 bacon Exp $ */ #pragma once @@ -8,7 +8,7 @@ using namespace System; namespace ASE { - namespace NET + namespace Net { } diff --git a/ase/net/asenet.vcproj b/ase/net/asenet.vcproj index 00ac650e..d0a146e6 100644 --- a/ase/net/asenet.vcproj +++ b/ase/net/asenet.vcproj @@ -59,7 +59,7 @@ /> + + @@ -219,6 +223,10 @@ /> + + + + +#include +#include +#include +#include + +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 + diff --git a/ase/test/awk/Awk.cpp b/ase/test/awk/Awk.cpp index bc0d7536..56f98689 100644 --- a/ase/test/awk/Awk.cpp +++ b/ase/test/awk/Awk.cpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.cpp,v 1.29 2007/06/25 14:01:28 bacon Exp $ + * $Id: Awk.cpp,v 1.30 2007/07/15 16:31:59 bacon Exp $ */ #include @@ -82,7 +82,8 @@ public: #endif } - int sleep (Return* ret, const Argument* args, size_t nargs) + int sleep (Return* ret, const Argument* args, size_t nargs, + const char_t* name, size_t len) { #ifdef _WIN32 ::Sleep (args[0].toInt() * 1000); diff --git a/ase/test/net/Form1.Designer.cs b/ase/test/net/Form1.Designer.cs new file mode 100644 index 00000000..e5cb8dee --- /dev/null +++ b/ase/test/net/Form1.Designer.cs @@ -0,0 +1,61 @@ +namespace asetestnet +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(56, 54); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(71, 25); + this.button1.TabIndex = 0; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 273); + this.Controls.Add(this.button1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + } +} + diff --git a/ase/test/net/Form1.cs b/ase/test/net/Form1.cs new file mode 100644 index 00000000..de8a6f0d --- /dev/null +++ b/ase/test/net/Form1.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace asetestnet +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + ASE.Net.Awk awk = new ASE.Net.Awk(); + } + } +} \ No newline at end of file diff --git a/ase/test/net/Form1.resx b/ase/test/net/Form1.resx new file mode 100644 index 00000000..19dc0dd8 --- /dev/null +++ b/ase/test/net/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ase/test/net/Program.cs b/ase/test/net/Program.cs new file mode 100644 index 00000000..0071019a --- /dev/null +++ b/ase/test/net/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace asetestnet +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/ase/test/net/Properties/AssemblyInfo.cs b/ase/test/net/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..413821b7 --- /dev/null +++ b/ase/test/net/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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: AssemblyTitle("asetestnet")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("asetestnet")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ceaa9e15-13fb-4248-a906-14965d5019c3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ase/test/net/Properties/Resources.Designer.cs b/ase/test/net/Properties/Resources.Designer.cs new file mode 100644 index 00000000..f194ccb2 --- /dev/null +++ b/ase/test/net/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace asetestnet.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("asetestnet.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/ase/test/net/Properties/Resources.resx b/ase/test/net/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/ase/test/net/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ase/test/net/Properties/Settings.Designer.cs b/ase/test/net/Properties/Settings.Designer.cs new file mode 100644 index 00000000..e08b87de --- /dev/null +++ b/ase/test/net/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace asetestnet.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/ase/test/net/Properties/Settings.settings b/ase/test/net/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/ase/test/net/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ase/test/net/asetestnet.csproj b/ase/test/net/asetestnet.csproj new file mode 100644 index 00000000..703e77de --- /dev/null +++ b/ase/test/net/asetestnet.csproj @@ -0,0 +1,84 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {7CC01C3D-FC1A-4587-868A-7FC4449B3F8B} + WinExe + Properties + asetestnet + asetestnet + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + Form + + + Form1.cs + + + + + Designer + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {A63E9DF9-1D47-4D81-834C-1D40406C18C4} + asenet + + + + + \ No newline at end of file