This commit is contained in:
hyung-hwan 2007-11-23 05:33:45 +00:00
parent e19ac0c344
commit bd55d249bd
2 changed files with 301 additions and 276 deletions

View File

@ -12,22 +12,22 @@ 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}
{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}
{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
{17621C83-40C9-4305-BAF9-132E250B5FE3} = {17621C83-40C9-4305-BAF9-132E250B5FE3}
{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}
{17621C83-40C9-4305-BAF9-132E250B5FE3} = {17621C83-40C9-4305-BAF9-132E250B5FE3}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk", "test\awk\aseawk.vcproj", "{57F1E1D0-28B6-42BF-BAFB-045AEE2DCF4F}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk", "test\awk\aseawk.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}"
@ -37,8 +37,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aselsp", "lsp\aselsp.vcproj
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aselsp", "test\lsp\aselsp.vcproj", "{868702B0-CB6B-4F1D-B98A-32193347EFAF}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aselsp", "test\lsp\aselsp.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}"
@ -48,13 +48,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk++", "awk\aseawk++.vc
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk++", "test\awk\aseawk++.vcproj", "{3BEA6CFE-C158-4BFB-B5FB-ED85251E3F98}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aseawk++", "test\awk\aseawk++.vcproj", "{3BEA6CFE-C158-4BFB-B5FB-ED85251E3F98}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} = {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
{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 ProjectSection(ProjectDependencies) = postProject
{E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} = {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5} = {E7A8B741-4E9D-4ED4-9F77-E7F637A678A5}
{C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD} = {C3EBBFAE-9D08-4FA2-8B0E-D09BEBF84EDD}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asenet", "test\net\asenet.csproj", "{7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asenet", "test\net\asenet.csproj", "{7CC01C3D-FC1A-4587-868A-7FC4449B3F8B}"

View File

@ -33,125 +33,140 @@ public:
int open (ASE::Net::Awk^ wrapper) int open (ASE::Net::Awk^ wrapper)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::open (); int n = ASE::Awk::open ();
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
void close (ASE::Net::Awk^ wrapper) void close (ASE::Net::Awk^ wrapper)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
Awk::close (); Awk::close ();
this->wrapper = nullptr; this->wrapper = old;
} }
int getOption (ASE::Net::Awk^ wrapper) const int getOption (ASE::Net::Awk^ wrapper) const
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::getOption (); int n = ASE::Awk::getOption ();
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
void setOption (ASE::Net::Awk^ wrapper, int opt) void setOption (ASE::Net::Awk^ wrapper, int opt)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::setOption (opt); ASE::Awk::setOption (opt);
this->wrapper = nullptr; this->wrapper = old;
} }
size_t getErrorLine (ASE::Net::Awk^ wrapper) const size_t getErrorLine (ASE::Net::Awk^ wrapper) const
{ {
this->wrapper = wrapper; ASE::Net::Awk^ old = this->wrapper;
size_t x = ASE::Awk::getErrorLine (); size_t x = ASE::Awk::getErrorLine ();
this->wrapper = nullptr; this->wrapper = old;
return x; return x;
} }
ErrorCode getErrorCode (ASE::Net::Awk^ wrapper) const ErrorCode getErrorCode (ASE::Net::Awk^ wrapper) const
{ {
this->wrapper = wrapper; ASE::Net::Awk^ old = this->wrapper;
ASE::Awk::ErrorCode x = ASE::Awk::getErrorCode (); ASE::Awk::ErrorCode x = ASE::Awk::getErrorCode ();
this->wrapper = nullptr; this->wrapper = old;
return x; return x;
} }
const char_t* getErrorMessage (ASE::Net::Awk^ wrapper) const const char_t* getErrorMessage (ASE::Net::Awk^ wrapper) const
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
const char_t* x = ASE::Awk::getErrorMessage(); const char_t* x = ASE::Awk::getErrorMessage();
this->wrapper = nullptr; this->wrapper = old;
return x; return x;
} }
const char_t* getErrorString (ASE::Net::Awk^ wrapper, ErrorCode num) const const char_t* getErrorString (ASE::Net::Awk^ wrapper, ErrorCode num) const
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
const char_t* x = ASE::Awk::getErrorString (num); const char_t* x = ASE::Awk::getErrorString (num);
this->wrapper = nullptr; this->wrapper = old;
return x; return x;
} }
void setError (ASE::Net::Awk^ wrapper, ErrorCode num) void setError (ASE::Net::Awk^ wrapper, ErrorCode num)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::setError (num); ASE::Awk::setError (num);
this->wrapper = nullptr; this->wrapper = old;
} }
void setError (ASE::Net::Awk^ wrapper, ErrorCode num, size_t line) void setError (ASE::Net::Awk^ wrapper, ErrorCode num, size_t line)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::setError (num, line); ASE::Awk::setError (num, line);
this->wrapper = nullptr; this->wrapper = old;
} }
void setError (ASE::Net::Awk^ wrapper, ErrorCode num, size_t line, const char_t* arg, size_t len) void setError (ASE::Net::Awk^ wrapper, ErrorCode num, size_t line, const char_t* arg, size_t len)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::setError (num, line, arg, len); ASE::Awk::setError (num, line, arg, len);
this->wrapper = nullptr; this->wrapper = old;
} }
void setErrorWithMessage (ASE::Net::Awk^ wrapper, ErrorCode num, size_t line, const char_t* msg) void setErrorWithMessage (ASE::Net::Awk^ wrapper, ErrorCode num, size_t line, const char_t* msg)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::setErrorWithMessage (num, line, msg); ASE::Awk::setErrorWithMessage (num, line, msg);
this->wrapper = nullptr; this->wrapper = old;
} }
int setErrorString (ASE::Net::Awk^ wrapper, ErrorCode num, const char_t* msg) int setErrorString (ASE::Net::Awk^ wrapper, ErrorCode num, const char_t* msg)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int x = ASE::Awk::setErrorString (num, msg); int x = ASE::Awk::setErrorString (num, msg);
this->wrapper = nullptr; this->wrapper = old;
return x; return x;
} }
int parse (ASE::Net::Awk^ wrapper) int parse (ASE::Net::Awk^ wrapper)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::parse (); int n = ASE::Awk::parse ();
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
int run (ASE::Net::Awk^ wrapper, const char_t* main = ASE_NULL, int run (ASE::Net::Awk^ wrapper, const char_t* main = ASE_NULL,
const char_t** args = ASE_NULL, size_t nargs = 0) const char_t** args = ASE_NULL, size_t nargs = 0)
{ {
// run can't be called more than once because this->wrapper ASE::Net::Awk^ old = this->wrapper;
// can be set to nullptr while another run is under execution.
// for the same reason, you can't call other methods except stop
// untile run ends.
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::run (main, args, nargs); int n = ASE::Awk::run (main, args, nargs);
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
void stop (ASE::Net::Awk^ wrapper) void stop (ASE::Net::Awk^ wrapper)
{ {
/*
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper;
ASE::Awk::stop ();
this->wrapper = old;
*/
if ((ASE::Net::Awk^)this->wrapper != nullptr) ASE::Awk::stop (); if ((ASE::Net::Awk^)this->wrapper != nullptr) ASE::Awk::stop ();
} }
@ -184,39 +199,44 @@ public:
int unsetAllWords (ASE::Net::Awk^ wrapper) int unsetAllWords (ASE::Net::Awk^ wrapper)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::unsetAllWords (); int n = ASE::Awk::unsetAllWords ();
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
void setMaxDepth (ASE::Net::Awk^ wrapper, int ids, size_t depth) void setMaxDepth (ASE::Net::Awk^ wrapper, int ids, size_t depth)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::setMaxDepth (ids, depth); ASE::Awk::setMaxDepth (ids, depth);
this->wrapper = nullptr; this->wrapper = old;
} }
size_t getMaxDepth (ASE::Net::Awk^ wrapper, int id) const size_t getMaxDepth (ASE::Net::Awk^ wrapper, int id) const
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
size_t n = ASE::Awk::getMaxDepth (id); size_t n = ASE::Awk::getMaxDepth (id);
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
void enableRunCallback (ASE::Net::Awk^ wrapper) void enableRunCallback (ASE::Net::Awk^ wrapper)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::enableRunCallback (); ASE::Awk::enableRunCallback ();
this->wrapper = nullptr; this->wrapper = old;
} }
void disableRunCallback (ASE::Net::Awk^ wrapper) void disableRunCallback (ASE::Net::Awk^ wrapper)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
ASE::Awk::disableRunCallback (); ASE::Awk::disableRunCallback ();
this->wrapper = nullptr; this->wrapper = old;
} }
void onRunStart (Run& run) void onRunStart (Run& run)
@ -287,17 +307,19 @@ public:
int addGlobal (ASE::Net::Awk^ wrapper, const char_t* name) int addGlobal (ASE::Net::Awk^ wrapper, const char_t* name)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::addGlobal (name); int n = ASE::Awk::addGlobal (name);
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
int deleteGlobal (ASE::Net::Awk^ wrapper, const char_t* name) int deleteGlobal (ASE::Net::Awk^ wrapper, const char_t* name)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::deleteGlobal (name); int n = ASE::Awk::deleteGlobal (name);
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
@ -305,17 +327,19 @@ public:
ASE::Net::Awk^ wrapper, const char_t* name, ASE::Net::Awk^ wrapper, const char_t* name,
size_t minArgs, size_t maxArgs, FunctionHandler handler) size_t minArgs, size_t maxArgs, FunctionHandler handler)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::addFunction (name, minArgs, maxArgs, handler); int n = ASE::Awk::addFunction (name, minArgs, maxArgs, handler);
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }
int deleteFunction (ASE::Net::Awk^ wrapper, const char_t* main) int deleteFunction (ASE::Net::Awk^ wrapper, const char_t* main)
{ {
ASE::Net::Awk^ old = this->wrapper;
this->wrapper = wrapper; this->wrapper = wrapper;
int n = ASE::Awk::deleteFunction (main); int n = ASE::Awk::deleteFunction (main);
this->wrapper = nullptr; this->wrapper = old;
return n; return n;
} }