initial commit

This commit is contained in:
2007-04-28 21:31:31 +00:00
parent 6acf470ccc
commit 2779dacb22
258 changed files with 10337 additions and 17385 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp,v 1.37 2007-04-26 15:50:17 bacon Exp $
* $Id: Awk.cpp,v 1.1 2007/03/28 14:05:22 bacon Exp $
*
* {License}
*/
@ -19,10 +19,6 @@
#include <ase/utl/stdio.h>
#include <ase/utl/ctype.h>
#ifdef _MSC_VER
#pragma warning (disable: 4996)
#endif
#define DBGOUT(x) do { if (debug) OutputDebugString (x); } while(0)
#define DBGOUT2(awk,x) do { if (awk->debug) OutputDebugString (x); } while(0)
@ -74,7 +70,6 @@ CAwk::CAwk ():
CAwk::~CAwk ()
{
while (bfn_list != NULL)
{
bfn_t* next = bfn_list->next;
@ -233,11 +228,11 @@ static ase_ssize_t __read_source (
if (cmd == ASE_AWK_IO_OPEN)
{
return (ase_ssize_t)awk->Fire_OpenSource (AWK_SOURCE_READ);
return (ase_ssize_t)awk->Fire_OpenSource (0);
}
else if (cmd == ASE_AWK_IO_CLOSE)
{
return (ase_ssize_t)awk->Fire_CloseSource (AWK_SOURCE_READ);
return (ase_ssize_t)awk->Fire_CloseSource (0);
}
else if (cmd == ASE_AWK_IO_READ)
{
@ -301,11 +296,11 @@ static ase_ssize_t __write_source (
if (cmd == ASE_AWK_IO_OPEN)
{
return (ase_ssize_t)awk->Fire_OpenSource (AWK_SOURCE_WRITE);
return (ase_ssize_t)awk->Fire_OpenSource (1);
}
else if (cmd == ASE_AWK_IO_CLOSE)
{
return (ase_ssize_t)awk->Fire_CloseSource (AWK_SOURCE_WRITE);
return (ase_ssize_t)awk->Fire_CloseSource (1);
}
else if (cmd == ASE_AWK_IO_WRITE)
{
@ -447,7 +442,7 @@ static int __handle_bfn (
}
ase_awk_val_t* ret;
int n = awk->Fire_HandleFunction (run, name, aa, &ret);
int n = awk->Fire_HandleBuiltinFunction (run, name, aa, &ret);
if (n == 1)
{
ase_char_t buf[128];
@ -476,7 +471,7 @@ static int __handle_bfn (
return -1;
}
/* name and aa are destroyed in HandleFunction */
/* name and aa are destroyed in HandleBuiltinFunction */
//SafeArrayDestroy (aa);
//SysFreeString (name);
@ -484,7 +479,7 @@ static int __handle_bfn (
return 0;
}
HRESULT CAwk::Parse (VARIANT_BOOL* ret)
HRESULT CAwk::Parse (int* ret)
{
if (handle == NULL)
{
@ -522,7 +517,7 @@ HRESULT CAwk::Parse (VARIANT_BOOL* ret)
errmsg, ASE_COUNTOF(errmsg),
ase_awk_geterrstr(NULL, ASE_AWK_ENOMEM));
*ret = VARIANT_FALSE;
*ret = -1;
DBGOUT (_T("cannot open awk"));
return S_OK;
@ -561,7 +556,7 @@ HRESULT CAwk::Parse (VARIANT_BOOL* ret)
ase_awk_geterror (handle, &errnum, &errlin, &msg);
ase_strxcpy (errmsg, ASE_COUNTOF(errmsg), msg);
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
}
@ -581,12 +576,12 @@ HRESULT CAwk::Parse (VARIANT_BOOL* ret)
DBGOUT (_T("cannot parse the source code"));
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
else DBGOUT (_T("parsed the source code successfully"));
*ret = VARIANT_TRUE;
*ret = 0;
return S_OK;
}
@ -629,8 +624,8 @@ static ase_ssize_t __process_extio (
DBGOUT2 (awk, _T("cannot set the name of the extio input buffer"));
return -1;
}
extio2->type = (AwkExtioType)(epa->type & 0xFF);
extio2->mode = (AwkExtioMode)(epa->mode);
extio2->type = epa->type & 0xFF;
extio2->mode = epa->mode;
read_buf->AddRef ();
extio2->read_buf = read_buf;
@ -752,11 +747,9 @@ static ase_ssize_t __process_extio (
return -1;
}
HRESULT CAwk::Run (VARIANT argarray, VARIANT_BOOL* ret)
HRESULT CAwk::Run (int* ret)
{
const ase_char_t* entry = NULL;
ase_awk_runarg_t* runarg;
long nrunargs;
if (handle == NULL)
{
@ -764,7 +757,7 @@ HRESULT CAwk::Run (VARIANT argarray, VARIANT_BOOL* ret)
errlin = 0;
_tcscpy (errmsg, _T("parse not called yet"));
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
@ -778,80 +771,7 @@ HRESULT CAwk::Run (VARIANT argarray, VARIANT_BOOL* ret)
if (entry_point != NULL &&
SysStringLen(entry_point) > 0) entry = entry_point;
if (argarray.vt == VT_EMPTY || argarray.vt == VT_NULL)
{
/* no run-time argument specified */
runarg = NULL;
}
else if (argarray.vt == (VT_ARRAY|VT_BSTR))
{
SAFEARRAY* sa = argarray.parray;
UINT dim = SafeArrayGetDim (sa);
if (dim != 1)
{
/* arguments should not be multi-dimensional */
errnum = ASE_AWK_EINTERN;
errlin = 0;
_tcscpy (errmsg, _T("multi-dimensional run-time argument array not allowed"));
*ret = VARIANT_FALSE;
return S_OK;
}
long lbound, ubound;
SafeArrayGetLBound (sa, 1, &lbound);
SafeArrayGetUBound (sa, 1, &ubound);
nrunargs = ubound - lbound + 1;
runarg = (ase_awk_runarg_t*) malloc (sizeof(*runarg) * (nrunargs+1));
if (runarg == NULL)
{
errnum = ASE_AWK_ENOMEM;
errlin = 0;
ase_strxcpy (
errmsg, ASE_COUNTOF(errmsg),
ase_awk_geterrstr(NULL, errnum));
*ret = VARIANT_FALSE;
return S_OK;
}
long i, j;
for (i = lbound, j = 0; i <= ubound; i++, j++)
{
BSTR bstr;
HRESULT hr = SafeArrayGetElement (sa, &i, (void**)&bstr);
if (FAILED(hr))
{
errnum = ASE_AWK_EINTERN;
errlin = 0;
_tcscpy (errmsg, _T("cannot get run-time argument array element"));
for (long i = 0; i < j; i++) SysFreeString (runarg[i].ptr);
free (runarg);
*ret = VARIANT_FALSE;
return S_OK;
}
runarg[j].ptr = bstr;
runarg[j].len = SysStringLen (bstr);
}
runarg[j].ptr = NULL;
runarg[j].len = 0;
}
else
{
errnum = ASE_AWK_EINTERN;
errlin = 0;
_tcscpy (errmsg, _T("invalid arguments"));
*ret = VARIANT_FALSE;
return S_OK;
}
if (ase_awk_run (handle, entry, &runios, NULL, runarg, this) == -1)
if (ase_awk_run (handle, entry, &runios, NULL, NULL, this) == -1)
{
const ase_char_t* msg;
@ -859,31 +779,17 @@ HRESULT CAwk::Run (VARIANT argarray, VARIANT_BOOL* ret)
ase_strxcpy (errmsg, ASE_COUNTOF(errmsg), msg);
DBGOUT (_T("cannot run the program"));
if (runarg != NULL)
{
for (long j = 0; j < nrunargs; j++) SysFreeString (runarg[j].ptr);
free (runarg);
}
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
else DBGOUT (_T("run the program successfully"));
if (runarg != NULL)
{
for (long j = 0; j < nrunargs; j++) SysFreeString (runarg[j].ptr);
free (runarg);
}
*ret = VARIANT_TRUE;
*ret = 0;
return S_OK;
}
STDMETHODIMP CAwk::AddFunction (
BSTR name, int minArgs, int maxArgs, VARIANT_BOOL* ret)
STDMETHODIMP CAwk::AddBuiltinFunction (
BSTR name, int min_args, int max_args, int* ret)
{
bfn_t* bfn;
size_t name_len = SysStringLen(name);
@ -901,7 +807,7 @@ STDMETHODIMP CAwk::AddFunction (
_T("'%.*s' added already"),
bfn->name.len, bfn->name.ptr);
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
}
@ -915,7 +821,7 @@ STDMETHODIMP CAwk::AddFunction (
errmsg, ASE_COUNTOF(errmsg),
ase_awk_geterrstr(NULL, errnum));
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
@ -931,21 +837,21 @@ STDMETHODIMP CAwk::AddFunction (
errmsg, ASE_COUNTOF(errmsg),
ase_awk_geterrstr(NULL, errnum));
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
memcpy (bfn->name.ptr, name, sizeof(TCHAR) * bfn->name.len);
bfn->min_args = minArgs;
bfn->max_args = maxArgs;
bfn->min_args = min_args;
bfn->max_args = max_args;
bfn->next = bfn_list;
bfn_list = bfn;
*ret = VARIANT_TRUE;
*ret = 0;
return S_OK;
}
STDMETHODIMP CAwk::DeleteFunction (BSTR name, VARIANT_BOOL* ret)
STDMETHODIMP CAwk::DeleteBuiltinFunction (BSTR name, int* ret)
{
size_t name_len = SysStringLen(name);
bfn_t* bfn, * next, * prev = NULL;
@ -964,7 +870,7 @@ STDMETHODIMP CAwk::DeleteFunction (BSTR name, VARIANT_BOOL* ret)
if (prev == NULL) bfn_list = next;
else prev->next = next;
*ret = VARIANT_TRUE;
*ret = 0;
return S_OK;
}
@ -977,7 +883,7 @@ STDMETHODIMP CAwk::DeleteFunction (BSTR name, VARIANT_BOOL* ret)
errmsg, ASE_COUNTOF(errmsg),
ase_awk_geterrstr(NULL, errnum));
*ret = VARIANT_FALSE;
*ret = -1;
return S_OK;
}
@ -1001,14 +907,14 @@ STDMETHODIMP CAwk::get_ErrorMessage(BSTR *pVal)
return S_OK;
}
STDMETHODIMP CAwk::get_ImplicitVariable(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_ImplicitVariable(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_IMPLICIT) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_ImplicitVariable(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_ImplicitVariable(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_IMPLICIT;
else option = option & ~ASE_AWK_IMPLICIT;
@ -1016,14 +922,14 @@ STDMETHODIMP CAwk::put_ImplicitVariable(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_ExplicitVariable(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_ExplicitVariable(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_EXPLICIT) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_ExplicitVariable(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_ExplicitVariable(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_EXPLICIT;
else option = option & ~ASE_AWK_EXPLICIT;
@ -1031,14 +937,14 @@ STDMETHODIMP CAwk::put_ExplicitVariable(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_UniqueFunction(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_UniqueFunction(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_UNIQUEFN) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_UniqueFunction(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_UniqueFunction(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_UNIQUEFN;
else option = option & ~ASE_AWK_UNIQUEFN;
@ -1046,14 +952,14 @@ STDMETHODIMP CAwk::put_UniqueFunction(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_VariableShading(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_VariableShading(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_SHADING) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_VariableShading(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_VariableShading(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_SHADING;
else option = option & ~ASE_AWK_SHADING;
@ -1061,14 +967,14 @@ STDMETHODIMP CAwk::put_VariableShading(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_ShiftOperators(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_ShiftOperators(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_SHIFT) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_ShiftOperators(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_ShiftOperators(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_SHIFT;
else option = option & ~ASE_AWK_SHIFT;
@ -1076,14 +982,14 @@ STDMETHODIMP CAwk::put_ShiftOperators(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_IdivOperator(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_IdivOperator(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_IDIV) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_IdivOperator(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_IdivOperator(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_IDIV;
else option = option & ~ASE_AWK_IDIV;
@ -1091,14 +997,14 @@ STDMETHODIMP CAwk::put_IdivOperator(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_ConcatString(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_ConcatString(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_STRCONCAT) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_ConcatString(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_ConcatString(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_STRCONCAT;
else option = option & ~ASE_AWK_STRCONCAT;
@ -1106,14 +1012,14 @@ STDMETHODIMP CAwk::put_ConcatString(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_SupportExtio(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_SupportExtio(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_EXTIO) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_SupportExtio(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_SupportExtio(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_EXTIO;
else option = option & ~ASE_AWK_EXTIO;
@ -1121,14 +1027,14 @@ STDMETHODIMP CAwk::put_SupportExtio(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_SupportBlockless(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_SupportBlockless(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_BLOCKLESS) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_SupportBlockless(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_SupportBlockless(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_BLOCKLESS;
else option = option & ~ASE_AWK_BLOCKLESS;
@ -1136,14 +1042,14 @@ STDMETHODIMP CAwk::put_SupportBlockless(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_StringBaseOne(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_StringBaseOne(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_STRBASEONE) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_StringBaseOne(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_StringBaseOne(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_STRBASEONE;
else option = option & ~ASE_AWK_STRBASEONE;
@ -1151,14 +1057,14 @@ STDMETHODIMP CAwk::put_StringBaseOne(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_StripSpaces(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_StripSpaces(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_STRIPSPACES) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_StripSpaces(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_StripSpaces(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_STRIPSPACES;
else option = option & ~ASE_AWK_STRIPSPACES;
@ -1166,14 +1072,14 @@ STDMETHODIMP CAwk::put_StripSpaces(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_Nextofile(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_Nextofile(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_NEXTOFILE) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_Nextofile(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_Nextofile(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_NEXTOFILE;
else option = option & ~ASE_AWK_NEXTOFILE;
@ -1181,14 +1087,14 @@ STDMETHODIMP CAwk::put_Nextofile(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_UseCrlf(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_UseCrlf(BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_CRLF) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_UseCrlf(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_UseCrlf(BOOL newVal)
{
if (newVal) option = option | ASE_AWK_CRLF;
else option = option & ~ASE_AWK_CRLF;
@ -1196,21 +1102,6 @@ STDMETHODIMP CAwk::put_UseCrlf(VARIANT_BOOL newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_ArgumentsToEntryPoint(VARIANT_BOOL *pVal)
{
if (handle != NULL) option = ase_awk_getoption (handle);
*pVal = (option & ASE_AWK_ARGSTOMAIN) == 1;
return S_OK;
}
STDMETHODIMP CAwk::put_ArgumentsToEntryPoint(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)
{
if (handle != NULL)
@ -1370,25 +1261,25 @@ STDMETHODIMP CAwk::put_EntryPoint(BSTR newVal)
return S_OK;
}
STDMETHODIMP CAwk::get_Debug(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_Debug(BOOL *pVal)
{
*pVal = debug;
return S_OK;
}
STDMETHODIMP CAwk::put_Debug(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_Debug(BOOL newVal)
{
debug = newVal;
return S_OK;
}
STDMETHODIMP CAwk::get_UseLongLong(VARIANT_BOOL *pVal)
STDMETHODIMP CAwk::get_UseLongLong(BOOL *pVal)
{
*pVal = use_longlong;
return S_OK;
}
STDMETHODIMP CAwk::put_UseLongLong(VARIANT_BOOL newVal)
STDMETHODIMP CAwk::put_UseLongLong(BOOL newVal)
{
use_longlong = newVal;
return S_OK;

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.h,v 1.23 2007-04-22 07:47:15 bacon Exp $
* $Id: Awk.h,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/
@ -21,13 +21,13 @@
// CAwk
class CAwk :
public IDispatchImpl<IAwk, &IID_IAwk, &LIBID_ASECOM>,
public IDispatchImpl<IAwk, &IID_IAwk, &LIBID_ASELib>,
public ISupportErrorInfo,
/*public CComObjectRoot,*/
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CAwk,&CLSID_Awk>,
public IConnectionPointContainerImpl<CAwk>,
public IProvideClassInfo2Impl<&CLSID_Awk, &DIID_IAwkEvents, &LIBID_ASECOM>,
public IProvideClassInfo2Impl<&CLSID_Awk, &DIID_IAwkEvents, &LIBID_ASELib>,
public CProxyIAwkEvents< CAwk >
{
@ -77,8 +77,8 @@ public:
} * bfn_list;
BSTR entry_point;
VARIANT_BOOL debug;
VARIANT_BOOL use_longlong;
BOOL debug;
BOOL use_longlong;
public:
CAwk();
~CAwk ();
@ -106,10 +106,9 @@ DECLARE_REGISTRY_RESOURCEID(IDR_AWK)
// IAwk
public:
STDMETHOD(get_UseLongLong)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_UseLongLong)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_Debug)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_Debug)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(put_UseLongLong)(/*[in]*/ BOOL newVal);
STDMETHOD(get_Debug)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_Debug)(/*[in]*/ BOOL newVal);
STDMETHOD(get_EntryPoint)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_EntryPoint)(/*[in]*/ BSTR newVal);
STDMETHOD(get_MaxDepthForRexMatch)(/*[out, retval]*/ int *pVal);
@ -124,48 +123,40 @@ public:
STDMETHOD(put_MaxDepthForBlockRun)(/*[in]*/ int newVal);
STDMETHOD(get_MaxDepthForBlockParse)(/*[out, retval]*/ int *pVal);
STDMETHOD(put_MaxDepthForBlockParse)(/*[in]*/ int newVal);
STDMETHOD(get_ArgumentsToEntryPoint)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_ArgumentsToEntryPoint)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_UseCrlf)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_UseCrlf)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_Nextofile)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_Nextofile)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_StripSpaces)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_StripSpaces)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_StringBaseOne)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_StringBaseOne)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_SupportBlockless)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_SupportBlockless)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_SupportExtio)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_SupportExtio)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_ConcatString)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_ConcatString)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_IdivOperator)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_IdivOperator)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_ShiftOperators)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_ShiftOperators)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_VariableShading)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_VariableShading)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_UniqueFunction)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_UniqueFunction)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_ExplicitVariable)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_ExplicitVariable)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_ImplicitVariable)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_ImplicitVariable)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_UseCrlf)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_UseCrlf)(/*[in]*/ BOOL newVal);
STDMETHOD(get_Nextofile)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_Nextofile)(/*[in]*/ BOOL newVal);
STDMETHOD(get_StripSpaces)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_StripSpaces)(/*[in]*/ BOOL newVal);
STDMETHOD(get_StringBaseOne)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_StringBaseOne)(/*[in]*/ BOOL newVal);
STDMETHOD(get_SupportBlockless)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_SupportBlockless)(/*[in]*/ BOOL newVal);
STDMETHOD(get_SupportExtio)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_SupportExtio)(/*[in]*/ BOOL newVal);
STDMETHOD(get_ConcatString)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_ConcatString)(/*[in]*/ BOOL newVal);
STDMETHOD(get_IdivOperator)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_IdivOperator)(/*[in]*/ BOOL newVal);
STDMETHOD(get_ShiftOperators)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_ShiftOperators)(/*[in]*/ BOOL newVal);
STDMETHOD(get_VariableShading)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_VariableShading)(/*[in]*/ BOOL newVal);
STDMETHOD(get_UniqueFunction)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_UniqueFunction)(/*[in]*/ BOOL newVal);
STDMETHOD(get_ExplicitVariable)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_ExplicitVariable)(/*[in]*/ BOOL newVal);
STDMETHOD(get_ImplicitVariable)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_ImplicitVariable)(/*[in]*/ BOOL newVal);
STDMETHOD(get_ErrorMessage)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal);
HRESULT __stdcall DeleteFunction (
/*[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 Run (
/*[in]*/ VARIANT argarray, /*[out, retval]*/ VARIANT_BOOL* ret);
STDMETHOD(DeleteBuiltinFunction)(/*[in]*/ BSTR name, /*[out, retval]*/ int* ret);
STDMETHOD(AddBuiltinFunction)(/*[in]*/ BSTR name, /*[in]*/ int min_args, /*[in]*/ int max_args, /*[out, retval]*/ int* ret);
STDMETHOD(get_UseLongLong)(/*[out, retval]*/ BOOL *pVal);
HRESULT __stdcall Parse (/*[out, retval]*/ int* ret);
HRESULT __stdcall Run (/*[out, retval]*/ int* ret);
};
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: AwkExtio.cpp,v 1.11 2007-04-15 13:15:35 bacon Exp $
* $Id: AwkExtio.cpp,v 1.1 2007/03/28 14:05:22 bacon Exp $
*
* {License}
*/
@ -43,13 +43,13 @@ BOOL CAwkExtio::PutName (const TCHAR* val)
return (name == NULL)? FALSE: TRUE;
}
STDMETHODIMP CAwkExtio::get_Type(AwkExtioType *pVal)
STDMETHODIMP CAwkExtio::get_Type(int *pVal)
{
*pVal = type;
return S_OK;
}
STDMETHODIMP CAwkExtio::get_Mode(AwkExtioMode *pVal)
STDMETHODIMP CAwkExtio::get_Mode(int *pVal)
{
*pVal = mode;
return S_OK;

View File

@ -1,5 +1,5 @@
/*
* $Id: AwkExtio.h,v 1.11 2007-04-22 07:47:15 bacon Exp $
* $Id: AwkExtio.h,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/
@ -15,12 +15,12 @@
class ATL_NO_VTABLE CAwkExtio :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CAwkExtio, &CLSID_AwkExtio>,
public IDispatchImpl<IAwkExtio, &IID_IAwkExtio, &LIBID_ASECOM>
public IDispatchImpl<IAwkExtio, &IID_IAwkExtio, &LIBID_ASELib>
{
public:
BSTR name;
AwkExtioType type;
AwkExtioMode mode;
int type;
int mode;
VARIANT handle;
IBuffer* read_buf;
@ -45,8 +45,8 @@ END_COM_MAP()
public:
STDMETHOD(get_Handle)(/*[out, retval]*/ VARIANT *pVal);
STDMETHOD(put_Handle)(/*[in]*/ VARIANT newVal);
STDMETHOD(get_Mode)(/*[out, retval]*/ AwkExtioMode *pVal);
STDMETHOD(get_Type)(/*[out, retval]*/ AwkExtioType *pVal);
STDMETHOD(get_Mode)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_Type)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_Name)(/*[out, retval]*/ BSTR *pVal);
};

View File

@ -1,5 +1,5 @@
/*
* $Id: Buffer.cpp,v 1.6 2007-02-03 10:52:12 bacon Exp $
* $Id: Buffer.cpp,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/

View File

@ -1,5 +1,5 @@
/*
* $Id: Buffer.h,v 1.7 2007-04-22 07:47:15 bacon Exp $
* $Id: Buffer.h,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/
@ -13,7 +13,7 @@
class ATL_NO_VTABLE CBuffer :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CBuffer, &CLSID_Buffer>,
public IDispatchImpl<IBuffer, &IID_IBuffer, &LIBID_ASECOM>
public IDispatchImpl<IBuffer, &IID_IBuffer, &LIBID_ASELib>
{
public:
BSTR str;

View File

@ -1,5 +1,5 @@
/*
* $Id: asecom.cpp,v 1.3 2007-04-22 07:47:15 bacon Exp $
* $Id: asecom.cpp,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/
@ -34,7 +34,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_Module.Init(ObjectMap, hInstance, &LIBID_ASECOM);
_Module.Init(ObjectMap, hInstance, &LIBID_ASELib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)

View File

@ -53,11 +53,11 @@ LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 aseawk.lib asecmn.lib aseutl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /implib:"debug/asecom.lib" /pdbtype:sept /libpath:"$(OutDir)"
# Begin Custom Build - Performing registration
IntDir=.\debug
OutDir=.\../debug/lib
TargetPath=\projects\ase\debug\lib\asecom.dll
InputPath=\projects\ase\debug\lib\asecom.dll
SOURCE="$(InputPath)"
IntDir=./debug
OutDir=./../debug/lib
#TargetPath=\projects\ase\debug\lib\asecom.dll
#InputPath=\projects\ase\debug\lib\asecom.dll
#SOURCE="$(InputPath)"
"$(IntDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
@ -94,13 +94,13 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo /o"release/awk.bsc"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 aseawk.lib asecmn.lib aseutl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /implib:"release/asecom.lib" /libpath:"$(OutDir)"
# ADD LINK32 aseawk.lib asecmn.lib aseutl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /implib:"release/asecom.lib" /libpath:"$(OutDir)"
# Begin Custom Build - Performing registration
IntDir=.\release
OutDir=.\../release/lib
TargetPath=\projects\ase\release\lib\asecom.dll
InputPath=\projects\ase\release\lib\asecom.dll
SOURCE="$(InputPath)"
IntDir=./release
OutDir=./../release/lib
#TargetPath=\projects\ase\release\lib\asecom.dll
#InputPath=\projects\ase\release\lib\asecom.dll
#SOURCE="$(InputPath)"
"$(IntDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
@ -186,6 +186,10 @@ SOURCE=.\resource.h
SOURCE=.\stdafx.h
# End Source File
# Begin Source File
SOURCE=.\xxx.h
# End Source File
# End Group
# Begin Group "Resource Files"

View File

@ -1,5 +1,5 @@
/*
* $Id: asecom.idl,v 1.8 2007-04-22 08:41:51 bacon Exp $
* $Id: asecom.idl,v 1.1 2007/03/28 14:05:23 bacon Exp $
*/
import "oaidl.idl";
@ -16,161 +16,149 @@ import "ocidl.idl";
interface IAwk : IDispatch
{
[id(1), helpstring("method Parse")]
HRESULT Parse([out,retval] VARIANT_BOOL* ret);
HRESULT Parse([out, retval] int* ret);
[id(2), helpstring("method Run")]
HRESULT Run([in] VARIANT argarray, [out,retval] VARIANT_BOOL* ret);
HRESULT Run([out, retval] int* ret);
[id(3), helpstring("method AddFunction")]
HRESULT AddFunction([in] BSTR name, [in] int minArgs, [in] int maxArgs, [out,retval] VARIANT_BOOL* ret);
[id(3), helpstring("method AddBuiltinFunction")]
HRESULT AddBuiltinFunction([in] BSTR name, [in] int min_args, [in] int max_args, [out, retval] int* ret);
[id(4), helpstring("method DeleteFunction")]
HRESULT DeleteFunction([in] BSTR name, [out,retval] VARIANT_BOOL* ret);
[id(4), helpstring("method DeleteBuiltinFunction")]
HRESULT DeleteBuiltinFunction([in] BSTR name, [out, retval] int* ret);
[propget, id(5), helpstring("property ErrorCode")]
HRESULT ErrorCode([out,retval] int *pVal);
HRESULT ErrorCode([out, retval] int *pVal);
[propget, id(6), helpstring("property ErrorLine")]
HRESULT ErrorLine([out,retval] int *pVal);
HRESULT ErrorLine([out, retval] int *pVal);
[propget, id(7), helpstring("property ErrorMessage")]
HRESULT ErrorMessage([out,retval] BSTR *pVal);
HRESULT ErrorMessage([out, retval] BSTR *pVal);
[propget, id(8), helpstring("property ImplicitVariable")]
HRESULT ImplicitVariable([out,retval] VARIANT_BOOL *pVal);
HRESULT ImplicitVariable([out, retval] BOOL *pVal);
[propput, id(8), helpstring("property ImplicitVariable")]
HRESULT ImplicitVariable([in] VARIANT_BOOL newVal);
HRESULT ImplicitVariable([in] BOOL newVal);
[propget, id(9), helpstring("property ExplicitVariable")]
HRESULT ExplicitVariable([out,retval] VARIANT_BOOL *pVal);
HRESULT ExplicitVariable([out, retval] BOOL *pVal);
[propput, id(9), helpstring("property ExplicitVariable")]
HRESULT ExplicitVariable([in] VARIANT_BOOL newVal);
HRESULT ExplicitVariable([in] BOOL newVal);
[propget, id(10), helpstring("property UniqueFunction")]
HRESULT UniqueFunction([out,retval] VARIANT_BOOL *pVal);
HRESULT UniqueFunction([out, retval] BOOL *pVal);
[propput, id(10), helpstring("property UniqueFunction")]
HRESULT UniqueFunction([in] VARIANT_BOOL newVal);
HRESULT UniqueFunction([in] BOOL newVal);
[propget, id(11), helpstring("property VariableShading")]
HRESULT VariableShading([out,retval] VARIANT_BOOL *pVal);
HRESULT VariableShading([out, retval] BOOL *pVal);
[propput, id(11), helpstring("property VariableShading")]
HRESULT VariableShading([in] VARIANT_BOOL newVal);
HRESULT VariableShading([in] BOOL newVal);
[propget, id(12), helpstring("property ShiftOperators")]
HRESULT ShiftOperators([out,retval] VARIANT_BOOL *pVal);
HRESULT ShiftOperators([out, retval] BOOL *pVal);
[propput, id(12), helpstring("property ShiftOperators")]
HRESULT ShiftOperators([in] VARIANT_BOOL newVal);
HRESULT ShiftOperators([in] BOOL newVal);
[propget, id(13), helpstring("property IdivOperator")]
HRESULT IdivOperator([out,retval] VARIANT_BOOL *pVal);
HRESULT IdivOperator([out, retval] BOOL *pVal);
[propput, id(13), helpstring("property IdivOperator")]
HRESULT IdivOperator([in] VARIANT_BOOL newVal);
HRESULT IdivOperator([in] BOOL newVal);
[propget, id(14), helpstring("property ConcatString")]
HRESULT ConcatString([out,retval] VARIANT_BOOL *pVal);
HRESULT ConcatString([out, retval] BOOL *pVal);
[propput, id(14), helpstring("property ConcatString")]
HRESULT ConcatString([in] VARIANT_BOOL newVal);
HRESULT ConcatString([in] BOOL newVal);
[propget, id(15), helpstring("property SupportExtio")]
HRESULT SupportExtio([out,retval] VARIANT_BOOL *pVal);
HRESULT SupportExtio([out, retval] BOOL *pVal);
[propput, id(15), helpstring("property SupportExtio")]
HRESULT SupportExtio([in] VARIANT_BOOL newVal);
HRESULT SupportExtio([in] BOOL newVal);
[propget, id(16), helpstring("property SupportBlockless")]
HRESULT SupportBlockless([out,retval] VARIANT_BOOL *pVal);
HRESULT SupportBlockless([out, retval] BOOL *pVal);
[propput, id(16), helpstring("property SupportBlockless")]
HRESULT SupportBlockless([in] VARIANT_BOOL newVal);
HRESULT SupportBlockless([in] BOOL newVal);
[propget, id(17), helpstring("property StringBaseOne")]
HRESULT StringBaseOne([out,retval] VARIANT_BOOL *pVal);
HRESULT StringBaseOne([out, retval] BOOL *pVal);
[propput, id(17), helpstring("property StringBaseOne")]
HRESULT StringBaseOne([in] VARIANT_BOOL newVal);
HRESULT StringBaseOne([in] BOOL newVal);
[propget, id(18), helpstring("property StripSpaces")]
HRESULT StripSpaces([out,retval] VARIANT_BOOL *pVal);
HRESULT StripSpaces([out, retval] BOOL *pVal);
[propput, id(18), helpstring("property StripSpaces")]
HRESULT StripSpaces([in] VARIANT_BOOL newVal);
HRESULT StripSpaces([in] BOOL newVal);
[propget, id(19), helpstring("property Nextofile")]
HRESULT Nextofile([out,retval] VARIANT_BOOL *pVal);
HRESULT Nextofile([out, retval] BOOL *pVal);
[propput, id(19), helpstring("property Nextofile")]
HRESULT Nextofile([in] VARIANT_BOOL newVal);
HRESULT Nextofile([in] BOOL newVal);
[propget, id(20), helpstring("property UseCrlf")]
HRESULT UseCrlf([out,retval] VARIANT_BOOL *pVal);
HRESULT UseCrlf([out, retval] BOOL *pVal);
[propput, id(20), helpstring("property UseCrlf")]
HRESULT UseCrlf([in] VARIANT_BOOL newVal);
HRESULT UseCrlf([in] BOOL newVal);
[propget, id(21), helpstring("property ArgumentsToEntryPoint")]
HRESULT ArgumentsToEntryPoint([out,retval] VARIANT_BOOL *pVal);
[propput, id(21), helpstring("property ArgumentsToEntryPoint")]
HRESULT ArgumentsToEntryPoint([in] VARIANT_BOOL newVal);
[propget, id(22), helpstring("property MaxDepthForBlockParse")]
HRESULT MaxDepthForBlockParse([out,retval] int *pVal);
[propput, id(22), helpstring("property MaxDepthForBlockParse")]
[propget, id(21), helpstring("property MaxDepthForBlockParse")]
HRESULT MaxDepthForBlockParse([out, retval] int *pVal);
[propput, id(21), helpstring("property MaxDepthForBlockParse")]
HRESULT MaxDepthForBlockParse([in] int newVal);
[propget, id(23), helpstring("property MaxDepthForBlockRun")]
HRESULT MaxDepthForBlockRun([out,retval] int *pVal);
[propput, id(23), helpstring("property MaxDepthForBlockRun")]
[propget, id(22), helpstring("property MaxDepthForBlockRun")]
HRESULT MaxDepthForBlockRun([out, retval] int *pVal);
[propput, id(22), helpstring("property MaxDepthForBlockRun")]
HRESULT MaxDepthForBlockRun([in] int newVal);
[propget, id(24), helpstring("property MaxDepthForExprParse")]
HRESULT MaxDepthForExprParse([out,retval] int *pVal);
[propput, id(24), helpstring("property MaxDepthForExprParse")]
[propget, id(23), helpstring("property MaxDepthForExprParse")]
HRESULT MaxDepthForExprParse([out, retval] int *pVal);
[propput, id(23), helpstring("property MaxDepthForExprParse")]
HRESULT MaxDepthForExprParse([in] int newVal);
[propget, id(25), helpstring("property MaxDepthForExprRun")]
HRESULT MaxDepthForExprRun([out,retval] int *pVal);
[propput, id(25), helpstring("property MaxDepthForExprRun")]
[propget, id(24), helpstring("property MaxDepthForExprRun")]
HRESULT MaxDepthForExprRun([out, retval] int *pVal);
[propput, id(24), helpstring("property MaxDepthForExprRun")]
HRESULT MaxDepthForExprRun([in] int newVal);
[propget, id(26), helpstring("property MaxDepthForRexBuild")]
HRESULT MaxDepthForRexBuild([out,retval] int *pVal);
[propput, id(26), helpstring("property MaxDepthForRexBuild")]
[propget, id(25), helpstring("property MaxDepthForRexBuild")]
HRESULT MaxDepthForRexBuild([out, retval] int *pVal);
[propput, id(25), helpstring("property MaxDepthForRexBuild")]
HRESULT MaxDepthForRexBuild([in] int newVal);
[propget, id(27), helpstring("property MaxDepthForRexMatch")]
HRESULT MaxDepthForRexMatch([out,retval] int *pVal);
[propput, id(27), helpstring("property MaxDepthForRexMatch")]
[propget, id(26), helpstring("property MaxDepthForRexMatch")]
HRESULT MaxDepthForRexMatch([out, retval] int *pVal);
[propput, id(26), helpstring("property MaxDepthForRexMatch")]
HRESULT MaxDepthForRexMatch([in] int newVal);
[propget, id(28), helpstring("property EntryPoint")]
HRESULT EntryPoint([out,retval] BSTR *pVal);
[propput, id(28), helpstring("property EntryPoint")]
[propget, id(27), helpstring("property EntryPoint")]
HRESULT EntryPoint([out, retval] BSTR *pVal);
[propput, id(27), helpstring("property EntryPoint")]
HRESULT EntryPoint([in] BSTR newVal);
[propget, id(29), helpstring("property Debug")]
HRESULT Debug([out,retval] VARIANT_BOOL *pVal);
[propput, id(29), helpstring("property Debug")]
HRESULT Debug([in] VARIANT_BOOL newVal);
[propget, id(28), helpstring("property Debug")]
HRESULT Debug([out, retval] BOOL *pVal);
[propput, id(28), helpstring("property Debug")]
HRESULT Debug([in] BOOL newVal);
[propget, id(30), helpstring("property UseLongLong")]
HRESULT UseLongLong([out,retval] VARIANT_BOOL *pVal);
[propput, id(30), helpstring("property UseLongLong")]
HRESULT UseLongLong([in] VARIANT_BOOL newVal);
[propget, id(29), helpstring("property UseLongLong")]
HRESULT UseLongLong([out, retval] BOOL *pVal);
[propput, id(29), helpstring("property UseLongLong")]
HRESULT UseLongLong([in] BOOL newVal);
};
/* ASECOM */
/* ASELib */
[
uuid(F9C69806-16A1-4162-998A-876B33C470BF),
version(1.0),
helpstring("ASECOM 1.0 Type Library")
helpstring("ASE 1.0 Type Library")
]
library ASECOM
library ASELib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[helpstring("Awk source mode")]
typedef [v1_enum] enum AwkSourceMode
{
AWK_SOURCE_READ = 0,
AWK_SOURCE_WRITE = 1
} AwkSourceMode;
[helpstring("AwkExtio type")]
[helpstring("AwkExtio tpe")]
typedef [v1_enum] enum AwkExtioType
{
AWK_EXTIO_PIPE = 0,
@ -208,7 +196,7 @@ library ASECOM
interface IBuffer : IDispatch
{
[propget, id(1), helpstring("property Value")]
HRESULT Value([out,retval] BSTR *pVal);
HRESULT Value([out, retval] BSTR *pVal);
[propput, id(1), helpstring("property Value")]
HRESULT Value([in] BSTR newVal);
@ -225,16 +213,16 @@ library ASECOM
interface IAwkExtio : IDispatch
{
[propget, id(1), helpstring("property Name")]
HRESULT Name([out,retval] BSTR *pVal);
HRESULT Name([out, retval] BSTR *pVal);
[propget, id(2), helpstring("property Type")]
HRESULT Type([out,retval] AwkExtioType *pVal);
HRESULT Type([out, retval] int *pVal);
[propget, id(3), helpstring("property Mode")]
HRESULT Mode([out,retval] AwkExtioMode *pVal);
HRESULT Mode([out, retval] int *pVal);
[propget, id(4), helpstring("property Handle")]
HRESULT Handle([out,retval] VARIANT *pVal);
HRESULT Handle([out, retval] VARIANT *pVal);
[propput, id(4), helpstring("property Handle")]
HRESULT Handle([in] VARIANT newVal);
};
@ -249,40 +237,37 @@ library ASECOM
properties:
methods:
[id(1), helpstring("open the source code")]
HRESULT OpenSource([in] AwkSourceMode mode, [out,retval] int* ret);
int OpenSource([in] int mode);
[id(2), helpstring("close the source code")]
HRESULT CloseSource([in] AwkSourceMode mode, [out,retval] int* ret);
int CloseSource([in] int mode);
[id(3), helpstring("read the source code")]
HRESULT ReadSource([in] IBuffer* buf, [out,retval] int* ret);
int ReadSource([in] IBuffer* buf);
[id(4), helpstring("write the source code")]
HRESULT WriteSource([in] IBuffer* buf, [out,retval] int* ret);
int WriteSource([in] IBuffer* buf);
[id(5), helpstring("method OpenExtio")]
HRESULT OpenExtio([in] IAwkExtio* extio, [out,retval] int* ret);
int OpenExtio([in] IAwkExtio* extio);
[id(6), helpstring("method CloseExtio")]
HRESULT CloseExtio([in] IAwkExtio* extio, [out,retval] int* ret);
int CloseExtio([in] IAwkExtio* extio);
[id(7), helpstring("method ReadExtio")]
HRESULT ReadExtio([in] IAwkExtio* extio, [in] IBuffer* buf, [out,retval] int* ret);
int ReadExtio([in] IAwkExtio* extio, [in] IBuffer* buf);
[id(8), helpstring("method WriteExtio")]
HRESULT WriteExtio([in] IAwkExtio* extio, [in] IBuffer* buf, [out,retval] int* ret);
int WriteExtio([in] IAwkExtio* extio, [in] IBuffer* buf);
[id(9), helpstring("method FlushExtio")]
HRESULT FlushExtio([in] IAwkExtio* extio, [out,retval] int* ret);
int FlushExtio([in] IAwkExtio* extio);
[id(10), helpstring("method NextExtio")]
HRESULT NextExtio([in] IAwkExtio* extio, [out,retval] int* ret);
int NextExtio([in] IAwkExtio* extio);
[id(11), helpstring("method HandleFunction")]
HRESULT HandleFunction([in] BSTR name, [in] VARIANT argarray, [out,retval] VARIANT* ret);
/*[id(12), helpstring("method OnClose")]
HRESULT OnClose([out,retval] int* ret);*/
[id(11), helpstring("method HandleBuiltinFunction")]
int HandleBuiltinFunction([in] BSTR name, [in] VARIANT argarray, [out, retval] VARIANT* ret);
};
/* Awk */

View File

@ -1,4 +1,4 @@
// Microsoft Visual C++ generated resource script.
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// TEXTINCLUDE
//
1 TEXTINCLUDE
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
3 TEXTINCLUDE DISCARDABLE
BEGIN
"1 TYPELIB ""asecom.tlb""\r\n"
"\0"
@ -47,14 +47,15 @@ END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -67,15 +68,17 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BLOCK "040904B0"
BEGIN
VALUE "FileDescription", "ASE.COM"
VALUE "FileVersion", "1, 0, 0, 0"
VALUE "InternalName", "ASECOM"
VALUE "LegalCopyright", "Hyung-Hwan Chung. All rights reserved"
VALUE "OriginalFilename", "asecom.dll"
VALUE "ProductName", "ASE.COM"
VALUE "ProductVersion", "1, 0, 0, 0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "ASE COM Module\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "ASE\0"
VALUE "LegalCopyright", "Copyright 2006\0"
VALUE "OriginalFilename", "asecom.dll\0"
VALUE "ProductName", "ASE COM Module\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "OLESelfRegister", "\0"
END
END
BLOCK "VarFileInfo"
@ -84,22 +87,24 @@ BEGIN
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//
IDR_AWK REGISTRY "Awk.rgs"
IDR_AWKEXTIO REGISTRY "AwkExtio.rgs"
IDR_BUFFER REGISTRY "Buffer.rgs"
IDR_AWK REGISTRY DISCARDABLE "Awk.rgs"
IDR_AWKEXTIO REGISTRY DISCARDABLE "AwkExtio.rgs"
IDR_BUFFER REGISTRY DISCARDABLE "Buffer.rgs"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
STRINGTABLE DISCARDABLE
BEGIN
IDS_PROJNAME "ASE COM Project"
END

View File

@ -1,5 +1,5 @@
/*
* $Id: awk_cp.h,v 1.11 2007-04-15 13:15:35 bacon Exp $
* $Id: awk_cp.h,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/
@ -506,7 +506,7 @@ public:
return -1;
}
int Fire_HandleFunction (
int Fire_HandleBuiltinFunction (
ase_awk_run_t* run, BSTR name, SAFEARRAY* argarray, ase_awk_val_t** retv)
{
T* pT = static_cast<T*>(this);
@ -595,43 +595,7 @@ public:
return 2; /* no proper handler */
}
INT Fire_OnClose ()
{
T* pT = static_cast<T*>(this);
int i, nconns = m_vec.GetSize();
CComVariant ret;
for (i = 0; i < nconns; i++)
{
pT->Lock();
CComPtr<IUnknown> sp = m_vec.GetAt(i);
pT->Unlock();
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
if (pDispatch == NULL) continue;
VariantClear (&ret);
HRESULT hr = pDispatch->Invoke(
0xC, IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_METHOD, NULL, &ret, NULL, NULL);
if (FAILED(hr)) continue;
if (ret.vt == VT_EMPTY) continue;
hr = ret.ChangeType (VT_I4);
if (FAILED(hr))
{
/* TODO: set the error code properly... */
/* invalid value returned... */
return -1;
}
return ret.lVal;
}
return -1;
}
};
#endif

View File

@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by asecom.rc
// Used by ase.rc
//
#define IDS_PROJNAME 100
#define IDR_AWK 101

View File

@ -1,5 +1,5 @@
/*
* $Id: stdafx.cpp,v 1.3 2007-02-03 10:52:12 bacon Exp $
* $Id: stdafx.cpp,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/

View File

@ -1,5 +1,5 @@
/*
* $Id: stdafx.h,v 1.3 2007-02-03 10:52:12 bacon Exp $
* $Id: stdafx.h,v 1.1 2007/03/28 14:05:23 bacon Exp $
*
* {License}
*/