Recovered from cvs revision 2007-07-21 04:14:00

This commit is contained in:
hyung-hwan 2007-07-25 18:53:00 +00:00
parent f263c4f96f
commit 21550f9acf
24 changed files with 532 additions and 340 deletions

View File

@ -12,20 +12,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk", "awk\aseawk.vcproj
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk_jni", "awk\aseawk_jni.vcproj", "{23B58791-FD44-4F95-9F77-34E4AF45A296}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk_jni", "awk\aseawk_jni.vcproj", "{23B58791-FD44-4F95-9F77-34E4AF45A296}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{17621C83-40C9-4305-BAF9-132E250B5FE3} = {17621C83-40C9-4305-BAF9-132E250B5FE3}
{5F2E77D5-1485-48D1-9371-987BC55FEE83} = {5F2E77D5-1485-48D1-9371-987BC55FEE83} {5F2E77D5-1485-48D1-9371-987BC55FEE83} = {5F2E77D5-1485-48D1-9371-987BC55FEE83}
{17621C83-40C9-4305-BAF9-132E250B5FE3} = {17621C83-40C9-4305-BAF9-132E250B5FE3}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asecom", "com\asecom.vcproj", "{963AF7B5-12E6-42B6-8CBE-89136C1A109B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asecom", "com\asecom.vcproj", "{963AF7B5-12E6-42B6-8CBE-89136C1A109B}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
{5F2E77D5-1485-48D1-9371-987BC55FEE83} = {5F2E77D5-1485-48D1-9371-987BC55FEE83} {5F2E77D5-1485-48D1-9371-987BC55FEE83} = {5F2E77D5-1485-48D1-9371-987BC55FEE83}
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestawk", "test\awk\asetestawk.vcproj", "{57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestawk", "test\awk\asetestawk.vcproj", "{57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
{5F2E77D5-1485-48D1-9371-987BC55FEE83} = {5F2E77D5-1485-48D1-9371-987BC55FEE83} {5F2E77D5-1485-48D1-9371-987BC55FEE83} = {5F2E77D5-1485-48D1-9371-987BC55FEE83}
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aselsp", "lsp\aselsp.vcproj", "{42FE7CED-34B7-45C8-92C9-8856E16640D2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aselsp", "lsp\aselsp.vcproj", "{42FE7CED-34B7-45C8-92C9-8856E16640D2}"
@ -35,8 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aselsp", "lsp\aselsp.vcproj
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestlsp", "test\lsp\asetestlsp.vcproj", "{868702B0-CB6B-4F1D-B98A-32193347EFAF}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestlsp", "test\lsp\asetestlsp.vcproj", "{868702B0-CB6B-4F1D-B98A-32193347EFAF}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
{42FE7CED-34B7-45C8-92C9-8856E16640D2} = {42FE7CED-34B7-45C8-92C9-8856E16640D2} {42FE7CED-34B7-45C8-92C9-8856E16640D2} = {42FE7CED-34B7-45C8-92C9-8856E16640D2}
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk++", "awk\aseawk++.vcproj", "{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk++", "awk\aseawk++.vcproj", "{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}"
@ -46,11 +46,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk++", "awk\aseawk++.vc
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestawk++", "test\awk\asetestawk++.vcproj", "{3BEA6CFE-C158-4BFB-B5FB-ED85251E3F98}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asetestawk++", "test\awk\asetestawk++.vcproj", "{3BEA6CFE-C158-4BFB-B5FB-ED85251E3F98}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} = {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}
{57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F} = {57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F} {57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F} = {57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F}
{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} = {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asenet", "net\asenet.vcproj", "{A63E9DF9-1D47-4D81-834C-1D40406C18C4}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asenet", "net\asenet.vcproj", "{A63E9DF9-1D47-4D81-834C-1D40406C18C4}"
ProjectSection(ProjectDependencies) = postProject
{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} = {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}
EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asetestnet", "test\net\asetestnet.csproj", "{7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asetestnet", "test\net\asetestnet.csproj", "{7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}"
EndProject EndProject

View File

@ -46,7 +46,7 @@
PreprocessorDefinitions="_DEBUG;WIN32" PreprocessorDefinitions="_DEBUG;WIN32"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
DisableLanguageExtensions="true" DisableLanguageExtensions="true"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"

View File

@ -117,7 +117,7 @@
PreprocessorDefinitions="_DEBUG;WIN32" PreprocessorDefinitions="_DEBUG;WIN32"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
DisableLanguageExtensions="true" DisableLanguageExtensions="true"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"

View File

@ -148,7 +148,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
PrecompiledHeaderFile=".\debug/aseawk_jni.pch" PrecompiledHeaderFile=".\debug/aseawk_jni.pch"
AssemblerListingLocation=".\debug/" AssemblerListingLocation=".\debug/"
ObjectFile=".\debug/" ObjectFile=".\debug/"

View File

@ -1,5 +1,5 @@
/* /*
* $Id: parse.c,v 1.11 2007/06/29 11:36:45 bacon Exp $ * $Id: parse.c,v 1.12 2007/07/20 09:23:37 bacon Exp $
* *
* {License} * {License}
*/ */
@ -582,6 +582,12 @@ static ase_awk_t* parse_progunit (ase_awk_t* awk)
} }
else if (MATCH(awk,TOKEN_BEGIN)) else if (MATCH(awk,TOKEN_BEGIN))
{ {
if (awk->tree.begin != ASE_NULL)
{
SETERRLIN (awk, ASE_AWK_EDUPBEG, awk->token.prev.line);
return ASE_NULL;
}
awk->parse.id.block = PARSE_BEGIN; awk->parse.id.block = PARSE_BEGIN;
if (get_token(awk) == -1) return ASE_NULL; if (get_token(awk) == -1) return ASE_NULL;
@ -605,6 +611,12 @@ static ase_awk_t* parse_progunit (ase_awk_t* awk)
} }
else if (MATCH(awk,TOKEN_END)) else if (MATCH(awk,TOKEN_END))
{ {
if (awk->tree.end != ASE_NULL)
{
SETERRLIN (awk, ASE_AWK_EDUPEND, awk->token.prev.line);
return ASE_NULL;
}
awk->parse.id.block = PARSE_END; awk->parse.id.block = PARSE_END;
if (get_token(awk) == -1) return ASE_NULL; if (get_token(awk) == -1) return ASE_NULL;

View File

@ -46,7 +46,7 @@
PreprocessorDefinitions="_DEBUG;WIN32" PreprocessorDefinitions="_DEBUG;WIN32"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
DisableLanguageExtensions="true" DisableLanguageExtensions="true"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"

View File

@ -52,7 +52,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h" PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\debug/asecom.pch" PrecompiledHeaderFile=".\debug/asecom.pch"

View File

@ -115,7 +115,7 @@
PreprocessorDefinitions="_DEBUG;WIN32" PreprocessorDefinitions="_DEBUG;WIN32"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="4" DebugInformationFormat="4"

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.cpp,v 1.8 2007/07/19 14:35:10 bacon Exp $ * $Id: Awk.cpp,v 1.9 2007/07/20 09:23:37 bacon Exp $
*/ */
#include "stdafx.h" #include "stdafx.h"
@ -48,8 +48,8 @@ namespace ASE
} }
System::IO::StreamReader^ reader = gcnew System::IO::StreamReader (wrapper->SourceInputStream); System::IO::StreamReader^ reader = gcnew System::IO::StreamReader (wrapper->SourceInputStream);
System::Runtime::InteropServices::GCHandle gh = System::Runtime::InteropServices::GCHandle::Alloc (reader); GCHandle gh = GCHandle::Alloc (reader);
System::IntPtr^ ip = System::Runtime::InteropServices::GCHandle::ToIntPtr(gh); System::IntPtr^ ip = GCHandle::ToIntPtr(gh);
io.setHandle (ip->ToPointer()); io.setHandle (ip->ToPointer());
} }
else else
@ -66,8 +66,8 @@ namespace ASE
} }
System::IO::StreamWriter^ writer = gcnew System::IO::StreamWriter (wrapper->SourceOutputStream); System::IO::StreamWriter^ writer = gcnew System::IO::StreamWriter (wrapper->SourceOutputStream);
System::Runtime::InteropServices::GCHandle gh = System::Runtime::InteropServices::GCHandle::Alloc (writer); GCHandle gh = GCHandle::Alloc (writer);
System::IntPtr^ ip = System::Runtime::InteropServices::GCHandle::ToIntPtr(gh); System::IntPtr^ ip = GCHandle::ToIntPtr(gh);
io.setHandle (ip->ToPointer()); io.setHandle (ip->ToPointer());
} }
@ -77,7 +77,7 @@ namespace ASE
int closeSource (Source& io) int closeSource (Source& io)
{ {
System::IntPtr ip ((void*)io.getHandle()); System::IntPtr ip ((void*)io.getHandle());
System::Runtime::InteropServices::GCHandle gh = System::Runtime::InteropServices::GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
if (io.getMode() == Source::READ) if (io.getMode() == Source::READ)
{ {
@ -97,7 +97,7 @@ namespace ASE
ssize_t readSource (Source& io, char_t* buf, size_t len) ssize_t readSource (Source& io, char_t* buf, size_t len)
{ {
System::IntPtr ip ((void*)io.getHandle()); System::IntPtr ip ((void*)io.getHandle());
System::Runtime::InteropServices::GCHandle gh = System::Runtime::InteropServices::GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
System::IO::StreamReader^ reader = (System::IO::StreamReader^)gh.Target; System::IO::StreamReader^ reader = (System::IO::StreamReader^)gh.Target;
@ -111,7 +111,7 @@ namespace ASE
ssize_t writeSource (Source& io, char_t* buf, size_t len) ssize_t writeSource (Source& io, char_t* buf, size_t len)
{ {
System::IntPtr ip ((void*)io.getHandle()); System::IntPtr ip ((void*)io.getHandle());
System::Runtime::InteropServices::GCHandle gh = System::Runtime::InteropServices::GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
System::IO::StreamWriter^ writer = (System::IO::StreamWriter^)gh.Target; System::IO::StreamWriter^ writer = (System::IO::StreamWriter^)gh.Target;
@ -131,16 +131,28 @@ namespace ASE
GCHandle gh = GCHandle::Alloc (nio); GCHandle gh = GCHandle::Alloc (nio);
io.setHandle (GCHandle::ToIntPtr(gh).ToPointer()); io.setHandle (GCHandle::ToIntPtr(gh).ToPointer());
return wrapper->FireOpenPipe (nio); try { return wrapper->OpenPipe (nio); }
catch (...)
{
gh.Free ();
io.setHandle (NULL);
return -1;
}
} }
int closePipe (Pipe& io) int closePipe (Pipe& io)
{ {
IntPtr ip ((void*)io.getHandle ()); IntPtr ip ((void*)io.getHandle ());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
int n = wrapper->FireClosePipe ((ASE::Net::Awk::Pipe^)gh.Target);
gh.Free (); try
return n; {
return wrapper->ClosePipe (
(ASE::Net::Awk::Pipe^)gh.Target);
}
catch (...) { return -1; }
finally { gh.Free (); }
} }
ssize_t readPipe (Pipe& io, char_t* buf, size_t len) ssize_t readPipe (Pipe& io, char_t* buf, size_t len)
@ -148,26 +160,48 @@ namespace ASE
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
cli::array<char_t>^ b = gcnew cli::array<char_t> (len); cli::array<char_t>^ b = nullptr;
int n = wrapper->FireReadPipe ((ASE::Net::Awk::Pipe^)gh.Target, b, len);
for (int i = 0; i < n; i++) buf[i] = b[i]; try
return n; {
b = gcnew cli::array<char_t> (len);
int n = wrapper->ReadPipe (
(ASE::Net::Awk::Pipe^)gh.Target, b, len);
for (int i = 0; i < n; i++) buf[i] = b[i];
return n;
}
catch (...) { return -1; }
finally { if (b != nullptr) delete b; }
} }
ssize_t writePipe (Pipe& io, char_t* buf, size_t len) ssize_t writePipe (Pipe& io, char_t* buf, size_t len)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
cli::array<char_t>^ b = gcnew cli::array<char_t> (len);
for (int i = 0; i < len; i++) b[i] = buf[i]; cli::array<char_t>^ b = nullptr;
return wrapper->FireWritePipe ((ASE::Net::Awk::Pipe^)gh.Target, b, len); try
{
b = gcnew cli::array<char_t> (len);
for (int i = 0; i < len; i++) b[i] = buf[i];
return wrapper->WritePipe (
(ASE::Net::Awk::Pipe^)gh.Target, b, len);
}
catch (...) { return -1; }
finally { if (b != nullptr) delete b; }
} }
int flushPipe (Pipe& io) int flushPipe (Pipe& io)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
return wrapper->FireFlushPipe ((ASE::Net::Awk::Pipe^)gh.Target);
try
{
return wrapper->FlushPipe (
(ASE::Net::Awk::Pipe^)gh.Target);
}
catch (...) { return -1; }
} }
int openFile (File& io) int openFile (File& io)
@ -179,16 +213,27 @@ namespace ASE
GCHandle gh = GCHandle::Alloc (nio); GCHandle gh = GCHandle::Alloc (nio);
io.setHandle (GCHandle::ToIntPtr(gh).ToPointer()); io.setHandle (GCHandle::ToIntPtr(gh).ToPointer());
return wrapper->FireOpenFile (nio); try { return wrapper->OpenFile (nio); }
catch (...)
{
gh.Free ();
io.setHandle (NULL);
return -1;
}
} }
int closeFile (File& io) int closeFile (File& io)
{ {
IntPtr ip ((void*)io.getHandle ()); IntPtr ip ((void*)io.getHandle ());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
int n = wrapper->FireCloseFile ((ASE::Net::Awk::File^)gh.Target);
gh.Free (); try
return n; {
return wrapper->CloseFile (
(ASE::Net::Awk::File^)gh.Target);
}
catch (...) { return -1; }
finally { gh.Free (); }
} }
ssize_t readFile (File& io, char_t* buf, size_t len) ssize_t readFile (File& io, char_t* buf, size_t len)
@ -196,26 +241,47 @@ namespace ASE
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
cli::array<char_t>^ b = gcnew cli::array<char_t> (len); cli::array<char_t>^ b = nullptr;
int n = wrapper->FireReadFile ((ASE::Net::Awk::File^)gh.Target, b, len); try
for (int i = 0; i < n; i++) buf[i] = b[i]; {
return n; b = gcnew cli::array<char_t> (len);
int n = wrapper->ReadFile (
(ASE::Net::Awk::File^)gh.Target, b, len);
for (int i = 0; i < n; i++) buf[i] = b[i];
return n;
}
catch (...) { return -1; }
finally { if (b != nullptr) delete b; }
} }
ssize_t writeFile (File& io, char_t* buf, size_t len) ssize_t writeFile (File& io, char_t* buf, size_t len)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
cli::array<char_t>^ b = gcnew cli::array<char_t> (len);
for (int i = 0; i < len; i++) b[i] = buf[i]; cli::array<char_t>^ b = nullptr;
return wrapper->FireWriteFile ((ASE::Net::Awk::File^)gh.Target, b, len); try
{
b = gcnew cli::array<char_t> (len);
for (int i = 0; i < len; i++) b[i] = buf[i];
return wrapper->WriteFile (
(ASE::Net::Awk::File^)gh.Target, b, len);
}
catch (...) { return -1; }
finally { if (b != nullptr) delete b; }
} }
int flushFile (File& io) int flushFile (File& io)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
return wrapper->FireFlushFile ((ASE::Net::Awk::File^)gh.Target);
try
{
return wrapper->FlushFile (
(ASE::Net::Awk::File^)gh.Target);
}
catch (...) { return -1; }
} }
int openConsole (Console& io) int openConsole (Console& io)
@ -227,49 +293,88 @@ namespace ASE
GCHandle gh = GCHandle::Alloc (nio); GCHandle gh = GCHandle::Alloc (nio);
io.setHandle (GCHandle::ToIntPtr(gh).ToPointer()); io.setHandle (GCHandle::ToIntPtr(gh).ToPointer());
return wrapper->FireOpenConsole (nio); try { return wrapper->OpenConsole (nio); }
catch (...)
{
gh.Free ();
io.setHandle (NULL);
return -1;
}
} }
int closeConsole (Console& io) int closeConsole (Console& io)
{ {
IntPtr ip ((void*)io.getHandle ()); IntPtr ip ((void*)io.getHandle ());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
int n = wrapper->FireCloseConsole ((ASE::Net::Awk::Console^)gh.Target);
gh.Free (); try
return n; {
return wrapper->CloseConsole (
(ASE::Net::Awk::Console^)gh.Target);
}
catch (...) { return -1; }
finally { gh.Free (); }
} }
ssize_t readConsole (Console& io, char_t* buf, size_t len) ssize_t readConsole (Console& io, char_t* buf, size_t len)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
cli::array<char_t>^ b = gcnew cli::array<char_t> (len);
int n = wrapper->FireReadConsole ((ASE::Net::Awk::Console^)gh.Target, b, len); cli::array<char_t>^ b = nullptr;
for (int i = 0; i < n; i++) buf[i] = b[i]; try
return n; {
b = gcnew cli::array<char_t> (len);
int n = wrapper->ReadConsole (
(ASE::Net::Awk::Console^)gh.Target, b, len);
for (int i = 0; i < n; i++) buf[i] = b[i];
return n;
}
catch (...) { return -1; }
finally { if (b != nullptr) delete b; }
} }
ssize_t writeConsole (Console& io, char_t* buf, size_t len) ssize_t writeConsole (Console& io, char_t* buf, size_t len)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
cli::array<char_t>^ b = gcnew cli::array<char_t> (len);
for (int i = 0; i < len; i++) b[i] = buf[i]; cli::array<char_t>^ b = nullptr;
return wrapper->FireWriteConsole ((ASE::Net::Awk::Console^)gh.Target, b, len); try
{
b = gcnew cli::array<char_t> (len);
for (int i = 0; i < len; i++) b[i] = buf[i];
return wrapper->WriteConsole (
(ASE::Net::Awk::Console^)gh.Target, b, len);
}
catch (...) { return -1; }
finally { if (b != nullptr) delete b; }
} }
int flushConsole (Console& io) int flushConsole (Console& io)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
return wrapper->FireFlushConsole ((ASE::Net::Awk::Console^)gh.Target);
try
{
return wrapper->FlushConsole (
(ASE::Net::Awk::Console^)gh.Target);
}
catch (...) { return -1; }
} }
int nextConsole (Console& io) int nextConsole (Console& io)
{ {
IntPtr ip ((void*)io.getHandle()); IntPtr ip ((void*)io.getHandle());
GCHandle gh = GCHandle::FromIntPtr (ip); GCHandle gh = GCHandle::FromIntPtr (ip);
return wrapper->FireNextConsole ((ASE::Net::Awk::Console^)gh.Target);
try
{
return wrapper->NextConsole (
(ASE::Net::Awk::Console^)gh.Target);
}
catch (...) { return -1; }
} }
// primitive operations // primitive operations
@ -363,73 +468,6 @@ namespace ASE
return 0; return 0;
} }
int Awk::FireOpenFile (File^ file)
{
return OpenFileHandler (file);
}
int Awk::FireCloseFile (File^ file)
{
return CloseFileHandler (file);
}
int Awk::FireReadFile (File^ file, cli::array<char_t>^ buf, int len)
{
return ReadFileHandler (file, buf, len);
}
int Awk::FireWriteFile (File^ file, cli::array<char_t>^ buf, int len)
{
return WriteFileHandler (file, buf, len);
}
int Awk::FireFlushFile (File^ file)
{
return FlushFileHandler (file);
}
int Awk::FireOpenPipe (Pipe^ pipe)
{
return OpenPipeHandler (pipe);
}
int Awk::FireClosePipe (Pipe^ pipe)
{
return ClosePipeHandler (pipe);
}
int Awk::FireReadPipe (Pipe^ pipe, cli::array<char_t>^ buf, int len)
{
return ReadPipeHandler (pipe, buf, len);
}
int Awk::FireWritePipe (Pipe^ pipe, cli::array<char_t>^ buf, int len)
{
return WritePipeHandler (pipe, buf, len);
}
int Awk::FireFlushPipe (Pipe^ pipe)
{
return FlushPipeHandler (pipe);
}
int Awk::FireOpenConsole (Console^ console)
{
return OpenConsoleHandler (console);
}
int Awk::FireCloseConsole (Console^ console)
{
return CloseConsoleHandler (console);
}
int Awk::FireReadConsole (Console^ console, cli::array<char_t>^ buf, int len)
{
return ReadConsoleHandler (console, buf, len);
}
int Awk::FireWriteConsole (Console^ console, cli::array<char_t>^ buf, int len)
{
return WriteConsoleHandler (console, buf, len);
}
int Awk::FireFlushConsole (Console^ console)
{
return FlushConsoleHandler (console);
}
int Awk::FireNextConsole (Console^ console)
{
return NextConsoleHandler (console);
}
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.hpp,v 1.6 2007/07/19 14:35:10 bacon Exp $ * $Id: Awk.hpp,v 1.7 2007/07/20 09:23:37 bacon Exp $
*/ */
#pragma once #pragma once
@ -172,71 +172,46 @@ namespace ASE
} }
} }
delegate int OpenPipe (Pipe^ pipe);
delegate int ClosePipe (Pipe^ pipe);
delegate int ReadPipe (Pipe^ pipe, cli::array<char_t>^ buf, int len);
delegate int WritePipe (Pipe^ pipe, cli::array<char_t>^ buf, int len);
delegate int FlushPipe (Pipe^ pipe);
delegate int OpenFile (File^ file);
delegate int CloseFile (File^ file);
delegate int ReadFile (File^ file, cli::array<char_t>^ buf, int len);
delegate int WriteFile (File^ file, cli::array<char_t>^ buf, int len);
delegate int FlushFile (File^ file);
delegate int OpenConsole (Console^ console);
delegate int CloseConsole (Console^ console);
delegate int ReadConsole (Console^ console, cli::array<char_t>^ buf, int len);
delegate int WriteConsole (Console^ console, cli::array<char_t>^ buf, int len);
delegate int FlushConsole (Console^ console);
delegate int NextConsole (Console^ console);
event OpenPipe^ OpenPipeHandler;
event ClosePipe^ ClosePipeHandler;
event ReadPipe^ ReadPipeHandler;
event WritePipe^ WritePipeHandler;
event FlushPipe^ FlushPipeHandler;
event OpenFile^ OpenFileHandler;
event CloseFile^ CloseFileHandler;
event ReadFile^ ReadFileHandler;
event WriteFile^ WriteFileHandler;
event FlushFile^ FlushFileHandler;
event OpenConsole^ OpenConsoleHandler;
event CloseConsole^ CloseConsoleHandler;
event ReadConsole^ ReadConsoleHandler;
event WriteConsole^ WriteConsoleHandler;
event FlushConsole^ FlushConsoleHandler;
event NextConsole^ NextConsoleHandler;
protected: protected:
ASE::Awk* awk; ASE::Awk* awk;
System::IO::Stream^ sourceInputStream; System::IO::Stream^ sourceInputStream;
System::IO::Stream^ sourceOutputStream; System::IO::Stream^ sourceOutputStream;
public protected:
// File
virtual int OpenFile (File^ file) = 0;
virtual int CloseFile (File^ file) = 0;
virtual int ReadFile (
File^ file, cli::array<char_t>^ buf, int len) = 0;
virtual int WriteFile (
File^ file, cli::array<char_t>^ buf, int len) = 0;
virtual int FlushFile (File^ file) = 0;
// Pipe
virtual int OpenPipe (Pipe^ pipe) = 0;
virtual int ClosePipe (Pipe^ pipe) = 0;
virtual int ReadPipe (
Pipe^ pipe, cli::array<char_t>^ buf, int len) = 0;
virtual int WritePipe (
Pipe^ pipe, cli::array<char_t>^ buf, int len) = 0;
virtual int FlushPipe (Pipe^ pipe) = 0;
// Console
virtual int OpenConsole (Console^ console) = 0;
virtual int CloseConsole (Console^ console) = 0;
virtual int ReadConsole (
Console^ console, cli::array<char_t>^ buf, int len) = 0;
virtual int WriteConsole (
Console^ console, cli::array<char_t>^ buf, int len) = 0;
virtual int FlushConsole (Console^ console) = 0;
virtual int NextConsole (Console^ console) = 0;
public protected: public protected:
int DispatchFunction (System::String^ name); int DispatchFunction (System::String^ name);
int FireOpenFile (File^ file);
int FireCloseFile (File^ file);
int FireReadFile (File^ file, cli::array<char_t>^ buf, int len);
int FireWriteFile (File^ file, cli::array<char_t>^ buf, int len);
int FireFlushFile (File^ file);
int FireOpenPipe (Pipe^ pipe);
int FireClosePipe (Pipe^ pipe);
int FireReadPipe (Pipe^ pipe, cli::array<char_t>^ buf, int len);
int FireWritePipe (Pipe^ pipe, cli::array<char_t>^ buf, int len);
int FireFlushPipe (Pipe^ pipe);
int FireOpenConsole (Console^ console);
int FireCloseConsole (Console^ console);
int FireReadConsole (Console^ console, cli::array<char_t>^ buf, int len);
int FireWriteConsole (Console^ console, cli::array<char_t>^ buf, int len);
int FireFlushConsole (Console^ console);
int FireNextConsole (Console^ console);
}; };
} }

View File

@ -1,10 +1,14 @@
/* /*
* $Id: StdAwk.cpp,v 1.2 2007/07/19 14:35:10 bacon Exp $ * $Id: StdAwk.cpp,v 1.3 2007/07/20 09:23:37 bacon Exp $
*/ */
#include "stdafx.h" #include "stdafx.h"
#include "misc.h"
#include <ase/net/StdAwk.hpp> #include <ase/net/StdAwk.hpp>
#include <stdio.h>
#include <tchar.h>
#include <vcclr.h>
namespace ASE namespace ASE
{ {
@ -13,62 +17,50 @@ namespace ASE
StdAwk::StdAwk () StdAwk::StdAwk ()
{ {
OpenFileHandler += gcnew OpenFile (this, &StdAwk::openFile);
CloseFileHandler += gcnew CloseFile (this, &StdAwk::closeFile);
ReadFileHandler += gcnew ReadFile (this, &StdAwk::readFile);
WriteFileHandler += gcnew WriteFile (this, &StdAwk::writeFile);
FlushFileHandler += gcnew FlushFile (this, &StdAwk::flushFile);
} }
StdAwk::~StdAwk () StdAwk::~StdAwk ()
{ {
} }
int StdAwk::openFile (File^ file) int StdAwk::OpenFile (File^ file)
{ {
System::IO::FileMode mode; System::IO::FileMode mode;
System::IO::FileAccess access; System::IO::FileAccess access;
System::IO::FileStream^ fs; System::IO::FileStream^ fs;
try if (file->Mode->Equals(File::MODE::READ))
{ {
if (file->Mode->Equals(File::MODE::READ)) mode = System::IO::FileMode::Open;
{ access = System::IO::FileAccess::Read;
mode = System::IO::FileMode::Open;
access = System::IO::FileAccess::Read;
fs = gcnew System::IO::FileStream (file->Name, mode, access); fs = gcnew System::IO::FileStream (file->Name, mode, access);
System::IO::StreamReader^ rd = gcnew System::IO::StreamReader (fs); System::IO::StreamReader^ rd = gcnew System::IO::StreamReader (fs);
file->Handle = rd; file->Handle = rd;
}
else if (file->Mode->Equals(File::MODE::WRITE))
{
mode = System::IO::FileMode::Create;
access = System::IO::FileAccess::Write;
fs = gcnew System::IO::FileStream (file->Name, mode, access);
System::IO::StreamWriter^ wr = gcnew System::IO::StreamWriter (fs);
file->Handle = wr;
}
else /* File::MODE::APPEND */
{
mode = System::IO::FileMode::Append;
access = System::IO::FileAccess::Write;
fs = gcnew System::IO::FileStream (file->Name, mode, access);
System::IO::StreamWriter^ wr = gcnew System::IO::StreamWriter (fs);
file->Handle = wr;
}
return 1;
} }
catch (System::Exception^) else if (file->Mode->Equals(File::MODE::WRITE))
{ {
return -1; mode = System::IO::FileMode::Create;
access = System::IO::FileAccess::Write;
fs = gcnew System::IO::FileStream (file->Name, mode, access);
System::IO::StreamWriter^ wr = gcnew System::IO::StreamWriter (fs);
file->Handle = wr;
} }
else /* File::MODE::APPEND */
{
mode = System::IO::FileMode::Append;
access = System::IO::FileAccess::Write;
fs = gcnew System::IO::FileStream (file->Name, mode, access);
System::IO::StreamWriter^ wr = gcnew System::IO::StreamWriter (fs);
file->Handle = wr;
}
return 1;
} }
int StdAwk::closeFile (File^ file) int StdAwk::CloseFile (File^ file)
{ {
if (file->Mode == File::MODE::READ) if (file->Mode == File::MODE::READ)
{ {
@ -83,34 +75,135 @@ namespace ASE
return 0; return 0;
} }
int StdAwk::readFile (File^ file, cli::array<char_t>^ buf, int len) int StdAwk::ReadFile (File^ file, cli::array<char_t>^ buf, int len)
{ {
System::IO::StreamReader^ sr = (System::IO::StreamReader^)file->Handle; System::IO::StreamReader^ sr = (System::IO::StreamReader^)file->Handle;
try { return sr->Read (buf, 0, len); } return sr->Read (buf, 0, len);
catch (System::Exception^) { return -1; }
} }
int StdAwk::writeFile (File^ file, cli::array<char_t>^ buf, int len) int StdAwk::WriteFile (File^ file, cli::array<char_t>^ buf, int len)
{ {
System::IO::StreamWriter^ sw = (System::IO::StreamWriter^)file->Handle; System::IO::StreamWriter^ sw = (System::IO::StreamWriter^)file->Handle;
try sw->Write (buf, 0, len);
{ return len;
sw->Write (buf, 0, len);
return len;
}
catch (System::Exception^) { return -1; }
} }
int StdAwk::flushFile (File^ file) int StdAwk::FlushFile (File^ file)
{ {
System::IO::StreamWriter^ sw = (System::IO::StreamWriter^)file->Handle; System::IO::StreamWriter^ sw = (System::IO::StreamWriter^)file->Handle;
try sw->Flush ();
{ return 0;
sw->Flush ();
return 0;
}
catch (System::Exception^) { return -1; }
} }
int StdAwk::OpenPipe (Pipe^ pipe)
{
FILE* fp = NULL;
cli::pin_ptr<const wchar_t> name =
PtrToStringChars(pipe->Name);
if (pipe->Mode->Equals(Pipe::MODE::READ))
{
fp = _wpopen (name, L"r");
}
else // Pipe::MODE::WRITE
{
fp = _wpopen (name, L"w");
}
if (fp == NULL) return -1;
pipe->Handle = IntPtr ((void*)fp);
return 1;
}
int StdAwk::ClosePipe (Pipe^ pipe)
{
IntPtr ip = (IntPtr)pipe->Handle;
FILE* fp = (FILE*)ip.ToPointer();
return (::_pclose (fp) == EOF)? -1: 0;
}
int StdAwk::ReadPipe (Pipe^ pipe, cli::array<char_t>^ buf, int len)
{
IntPtr ip = (IntPtr)pipe->Handle;
FILE* fp = (FILE*)ip.ToPointer();
int n = 0;
while (n < len)
{
wint_t c = fgetwc (fp);
if (c == WEOF) break;
buf[n++] = c;
if (c == L'\n') break;
}
return n;
}
int StdAwk::WritePipe (Pipe^ pipe, cli::array<char_t>^ buf, int len)
{
IntPtr ip = (IntPtr)pipe->Handle;
FILE* fp = (FILE*)ip.ToPointer();
int left;
cli::pin_ptr<char_t> bp = &buf[0];
/* somehow, fwprintf returns 0 when non-ascii
* characters are included in the buffer.
while (left > 0)
{
if (*bp == ASE_T('\0'))
{
if (fputwc (*ptr, fp) == WEOF)
{
return -1;
}
left -= 1; bp += 1;
}
else
{
int n = fwprintf (fp, L"%.*s", left, bp);
if (n < 0 || n > left) return -1;
left -= n; bp += n;
}
}*/
/* so the scheme has been changed to the following */
char* mbp = unicode_to_multibyte (bp, len, &left);
if (mbp == NULL) return -1;
char* ptr = mbp;
while (left > 0)
{
if (*ptr == '\0')
{
if (fputwc (*ptr, fp) == WEOF)
{
return -1;
}
left -= 1; ptr += 1;
}
else
{
int n = fprintf (fp, "%.*s", left, ptr);
if (n < 0 || n > left) return -1;
left -= n; ptr += n;
}
}
::free (mbp);
return len;
}
int StdAwk::FlushPipe (Pipe^ pipe)
{
IntPtr ip = (IntPtr)pipe->Handle;
FILE* fp = (FILE*)ip.ToPointer();
return (::fflush (fp) == EOF)? -1: 0;
}
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: StdAwk.hpp,v 1.3 2007/07/19 14:35:10 bacon Exp $ * $Id: StdAwk.hpp,v 1.4 2007/07/20 09:23:37 bacon Exp $
*/ */
#include <ase/net/Awk.hpp> #include <ase/net/Awk.hpp>
@ -9,20 +9,30 @@ namespace ASE
namespace Net namespace Net
{ {
public ref class StdAwk: Awk public ref class StdAwk abstract: public Awk
{ {
public: public:
StdAwk (); StdAwk ();
~StdAwk (); ~StdAwk ();
protected: public protected:
int openFile (File^ file); // File
int closeFile (File^ file); virtual int OpenFile (File^ file) override;
int readFile (File^ file, cli::array<char_t>^ buf, int len); virtual int CloseFile (File^ file) override;
int writeFile (File^ file, cli::array<char_t>^ buf, int len); virtual int ReadFile (
int flushFile (File^ file); File^ file, cli::array<char_t>^ buf, int len) override;
virtual int WriteFile (
}; File^ file, cli::array<char_t>^ buf, int len) override;
virtual int FlushFile (File^ file) override;
// Pipe
virtual int OpenPipe (Pipe^ pipe) override;
virtual int ClosePipe (Pipe^ pipe) override;
virtual int ReadPipe (
Pipe^ pipe, cli::array<char_t>^ buf, int len) override;
virtual int WritePipe (
Pipe^ pipe, cli::array<char_t>^ buf, int len) override;
virtual int FlushPipe (Pipe^ pipe) override;
};
} }
} }

View File

@ -188,11 +188,11 @@
> >
</File> </File>
<File <File
RelativePath=".\assert.cpp" RelativePath=".\Awk.cpp"
> >
</File> </File>
<File <File
RelativePath=".\Awk.cpp" RelativePath=".\misc.cpp"
> >
</File> </File>
<File <File
@ -233,6 +233,10 @@
RelativePath=".\Awk.hpp" RelativePath=".\Awk.hpp"
> >
</File> </File>
<File
RelativePath=".\misc.h"
>
</File>
<File <File
RelativePath=".\resource.h" RelativePath=".\resource.h"
> >

View File

@ -1,8 +1,9 @@
/* /*
* $Id: assert.cpp,v 1.2 2007/07/16 11:12:12 bacon Exp $ * $Id: misc.cpp,v 1.1 2007/07/20 09:23:37 bacon Exp $
*/ */
#include "stdafx.h" #include "stdafx.h"
#include "misc.h"
#ifndef NDEBUG #ifndef NDEBUG
@ -41,3 +42,14 @@ void ase_assert_printf (const ase_char_t* fmt, ...)
} }
#endif #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;
}

18
ase/net/misc.h Normal file
View File

@ -0,0 +1,18 @@
/*
* $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

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.cpp,v 1.30 2007/07/15 16:31:59 bacon Exp $ * $Id: Awk.cpp,v 1.31 2007/07/20 09:23:37 bacon Exp $
*/ */
#include <ase/awk/StdAwk.hpp> #include <ase/awk/StdAwk.hpp>
@ -77,8 +77,11 @@ public:
numConOutFiles = 0; numConOutFiles = 0;
#ifdef _WIN32 #ifdef _WIN32
HeapDestroy (heap); if (heap != ASE_NULL)
heap = ASE_NULL; {
HeapDestroy (heap);
heap = ASE_NULL;
}
#endif #endif
} }

View File

@ -105,8 +105,8 @@
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory=".\..\..\debug\bin" OutputDirectory="..\..\debug\bin"
IntermediateDirectory=".\debug\cpp" IntermediateDirectory="debug\cpp"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0" UseOfMFC="0"
@ -137,7 +137,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
PrecompiledHeaderFile=".\debug\cpp\asetestawk++.pch" PrecompiledHeaderFile=".\debug\cpp\asetestawk++.pch"
AssemblerListingLocation="" AssemblerListingLocation=""
BrowseInformation="1" BrowseInformation="1"

View File

@ -135,7 +135,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
BrowseInformation="1" BrowseInformation="1"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"

View File

@ -48,7 +48,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
BrowseInformation="1" BrowseInformation="1"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"

View File

@ -8,8 +8,43 @@ using System.Windows.Forms;
namespace asetestnet namespace asetestnet
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
public class Awk : ASE.Net.StdAwk
{
protected override int OpenConsole(ASE.Net.StdAwk.Console console)
{
return -1;
}
protected override int CloseConsole(ASE.Net.StdAwk.Console console)
{
return -1;
}
protected override int ReadConsole(ASE.Net.StdAwk.Console console, char[] buf, int len)
{
return -1;
}
protected override int WriteConsole(ASE.Net.StdAwk.Console console, char[] buf, int len)
{
return -1;
}
protected override int FlushConsole(ASE.Net.StdAwk.Console console)
{
return -1;
}
protected override int NextConsole(ASE.Net.StdAwk.Console console)
{
return -1;
}
}
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
@ -17,8 +52,8 @@ namespace asetestnet
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
ASE.Net.Awk awk = new ASE.Net.StdAwk(); ASE.Net.Awk awk = new Awk();
/*awk.OpenFileHandler += new ASE.Net.Awk.OpenFile (OpenFile); /*awk.OpenFileHandler += new ASE.Net.Awk.OpenFile (OpenFile);
awk.CloseFileHandler += CloseFile;*/ awk.CloseFileHandler += CloseFile;*/

View File

@ -8,64 +8,56 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace asetestnet.Properties namespace asetestnet.Properties {
{ using System;
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources internal class Resources {
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() {
internal Resources() }
{
} /// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// <summary> /// </summary>
/// Returns the cached ResourceManager instance used by this class. [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
/// </summary> internal static global::System.Resources.ResourceManager ResourceManager {
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] get {
internal static global::System.Resources.ResourceManager ResourceManager if (object.ReferenceEquals(resourceMan, null)) {
{ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("asetestnet.Properties.Resources", typeof(Resources).Assembly);
get resourceMan = temp;
{ }
if ((resourceMan == null)) return resourceMan;
{ }
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("asetestnet.Properties.Resources", typeof(Resources).Assembly); }
resourceMan = temp;
} /// <summary>
return resourceMan; /// Overrides the current thread's CurrentUICulture property for all
} /// resource lookups using this strongly typed resource class.
} /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
/// <summary> internal static global::System.Globalization.CultureInfo Culture {
/// Overrides the current thread's CurrentUICulture property for all get {
/// resource lookups using this strongly typed resource class. return resourceCulture;
/// </summary> }
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] set {
internal static global::System.Globalization.CultureInfo Culture resourceCulture = value;
{ }
get }
{ }
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
} }

View File

@ -8,23 +8,19 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace asetestnet.Properties namespace asetestnet.Properties {
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default {
get {
public static Settings Default return defaultInstance;
{ }
get }
{ }
return defaultInstance;
}
}
}
} }

View File

@ -56,6 +56,7 @@
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>

View File

@ -116,7 +116,7 @@
PreprocessorDefinitions="_DEBUG;WIN32" PreprocessorDefinitions="_DEBUG;WIN32"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
DisableLanguageExtensions="true" DisableLanguageExtensions="true"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"