*** empty log message ***

This commit is contained in:
hyung-hwan 2007-04-15 15:26:58 +00:00
parent 8932f06fdd
commit 09c1fbd12c
8 changed files with 72 additions and 34 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.h,v 1.213 2007-03-23 07:45:22 bacon Exp $ * $Id: awk.h,v 1.214 2007-04-15 15:26:57 bacon Exp $
* *
* {License} * {License}
*/ */
@ -187,7 +187,10 @@ enum
ASE_AWK_NEXTOFILE = (1 << 12), ASE_AWK_NEXTOFILE = (1 << 12),
/* cr + lf by default */ /* cr + lf by default */
ASE_AWK_CRLF = (1 << 13) ASE_AWK_CRLF = (1 << 13),
/* pass the arguments to the main function */
ASE_AWK_ARGSTOMAIN = (1 << 14)
}; };
/* error code */ /* error code */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c,v 1.347 2007-03-20 10:44:44 bacon Exp $ * $Id: run.c,v 1.348 2007-04-15 15:26:57 bacon Exp $
* *
* {License} * {License}
*/ */
@ -1209,6 +1209,14 @@ static int run_main (
if (runarg != ASE_NULL) if (runarg != ASE_NULL)
{ {
if (!(run->awk->option & ASE_AWK_ARGSTOMAIN))
{
/* if the option is not set, the arguments
* arenot passed to the main function as
* parameters */
nrunargs = 0;
}
/* prepare to pass the arguments to the main function */ /* prepare to pass the arguments to the main function */
for (i = nrunargs; i > 0; ) for (i = nrunargs; i > 0; )
{ {

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.cpp,v 1.33 2007-04-15 14:25:35 bacon Exp $ * $Id: Awk.cpp,v 1.34 2007-04-15 15:26:57 bacon Exp $
* *
* {License} * {License}
*/ */
@ -790,7 +790,7 @@ HRESULT CAwk::Run (VARIANT_BOOL* ret)
} }
STDMETHODIMP CAwk::AddFunction ( STDMETHODIMP CAwk::AddFunction (
BSTR name, int min_args, int max_args, VARIANT_BOOL* ret) BSTR name, int minArgs, int maxArgs, VARIANT_BOOL* ret)
{ {
bfn_t* bfn; bfn_t* bfn;
size_t name_len = SysStringLen(name); size_t name_len = SysStringLen(name);
@ -843,8 +843,8 @@ STDMETHODIMP CAwk::AddFunction (
} }
memcpy (bfn->name.ptr, name, sizeof(TCHAR) * bfn->name.len); memcpy (bfn->name.ptr, name, sizeof(TCHAR) * bfn->name.len);
bfn->min_args = min_args; bfn->min_args = minArgs;
bfn->max_args = max_args; bfn->max_args = maxArgs;
bfn->next = bfn_list; bfn->next = bfn_list;
bfn_list = bfn; bfn_list = bfn;
@ -1103,6 +1103,21 @@ STDMETHODIMP CAwk::put_UseCrlf(VARIANT_BOOL newVal)
return S_OK; return S_OK;
} }
STDMETHODIMP CAwk::get_ArgsToMain(VARIANT_BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_ARGSTOMAIN) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_ArgsToMain(VARIANT_BOOL newVal)
{
if (newVal) option = option | ASE_AWK_ARGSTOMAIN;
else option = option & ~ASE_AWK_ARGSTOMAIN;
if (handle != NULL) ase_awk_setoption (handle, option);
return S_OK;
}
STDMETHODIMP CAwk::get_MaxDepthForBlockParse(int *pVal) STDMETHODIMP CAwk::get_MaxDepthForBlockParse(int *pVal)
{ {
if (handle != NULL) if (handle != NULL)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.h,v 1.20 2007-04-15 14:25:35 bacon Exp $ * $Id: Awk.h,v 1.21 2007-04-15 15:26:58 bacon Exp $
* *
* {License} * {License}
*/ */
@ -124,6 +124,8 @@ public:
STDMETHOD(put_MaxDepthForBlockRun)(/*[in]*/ int newVal); STDMETHOD(put_MaxDepthForBlockRun)(/*[in]*/ int newVal);
STDMETHOD(get_MaxDepthForBlockParse)(/*[out, retval]*/ int *pVal); STDMETHOD(get_MaxDepthForBlockParse)(/*[out, retval]*/ int *pVal);
STDMETHOD(put_MaxDepthForBlockParse)(/*[in]*/ int newVal); STDMETHOD(put_MaxDepthForBlockParse)(/*[in]*/ int newVal);
STDMETHOD(get_ArgsToMain)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_ArgsToMain)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_UseCrlf)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(get_UseCrlf)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_UseCrlf)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(put_UseCrlf)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_Nextofile)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(get_Nextofile)(/*[out, retval]*/ VARIANT_BOOL *pVal);
@ -154,8 +156,12 @@ public:
STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal); STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal); STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal);
STDMETHOD(DeleteFunction)(/*[in]*/ BSTR name, /*[out, retval]*/ VARIANT_BOOL* ret); HRESULT __stdcall DeleteFunction (
STDMETHOD(AddFunction)(/*[in]*/ BSTR name, /*[in]*/ int min_args, /*[in]*/ int max_args, /*[out, retval]*/ VARIANT_BOOL* ret); /*[in]*/ BSTR name, /*[out, retval]*/ VARIANT_BOOL* ret);
HRESULT __stdcall AddFunction (
/*[in]*/ BSTR name, /*[in]*/ int minArgs,
/*[in]*/ int maxArgs, /*[out, retval]*/ VARIANT_BOOL* ret);
HRESULT __stdcall Parse (/*[out, retval]*/ VARIANT_BOOL* ret); HRESULT __stdcall Parse (/*[out, retval]*/ VARIANT_BOOL* ret);
HRESULT __stdcall Run (/*[out, retval]*/ VARIANT_BOOL* ret); HRESULT __stdcall Run (/*[out, retval]*/ VARIANT_BOOL* ret);
}; };

View File

@ -1,5 +1,5 @@
/* /*
* $Id: asecom.idl,v 1.4 2007-04-15 14:25:35 bacon Exp $ * $Id: asecom.idl,v 1.5 2007-04-15 15:26:58 bacon Exp $
*/ */
import "oaidl.idl"; import "oaidl.idl";
@ -22,7 +22,7 @@ interface IAwk : IDispatch
HRESULT Run([out,retval] VARIANT_BOOL* ret); HRESULT Run([out,retval] VARIANT_BOOL* ret);
[id(3), helpstring("method AddFunction")] [id(3), helpstring("method AddFunction")]
HRESULT AddFunction([in] BSTR name, [in] int min_args, [in] int max_args, [out,retval] VARIANT_BOOL* ret); HRESULT AddFunction([in] BSTR name, [in] int minArgs, [in] int maxArgs, [out,retval] VARIANT_BOOL* ret);
[id(4), helpstring("method DeleteFunction")] [id(4), helpstring("method DeleteFunction")]
HRESULT DeleteFunction([in] BSTR name, [out,retval] VARIANT_BOOL* ret); HRESULT DeleteFunction([in] BSTR name, [out,retval] VARIANT_BOOL* ret);
@ -101,49 +101,54 @@ interface IAwk : IDispatch
[propput, id(20), helpstring("property UseCrlf")] [propput, id(20), helpstring("property UseCrlf")]
HRESULT UseCrlf([in] VARIANT_BOOL newVal); HRESULT UseCrlf([in] VARIANT_BOOL newVal);
[propget, id(21), helpstring("property MaxDepthForBlockParse")] [propget, id(21), helpstring("property ArgsToMain")]
HRESULT ArgsToMain([out,retval] VARIANT_BOOL *pVal);
[propput, id(21), helpstring("property ArgsToMain")]
HRESULT ArgsToMain([in] VARIANT_BOOL newVal);
[propget, id(22), helpstring("property MaxDepthForBlockParse")]
HRESULT MaxDepthForBlockParse([out,retval] int *pVal); HRESULT MaxDepthForBlockParse([out,retval] int *pVal);
[propput, id(21), helpstring("property MaxDepthForBlockParse")] [propput, id(22), helpstring("property MaxDepthForBlockParse")]
HRESULT MaxDepthForBlockParse([in] int newVal); HRESULT MaxDepthForBlockParse([in] int newVal);
[propget, id(22), helpstring("property MaxDepthForBlockRun")] [propget, id(23), helpstring("property MaxDepthForBlockRun")]
HRESULT MaxDepthForBlockRun([out,retval] int *pVal); HRESULT MaxDepthForBlockRun([out,retval] int *pVal);
[propput, id(22), helpstring("property MaxDepthForBlockRun")] [propput, id(23), helpstring("property MaxDepthForBlockRun")]
HRESULT MaxDepthForBlockRun([in] int newVal); HRESULT MaxDepthForBlockRun([in] int newVal);
[propget, id(23), helpstring("property MaxDepthForExprParse")] [propget, id(24), helpstring("property MaxDepthForExprParse")]
HRESULT MaxDepthForExprParse([out,retval] int *pVal); HRESULT MaxDepthForExprParse([out,retval] int *pVal);
[propput, id(23), helpstring("property MaxDepthForExprParse")] [propput, id(24), helpstring("property MaxDepthForExprParse")]
HRESULT MaxDepthForExprParse([in] int newVal); HRESULT MaxDepthForExprParse([in] int newVal);
[propget, id(24), helpstring("property MaxDepthForExprRun")] [propget, id(25), helpstring("property MaxDepthForExprRun")]
HRESULT MaxDepthForExprRun([out,retval] int *pVal); HRESULT MaxDepthForExprRun([out,retval] int *pVal);
[propput, id(24), helpstring("property MaxDepthForExprRun")] [propput, id(25), helpstring("property MaxDepthForExprRun")]
HRESULT MaxDepthForExprRun([in] int newVal); HRESULT MaxDepthForExprRun([in] int newVal);
[propget, id(25), helpstring("property MaxDepthForRexBuild")] [propget, id(26), helpstring("property MaxDepthForRexBuild")]
HRESULT MaxDepthForRexBuild([out,retval] int *pVal); HRESULT MaxDepthForRexBuild([out,retval] int *pVal);
[propput, id(25), helpstring("property MaxDepthForRexBuild")] [propput, id(26), helpstring("property MaxDepthForRexBuild")]
HRESULT MaxDepthForRexBuild([in] int newVal); HRESULT MaxDepthForRexBuild([in] int newVal);
[propget, id(26), helpstring("property MaxDepthForRexMatch")] [propget, id(27), helpstring("property MaxDepthForRexMatch")]
HRESULT MaxDepthForRexMatch([out,retval] int *pVal); HRESULT MaxDepthForRexMatch([out,retval] int *pVal);
[propput, id(26), helpstring("property MaxDepthForRexMatch")] [propput, id(27), helpstring("property MaxDepthForRexMatch")]
HRESULT MaxDepthForRexMatch([in] int newVal); HRESULT MaxDepthForRexMatch([in] int newVal);
[propget, id(27), helpstring("property EntryPoint")] [propget, id(28), helpstring("property EntryPoint")]
HRESULT EntryPoint([out,retval] BSTR *pVal); HRESULT EntryPoint([out,retval] BSTR *pVal);
[propput, id(27), helpstring("property EntryPoint")] [propput, id(28), helpstring("property EntryPoint")]
HRESULT EntryPoint([in] BSTR newVal); HRESULT EntryPoint([in] BSTR newVal);
[propget, id(28), helpstring("property Debug")] [propget, id(29), helpstring("property Debug")]
HRESULT Debug([out,retval] VARIANT_BOOL *pVal); HRESULT Debug([out,retval] VARIANT_BOOL *pVal);
[propput, id(28), helpstring("property Debug")] [propput, id(29), helpstring("property Debug")]
HRESULT Debug([in] VARIANT_BOOL newVal); HRESULT Debug([in] VARIANT_BOOL newVal);
[propget, id(29), helpstring("property UseLongLong")] [propget, id(30), helpstring("property UseLongLong")]
HRESULT UseLongLong([out,retval] VARIANT_BOOL *pVal); HRESULT UseLongLong([out,retval] VARIANT_BOOL *pVal);
[propput, id(29), helpstring("property UseLongLong")] [propput, id(30), helpstring("property UseLongLong")]
HRESULT UseLongLong([in] VARIANT_BOOL newVal); HRESULT UseLongLong([in] VARIANT_BOOL newVal);
}; };

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.c,v 1.192 2007-03-20 10:44:45 bacon Exp $ * $Id: awk.c,v 1.193 2007-04-15 15:26:58 bacon Exp $
*/ */
#include <ase/awk/awk.h> #include <ase/awk/awk.h>
@ -835,7 +835,8 @@ static int awk_main (int argc, ase_char_t* argv[])
ASE_AWK_BLOCKLESS | ASE_AWK_BLOCKLESS |
ASE_AWK_STRBASEONE | ASE_AWK_STRBASEONE |
ASE_AWK_STRIPSPACES | ASE_AWK_STRIPSPACES |
ASE_AWK_NEXTOFILE; ASE_AWK_NEXTOFILE /*|
ASE_AWK_ARGSTOMAIN*/;
if (argc <= 1) if (argc <= 1)
{ {

View File

@ -1,6 +1,6 @@
VERSION 5.00 VERSION 5.00
Begin VB.Form AwkForm Begin VB.Form AwkForm
Caption = "ASE COM AWK" Caption = "ASE.COM.AWK"
ClientHeight = 7635 ClientHeight = 7635
ClientLeft = 60 ClientLeft = 60
ClientTop = 345 ClientTop = 345

View File

@ -1,2 +1,2 @@
AwkForm = 13, 12, 735, 661, , 22, 22, 753, 640, C AwkForm = 13, 12, 735, 661, C, 22, 22, 753, 640, C
AwkExtioConsole = 0, 0, 547, 460, C AwkExtioConsole = 0, 0, 547, 460, C