Recovered from cvs revision 2007-04-30 05:47:00
This commit is contained in:
1286
ase/com/Awk.cpp
1286
ase/com/Awk.cpp
File diff suppressed because it is too large
Load Diff
162
ase/com/Awk.h
162
ase/com/Awk.h
@ -1,162 +0,0 @@
|
||||
/*
|
||||
* $Id: Awk.h,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_AWK_H_
|
||||
#define _ASE_COM_AWK_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "resource.h"
|
||||
#include "asecom.h"
|
||||
#include <ase/awk/awk.h>
|
||||
#include <ase/awk/val.h>
|
||||
#include "awk_cp.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwk
|
||||
|
||||
class CAwk :
|
||||
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_ASELib>,
|
||||
public CProxyIAwkEvents< CAwk >
|
||||
|
||||
{
|
||||
public:
|
||||
ase_awk_t* handle;
|
||||
int option;
|
||||
int errnum;
|
||||
ase_size_t errlin;
|
||||
ase_char_t errmsg[256];
|
||||
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
int parse;
|
||||
int run;
|
||||
} block;
|
||||
struct
|
||||
{
|
||||
int parse;
|
||||
int run;
|
||||
} expr;
|
||||
struct
|
||||
{
|
||||
int build;
|
||||
int match;
|
||||
} rex;
|
||||
} max_depth;
|
||||
|
||||
IBuffer* read_src_buf;
|
||||
IBuffer* write_src_buf;
|
||||
ase_size_t read_src_pos;
|
||||
ase_size_t read_src_len;
|
||||
|
||||
IBuffer* write_extio_buf;
|
||||
|
||||
struct bfn_t
|
||||
{
|
||||
struct
|
||||
{
|
||||
TCHAR* ptr;
|
||||
size_t len;
|
||||
} name;
|
||||
size_t min_args;
|
||||
size_t max_args;
|
||||
struct bfn_t* next;
|
||||
} * bfn_list;
|
||||
|
||||
BSTR entry_point;
|
||||
BOOL debug;
|
||||
BOOL use_longlong;
|
||||
public:
|
||||
CAwk();
|
||||
~CAwk ();
|
||||
|
||||
BEGIN_COM_MAP(CAwk)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
COM_INTERFACE_ENTRY(IAwk)
|
||||
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
||||
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo2)
|
||||
END_COM_MAP()
|
||||
|
||||
BEGIN_CONNECTION_POINT_MAP(CAwk)
|
||||
CONNECTION_POINT_ENTRY(DIID_IAwkEvents)
|
||||
END_CONNECTION_POINT_MAP()
|
||||
|
||||
//DECLARE_NOT_AGGREGATABLE(CAwk)
|
||||
// Remove the comment from the line above if you don't want your object to
|
||||
// support aggregation.
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_AWK)
|
||||
// ISupportsErrorInfo
|
||||
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
|
||||
|
||||
// IAwk
|
||||
public:
|
||||
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);
|
||||
STDMETHOD(put_MaxDepthForRexMatch)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForRexBuild)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForRexBuild)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForExprRun)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForExprRun)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForExprParse)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForExprParse)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForBlockRun)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForBlockRun)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForBlockParse)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForBlockParse)(/*[in]*/ int 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);
|
||||
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
|
@ -1,25 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
ASE.Awk.1 = s 'ASE Awk Class'
|
||||
{
|
||||
CLSID = s '{AD863B53-F5EC-45C3-8B1C-6AC678227DC8}'
|
||||
}
|
||||
ASE.Awk = s 'ASE Awk Class'
|
||||
{
|
||||
CLSID = s '{AD863B53-F5EC-45C3-8B1C-6AC678227DC8}'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {AD863B53-F5EC-45C3-8B1C-6AC678227DC8} = s 'ASE Awk Class'
|
||||
{
|
||||
ProgID = s 'ASE.Awk.1'
|
||||
VersionIndependentProgID = s 'ASE.Awk'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
'TypeLib' = s '{F9C69806-16A1-4162-998A-876B33C470BF}'
|
||||
}
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* $Id: AwkExtio.cpp,v 1.1.1.1 2007/03/28 14:05:22 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "asecom.h"
|
||||
#include "AwkExtio.h"
|
||||
|
||||
#include <stdio.h>
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwkExtio
|
||||
|
||||
CAwkExtio::CAwkExtio (): name (NULL)
|
||||
{
|
||||
VariantInit (&handle);
|
||||
}
|
||||
|
||||
CAwkExtio::~CAwkExtio ()
|
||||
{
|
||||
if (name != NULL) SysFreeString (name);
|
||||
VariantClear (&handle);
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Name (BSTR *pVal)
|
||||
{
|
||||
if (name == NULL) *pVal = name;
|
||||
else
|
||||
{
|
||||
BSTR tmp = SysAllocStringLen (name, SysStringLen(name));
|
||||
if (tmp == NULL) return E_OUTOFMEMORY;
|
||||
*pVal = tmp;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
BOOL CAwkExtio::PutName (const TCHAR* val)
|
||||
{
|
||||
if (name != NULL) SysFreeString (name);
|
||||
name = SysAllocString (val);
|
||||
return (name == NULL)? FALSE: TRUE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Type(int *pVal)
|
||||
{
|
||||
*pVal = type;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Mode(int *pVal)
|
||||
{
|
||||
*pVal = mode;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Handle (VARIANT *pVal)
|
||||
{
|
||||
VariantClear (pVal);
|
||||
VariantCopy (pVal, &handle);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::put_Handle (VARIANT newVal)
|
||||
{
|
||||
VariantClear (&handle);
|
||||
VariantCopy (&handle, &newVal);
|
||||
return S_OK;
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* $Id: AwkExtio.h,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_AWKEXTIO_H_
|
||||
#define _ASE_COM_AWKEXTIO_H_
|
||||
|
||||
#include "resource.h"
|
||||
#include <ase/awk/awk.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwkExtio
|
||||
class ATL_NO_VTABLE CAwkExtio :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CAwkExtio, &CLSID_AwkExtio>,
|
||||
public IDispatchImpl<IAwkExtio, &IID_IAwkExtio, &LIBID_ASELib>
|
||||
{
|
||||
public:
|
||||
BSTR name;
|
||||
int type;
|
||||
int mode;
|
||||
VARIANT handle;
|
||||
|
||||
IBuffer* read_buf;
|
||||
ase_size_t read_buf_pos;
|
||||
ase_size_t read_buf_len;
|
||||
|
||||
BOOL PutName (const TCHAR* val);
|
||||
|
||||
CAwkExtio ();
|
||||
~CAwkExtio ();
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_AWKEXTIO)
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(CAwkExtio)
|
||||
COM_INTERFACE_ENTRY(IAwkExtio)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
END_COM_MAP()
|
||||
|
||||
// IAwkExtio
|
||||
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_Name)(/*[out, retval]*/ BSTR *pVal);
|
||||
};
|
||||
|
||||
#endif //__AWKEXTIO_H_
|
@ -1,26 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
ASE.AwkExtio.1 = s 'ASE AwkExtio Class'
|
||||
{
|
||||
CLSID = s '{F52F065A-5FD4-4F4D-AFEA-F5E446B16383}'
|
||||
}
|
||||
ASE.AwkExtio = s 'ASE AwkExtio Class'
|
||||
{
|
||||
CLSID = s '{F52F065A-5FD4-4F4D-AFEA-F5E446B16383}'
|
||||
CurVer = s 'ASE.AwkExtio.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {F52F065A-5FD4-4F4D-AFEA-F5E446B16383} = s 'ASE AwkExtio Class'
|
||||
{
|
||||
ProgID = s 'ASE.AwkExtio.1'
|
||||
VersionIndependentProgID = s 'ASE.AwkExtio'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
'TypeLib' = s '{F9C69806-16A1-4162-998A-876B33C470BF}'
|
||||
}
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* $Id: Buffer.cpp,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Buffer.h"
|
||||
|
||||
CBuffer::CBuffer ()
|
||||
{
|
||||
str = NULL;
|
||||
}
|
||||
|
||||
CBuffer::~CBuffer ()
|
||||
{
|
||||
if (str != NULL) SysFreeString (str);
|
||||
}
|
||||
|
||||
STDMETHODIMP CBuffer::get_Value (BSTR *pVal)
|
||||
{
|
||||
if (str == NULL) *pVal = NULL;
|
||||
else
|
||||
{
|
||||
BSTR tmp = SysAllocStringLen(str, SysStringLen(str));
|
||||
if (tmp == NULL) return E_OUTOFMEMORY;
|
||||
*pVal = tmp;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CBuffer::put_Value (BSTR newVal)
|
||||
{
|
||||
if (str != NULL) SysFreeString (str);
|
||||
if (newVal == NULL) str = newVal;
|
||||
else
|
||||
{
|
||||
str = SysAllocStringLen (newVal, SysStringLen(newVal));
|
||||
if (str == NULL) return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
BOOL CBuffer::PutValue (const TCHAR* val, SIZE_T len)
|
||||
{
|
||||
if (str != NULL) SysFreeString (str);
|
||||
str = SysAllocStringLen (val, len);
|
||||
return (str == NULL)? FALSE: TRUE;
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* $Id: Buffer.h,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_BUFFER_H_
|
||||
#define _ASE_COM_BUFFER_H_
|
||||
|
||||
#include "resource.h"
|
||||
#include "asecom.h"
|
||||
|
||||
class ATL_NO_VTABLE CBuffer :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CBuffer, &CLSID_Buffer>,
|
||||
public IDispatchImpl<IBuffer, &IID_IBuffer, &LIBID_ASELib>
|
||||
{
|
||||
public:
|
||||
BSTR str;
|
||||
BOOL PutValue (const TCHAR* val, SIZE_T len);
|
||||
|
||||
public:
|
||||
CBuffer ();
|
||||
~CBuffer ();
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_BUFFER)
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(CBuffer)
|
||||
COM_INTERFACE_ENTRY(IBuffer)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
END_COM_MAP()
|
||||
|
||||
public:
|
||||
STDMETHOD(get_Value)(/*[out, retval]*/ BSTR *pVal);
|
||||
STDMETHOD(put_Value)(/*[in]*/ BSTR newVal);
|
||||
};
|
||||
|
||||
#endif
|
@ -1,26 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
ASE.Buffer.1 = s 'ASE Buffer Class'
|
||||
{
|
||||
CLSID = s '{866B79A7-7628-4808-8AE7-784BE2491C80}'
|
||||
}
|
||||
ASE.Buffer = s 'ASE Buffer Class'
|
||||
{
|
||||
CLSID = s '{866B79A7-7628-4808-8AE7-784BE2491C80}'
|
||||
CurVer = s 'ASE.Buffer.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {866B79A7-7628-4808-8AE7-784BE2491C80} = s 'ASE Buffer Class'
|
||||
{
|
||||
ProgID = s 'ASE.Buffer.1'
|
||||
VersionIndependentProgID = s 'ASE.Buffer'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
'TypeLib' = s '{F9C69806-16A1-4162-998A-876B33C470BF}'
|
||||
}
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* $Id: asecom.cpp,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
// Note: Proxy/Stub Information
|
||||
// To build a separate proxy/stub DLL,
|
||||
// run nmake -f aseps.mk in the project directory.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
#include <initguid.h>
|
||||
#include "asecom.h"
|
||||
|
||||
#include "asecom_i.c"
|
||||
#include "Awk.h"
|
||||
#include "Buffer.h"
|
||||
#include "AwkExtio.h"
|
||||
|
||||
CComModule _Module;
|
||||
|
||||
BEGIN_OBJECT_MAP(ObjectMap)
|
||||
OBJECT_ENTRY(CLSID_Awk, CAwk)
|
||||
OBJECT_ENTRY(CLSID_Buffer, CBuffer)
|
||||
OBJECT_ENTRY(CLSID_AwkExtio, CAwkExtio)
|
||||
END_OBJECT_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DLL Entry Point
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
_Module.Init(ObjectMap, hInstance, &LIBID_ASELib);
|
||||
DisableThreadLibraryCalls(hInstance);
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
_Module.Term();
|
||||
return TRUE; // ok
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Used to determine whether the DLL can be unloaded by OLE
|
||||
|
||||
STDAPI DllCanUnloadNow(void)
|
||||
{
|
||||
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Returns a class factory to create an object of the requested type
|
||||
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
|
||||
{
|
||||
return _Module.GetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DllRegisterServer - Adds entries to the system registry
|
||||
|
||||
STDAPI DllRegisterServer(void)
|
||||
{
|
||||
// registers object, typelib and all interfaces in typelib
|
||||
return _Module.RegisterServer(TRUE);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DllUnregisterServer - Removes entries from the system registry
|
||||
|
||||
STDAPI DllUnregisterServer(void)
|
||||
{
|
||||
return _Module.UnregisterServer(TRUE);
|
||||
}
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
; ase.def : Declares the module parameters.
|
||||
|
||||
LIBRARY "asecom.dll"
|
||||
|
||||
EXPORTS
|
||||
DllCanUnloadNow @1 PRIVATE
|
||||
DllGetClassObject @2 PRIVATE
|
||||
DllRegisterServer @3 PRIVATE
|
||||
DllUnregisterServer @4 PRIVATE
|
@ -1,211 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="asecom" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=asecom - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "asecom.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "asecom.mak" CFG="asecom - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "asecom - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "asecom - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "asecom - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../debug/lib"
|
||||
# PROP Intermediate_Dir "debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "../.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /FR /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo /o"debug/asecom.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 /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)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
regsvr32 /s /c "$(TargetPath)"
|
||||
echo regsvr32 exec. time > "$(IntDir)\regsvr32.trg"
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register DLL on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "asecom - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../release/lib"
|
||||
# PROP Intermediate_Dir "release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O1 /I "../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# 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)"
|
||||
# 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)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
regsvr32 /s /c "$(TargetPath)"
|
||||
echo regsvr32 exec. time > "$(IntDir)\regsvr32.trg"
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register DLL on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "asecom - Win32 Debug"
|
||||
# Name "asecom - Win32 Release"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.idl
|
||||
# ADD MTL /tlb ".\asecom.tlb" /h "asecom.h" /iid "asecom_i.c" /Oicf
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Awk.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AwkExtio.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Buffer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stdafx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Awk.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\awk_cp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AwkExtio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Buffer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stdafx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xxx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Awk.rgs
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AwkExtio.rgs
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Buffer.rgs
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -1,303 +0,0 @@
|
||||
/*
|
||||
* $Id: asecom.idl,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*/
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
|
||||
/* IAwk */
|
||||
[
|
||||
object,
|
||||
uuid(05BC1C9F-7C4E-4F77-B186-2E0FD26C0641),
|
||||
dual,
|
||||
helpstring("ASE Awk Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IAwk : IDispatch
|
||||
{
|
||||
[id(1), helpstring("method Parse")]
|
||||
HRESULT Parse([out, retval] int* ret);
|
||||
|
||||
[id(2), helpstring("method Run")]
|
||||
HRESULT Run([out, retval] int* 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 DeleteBuiltinFunction")]
|
||||
HRESULT DeleteBuiltinFunction([in] BSTR name, [out, retval] int* ret);
|
||||
|
||||
[propget, id(5), helpstring("property ErrorCode")]
|
||||
HRESULT ErrorCode([out, retval] int *pVal);
|
||||
|
||||
[propget, id(6), helpstring("property ErrorLine")]
|
||||
HRESULT ErrorLine([out, retval] int *pVal);
|
||||
|
||||
[propget, id(7), helpstring("property ErrorMessage")]
|
||||
HRESULT ErrorMessage([out, retval] BSTR *pVal);
|
||||
|
||||
[propget, id(8), helpstring("property ImplicitVariable")]
|
||||
HRESULT ImplicitVariable([out, retval] BOOL *pVal);
|
||||
[propput, id(8), helpstring("property ImplicitVariable")]
|
||||
HRESULT ImplicitVariable([in] BOOL newVal);
|
||||
|
||||
[propget, id(9), helpstring("property ExplicitVariable")]
|
||||
HRESULT ExplicitVariable([out, retval] BOOL *pVal);
|
||||
[propput, id(9), helpstring("property ExplicitVariable")]
|
||||
HRESULT ExplicitVariable([in] BOOL newVal);
|
||||
|
||||
[propget, id(10), helpstring("property UniqueFunction")]
|
||||
HRESULT UniqueFunction([out, retval] BOOL *pVal);
|
||||
[propput, id(10), helpstring("property UniqueFunction")]
|
||||
HRESULT UniqueFunction([in] BOOL newVal);
|
||||
|
||||
[propget, id(11), helpstring("property VariableShading")]
|
||||
HRESULT VariableShading([out, retval] BOOL *pVal);
|
||||
[propput, id(11), helpstring("property VariableShading")]
|
||||
HRESULT VariableShading([in] BOOL newVal);
|
||||
|
||||
[propget, id(12), helpstring("property ShiftOperators")]
|
||||
HRESULT ShiftOperators([out, retval] BOOL *pVal);
|
||||
[propput, id(12), helpstring("property ShiftOperators")]
|
||||
HRESULT ShiftOperators([in] BOOL newVal);
|
||||
|
||||
[propget, id(13), helpstring("property IdivOperator")]
|
||||
HRESULT IdivOperator([out, retval] BOOL *pVal);
|
||||
[propput, id(13), helpstring("property IdivOperator")]
|
||||
HRESULT IdivOperator([in] BOOL newVal);
|
||||
|
||||
[propget, id(14), helpstring("property ConcatString")]
|
||||
HRESULT ConcatString([out, retval] BOOL *pVal);
|
||||
[propput, id(14), helpstring("property ConcatString")]
|
||||
HRESULT ConcatString([in] BOOL newVal);
|
||||
|
||||
[propget, id(15), helpstring("property SupportExtio")]
|
||||
HRESULT SupportExtio([out, retval] BOOL *pVal);
|
||||
[propput, id(15), helpstring("property SupportExtio")]
|
||||
HRESULT SupportExtio([in] BOOL newVal);
|
||||
|
||||
[propget, id(16), helpstring("property SupportBlockless")]
|
||||
HRESULT SupportBlockless([out, retval] BOOL *pVal);
|
||||
[propput, id(16), helpstring("property SupportBlockless")]
|
||||
HRESULT SupportBlockless([in] BOOL newVal);
|
||||
|
||||
[propget, id(17), helpstring("property StringBaseOne")]
|
||||
HRESULT StringBaseOne([out, retval] BOOL *pVal);
|
||||
[propput, id(17), helpstring("property StringBaseOne")]
|
||||
HRESULT StringBaseOne([in] BOOL newVal);
|
||||
|
||||
[propget, id(18), helpstring("property StripSpaces")]
|
||||
HRESULT StripSpaces([out, retval] BOOL *pVal);
|
||||
[propput, id(18), helpstring("property StripSpaces")]
|
||||
HRESULT StripSpaces([in] BOOL newVal);
|
||||
|
||||
[propget, id(19), helpstring("property Nextofile")]
|
||||
HRESULT Nextofile([out, retval] BOOL *pVal);
|
||||
[propput, id(19), helpstring("property Nextofile")]
|
||||
HRESULT Nextofile([in] BOOL newVal);
|
||||
|
||||
[propget, id(20), helpstring("property UseCrlf")]
|
||||
HRESULT UseCrlf([out, retval] BOOL *pVal);
|
||||
[propput, id(20), helpstring("property UseCrlf")]
|
||||
HRESULT UseCrlf([in] BOOL newVal);
|
||||
|
||||
[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(22), helpstring("property MaxDepthForBlockRun")]
|
||||
HRESULT MaxDepthForBlockRun([out, retval] int *pVal);
|
||||
[propput, id(22), helpstring("property MaxDepthForBlockRun")]
|
||||
HRESULT MaxDepthForBlockRun([in] int newVal);
|
||||
|
||||
[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(24), helpstring("property MaxDepthForExprRun")]
|
||||
HRESULT MaxDepthForExprRun([out, retval] int *pVal);
|
||||
[propput, id(24), helpstring("property MaxDepthForExprRun")]
|
||||
HRESULT MaxDepthForExprRun([in] int newVal);
|
||||
|
||||
[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(26), helpstring("property MaxDepthForRexMatch")]
|
||||
HRESULT MaxDepthForRexMatch([out, retval] int *pVal);
|
||||
[propput, id(26), helpstring("property MaxDepthForRexMatch")]
|
||||
HRESULT MaxDepthForRexMatch([in] int newVal);
|
||||
|
||||
[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(28), helpstring("property Debug")]
|
||||
HRESULT Debug([out, retval] BOOL *pVal);
|
||||
[propput, id(28), helpstring("property Debug")]
|
||||
HRESULT Debug([in] 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);
|
||||
};
|
||||
|
||||
/* ASELib */
|
||||
[
|
||||
uuid(F9C69806-16A1-4162-998A-876B33C470BF),
|
||||
version(1.0),
|
||||
helpstring("ASE 1.0 Type Library")
|
||||
]
|
||||
library ASELib
|
||||
{
|
||||
importlib("stdole32.tlb");
|
||||
importlib("stdole2.tlb");
|
||||
|
||||
[helpstring("AwkExtio tpe")]
|
||||
typedef [v1_enum] enum AwkExtioType
|
||||
{
|
||||
AWK_EXTIO_PIPE = 0,
|
||||
AWK_EXTIO_COPROC = 1,
|
||||
AWK_EXTIO_FILE = 2,
|
||||
AWK_EXTIO_CONSOLE = 3
|
||||
} AwkExtioType;
|
||||
|
||||
[helpstring("AwkExtio mode")]
|
||||
typedef [v1_enum] enum AwkExtioMode
|
||||
{
|
||||
AWK_EXTIO_PIPE_READ = 0,
|
||||
AWK_EXTIO_PIPE_WRITE = 1,
|
||||
|
||||
AWK_EXTIO_COPROC_READ = 0,
|
||||
AWK_EXTIO_COPROC_WRITE = 1,
|
||||
AWK_EXTIO_COPROC_RDWR = 2,
|
||||
|
||||
AWK_EXTIO_FILE_READ = 0,
|
||||
AWK_EXTIO_FILE_WRITE = 1,
|
||||
AWK_EXTIO_FILE_APPEND = 2,
|
||||
|
||||
AWK_EXTIO_CONSOLE_READ = 0,
|
||||
AWK_EXTIO_CONSOLE_WRITE = 1
|
||||
} AwkExtioMode;
|
||||
|
||||
/* IBuffer */
|
||||
[
|
||||
object,
|
||||
uuid(AD5EA986-37E9-410E-A78E-21799104293A),
|
||||
dual,
|
||||
helpstring("IBuffer Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IBuffer : IDispatch
|
||||
{
|
||||
[propget, id(1), helpstring("property Value")]
|
||||
HRESULT Value([out, retval] BSTR *pVal);
|
||||
|
||||
[propput, id(1), helpstring("property Value")]
|
||||
HRESULT Value([in] BSTR newVal);
|
||||
};
|
||||
|
||||
/* IAwkExtio */
|
||||
[
|
||||
object,
|
||||
uuid(BE0B91FF-9944-4DFC-A55B-1FE14E24AFEE),
|
||||
dual,
|
||||
helpstring("IAwkExtio Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IAwkExtio : IDispatch
|
||||
{
|
||||
[propget, id(1), helpstring("property Name")]
|
||||
HRESULT Name([out, retval] BSTR *pVal);
|
||||
|
||||
[propget, id(2), helpstring("property Type")]
|
||||
HRESULT Type([out, retval] int *pVal);
|
||||
|
||||
[propget, id(3), helpstring("property Mode")]
|
||||
HRESULT Mode([out, retval] int *pVal);
|
||||
|
||||
[propget, id(4), helpstring("property Handle")]
|
||||
HRESULT Handle([out, retval] VARIANT *pVal);
|
||||
[propput, id(4), helpstring("property Handle")]
|
||||
HRESULT Handle([in] VARIANT newVal);
|
||||
};
|
||||
|
||||
/* IAwkEvents */
|
||||
[
|
||||
uuid(1351DC8F-10AD-4C40-A2FA-9A2E89C27AC8),
|
||||
helpstring("ASE Awk Events Interface")
|
||||
]
|
||||
dispinterface IAwkEvents
|
||||
{
|
||||
properties:
|
||||
methods:
|
||||
[id(1), helpstring("open the source code")]
|
||||
int OpenSource([in] int mode);
|
||||
|
||||
[id(2), helpstring("close the source code")]
|
||||
int CloseSource([in] int mode);
|
||||
|
||||
[id(3), helpstring("read the source code")]
|
||||
int ReadSource([in] IBuffer* buf);
|
||||
|
||||
[id(4), helpstring("write the source code")]
|
||||
int WriteSource([in] IBuffer* buf);
|
||||
|
||||
[id(5), helpstring("method OpenExtio")]
|
||||
int OpenExtio([in] IAwkExtio* extio);
|
||||
|
||||
[id(6), helpstring("method CloseExtio")]
|
||||
int CloseExtio([in] IAwkExtio* extio);
|
||||
|
||||
[id(7), helpstring("method ReadExtio")]
|
||||
int ReadExtio([in] IAwkExtio* extio, [in] IBuffer* buf);
|
||||
|
||||
[id(8), helpstring("method WriteExtio")]
|
||||
int WriteExtio([in] IAwkExtio* extio, [in] IBuffer* buf);
|
||||
|
||||
[id(9), helpstring("method FlushExtio")]
|
||||
int FlushExtio([in] IAwkExtio* extio);
|
||||
|
||||
[id(10), helpstring("method NextExtio")]
|
||||
int NextExtio([in] IAwkExtio* extio);
|
||||
|
||||
[id(11), helpstring("method HandleBuiltinFunction")]
|
||||
int HandleBuiltinFunction([in] BSTR name, [in] VARIANT argarray, [out, retval] VARIANT* ret);
|
||||
};
|
||||
|
||||
/* Awk */
|
||||
[
|
||||
uuid(AD863B53-F5EC-45C3-8B1C-6AC678227DC8),
|
||||
helpstring("ASE Awk Class")
|
||||
]
|
||||
coclass Awk
|
||||
{
|
||||
[default] interface IAwk;
|
||||
[default,source] dispinterface IAwkEvents;
|
||||
};
|
||||
|
||||
/* AwkExtio */
|
||||
[
|
||||
uuid(F52F065A-5FD4-4F4D-AFEA-F5E446B16383),
|
||||
helpstring("ASE AwkExtio Class")
|
||||
]
|
||||
coclass AwkExtio
|
||||
{
|
||||
[default] interface IAwkExtio;
|
||||
};
|
||||
|
||||
/* Buffer */
|
||||
[
|
||||
uuid(866B79A7-7628-4808-8AE7-784BE2491C80),
|
||||
helpstring("ASE Buffer Class")
|
||||
]
|
||||
coclass Buffer
|
||||
{
|
||||
[default] interface IBuffer;
|
||||
};
|
||||
};
|
@ -1,126 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"1 TYPELIB ""asecom.tlb""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
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"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_AWK REGISTRY DISCARDABLE "Awk.rgs"
|
||||
IDR_AWKEXTIO REGISTRY DISCARDABLE "AwkExtio.rgs"
|
||||
IDR_BUFFER REGISTRY DISCARDABLE "Buffer.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "ASE COM Project"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
1 TYPELIB "asecom.tlb"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -1,11 +0,0 @@
|
||||
|
||||
LIBRARY "asePS"
|
||||
|
||||
DESCRIPTION 'Proxy/Stub DLL'
|
||||
|
||||
EXPORTS
|
||||
DllGetClassObject @1 PRIVATE
|
||||
DllCanUnloadNow @2 PRIVATE
|
||||
GetProxyDllInfo @3 PRIVATE
|
||||
DllRegisterServer @4 PRIVATE
|
||||
DllUnregisterServer @5 PRIVATE
|
@ -1,16 +0,0 @@
|
||||
|
||||
aseps.dll: dlldata.obj ase_p.obj ase_i.obj
|
||||
link /dll /out:aseps.dll /def:aseps.def /entry:DllMain dlldata.obj ase_p.obj ase_i.obj \
|
||||
kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \
|
||||
|
||||
.c.obj:
|
||||
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
|
||||
$<
|
||||
|
||||
clean:
|
||||
@del aseps.dll
|
||||
@del aseps.lib
|
||||
@del aseps.exp
|
||||
@del dlldata.obj
|
||||
@del ase_p.obj
|
||||
@del ase_i.obj
|
601
ase/com/awk_cp.h
601
ase/com/awk_cp.h
@ -1,601 +0,0 @@
|
||||
/*
|
||||
* $Id: awk_cp.h,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _AWK_CP_H_
|
||||
#define _AWK_CP_H_
|
||||
|
||||
template <class T>
|
||||
class CProxyIAwkEvents:
|
||||
public IConnectionPointImpl<T, &DIID_IAwkEvents, CComDynamicUnkArray>
|
||||
{
|
||||
public:
|
||||
INT Fire_OpenSource(INT mode)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = mode;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x1, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
INT Fire_CloseSource(INT mode)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = mode;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x2, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
INT Fire_ReadSource (IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x3, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
/* no event handler attached for the source code read. */
|
||||
/* TODO: set error code ... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_WriteSource (IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x4, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
/* no event handler attached for the source code write.
|
||||
* make the operation succeed by returning the reqested
|
||||
* data length. */
|
||||
CComBSTR bstr;
|
||||
buf->get_Value (&bstr);
|
||||
return bstr.Length();
|
||||
}
|
||||
|
||||
INT Fire_OpenExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x5, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
INT Fire_CloseExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x6, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
INT Fire_ReadExtio (IAwkExtio* extio, IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[2], 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);
|
||||
VariantClear (&args[0]);
|
||||
VariantClear (&args[1]);
|
||||
|
||||
args[1] = (IUnknown*)extio;
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 2, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x7, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
INT Fire_WriteExtio (IAwkExtio* extio, IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[2], 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);
|
||||
VariantClear (&args[0]);
|
||||
VariantClear (&args[1]);
|
||||
|
||||
args[1] = (IUnknown*)extio;
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 2, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x8, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
INT Fire_FlushExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x9, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
INT Fire_NextExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], 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);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0xA, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
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;
|
||||
}
|
||||
|
||||
int Fire_HandleBuiltinFunction (
|
||||
ase_awk_run_t* run, BSTR name, SAFEARRAY* argarray, ase_awk_val_t** retv)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant ret;
|
||||
VARIANT args[2];
|
||||
ase_awk_val_t* v;
|
||||
|
||||
VariantInit (&args[0]);
|
||||
VariantInit (&args[1]);
|
||||
|
||||
args[1].vt = VT_BSTR;
|
||||
args[1].bstrVal = name;
|
||||
|
||||
args[0].vt = VT_ARRAY | VT_VARIANT;
|
||||
args[0].parray = argarray;
|
||||
|
||||
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);
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 2, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0xB, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
VariantClear (&args[1]);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
if (ret.vt == VT_I1)
|
||||
v = ase_awk_makeintval (run, ret.cVal);
|
||||
else if (ret.vt == VT_I2)
|
||||
v = ase_awk_makeintval (run, ret.iVal);
|
||||
else if (ret.vt == VT_I4)
|
||||
v = ase_awk_makeintval (run, ret.lVal);
|
||||
else if (ret.vt == VT_I8)
|
||||
v = ase_awk_makeintval (run, ret.llVal);
|
||||
else if (ret.vt == VT_UI1)
|
||||
v = ase_awk_makeintval (run, ret.bVal);
|
||||
else if (ret.vt == VT_UI2)
|
||||
v = ase_awk_makeintval (run, ret.uiVal);
|
||||
else if (ret.vt == VT_UI4)
|
||||
v = ase_awk_makeintval (run, ret.ulVal);
|
||||
else if (ret.vt == VT_UI8)
|
||||
v = ase_awk_makeintval (run, ret.ullVal);
|
||||
else if (ret.vt == VT_INT)
|
||||
v = ase_awk_makeintval (run, ret.intVal);
|
||||
else if (ret.vt == VT_UINT)
|
||||
v = ase_awk_makeintval (run, ret.uintVal);
|
||||
else if (ret.vt == VT_BOOL)
|
||||
v = ase_awk_makeintval (run, ((ret.boolVal == 0)? 0: 1));
|
||||
else if (ret.vt == VT_R4)
|
||||
v = ase_awk_makerealval (run, ret.fltVal);
|
||||
else if (ret.vt == VT_R8)
|
||||
v = ase_awk_makerealval (run, ret.dblVal);
|
||||
else if (ret.vt == VT_BSTR)
|
||||
v = ase_awk_makestrval (run, ret.bstrVal, SysStringLen(ret.bstrVal));
|
||||
else if (ret.vt == VT_NULL)
|
||||
|
||||
v = ase_awk_val_nil;
|
||||
else return 3; /* wrong return value */
|
||||
|
||||
if (v == ASE_NULL) return 1; /* out of memory */
|
||||
|
||||
*retv = v;
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
VariantClear (&args[1]);
|
||||
VariantClear (&args[0]);
|
||||
return 2; /* no proper handler */
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,19 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by ase.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_AWK 101
|
||||
#define IDR_AWKEXTIO 102
|
||||
#define IDR_BUFFER 103
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 201
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 201
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* $Id: stdafx.cpp,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// stdafx.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef _ATL_STATIC_REGISTRY
|
||||
#include <statreg.h>
|
||||
#include <statreg.cpp>
|
||||
#endif
|
||||
|
||||
#include <atlimpl.cpp>
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* $Id: stdafx.h,v 1.1.1.1 2007/03/28 14:05:23 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_STDAFX_H_
|
||||
#define _ASE_COM_STDAFX_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define STRICT
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
|
||||
#include <atlbase.h>
|
||||
//You may derive a class from CComModule and use it if you want to override
|
||||
//something, but do not change the name of _Module
|
||||
extern CComModule _Module;
|
||||
#include <atlcom.h>
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user