*** empty log message ***

This commit is contained in:
hyung-hwan 2007-04-15 13:15:35 +00:00
parent 10e4d27cf2
commit 8536529c43
10 changed files with 95 additions and 53 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp,v 1.31 2007-04-14 15:30:14 bacon Exp $
* $Id: Awk.cpp,v 1.32 2007-04-15 13:15:35 bacon Exp $
*
* {License}
*/
@ -70,6 +70,7 @@ CAwk::CAwk ():
CAwk::~CAwk ()
{
while (bfn_list != NULL)
{
bfn_t* next = bfn_list->next;
@ -228,11 +229,11 @@ static ase_ssize_t __read_source (
if (cmd == ASE_AWK_IO_OPEN)
{
return (ase_ssize_t)awk->Fire_OpenSource (0);
return (ase_ssize_t)awk->Fire_OpenSource (AWK_SOURCE_READ);
}
else if (cmd == ASE_AWK_IO_CLOSE)
{
return (ase_ssize_t)awk->Fire_CloseSource (0);
return (ase_ssize_t)awk->Fire_CloseSource (AWK_SOURCE_READ);
}
else if (cmd == ASE_AWK_IO_READ)
{
@ -296,11 +297,11 @@ static ase_ssize_t __write_source (
if (cmd == ASE_AWK_IO_OPEN)
{
return (ase_ssize_t)awk->Fire_OpenSource (1);
return (ase_ssize_t)awk->Fire_OpenSource (AWK_SOURCE_WRITE);
}
else if (cmd == ASE_AWK_IO_CLOSE)
{
return (ase_ssize_t)awk->Fire_CloseSource (1);
return (ase_ssize_t)awk->Fire_CloseSource (AWK_SOURCE_WRITE);
}
else if (cmd == ASE_AWK_IO_WRITE)
{
@ -624,8 +625,8 @@ static ase_ssize_t __process_extio (
DBGOUT2 (awk, _T("cannot set the name of the extio input buffer"));
return -1;
}
extio2->type = epa->type & 0xFF;
extio2->mode = epa->mode;
extio2->type = (AwkExtioType)(epa->type & 0xFF);
extio2->mode = (AwkExtioMode)(epa->mode);
read_buf->AddRef ();
extio2->read_buf = read_buf;

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.h,v 1.18 2007-04-14 15:30:14 bacon Exp $
* $Id: Awk.h,v 1.19 2007-04-15 13:15:35 bacon Exp $
*
* {License}
*/
@ -106,6 +106,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_AWK)
// IAwk
public:
STDMETHOD(get_UseLongLong)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_UseLongLong)(/*[in]*/ BOOL newVal);
STDMETHOD(get_Debug)(/*[out, retval]*/ BOOL *pVal);
STDMETHOD(put_Debug)(/*[in]*/ BOOL newVal);
@ -152,9 +153,9 @@ public:
STDMETHOD(get_ErrorMessage)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal);
STDMETHOD(DeleteFunction)(/*[in]*/ BSTR name, /*[out, retval]*/ int* ret);
STDMETHOD(AddFunction)(/*[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);
};

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: AwkExtio.h,v 1.9 2007-02-03 10:52:12 bacon Exp $
* $Id: AwkExtio.h,v 1.10 2007-04-15 13:15:35 bacon Exp $
*
* {License}
*/
@ -19,8 +19,8 @@ class ATL_NO_VTABLE CAwkExtio :
{
public:
BSTR name;
int type;
int mode;
AwkExtioType type;
AwkExtioMode 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]*/ int *pVal);
STDMETHOD(get_Type)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_Mode)(/*[out, retval]*/ AwkExtioMode *pVal);
STDMETHOD(get_Type)(/*[out, retval]*/ AwkExtioType *pVal);
STDMETHOD(get_Name)(/*[out, retval]*/ BSTR *pVal);
};

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"
@ -96,11 +96,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 /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)"
# 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,10 +186,6 @@ 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.2 2007-04-14 15:30:14 bacon Exp $
* $Id: asecom.idl,v 1.3 2007-04-15 13:15:35 bacon Exp $
*/
import "oaidl.idl";
@ -223,10 +223,10 @@ library ASELib
HRESULT Name([out,retval] BSTR *pVal);
[propget, id(2), helpstring("property Type")]
HRESULT Type([out,retval] int *pVal);
HRESULT Type([out,retval] AwkExtioType *pVal);
[propget, id(3), helpstring("property Mode")]
HRESULT Mode([out,retval] int *pVal);
HRESULT Mode([out,retval] AwkExtioMode *pVal);
[propget, id(4), helpstring("property Handle")]
HRESULT Handle([out,retval] VARIANT *pVal);
@ -275,6 +275,9 @@ library ASELib
[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);*/
};
/* Awk */

View File

@ -54,8 +54,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -68,17 +68,21 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\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 "FileVersion", "1, 0, 0, 0\0"
VALUE "InternalName", "ASECOM\0"
VALUE "LegalCopyright", "Hyung-Hwan Chung. All rights reserved\0"
VALUE "LegalTrademarks", "\0"
VALUE "OLESelfRegister", "\0"
VALUE "OriginalFilename", "asecom.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "ASE COM Module\0"
VALUE "ProductVersion", "1, 0, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"

View File

@ -1,5 +1,5 @@
/*
* $Id: awk_cp.h,v 1.10 2007-04-14 15:30:14 bacon Exp $
* $Id: awk_cp.h,v 1.11 2007-04-15 13:15:35 bacon Exp $
*
* {License}
*/
@ -595,6 +595,43 @@ 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 ase.rc
// Used by asecom.rc
//
#define IDS_PROJNAME 100
#define IDR_AWK 101

View File

@ -175,18 +175,18 @@ Private Sub Execute_Click()
Awk.UseLongLong = False
Awk.Debug = True
If Awk.AddBuiltinFunction("sin", 1, 1) = -1 Then
If Awk.AddFunction("sin", 1, 1) = -1 Then
MsgBox "Cannot add builtin function - " + Awk.ErrorMessage
Exit Sub
End If
If Awk.AddBuiltinFunction("cos", 1, 1) = -1 Then
If Awk.AddFunction("cos", 1, 1) = -1 Then
MsgBox "Cannot add builtin function - " + Awk.ErrorMessage
Exit Sub
End If
Call Awk.AddBuiltinFunction("tan", 1, 1)
Call Awk.AddBuiltinFunction("sqrt", 1, 1)
Call Awk.AddBuiltinFunction("trim", 1, 1)
'Call Awk.DeleteBuiltinFunction("tan")
Call Awk.AddFunction("tan", 1, 1)
Call Awk.AddFunction("sqrt", 1, 1)
Call Awk.AddFunction("trim", 1, 1)
'Call Awk.DeleteFunction("tan")
If Awk.Parse() = -1 Then
MsgBox "PARSE ERROR [" + Str(Awk.ErrorLine) + "]" + Awk.ErrorMessage