*** empty log message ***
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Awk.cpp,v 1.5 2006-12-11 06:29:18 bacon Exp $
|
||||
* $Id: Awk.cpp,v 1.6 2006-12-11 08:44:52 bacon Exp $
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
@ -306,11 +306,11 @@ HRESULT CAwk::Parse (int* ret)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int opt = /*ASE_AWK_IMPLICIT |
|
||||
int opt = ASE_AWK_IMPLICIT |
|
||||
ASE_AWK_EXPLICIT |
|
||||
ASE_AWK_UNIQUEAFN |
|
||||
ASE_AWK_HASHSIGN |
|
||||
ASE_AWK_IDIV |
|
||||
/*ASE_AWK_IDIV |
|
||||
ASE_AWK_SHADING |
|
||||
ASE_AWK_SHIFT | */
|
||||
ASE_AWK_EXTIO /*|
|
||||
@ -423,7 +423,7 @@ static ase_ssize_t __process_extio (
|
||||
CBuffer* tmp = (CBuffer*)extio2->read_buf;
|
||||
if (extio2->read_buf_pos >= extio2->read_buf_len)
|
||||
{
|
||||
INT n = awk->Fire_ReadSource (extio2->read_buf);
|
||||
INT n = awk->Fire_ReadExtio (extio, extio2->read_buf);
|
||||
if (n <= 0) return (ase_ssize_t)n;
|
||||
|
||||
if (SysStringLen(tmp->str) < (UINT)n) return -1;
|
||||
|
@ -1,11 +1,12 @@
|
||||
/*
|
||||
* $Id: AwkExtio.h,v 1.5 2006-12-11 06:29:19 bacon Exp $
|
||||
* $Id: AwkExtio.h,v 1.6 2006-12-11 08:44:52 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_AWKEXTIO_H_
|
||||
#define _ASE_COM_AWKEXTIO_H_
|
||||
|
||||
#include "resource.h"
|
||||
#include <ase/awk/awk.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwkExtio
|
||||
|
@ -1,14 +1,13 @@
|
||||
/*
|
||||
* $Id: awk_cp.h,v 1.3 2006-12-09 17:36:27 bacon Exp $
|
||||
* $Id: awk_cp.h,v 1.4 2006-12-11 08:44:52 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _AWK_CP_H_
|
||||
#define _AWK_CP_H_
|
||||
|
||||
/*#import "C:\projects\ase\debug\win32\vs60\aseawk.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids*/
|
||||
|
||||
template <class T>
|
||||
class CProxyIAwkEvents : public IConnectionPointImpl<T, &DIID_IAwkEvents, CComDynamicUnkArray>
|
||||
class CProxyIAwkEvents:
|
||||
public IConnectionPointImpl<T, &DIID_IAwkEvents, CComDynamicUnkArray>
|
||||
{
|
||||
public:
|
||||
INT Fire_OpenSource(INT mode)
|
||||
@ -306,6 +305,58 @@ public:
|
||||
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);
|
||||
|
Reference in New Issue
Block a user