ReactOS 0.4.17-dev-357-ga8f14ff
vbregexp.c File Reference
#include "vbscript.h"
#include "regexp.h"
#include "vbsregexp55.h"
#include "wchar.h"
#include "wine/debug.h"
Include dependency graph for vbregexp.c:

Go to the source code of this file.

Classes

struct  SubMatches
 
struct  Match2
 
struct  MatchCollectionEnum
 
struct  MatchCollection2
 
struct  RegExp2
 
struct  strbuf_t
 

Macros

#define REGEXP_TID_LIST
 
#define XDIID(iface)   iface ## _tid
 
#define XDIID(iface)   &IID_I ## iface
 

Typedefs

typedef struct Match2 Match2
 
typedef struct MatchCollectionEnum MatchCollectionEnum
 
typedef struct MatchCollection2 MatchCollection2
 
typedef struct RegExp2 RegExp2
 

Enumerations

enum  regexp_tid_t { REGEXP_TID_LIST , REGEXP_LAST_tid }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (vbscript)
 
static HRESULT init_regexp_typeinfo (regexp_tid_t tid)
 
static SubMatchesimpl_from_ISubMatches (ISubMatches *iface)
 
static HRESULT WINAPI SubMatches_QueryInterface (ISubMatches *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI SubMatches_AddRef (ISubMatches *iface)
 
static ULONG WINAPI SubMatches_Release (ISubMatches *iface)
 
static HRESULT WINAPI SubMatches_GetTypeInfoCount (ISubMatches *iface, UINT *pctinfo)
 
static HRESULT WINAPI SubMatches_GetTypeInfo (ISubMatches *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI SubMatches_GetIDsOfNames (ISubMatches *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI SubMatches_Invoke (ISubMatches *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI SubMatches_get_Item (ISubMatches *iface, LONG index, VARIANT *pSubMatch)
 
static HRESULT WINAPI SubMatches_get_Count (ISubMatches *iface, LONG *pCount)
 
static HRESULT WINAPI SubMatches_get__NewEnum (ISubMatches *iface, IUnknown **ppEnum)
 
static HRESULT create_sub_matches (DWORD pos, match_state_t *result, SubMatches **sub_matches)
 
static Match2impl_from_IMatch2 (IMatch2 *iface)
 
static HRESULT WINAPI Match2_QueryInterface (IMatch2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Match2_AddRef (IMatch2 *iface)
 
static ULONG WINAPI Match2_Release (IMatch2 *iface)
 
static HRESULT WINAPI Match2_GetTypeInfoCount (IMatch2 *iface, UINT *pctinfo)
 
static HRESULT WINAPI Match2_GetTypeInfo (IMatch2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI Match2_GetIDsOfNames (IMatch2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI Match2_Invoke (IMatch2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI Match2_get_Value (IMatch2 *iface, BSTR *pValue)
 
static HRESULT WINAPI Match2_get_FirstIndex (IMatch2 *iface, LONG *pFirstIndex)
 
static HRESULT WINAPI Match2_get_Length (IMatch2 *iface, LONG *pLength)
 
static HRESULT WINAPI Match2_get_SubMatches (IMatch2 *iface, IDispatch **ppSubMatches)
 
static Match2impl_from_IMatch (IMatch *iface)
 
static HRESULT WINAPI Match_QueryInterface (IMatch *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Match_AddRef (IMatch *iface)
 
static ULONG WINAPI Match_Release (IMatch *iface)
 
static HRESULT WINAPI Match_GetTypeInfoCount (IMatch *iface, UINT *pctinfo)
 
static HRESULT WINAPI Match_GetTypeInfo (IMatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI Match_GetIDsOfNames (IMatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI Match_Invoke (IMatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI Match_get_Value (IMatch *iface, BSTR *pValue)
 
static HRESULT WINAPI Match_get_FirstIndex (IMatch *iface, LONG *pFirstIndex)
 
static HRESULT WINAPI Match_get_Length (IMatch *iface, LONG *pLength)
 
static HRESULT create_match2 (DWORD pos, match_state_t **result, IMatch2 **match)
 
static MatchCollectionEnumimpl_from_IMatchCollectionEnum (IEnumVARIANT *iface)
 
static HRESULT WINAPI MatchCollectionEnum_QueryInterface (IEnumVARIANT *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MatchCollectionEnum_AddRef (IEnumVARIANT *iface)
 
static ULONG WINAPI MatchCollectionEnum_Release (IEnumVARIANT *iface)
 
static HRESULT WINAPI MatchCollectionEnum_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
 
static HRESULT WINAPI MatchCollectionEnum_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI MatchCollectionEnum_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI MatchCollectionEnum_Clone (IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
 
static HRESULT create_enum_variant_mc2 (IMatchCollection2 *mc, ULONG pos, IEnumVARIANT **enum_variant)
 
static MatchCollection2impl_from_IMatchCollection2 (IMatchCollection2 *iface)
 
static HRESULT WINAPI MatchCollection2_QueryInterface (IMatchCollection2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MatchCollection2_AddRef (IMatchCollection2 *iface)
 
static ULONG WINAPI MatchCollection2_Release (IMatchCollection2 *iface)
 
static HRESULT WINAPI MatchCollection2_GetTypeInfoCount (IMatchCollection2 *iface, UINT *pctinfo)
 
static HRESULT WINAPI MatchCollection2_GetTypeInfo (IMatchCollection2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI MatchCollection2_GetIDsOfNames (IMatchCollection2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI MatchCollection2_Invoke (IMatchCollection2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI MatchCollection2_get_Item (IMatchCollection2 *iface, LONG index, IDispatch **ppMatch)
 
static HRESULT WINAPI MatchCollection2_get_Count (IMatchCollection2 *iface, LONG *pCount)
 
static HRESULT WINAPI MatchCollection2_get__NewEnum (IMatchCollection2 *iface, IUnknown **ppEnum)
 
static MatchCollection2impl_from_IMatchCollection (IMatchCollection *iface)
 
static HRESULT WINAPI MatchCollection_QueryInterface (IMatchCollection *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MatchCollection_AddRef (IMatchCollection *iface)
 
static ULONG WINAPI MatchCollection_Release (IMatchCollection *iface)
 
static HRESULT WINAPI MatchCollection_GetTypeInfoCount (IMatchCollection *iface, UINT *pctinfo)
 
static HRESULT WINAPI MatchCollection_GetTypeInfo (IMatchCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI MatchCollection_GetIDsOfNames (IMatchCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI MatchCollection_Invoke (IMatchCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI MatchCollection_get_Item (IMatchCollection *iface, LONG index, IDispatch **ppMatch)
 
static HRESULT WINAPI MatchCollection_get_Count (IMatchCollection *iface, LONG *pCount)
 
static HRESULT WINAPI MatchCollection_get__NewEnum (IMatchCollection *iface, IUnknown **ppEnum)
 
static HRESULT add_match (IMatchCollection2 *iface, IMatch2 *add)
 
static HRESULT create_match_collection2 (IMatchCollection2 **match_collection)
 
static RegExp2impl_from_IRegExp2 (IRegExp2 *iface)
 
static HRESULT WINAPI RegExp2_QueryInterface (IRegExp2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI RegExp2_AddRef (IRegExp2 *iface)
 
static ULONG WINAPI RegExp2_Release (IRegExp2 *iface)
 
static HRESULT WINAPI RegExp2_GetTypeInfoCount (IRegExp2 *iface, UINT *pctinfo)
 
static HRESULT WINAPI RegExp2_GetTypeInfo (IRegExp2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI RegExp2_GetIDsOfNames (IRegExp2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI RegExp2_Invoke (IRegExp2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI RegExp2_get_Pattern (IRegExp2 *iface, BSTR *pPattern)
 
static HRESULT WINAPI RegExp2_put_Pattern (IRegExp2 *iface, BSTR pattern)
 
static HRESULT WINAPI RegExp2_get_IgnoreCase (IRegExp2 *iface, VARIANT_BOOL *pIgnoreCase)
 
static HRESULT WINAPI RegExp2_put_IgnoreCase (IRegExp2 *iface, VARIANT_BOOL ignoreCase)
 
static HRESULT WINAPI RegExp2_get_Global (IRegExp2 *iface, VARIANT_BOOL *pGlobal)
 
static HRESULT WINAPI RegExp2_put_Global (IRegExp2 *iface, VARIANT_BOOL global)
 
static HRESULT WINAPI RegExp2_get_Multiline (IRegExp2 *iface, VARIANT_BOOL *pMultiline)
 
static HRESULT WINAPI RegExp2_put_Multiline (IRegExp2 *iface, VARIANT_BOOL multiline)
 
static HRESULT WINAPI RegExp2_Execute (IRegExp2 *iface, BSTR sourceString, IDispatch **ppMatches)
 
static HRESULT WINAPI RegExp2_Test (IRegExp2 *iface, BSTR sourceString, VARIANT_BOOL *pMatch)
 
static BOOL strbuf_ensure_size (strbuf_t *buf, unsigned len)
 
static HRESULT strbuf_append (strbuf_t *buf, const WCHAR *str, DWORD len)
 
static HRESULT WINAPI RegExp2_Replace (IRegExp2 *iface, BSTR source, VARIANT replaceVar, BSTR *ret)
 
BSTR string_replace (BSTR string, BSTR find, BSTR replace, int from, int cnt, int mode)
 
static RegExp2impl_from_IRegExp (IRegExp *iface)
 
static HRESULT WINAPI RegExp_QueryInterface (IRegExp *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI RegExp_AddRef (IRegExp *iface)
 
static ULONG WINAPI RegExp_Release (IRegExp *iface)
 
static HRESULT WINAPI RegExp_GetTypeInfoCount (IRegExp *iface, UINT *pctinfo)
 
static HRESULT WINAPI RegExp_GetTypeInfo (IRegExp *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI RegExp_GetIDsOfNames (IRegExp *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI RegExp_Invoke (IRegExp *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI RegExp_get_Pattern (IRegExp *iface, BSTR *pPattern)
 
static HRESULT WINAPI RegExp_put_Pattern (IRegExp *iface, BSTR pPattern)
 
static HRESULT WINAPI RegExp_get_IgnoreCase (IRegExp *iface, VARIANT_BOOL *pIgnoreCase)
 
static HRESULT WINAPI RegExp_put_IgnoreCase (IRegExp *iface, VARIANT_BOOL pIgnoreCase)
 
static HRESULT WINAPI RegExp_get_Global (IRegExp *iface, VARIANT_BOOL *pGlobal)
 
static HRESULT WINAPI RegExp_put_Global (IRegExp *iface, VARIANT_BOOL pGlobal)
 
static HRESULT WINAPI RegExp_Execute (IRegExp *iface, BSTR sourceString, IDispatch **ppMatches)
 
static HRESULT WINAPI RegExp_Test (IRegExp *iface, BSTR sourceString, VARIANT_BOOL *pMatch)
 
static HRESULT WINAPI RegExp_Replace (IRegExp *iface, BSTR sourceString, BSTR replaceString, BSTR *pDestString)
 
HRESULT create_regexp (IDispatch **ret)
 
HRESULT WINAPI VBScriptRegExpFactory_CreateInstance (IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
 
void release_regexp_typelib (void)
 

Variables

static REFIID tid_ids []
 
static ITypeLibtypelib
 
static ITypeInfotypeinfos [REGEXP_LAST_tid]
 
static const ISubMatchesVtbl SubMatchesVtbl
 
static const IMatch2Vtbl Match2Vtbl
 
static IMatchVtbl MatchVtbl
 
static const IEnumVARIANTVtbl MatchCollectionEnum_Vtbl
 
static const IMatchCollection2Vtbl MatchCollection2Vtbl
 
static const IMatchCollectionVtbl MatchCollectionVtbl
 
static const IRegExp2Vtbl RegExp2Vtbl
 
static IRegExpVtbl RegExpVtbl
 

Macro Definition Documentation

◆ REGEXP_TID_LIST

#define REGEXP_TID_LIST
Value:
XDIID(Match2), \
XDIID(MatchCollection2), \
XDIID(SubMatches)
#define XDIID(iface)
Definition: vbregexp.c:35

Definition at line 28 of file vbregexp.c.

◆ XDIID [1/2]

#define XDIID (   iface)    iface ## _tid

Definition at line 35 of file vbregexp.c.

◆ XDIID [2/2]

#define XDIID (   iface)    &IID_I ## iface

Definition at line 35 of file vbregexp.c.

Typedef Documentation

◆ Match2

typedef struct Match2 Match2

◆ MatchCollection2

◆ MatchCollectionEnum

◆ RegExp2

Enumeration Type Documentation

◆ regexp_tid_t

Enumerator
REGEXP_TID_LIST 
REGEXP_LAST_tid 

Definition at line 34 of file vbregexp.c.

34 {
35#define XDIID(iface) iface ## _tid
37#undef XDIID
#define REGEXP_TID_LIST
Definition: vbregexp.c:28
regexp_tid_t
Definition: vbregexp.c:34
@ REGEXP_LAST_tid
Definition: vbregexp.c:38

Function Documentation

◆ add_match()

static HRESULT add_match ( IMatchCollection2 *  iface,
IMatch2 *  add 
)
static

Definition at line 1020 of file vbregexp.c.

1021{
1023
1024 TRACE("(%p)->(%p)\n", This, add);
1025
1026 if(!This->size) {
1027 This->matches = malloc(8 * sizeof(*This->matches));
1028 if(!This->matches)
1029 return E_OUTOFMEMORY;
1030 This->size = 8;
1031 }else if(This->size == This->count) {
1032 IMatch2 **new_matches = realloc(This->matches, 2 * This->size * sizeof(*This->matches));
1033 if(!new_matches)
1034 return E_OUTOFMEMORY;
1035
1036 This->matches = new_matches;
1037 This->size <<= 1;
1038 }
1039
1040 This->matches[This->count++] = add;
1041 IMatch2_AddRef(add);
1042 return S_OK;
1043}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define realloc
Definition: debug_ros.c:6
#define malloc
Definition: debug_ros.c:4
#define S_OK
Definition: intsafe.h:52
__forceinline bool __cdecl add(big_integer &x, uint32_t const value)
#define TRACE(s)
Definition: solgame.cpp:4
static MatchCollection2 * impl_from_IMatchCollection2(IMatchCollection2 *iface)
Definition: vbregexp.c:772

Referenced by init_boot_catalog(), and RegExp2_Execute().

◆ create_enum_variant_mc2()

static HRESULT create_enum_variant_mc2 ( IMatchCollection2 *  mc,
ULONG  pos,
IEnumVARIANT **  enum_variant 
)
static

Definition at line 753 of file vbregexp.c.

754{
756
757 ret = calloc(1, sizeof(*ret));
758 if(!ret)
759 return E_OUTOFMEMORY;
760
761 ret->IEnumVARIANT_iface.lpVtbl = &MatchCollectionEnum_Vtbl;
762 ret->ref = 1;
763 ret->pos = pos;
764 IMatchCollection2_get_Count(mc, &ret->count);
765 ret->mc = mc;
766 IMatchCollection2_AddRef(mc);
767
768 *enum_variant = &ret->IEnumVARIANT_iface;
769 return S_OK;
770}
return ret
Definition: mutex.c:146
#define calloc
Definition: rosglue.h:14
static const IEnumVARIANTVtbl MatchCollectionEnum_Vtbl
Definition: vbregexp.c:743

Referenced by MatchCollection2_get__NewEnum().

◆ create_match2()

static HRESULT create_match2 ( DWORD  pos,
match_state_t **  result,
IMatch2 **  match 
)
static

Definition at line 599 of file vbregexp.c.

600{
601 Match2 *ret;
603
604 hres = init_regexp_typeinfo(Match2_tid);
605 if(FAILED(hres))
606 return hres;
607
608 ret = calloc(1, sizeof(*ret));
609 if(!ret)
610 return E_OUTOFMEMORY;
611
612 ret->index = pos;
613 hres = create_sub_matches(pos, result ? *result : NULL, &ret->sub_matches);
614 if(FAILED(hres)) {
615 free(ret);
616 return hres;
617 }
618 if(result)
619 *result = NULL;
620
621 ret->IMatch2_iface.lpVtbl = &Match2Vtbl;
622 ret->IMatch_iface.lpVtbl = &MatchVtbl;
623
624 ret->ref = 1;
625 *match = &ret->IMatch2_iface;
626 return hres;
627}
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
GLuint64EXT * result
Definition: glext.h:11304
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
Definition: match.c:28
static HRESULT create_sub_matches(DWORD pos, match_state_t *result, SubMatches **sub_matches)
Definition: vbregexp.c:300
static const IMatch2Vtbl Match2Vtbl
Definition: vbregexp.c:503
static IMatchVtbl MatchVtbl
Definition: vbregexp.c:586
static HRESULT init_regexp_typeinfo(regexp_tid_t tid)
Definition: vbregexp.c:50

Referenced by RegExp2_Execute().

◆ create_match_collection2()

static HRESULT create_match_collection2 ( IMatchCollection2 **  match_collection)
static

Definition at line 1045 of file vbregexp.c.

1046{
1048 HRESULT hres;
1049
1050 hres = init_regexp_typeinfo(MatchCollection2_tid);
1051 if(FAILED(hres))
1052 return hres;
1053
1054 ret = calloc(1, sizeof(*ret));
1055 if(!ret)
1056 return E_OUTOFMEMORY;
1057
1058 ret->IMatchCollection2_iface.lpVtbl = &MatchCollection2Vtbl;
1059 ret->IMatchCollection_iface.lpVtbl = &MatchCollectionVtbl;
1060
1061 ret->ref = 1;
1062 *match_collection = &ret->IMatchCollection2_iface;
1063 return S_OK;
1064}
static const IMatchCollection2Vtbl MatchCollection2Vtbl
Definition: vbregexp.c:923
static const IMatchCollectionVtbl MatchCollectionVtbl
Definition: vbregexp.c:1007

Referenced by RegExp2_Execute().

◆ create_regexp()

HRESULT create_regexp ( IDispatch **  ret)

Definition at line 1811 of file vbregexp.c.

1812{
1813 RegExp2 *regexp;
1814 HRESULT hres;
1815
1816 hres = init_regexp_typeinfo(RegExp2_tid);
1817 if(FAILED(hres))
1818 return hres;
1819
1820 regexp = calloc(1, sizeof(*regexp));
1821 if(!regexp)
1822 return E_OUTOFMEMORY;
1823
1824 regexp->IRegExp2_iface.lpVtbl = &RegExp2Vtbl;
1825 regexp->IRegExp_iface.lpVtbl = &RegExpVtbl;
1826 regexp->ref = 1;
1827 heap_pool_init(&regexp->pool);
1828
1829 *ret = (IDispatch*)&regexp->IRegExp2_iface;
1830 return S_OK;
1831}
void heap_pool_init(heap_pool_t *)
Definition: jsutils.c:66
IRegExp IRegExp_iface
Definition: vbregexp.c:125
LONG ref
Definition: vbregexp.c:127
IRegExp2 IRegExp2_iface
Definition: vbregexp.c:124
heap_pool_t pool
Definition: vbregexp.c:131
static IRegExpVtbl RegExpVtbl
Definition: vbregexp.c:1792
static const IRegExp2Vtbl RegExp2Vtbl
Definition: vbregexp.c:1614

Referenced by VBScriptRegExpFactory_CreateInstance().

◆ create_sub_matches()

static HRESULT create_sub_matches ( DWORD  pos,
match_state_t result,
SubMatches **  sub_matches 
)
static

Definition at line 300 of file vbregexp.c.

301{
303 DWORD i;
305
306 hres = init_regexp_typeinfo(SubMatches_tid);
307 if(FAILED(hres))
308 return hres;
309
310 ret = calloc(1, sizeof(*ret));
311 if(!ret)
312 return E_OUTOFMEMORY;
313
314 ret->ISubMatches_iface.lpVtbl = &SubMatchesVtbl;
315
316 ret->result = result;
317 if(result) {
318 ret->match = malloc((result->match_len+1) * sizeof(WCHAR));
319 if(!ret->match) {
320 free(ret);
321 return E_OUTOFMEMORY;
322 }
323 memcpy(ret->match, result->cp-result->match_len, result->match_len*sizeof(WCHAR));
324 ret->match[result->match_len] = 0;
325
326 result->cp = NULL;
327 for(i=0; i<result->paren_count; i++)
328 if(result->parens[i].index != -1)
329 result->parens[i].index -= pos;
330 }else {
331 ret->match = NULL;
332 }
333
334 ret->ref = 1;
335 *sub_matches = ret;
336 return hres;
337}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
short WCHAR
Definition: pedump.c:58
static const ISubMatchesVtbl SubMatchesVtbl
Definition: vbregexp.c:287

Referenced by create_match2().

◆ impl_from_IMatch()

static Match2 * impl_from_IMatch ( IMatch *  iface)
inlinestatic

Definition at line 517 of file vbregexp.c.

518{
519 return CONTAINING_RECORD(iface, Match2, IMatch_iface);
520}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by Match_AddRef(), Match_get_FirstIndex(), Match_get_Length(), Match_get_Value(), Match_GetIDsOfNames(), Match_GetTypeInfo(), Match_GetTypeInfoCount(), Match_Invoke(), Match_QueryInterface(), and Match_Release().

◆ impl_from_IMatch2()

static Match2 * impl_from_IMatch2 ( IMatch2 *  iface)
inlinestatic

◆ impl_from_IMatchCollection()

◆ impl_from_IMatchCollection2()

◆ impl_from_IMatchCollectionEnum()

◆ impl_from_IRegExp()

◆ impl_from_IRegExp2()

◆ impl_from_ISubMatches()

static SubMatches * impl_from_ISubMatches ( ISubMatches *  iface)
inlinestatic

◆ init_regexp_typeinfo()

static HRESULT init_regexp_typeinfo ( regexp_tid_t  tid)
static

Definition at line 50 of file vbregexp.c.

51{
53
54 if(!typelib) {
55 ITypeLib *tl;
56
57 hres = LoadTypeLib(L"vbscript.dll\\3", &tl);
58 if(FAILED(hres)) {
59 ERR("LoadRegTypeLib failed: %08lx\n", hres);
60 return hres;
61 }
62
64 ITypeLib_Release(tl);
65 }
66
67 if(!typeinfos[tid]) {
68 ITypeInfo *ti;
69
70 hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
71 if(FAILED(hres)) {
72 ERR("GetTypeInfoOfGuid(%s) failed: %08lx\n", debugstr_guid(tid_ids[tid]), hres);
73 return hres;
74 }
75
77 ITypeInfo_Release(ti);
78 }
79
80 return S_OK;
81}
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:458
#define L(x)
Definition: resources.c:13
static TfClientId tid
#define InterlockedCompareExchangePointer
Definition: interlocked.h:144
#define debugstr_guid
Definition: kernel32.h:35
static ITypeInfo * typeinfos[REGEXP_LAST_tid]
Definition: vbregexp.c:48
static REFIID tid_ids[]
Definition: vbregexp.c:41

Referenced by create_match2(), create_match_collection2(), create_regexp(), and create_sub_matches().

◆ Match2_AddRef()

static ULONG WINAPI Match2_AddRef ( IMatch2 *  iface)
static

Definition at line 375 of file vbregexp.c.

376{
377 Match2 *This = impl_from_IMatch2(iface);
379
380 TRACE("(%p) ref=%ld\n", This, ref);
381
382 return ref;
383}
#define InterlockedIncrement
Definition: armddk.h:53
long LONG
Definition: pedump.c:60
Definition: send.c:48
static Match2 * impl_from_IMatch2(IMatch2 *iface)
Definition: vbregexp.c:339

◆ Match2_get_FirstIndex()

static HRESULT WINAPI Match2_get_FirstIndex ( IMatch2 *  iface,
LONG pFirstIndex 
)
static

Definition at line 460 of file vbregexp.c.

461{
462 Match2 *This = impl_from_IMatch2(iface);
463
464 TRACE("(%p)->(%p)\n", This, pFirstIndex);
465
466 if(!pFirstIndex)
467 return E_POINTER;
468
469 *pFirstIndex = This->index;
470 return S_OK;
471}
#define E_POINTER
Definition: winerror.h:3480

◆ Match2_get_Length()

static HRESULT WINAPI Match2_get_Length ( IMatch2 *  iface,
LONG pLength 
)
static

Definition at line 473 of file vbregexp.c.

474{
475 Match2 *This = impl_from_IMatch2(iface);
476
477 TRACE("(%p)->(%p)\n", This, pLength);
478
479 if(!pLength)
480 return E_POINTER;
481
482 if(This->sub_matches->result)
483 *pLength = This->sub_matches->result->match_len;
484 else
485 *pLength = 0;
486 return S_OK;
487}

◆ Match2_get_SubMatches()

static HRESULT WINAPI Match2_get_SubMatches ( IMatch2 *  iface,
IDispatch **  ppSubMatches 
)
static

Definition at line 489 of file vbregexp.c.

490{
491 Match2 *This = impl_from_IMatch2(iface);
492
493 TRACE("(%p)->(%p)\n", This, ppSubMatches);
494
495 if(!ppSubMatches)
496 return E_POINTER;
497
498 *ppSubMatches = (IDispatch*)&This->sub_matches->ISubMatches_iface;
499 ISubMatches_AddRef(&This->sub_matches->ISubMatches_iface);
500 return S_OK;
501}

◆ Match2_get_Value()

static HRESULT WINAPI Match2_get_Value ( IMatch2 *  iface,
BSTR pValue 
)
static

Definition at line 442 of file vbregexp.c.

443{
444 Match2 *This = impl_from_IMatch2(iface);
445
446 TRACE("(%p)->(%p)\n", This, pValue);
447
448 if(!pValue)
449 return E_POINTER;
450
451 if(!This->sub_matches->match) {
452 *pValue = NULL;
453 return S_OK;
454 }
455
456 *pValue = SysAllocString(This->sub_matches->match);
457 return *pValue ? S_OK : E_OUTOFMEMORY;
458}
PWCHAR pValue
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238

◆ Match2_GetIDsOfNames()

static HRESULT WINAPI Match2_GetIDsOfNames ( IMatch2 *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 418 of file vbregexp.c.

420{
421 Match2 *This = impl_from_IMatch2(iface);
422
423 TRACE("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid),
424 rgszNames, cNames, lcid, rgDispId);
425
426 return ITypeInfo_GetIDsOfNames(typeinfos[Match2_tid], rgszNames, cNames, rgDispId);
427}
LCID lcid
Definition: locale.c:5660
REFIID riid
Definition: atlbase.h:39

◆ Match2_GetTypeInfo()

static HRESULT WINAPI Match2_GetTypeInfo ( IMatch2 *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 410 of file vbregexp.c.

412{
413 Match2 *This = impl_from_IMatch2(iface);
414 FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
415 return E_NOTIMPL;
416}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Match2_GetTypeInfoCount()

static HRESULT WINAPI Match2_GetTypeInfoCount ( IMatch2 *  iface,
UINT pctinfo 
)
static

Definition at line 400 of file vbregexp.c.

401{
402 Match2 *This = impl_from_IMatch2(iface);
403
404 TRACE("(%p)->(%p)\n", This, pctinfo);
405
406 *pctinfo = 1;
407 return S_OK;
408}

◆ Match2_Invoke()

static HRESULT WINAPI Match2_Invoke ( IMatch2 *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 429 of file vbregexp.c.

432{
433 Match2 *This = impl_from_IMatch2(iface);
434
435 TRACE("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
436 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
437
438 return ITypeInfo_Invoke(typeinfos[Match2_tid], iface, dispIdMember, wFlags,
439 pDispParams, pVarResult, pExcepInfo, puArgErr);
440}
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337

◆ Match2_QueryInterface()

static HRESULT WINAPI Match2_QueryInterface ( IMatch2 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 344 of file vbregexp.c.

346{
347 Match2 *This = impl_from_IMatch2(iface);
348
350 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
351 *ppv = &This->IMatch2_iface;
352 }else if(IsEqualGUID(riid, &IID_IDispatch)) {
353 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
354 *ppv = &This->IMatch2_iface;
355 }else if(IsEqualGUID(riid, &IID_IMatch2)) {
356 TRACE("(%p)->(IID_IMatch2 %p)\n", This, ppv);
357 *ppv = &This->IMatch2_iface;
358 }else if(IsEqualGUID(riid, &IID_IMatch)) {
359 TRACE("(%p)->(IID_IMatch %p)\n", This, ppv);
360 *ppv = &This->IMatch_iface;
361 }else if(IsEqualGUID(riid, &IID_IDispatchEx)) {
362 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
363 *ppv = NULL;
364 return E_NOINTERFACE;
365 }else {
366 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
367 *ppv = NULL;
368 return E_NOINTERFACE;
369 }
370
371 IUnknown_AddRef((IUnknown*)*ppv);
372 return S_OK;
373}
const GUID IID_IUnknown
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ Match2_Release()

static ULONG WINAPI Match2_Release ( IMatch2 *  iface)
static

Definition at line 385 of file vbregexp.c.

386{
387 Match2 *This = impl_from_IMatch2(iface);
389
390 TRACE("(%p) ref=%ld\n", This, ref);
391
392 if(!ref) {
393 ISubMatches_Release(&This->sub_matches->ISubMatches_iface);
394 free(This);
395 }
396
397 return ref;
398}
#define InterlockedDecrement
Definition: armddk.h:52

◆ Match_AddRef()

static ULONG WINAPI Match_AddRef ( IMatch *  iface)
static

Definition at line 528 of file vbregexp.c.

529{
530 Match2 *This = impl_from_IMatch(iface);
531 return IMatch2_AddRef(&This->IMatch2_iface);
532}
static Match2 * impl_from_IMatch(IMatch *iface)
Definition: vbregexp.c:517

◆ Match_get_FirstIndex()

static HRESULT WINAPI Match_get_FirstIndex ( IMatch *  iface,
LONG pFirstIndex 
)
static

Definition at line 574 of file vbregexp.c.

575{
576 Match2 *This = impl_from_IMatch(iface);
577 return IMatch2_get_FirstIndex(&This->IMatch2_iface, pFirstIndex);
578}

◆ Match_get_Length()

static HRESULT WINAPI Match_get_Length ( IMatch *  iface,
LONG pLength 
)
static

Definition at line 580 of file vbregexp.c.

581{
582 Match2 *This = impl_from_IMatch(iface);
583 return IMatch2_get_Length(&This->IMatch2_iface, pLength);
584}

◆ Match_get_Value()

static HRESULT WINAPI Match_get_Value ( IMatch *  iface,
BSTR pValue 
)
static

Definition at line 568 of file vbregexp.c.

569{
570 Match2 *This = impl_from_IMatch(iface);
571 return IMatch2_get_Value(&This->IMatch2_iface, pValue);
572}

◆ Match_GetIDsOfNames()

static HRESULT WINAPI Match_GetIDsOfNames ( IMatch *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 552 of file vbregexp.c.

554{
555 Match2 *This = impl_from_IMatch(iface);
556 return IMatch2_GetIDsOfNames(&This->IMatch2_iface, riid, rgszNames, cNames, lcid, rgDispId);
557}

◆ Match_GetTypeInfo()

static HRESULT WINAPI Match_GetTypeInfo ( IMatch *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 546 of file vbregexp.c.

547{
548 Match2 *This = impl_from_IMatch(iface);
549 return IMatch2_GetTypeInfo(&This->IMatch2_iface, iTInfo, lcid, ppTInfo);
550}

◆ Match_GetTypeInfoCount()

static HRESULT WINAPI Match_GetTypeInfoCount ( IMatch *  iface,
UINT pctinfo 
)
static

Definition at line 540 of file vbregexp.c.

541{
542 Match2 *This = impl_from_IMatch(iface);
543 return IMatch2_GetTypeInfoCount(&This->IMatch2_iface, pctinfo);
544}

◆ Match_Invoke()

static HRESULT WINAPI Match_Invoke ( IMatch *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 559 of file vbregexp.c.

562{
563 Match2 *This = impl_from_IMatch(iface);
564 return IMatch2_Invoke(&This->IMatch2_iface, dispIdMember, riid, lcid,
565 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
566}

◆ Match_QueryInterface()

static HRESULT WINAPI Match_QueryInterface ( IMatch *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 522 of file vbregexp.c.

523{
524 Match2 *This = impl_from_IMatch(iface);
525 return IMatch2_QueryInterface(&This->IMatch2_iface, riid, ppv);
526}

◆ Match_Release()

static ULONG WINAPI Match_Release ( IMatch *  iface)
static

Definition at line 534 of file vbregexp.c.

535{
536 Match2 *This = impl_from_IMatch(iface);
537 return IMatch2_Release(&This->IMatch2_iface);
538}

◆ MatchCollection2_AddRef()

static ULONG WINAPI MatchCollection2_AddRef ( IMatchCollection2 *  iface)
static

Definition at line 808 of file vbregexp.c.

809{
812
813 TRACE("(%p) ref=%ld\n", This, ref);
814
815 return ref;
816}

◆ MatchCollection2_get__NewEnum()

static HRESULT WINAPI MatchCollection2_get__NewEnum ( IMatchCollection2 *  iface,
IUnknown **  ppEnum 
)
static

Definition at line 911 of file vbregexp.c.

912{
914
915 TRACE("(%p)->(%p)\n", This, ppEnum);
916
917 if(!ppEnum)
918 return E_POINTER;
919
920 return create_enum_variant_mc2(&This->IMatchCollection2_iface, 0, (IEnumVARIANT**)ppEnum);
921}
static HRESULT create_enum_variant_mc2(IMatchCollection2 *mc, ULONG pos, IEnumVARIANT **enum_variant)
Definition: vbregexp.c:753

◆ MatchCollection2_get_Count()

static HRESULT WINAPI MatchCollection2_get_Count ( IMatchCollection2 *  iface,
LONG pCount 
)
static

Definition at line 898 of file vbregexp.c.

899{
901
902 TRACE("(%p)->()\n", This);
903
904 if(!pCount)
905 return E_POINTER;
906
907 *pCount = This->count;
908 return S_OK;
909}

◆ MatchCollection2_get_Item()

static HRESULT WINAPI MatchCollection2_get_Item ( IMatchCollection2 *  iface,
LONG  index,
IDispatch **  ppMatch 
)
static

Definition at line 880 of file vbregexp.c.

882{
884
885 TRACE("(%p)->()\n", This);
886
887 if(!ppMatch)
888 return E_POINTER;
889
890 if(index<0 || index>=This->count)
891 return E_INVALIDARG;
892
893 *ppMatch = (IDispatch*)This->matches[index];
894 IMatch2_AddRef(This->matches[index]);
895 return S_OK;
896}
#define E_INVALIDARG
Definition: ddrawi.h:101
GLuint index
Definition: glext.h:6031

◆ MatchCollection2_GetIDsOfNames()

static HRESULT WINAPI MatchCollection2_GetIDsOfNames ( IMatchCollection2 *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 856 of file vbregexp.c.

858{
860
861 TRACE("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid),
862 rgszNames, cNames, lcid, rgDispId);
863
864 return ITypeInfo_GetIDsOfNames(typeinfos[MatchCollection2_tid], rgszNames, cNames, rgDispId);
865}

◆ MatchCollection2_GetTypeInfo()

static HRESULT WINAPI MatchCollection2_GetTypeInfo ( IMatchCollection2 *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 848 of file vbregexp.c.

850{
852 FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
853 return E_NOTIMPL;
854}

◆ MatchCollection2_GetTypeInfoCount()

static HRESULT WINAPI MatchCollection2_GetTypeInfoCount ( IMatchCollection2 *  iface,
UINT pctinfo 
)
static

Definition at line 838 of file vbregexp.c.

839{
841
842 TRACE("(%p)->(%p)\n", This, pctinfo);
843
844 *pctinfo = 1;
845 return S_OK;
846}

◆ MatchCollection2_Invoke()

static HRESULT WINAPI MatchCollection2_Invoke ( IMatchCollection2 *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 867 of file vbregexp.c.

870{
872
873 TRACE("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
874 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
875
876 return ITypeInfo_Invoke(typeinfos[MatchCollection2_tid], iface, dispIdMember, wFlags,
877 pDispParams, pVarResult, pExcepInfo, puArgErr);
878}

◆ MatchCollection2_QueryInterface()

static HRESULT WINAPI MatchCollection2_QueryInterface ( IMatchCollection2 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 777 of file vbregexp.c.

779{
781
783 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
784 *ppv = &This->IMatchCollection2_iface;
785 }else if(IsEqualGUID(riid, &IID_IDispatch)) {
786 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
787 *ppv = &This->IMatchCollection2_iface;
788 }else if(IsEqualGUID(riid, &IID_IMatchCollection2)) {
789 TRACE("(%p)->(IID_IMatchCollection2 %p)\n", This, ppv);
790 *ppv = &This->IMatchCollection2_iface;
791 }else if(IsEqualGUID(riid, &IID_IMatchCollection)) {
792 TRACE("(%p)->(IID_IMatchCollection %p)\n", This, ppv);
793 *ppv = &This->IMatchCollection_iface;
794 }else if(IsEqualGUID(riid, &IID_IDispatchEx)) {
795 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
796 *ppv = NULL;
797 return E_NOINTERFACE;
798 }else {
799 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
800 *ppv = NULL;
801 return E_NOINTERFACE;
802 }
803
804 IUnknown_AddRef((IUnknown*)*ppv);
805 return S_OK;
806}

◆ MatchCollection2_Release()

static ULONG WINAPI MatchCollection2_Release ( IMatchCollection2 *  iface)
static

Definition at line 818 of file vbregexp.c.

819{
822
823 TRACE("(%p) ref=%ld\n", This, ref);
824
825 if(!ref) {
826 DWORD i;
827
828 for(i=0; i<This->count; i++)
829 IMatch2_Release(This->matches[i]);
830 free(This->matches);
831
832 free(This);
833 }
834
835 return ref;
836}

◆ MatchCollection_AddRef()

static ULONG WINAPI MatchCollection_AddRef ( IMatchCollection *  iface)
static

Definition at line 947 of file vbregexp.c.

948{
950 return IMatchCollection2_AddRef(&This->IMatchCollection2_iface);
951}
static MatchCollection2 * impl_from_IMatchCollection(IMatchCollection *iface)
Definition: vbregexp.c:936

◆ MatchCollection_get__NewEnum()

static HRESULT WINAPI MatchCollection_get__NewEnum ( IMatchCollection *  iface,
IUnknown **  ppEnum 
)
static

Definition at line 1001 of file vbregexp.c.

1002{
1004 return IMatchCollection2_get__NewEnum(&This->IMatchCollection2_iface, ppEnum);
1005}

◆ MatchCollection_get_Count()

static HRESULT WINAPI MatchCollection_get_Count ( IMatchCollection *  iface,
LONG pCount 
)
static

Definition at line 995 of file vbregexp.c.

996{
998 return IMatchCollection2_get_Count(&This->IMatchCollection2_iface, pCount);
999}

◆ MatchCollection_get_Item()

static HRESULT WINAPI MatchCollection_get_Item ( IMatchCollection *  iface,
LONG  index,
IDispatch **  ppMatch 
)
static

Definition at line 989 of file vbregexp.c.

990{
992 return IMatchCollection2_get_Item(&This->IMatchCollection2_iface, index, ppMatch);
993}

◆ MatchCollection_GetIDsOfNames()

static HRESULT WINAPI MatchCollection_GetIDsOfNames ( IMatchCollection *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 972 of file vbregexp.c.

974{
976 return IMatchCollection2_GetIDsOfNames(&This->IMatchCollection2_iface,
977 riid, rgszNames, cNames, lcid, rgDispId);
978}

◆ MatchCollection_GetTypeInfo()

static HRESULT WINAPI MatchCollection_GetTypeInfo ( IMatchCollection *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 965 of file vbregexp.c.

967{
969 return IMatchCollection2_GetTypeInfo(&This->IMatchCollection2_iface, iTInfo, lcid, ppTInfo);
970}

◆ MatchCollection_GetTypeInfoCount()

static HRESULT WINAPI MatchCollection_GetTypeInfoCount ( IMatchCollection *  iface,
UINT pctinfo 
)
static

Definition at line 959 of file vbregexp.c.

960{
962 return IMatchCollection2_GetTypeInfoCount(&This->IMatchCollection2_iface, pctinfo);
963}

◆ MatchCollection_Invoke()

static HRESULT WINAPI MatchCollection_Invoke ( IMatchCollection *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 980 of file vbregexp.c.

983{
985 return IMatchCollection2_Invoke(&This->IMatchCollection2_iface, dispIdMember,
986 riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
987}

◆ MatchCollection_QueryInterface()

static HRESULT WINAPI MatchCollection_QueryInterface ( IMatchCollection *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 941 of file vbregexp.c.

942{
944 return IMatchCollection2_QueryInterface(&This->IMatchCollection2_iface, riid, ppv);
945}

◆ MatchCollection_Release()

static ULONG WINAPI MatchCollection_Release ( IMatchCollection *  iface)
static

Definition at line 953 of file vbregexp.c.

954{
956 return IMatchCollection2_Release(&This->IMatchCollection2_iface);
957}

◆ MatchCollectionEnum_AddRef()

static ULONG WINAPI MatchCollectionEnum_AddRef ( IEnumVARIANT iface)
static

Definition at line 655 of file vbregexp.c.

656{
659
660 TRACE("(%p) ref=%ld\n", This, ref);
661
662 return ref;
663}
static MatchCollectionEnum * impl_from_IMatchCollectionEnum(IEnumVARIANT *iface)
Definition: vbregexp.c:629

◆ MatchCollectionEnum_Clone()

static HRESULT WINAPI MatchCollectionEnum_Clone ( IEnumVARIANT iface,
IEnumVARIANT **  ppEnum 
)
static

Definition at line 736 of file vbregexp.c.

737{
739 FIXME("(%p)->(%p)\n", This, ppEnum);
740 return E_NOTIMPL;
741}

◆ MatchCollectionEnum_Next()

static HRESULT WINAPI MatchCollectionEnum_Next ( IEnumVARIANT iface,
ULONG  celt,
VARIANT rgVar,
ULONG pCeltFetched 
)
static

Definition at line 680 of file vbregexp.c.

682{
684 DWORD i;
685 HRESULT hres = S_OK;
686
687 TRACE("(%p)->(%lu %p %p)\n", This, celt, rgVar, pCeltFetched);
688
689 if(This->pos>=This->count) {
690 if(pCeltFetched)
691 *pCeltFetched = 0;
692 return S_FALSE;
693 }
694
695 for(i=0; i<celt && This->pos+i<This->count; i++) {
696 V_VT(rgVar+i) = VT_DISPATCH;
697 hres = IMatchCollection2_get_Item(This->mc, This->pos+i, &V_DISPATCH(rgVar+i));
698 if(FAILED(hres))
699 break;
700 }
701 if(FAILED(hres)) {
702 while(i--)
703 VariantClear(rgVar+i);
704 return hres;
705 }
706
707 if(pCeltFetched)
708 *pCeltFetched = i;
709 This->pos += i;
710 return S_OK;
711}
@ VT_DISPATCH
Definition: compat.h:2304
#define V_VT(A)
Definition: oleauto.h:211
#define V_DISPATCH(A)
Definition: oleauto.h:239
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define S_FALSE
Definition: winerror.h:3451

◆ MatchCollectionEnum_QueryInterface()

static HRESULT WINAPI MatchCollectionEnum_QueryInterface ( IEnumVARIANT iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 634 of file vbregexp.c.

636{
638
640 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
641 *ppv = &This->IEnumVARIANT_iface;
642 }else if(IsEqualGUID(riid, &IID_IEnumVARIANT)) {
643 TRACE("(%p)->(IID_IEnumVARIANT %p)\n", This, ppv);
644 *ppv = &This->IEnumVARIANT_iface;
645 }else {
646 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
647 *ppv = NULL;
648 return E_NOINTERFACE;
649 }
650
651 IUnknown_AddRef((IUnknown*)*ppv);
652 return S_OK;
653}

◆ MatchCollectionEnum_Release()

static ULONG WINAPI MatchCollectionEnum_Release ( IEnumVARIANT iface)
static

Definition at line 665 of file vbregexp.c.

666{
669
670 TRACE("(%p) ref=%ld\n", This, ref);
671
672 if(!ref) {
673 IMatchCollection2_Release(This->mc);
674 free(This);
675 }
676
677 return ref;
678}

◆ MatchCollectionEnum_Reset()

static HRESULT WINAPI MatchCollectionEnum_Reset ( IEnumVARIANT iface)
static

Definition at line 726 of file vbregexp.c.

727{
729
730 TRACE("(%p)\n", This);
731
732 This->pos = 0;
733 return S_OK;
734}

◆ MatchCollectionEnum_Skip()

static HRESULT WINAPI MatchCollectionEnum_Skip ( IEnumVARIANT iface,
ULONG  celt 
)
static

Definition at line 713 of file vbregexp.c.

714{
716
717 TRACE("(%p)->(%lu)\n", This, celt);
718
719 if(This->pos+celt <= This->count)
720 This->pos += celt;
721 else
722 This->pos = This->count;
723 return S_OK;
724}
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ RegExp2_AddRef()

static ULONG WINAPI RegExp2_AddRef ( IRegExp2 *  iface)
static

Definition at line 1101 of file vbregexp.c.

1102{
1105
1106 TRACE("(%p) ref=%ld\n", This, ref);
1107
1108 return ref;
1109}
static RegExp2 * impl_from_IRegExp2(IRegExp2 *iface)
Definition: vbregexp.c:1066

◆ RegExp2_Execute()

static HRESULT WINAPI RegExp2_Execute ( IRegExp2 *  iface,
BSTR  sourceString,
IDispatch **  ppMatches 
)
static

Definition at line 1298 of file vbregexp.c.

1300{
1303 const WCHAR *pos;
1304 IMatchCollection2 *match_collection;
1305 IMatch2 *add = NULL;
1306 HRESULT hres;
1307
1308 TRACE("(%p)->(%s %p)\n", This, debugstr_w(sourceString), ppMatches);
1309
1310 if(!This->pattern) {
1311 DWORD i, len = SysStringLen(sourceString);
1312
1313 hres = create_match_collection2(&match_collection);
1314 if(FAILED(hres))
1315 return hres;
1316
1317 for(i=0; i<=len; i++) {
1318 hres = create_match2(i, NULL, &add);
1319 if(FAILED(hres))
1320 break;
1321
1322 hres = add_match(match_collection, add);
1323 IMatch2_Release(add);
1324 if(FAILED(hres))
1325 break;
1326
1327 if(!(This->flags & REG_GLOB))
1328 break;
1329 }
1330
1331 if(FAILED(hres)) {
1332 IMatchCollection2_Release(match_collection);
1333 return hres;
1334 }
1335
1336 *ppMatches = (IDispatch*)match_collection;
1337 return S_OK;
1338 }
1339
1340 if(!This->regexp) {
1341 This->regexp = regexp_new(NULL, &This->pool, This->pattern,
1342 lstrlenW(This->pattern), This->flags, FALSE);
1343 if(!This->regexp)
1344 return E_FAIL;
1345 }else {
1346 hres = regexp_set_flags(&This->regexp, NULL, &This->pool, This->flags);
1347 if(FAILED(hres))
1348 return hres;
1349 }
1350
1351 hres = create_match_collection2(&match_collection);
1352 if(FAILED(hres))
1353 return hres;
1354
1355 pos = sourceString;
1356 while(1) {
1357 result = alloc_match_state(This->regexp, NULL, pos);
1358 if(!result) {
1360 break;
1361 }
1362
1363 hres = regexp_execute(This->regexp, NULL, &This->pool,
1364 sourceString, SysStringLen(sourceString), result);
1365 if(hres != S_OK) {
1366 free(result);
1367 break;
1368 }
1369 pos = result->cp;
1370
1371 hres = create_match2(result->cp-result->match_len-sourceString, &result, &add);
1372 free(result);
1373 if(FAILED(hres))
1374 break;
1375 hres = add_match(match_collection, add);
1376 IMatch2_Release(add);
1377 if(FAILED(hres))
1378 break;
1379
1380 if(!(This->flags & REG_GLOB))
1381 break;
1382 }
1383
1384 if(FAILED(hres)) {
1385 IMatchCollection2_Release(match_collection);
1386 return hres;
1387 }
1388
1389 *ppMatches = (IDispatch*)match_collection;
1390 return S_OK;
1391}
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
#define lstrlenW
Definition: compat.h:750
#define REG_GLOB
Definition: regexp.h:37
static match_state_t * alloc_match_state(regexp_t *regexp, heap_pool_t *pool, const WCHAR *pos)
Definition: regexp.h:71
GLenum GLsizei len
Definition: glext.h:6722
HRESULT regexp_execute(regexp_t *regexp, void *cx, heap_pool_t *pool, const WCHAR *str, DWORD str_len, match_state_t *result)
Definition: regexp.c:3136
regexp_t * regexp_new(void *cx, heap_pool_t *pool, const WCHAR *str, DWORD str_len, WORD flags, BOOL flat)
Definition: regexp.c:3191
#define debugstr_w
Definition: kernel32.h:32
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
static HRESULT add_match(IMatchCollection2 *iface, IMatch2 *add)
Definition: vbregexp.c:1020
static HRESULT create_match2(DWORD pos, match_state_t **result, IMatch2 **match)
Definition: vbregexp.c:599
static HRESULT create_match_collection2(IMatchCollection2 **match_collection)
Definition: vbregexp.c:1045
HRESULT regexp_set_flags(regexp_t **regexp, void *cx, heap_pool_t *pool, WORD flags)
Definition: regexp.c:3290

◆ RegExp2_get_Global()

static HRESULT WINAPI RegExp2_get_Global ( IRegExp2 *  iface,
VARIANT_BOOL pGlobal 
)
static

Definition at line 1246 of file vbregexp.c.

1247{
1249
1250 TRACE("(%p)->(%p)\n", This, pGlobal);
1251
1252 if(!pGlobal)
1253 return E_POINTER;
1254
1255 *pGlobal = This->flags & REG_GLOB ? VARIANT_TRUE : VARIANT_FALSE;
1256 return S_OK;
1257}

◆ RegExp2_get_IgnoreCase()

static HRESULT WINAPI RegExp2_get_IgnoreCase ( IRegExp2 *  iface,
VARIANT_BOOL pIgnoreCase 
)
static

Definition at line 1220 of file vbregexp.c.

1221{
1223
1224 TRACE("(%p)->(%p)\n", This, pIgnoreCase);
1225
1226 if(!pIgnoreCase)
1227 return E_POINTER;
1228
1229 *pIgnoreCase = This->flags & REG_FOLD ? VARIANT_TRUE : VARIANT_FALSE;
1230 return S_OK;
1231}
#define REG_FOLD
Definition: regexp.h:36

◆ RegExp2_get_Multiline()

static HRESULT WINAPI RegExp2_get_Multiline ( IRegExp2 *  iface,
VARIANT_BOOL pMultiline 
)
static

Definition at line 1272 of file vbregexp.c.

1273{
1275
1276 TRACE("(%p)->(%p)\n", This, pMultiline);
1277
1278 if(!pMultiline)
1279 return E_POINTER;
1280
1281 *pMultiline = This->flags & REG_MULTILINE ? VARIANT_TRUE : VARIANT_FALSE;
1282 return S_OK;
1283}
#define REG_MULTILINE
Definition: regexp.h:38

◆ RegExp2_get_Pattern()

static HRESULT WINAPI RegExp2_get_Pattern ( IRegExp2 *  iface,
BSTR pPattern 
)
static

Definition at line 1175 of file vbregexp.c.

1176{
1178
1179 TRACE("(%p)->(%p)\n", This, pPattern);
1180
1181 if(!pPattern)
1182 return E_POINTER;
1183
1184 if(!This->pattern) {
1185 *pPattern = NULL;
1186 return S_OK;
1187 }
1188
1189 *pPattern = SysAllocString(This->pattern);
1190 return *pPattern ? S_OK : E_OUTOFMEMORY;
1191}

◆ RegExp2_GetIDsOfNames()

static HRESULT WINAPI RegExp2_GetIDsOfNames ( IRegExp2 *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1151 of file vbregexp.c.

1153{
1155
1156 TRACE("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid),
1157 rgszNames, cNames, lcid, rgDispId);
1158
1159 return ITypeInfo_GetIDsOfNames(typeinfos[RegExp2_tid], rgszNames, cNames, rgDispId);
1160}

◆ RegExp2_GetTypeInfo()

static HRESULT WINAPI RegExp2_GetTypeInfo ( IRegExp2 *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1139 of file vbregexp.c.

1141{
1143
1144 TRACE("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
1145
1146 *ppTInfo = typeinfos[RegExp2_tid];
1147 ITypeInfo_AddRef(*ppTInfo);
1148 return S_OK;
1149}

◆ RegExp2_GetTypeInfoCount()

static HRESULT WINAPI RegExp2_GetTypeInfoCount ( IRegExp2 *  iface,
UINT pctinfo 
)
static

Definition at line 1129 of file vbregexp.c.

1130{
1132
1133 TRACE("(%p)->(%p)\n", This, pctinfo);
1134
1135 *pctinfo = 1;
1136 return S_OK;
1137}

◆ RegExp2_Invoke()

static HRESULT WINAPI RegExp2_Invoke ( IRegExp2 *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1162 of file vbregexp.c.

1165{
1167
1168 TRACE("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
1169 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1170
1171 return ITypeInfo_Invoke(typeinfos[RegExp2_tid], iface, dispIdMember, wFlags,
1172 pDispParams, pVarResult, pExcepInfo, puArgErr);
1173}

◆ RegExp2_put_Global()

static HRESULT WINAPI RegExp2_put_Global ( IRegExp2 *  iface,
VARIANT_BOOL  global 
)
static

Definition at line 1259 of file vbregexp.c.

1260{
1262
1263 TRACE("(%p)->(%s)\n", This, global ? "true" : "false");
1264
1265 if(global)
1266 This->flags |= REG_GLOB;
1267 else
1268 This->flags &= ~REG_GLOB;
1269 return S_OK;
1270}
int global
Definition: ehframes.cpp:22

◆ RegExp2_put_IgnoreCase()

static HRESULT WINAPI RegExp2_put_IgnoreCase ( IRegExp2 *  iface,
VARIANT_BOOL  ignoreCase 
)
static

Definition at line 1233 of file vbregexp.c.

1234{
1236
1237 TRACE("(%p)->(%s)\n", This, ignoreCase ? "true" : "false");
1238
1239 if(ignoreCase)
1240 This->flags |= REG_FOLD;
1241 else
1242 This->flags &= ~REG_FOLD;
1243 return S_OK;
1244}

◆ RegExp2_put_Multiline()

static HRESULT WINAPI RegExp2_put_Multiline ( IRegExp2 *  iface,
VARIANT_BOOL  multiline 
)
static

Definition at line 1285 of file vbregexp.c.

1286{
1288
1289 TRACE("(%p)->(%s)\n", This, multiline ? "true" : "false");
1290
1291 if(multiline)
1292 This->flags |= REG_MULTILINE;
1293 else
1294 This->flags &= ~REG_MULTILINE;
1295 return S_OK;
1296}

◆ RegExp2_put_Pattern()

static HRESULT WINAPI RegExp2_put_Pattern ( IRegExp2 *  iface,
BSTR  pattern 
)
static

Definition at line 1193 of file vbregexp.c.

1194{
1196 WCHAR *new_pattern;
1197
1198 TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(pattern));
1199
1200 if(pattern && *pattern) {
1201 SIZE_T size = (SysStringLen(pattern)+1) * sizeof(WCHAR);
1202 new_pattern = malloc(size);
1203 if(!new_pattern)
1204 return E_OUTOFMEMORY;
1205 memcpy(new_pattern, pattern, size);
1206 }else {
1207 new_pattern = NULL;
1208 }
1209
1210 free(This->pattern);
1211 This->pattern = new_pattern;
1212
1213 if(This->regexp) {
1214 regexp_destroy(This->regexp);
1215 This->regexp = NULL;
1216 }
1217 return S_OK;
1218}
GLsizeiptr size
Definition: glext.h:5919
GLubyte * pattern
Definition: glext.h:7787
void regexp_destroy(regexp_t *re)
Definition: regexp.c:3177
#define wine_dbgstr_w
Definition: kernel32.h:34
ULONG_PTR SIZE_T
Definition: typedefs.h:80

◆ RegExp2_QueryInterface()

static HRESULT WINAPI RegExp2_QueryInterface ( IRegExp2 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1071 of file vbregexp.c.

1072{
1074
1076 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1077 *ppv = &This->IRegExp2_iface;
1078 }else if(IsEqualGUID(riid, &IID_IDispatch)) {
1079 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1080 *ppv = &This->IRegExp2_iface;
1081 }else if(IsEqualGUID(riid, &IID_IRegExp2)) {
1082 TRACE("(%p)->(IID_IRegExp2 %p)\n", This, ppv);
1083 *ppv = &This->IRegExp2_iface;
1084 }else if(IsEqualGUID(riid, &IID_IRegExp)) {
1085 TRACE("(%p)->(IID_IRegExp %p)\n", This, ppv);
1086 *ppv = &This->IRegExp_iface;
1087 }else if(IsEqualGUID(riid, &IID_IDispatchEx)) {
1088 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
1089 *ppv = NULL;
1090 return E_NOINTERFACE;
1091 }else {
1092 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
1093 *ppv = NULL;
1094 return E_NOINTERFACE;
1095 }
1096
1097 IUnknown_AddRef((IUnknown*)*ppv);
1098 return S_OK;
1099}

◆ RegExp2_Release()

static ULONG WINAPI RegExp2_Release ( IRegExp2 *  iface)
static

Definition at line 1111 of file vbregexp.c.

1112{
1115
1116 TRACE("(%p) ref=%ld\n", This, ref);
1117
1118 if(!ref) {
1119 free(This->pattern);
1120 if(This->regexp)
1121 regexp_destroy(This->regexp);
1122 heap_pool_free(&This->pool);
1123 free(This);
1124 }
1125
1126 return ref;
1127}
void heap_pool_free(heap_pool_t *)
Definition: jsutils.c:164

◆ RegExp2_Replace()

static HRESULT WINAPI RegExp2_Replace ( IRegExp2 *  iface,
BSTR  source,
VARIANT  replaceVar,
BSTR ret 
)
static

Definition at line 1481 of file vbregexp.c.

1482{
1484 const WCHAR *cp, *prev_cp = NULL, *ptr, *prev_ptr;
1485 size_t match_len = 0, source_len, replace_len;
1486 strbuf_t buf = { NULL, 0, 0 };
1488 heap_pool_t *mark;
1489 VARIANT strv;
1490 BSTR replace;
1491 HRESULT hres;
1492
1493 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(source), debugstr_variant(&replaceVar), ret);
1494
1495 if(This->pattern) {
1496 if(!This->regexp) {
1497 This->regexp = regexp_new(NULL, &This->pool, This->pattern,
1498 lstrlenW(This->pattern), This->flags, FALSE);
1499 if(!This->regexp)
1500 return E_OUTOFMEMORY;
1501 }else {
1502 hres = regexp_set_flags(&This->regexp, NULL, &This->pool, This->flags);
1503 if(FAILED(hres))
1504 return hres;
1505 }
1506 }
1507
1508 V_VT(&strv) = VT_EMPTY;
1509 hres = VariantChangeType(&strv, &replaceVar, 0, VT_BSTR);
1510 if(FAILED(hres))
1511 return hres;
1512 replace = V_BSTR(&strv);
1513 replace_len = SysStringLen(replace);
1514 source_len = SysStringLen(source);
1515
1516 mark = heap_pool_mark(&This->pool);
1517 cp = source;
1518 if(This->regexp && !(state = alloc_match_state(This->regexp, &This->pool, cp)))
1520
1521 while(SUCCEEDED(hres)) {
1522 if(This->regexp) {
1523 prev_cp = cp;
1524 hres = regexp_execute(This->regexp, NULL, &This->pool, source, source_len, state);
1525 if(hres != S_OK) break;
1526 cp = state->cp;
1527 match_len = state->match_len;
1528 }else if(prev_cp) {
1529 if(cp == source + source_len)
1530 break;
1531 prev_cp = cp++;
1532 }else {
1533 prev_cp = cp;
1534 }
1535
1536 hres = strbuf_append(&buf, prev_cp, cp - prev_cp - match_len);
1537 if(FAILED(hres))
1538 break;
1539
1540 prev_ptr = replace;
1541 while((ptr = wmemchr(prev_ptr, '$', replace + replace_len - prev_ptr))) {
1542 hres = strbuf_append(&buf, prev_ptr, ptr - prev_ptr);
1543 if(FAILED(hres))
1544 break;
1545
1546 switch(ptr[1]) {
1547 case '$':
1548 hres = strbuf_append(&buf, ptr, 1);
1549 prev_ptr = ptr + 2;
1550 break;
1551 case '&':
1552 hres = strbuf_append(&buf, cp - match_len, match_len);
1553 prev_ptr = ptr + 2;
1554 break;
1555 case '`':
1556 hres = strbuf_append(&buf, source, cp - source - match_len);
1557 prev_ptr = ptr + 2;
1558 break;
1559 case '\'':
1560 hres = strbuf_append(&buf, cp, source + source_len - cp);
1561 prev_ptr = ptr + 2;
1562 break;
1563 default: {
1564 DWORD idx;
1565
1566 if(!is_digit(ptr[1])) {
1567 hres = strbuf_append(&buf, ptr, 1);
1568 prev_ptr = ptr + 1;
1569 break;
1570 }
1571
1572 idx = ptr[1] - '0';
1573 if(is_digit(ptr[2]) && idx * 10 + (ptr[2] - '0') <= state->paren_count) {
1574 idx = idx * 10 + (ptr[2] - '0');
1575 prev_ptr = ptr + 3;
1576 }else if(idx && idx <= state->paren_count) {
1577 prev_ptr = ptr + 2;
1578 }else {
1579 hres = strbuf_append(&buf, ptr, 1);
1580 prev_ptr = ptr + 1;
1581 break;
1582 }
1583
1584 if(state->parens[idx - 1].index != -1)
1585 hres = strbuf_append(&buf, source + state->parens[idx - 1].index,
1586 state->parens[idx - 1].length);
1587 break;
1588 }
1589 }
1590 if(FAILED(hres))
1591 break;
1592 }
1593 if(SUCCEEDED(hres))
1594 hres = strbuf_append(&buf, prev_ptr, replace + replace_len - prev_ptr);
1595 if(FAILED(hres))
1596 break;
1597
1598 if(!(This->flags & REG_GLOB))
1599 break;
1600 }
1601
1602 if(SUCCEEDED(hres)) {
1603 hres = strbuf_append(&buf, cp, source + source_len - cp);
1604 if(SUCCEEDED(hres) && !(*ret = SysAllocStringLen(buf.buf, buf.len)))
1606 }
1607
1608 heap_pool_clear(mark);
1609 free(buf.buf);
1611 return hres;
1612}
static int state
Definition: maze.c:121
#define is_digit(c)
Definition: astoll.c:39
unsigned int idx
Definition: utils.c:41
OLECHAR * BSTR
Definition: compat.h:2293
@ VT_BSTR
Definition: compat.h:2303
@ VT_EMPTY
Definition: compat.h:2295
static wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n)
Definition: wchar.h:48
static const char * debugstr_variant(const VARIANT *var)
Definition: dom.c:505
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SUCCEEDED(hr)
Definition: intsafe.h:50
void heap_pool_clear(heap_pool_t *)
Definition: jsutils.c:141
heap_pool_t * heap_pool_mark(heap_pool_t *)
Definition: jsutils.c:177
POINT cp
Definition: magnifier.c:59
static PVOID ptr
Definition: dispmode.c:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_BSTR(A)
Definition: oleauto.h:226
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:38
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
static HRESULT strbuf_append(strbuf_t *buf, const WCHAR *str, DWORD len)
Definition: vbregexp.c:1468

◆ RegExp2_Test()

static HRESULT WINAPI RegExp2_Test ( IRegExp2 *  iface,
BSTR  sourceString,
VARIANT_BOOL pMatch 
)
static

Definition at line 1393 of file vbregexp.c.

1394{
1397 heap_pool_t *mark;
1398 HRESULT hres;
1399
1400 TRACE("(%p)->(%s %p)\n", This, debugstr_w(sourceString), pMatch);
1401
1402 if(!This->pattern) {
1403 *pMatch = VARIANT_TRUE;
1404 return S_OK;
1405 }
1406
1407 if(!This->regexp) {
1408 This->regexp = regexp_new(NULL, &This->pool, This->pattern,
1409 lstrlenW(This->pattern), This->flags, FALSE);
1410 if(!This->regexp)
1411 return E_FAIL;
1412 }else {
1413 hres = regexp_set_flags(&This->regexp, NULL, &This->pool, This->flags);
1414 if(FAILED(hres))
1415 return hres;
1416 }
1417
1418 mark = heap_pool_mark(&This->pool);
1419 result = alloc_match_state(This->regexp, &This->pool, sourceString);
1420 if(!result) {
1421 heap_pool_clear(mark);
1422 return E_OUTOFMEMORY;
1423 }
1424
1425 hres = regexp_execute(This->regexp, NULL, &This->pool,
1426 sourceString, SysStringLen(sourceString), result);
1427
1428 heap_pool_clear(mark);
1429
1430 if(hres == S_OK) {
1431 *pMatch = VARIANT_TRUE;
1432 }else if(hres == S_FALSE) {
1433 *pMatch = VARIANT_FALSE;
1434 hres = S_OK;
1435 }
1436 return hres;
1437}

◆ RegExp_AddRef()

static ULONG WINAPI RegExp_AddRef ( IRegExp *  iface)
static

Definition at line 1691 of file vbregexp.c.

1692{
1693 RegExp2 *This = impl_from_IRegExp(iface);
1694 return IRegExp2_AddRef(&This->IRegExp2_iface);
1695}
static RegExp2 * impl_from_IRegExp(IRegExp *iface)
Definition: vbregexp.c:1680

◆ RegExp_Execute()

static HRESULT WINAPI RegExp_Execute ( IRegExp *  iface,
BSTR  sourceString,
IDispatch **  ppMatches 
)
static

Definition at line 1768 of file vbregexp.c.

1770{
1771 RegExp2 *This = impl_from_IRegExp(iface);
1772 return IRegExp2_Execute(&This->IRegExp2_iface, sourceString, ppMatches);
1773}

◆ RegExp_get_Global()

static HRESULT WINAPI RegExp_get_Global ( IRegExp *  iface,
VARIANT_BOOL pGlobal 
)
static

Definition at line 1756 of file vbregexp.c.

1757{
1758 RegExp2 *This = impl_from_IRegExp(iface);
1759 return IRegExp2_get_Global(&This->IRegExp2_iface, pGlobal);
1760}

◆ RegExp_get_IgnoreCase()

static HRESULT WINAPI RegExp_get_IgnoreCase ( IRegExp *  iface,
VARIANT_BOOL pIgnoreCase 
)
static

Definition at line 1744 of file vbregexp.c.

1745{
1746 RegExp2 *This = impl_from_IRegExp(iface);
1747 return IRegExp2_get_IgnoreCase(&This->IRegExp2_iface, pIgnoreCase);
1748}

◆ RegExp_get_Pattern()

static HRESULT WINAPI RegExp_get_Pattern ( IRegExp *  iface,
BSTR pPattern 
)
static

Definition at line 1732 of file vbregexp.c.

1733{
1734 RegExp2 *This = impl_from_IRegExp(iface);
1735 return IRegExp2_get_Pattern(&This->IRegExp2_iface, pPattern);
1736}

◆ RegExp_GetIDsOfNames()

static HRESULT WINAPI RegExp_GetIDsOfNames ( IRegExp *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1716 of file vbregexp.c.

1718{
1719 RegExp2 *This = impl_from_IRegExp(iface);
1720 return IRegExp2_GetIDsOfNames(&This->IRegExp2_iface, riid, rgszNames, cNames, lcid, rgDispId);
1721}

◆ RegExp_GetTypeInfo()

static HRESULT WINAPI RegExp_GetTypeInfo ( IRegExp *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1709 of file vbregexp.c.

1711{
1712 RegExp2 *This = impl_from_IRegExp(iface);
1713 return IRegExp2_GetTypeInfo(&This->IRegExp2_iface, iTInfo, lcid, ppTInfo);
1714}

◆ RegExp_GetTypeInfoCount()

static HRESULT WINAPI RegExp_GetTypeInfoCount ( IRegExp *  iface,
UINT pctinfo 
)
static

Definition at line 1703 of file vbregexp.c.

1704{
1705 RegExp2 *This = impl_from_IRegExp(iface);
1706 return IRegExp2_GetTypeInfoCount(&This->IRegExp2_iface, pctinfo);
1707}

◆ RegExp_Invoke()

static HRESULT WINAPI RegExp_Invoke ( IRegExp *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1723 of file vbregexp.c.

1726{
1727 RegExp2 *This = impl_from_IRegExp(iface);
1728 return IRegExp2_Invoke(&This->IRegExp2_iface, dispIdMember, riid, lcid,
1729 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1730}

◆ RegExp_put_Global()

static HRESULT WINAPI RegExp_put_Global ( IRegExp *  iface,
VARIANT_BOOL  pGlobal 
)
static

Definition at line 1762 of file vbregexp.c.

1763{
1764 RegExp2 *This = impl_from_IRegExp(iface);
1765 return IRegExp2_put_Global(&This->IRegExp2_iface, pGlobal);
1766}

◆ RegExp_put_IgnoreCase()

static HRESULT WINAPI RegExp_put_IgnoreCase ( IRegExp *  iface,
VARIANT_BOOL  pIgnoreCase 
)
static

Definition at line 1750 of file vbregexp.c.

1751{
1752 RegExp2 *This = impl_from_IRegExp(iface);
1753 return IRegExp2_put_IgnoreCase(&This->IRegExp2_iface, pIgnoreCase);
1754}

◆ RegExp_put_Pattern()

static HRESULT WINAPI RegExp_put_Pattern ( IRegExp *  iface,
BSTR  pPattern 
)
static

Definition at line 1738 of file vbregexp.c.

1739{
1740 RegExp2 *This = impl_from_IRegExp(iface);
1741 return IRegExp2_put_Pattern(&This->IRegExp2_iface, pPattern);
1742}

◆ RegExp_QueryInterface()

static HRESULT WINAPI RegExp_QueryInterface ( IRegExp *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1685 of file vbregexp.c.

1686{
1687 RegExp2 *This = impl_from_IRegExp(iface);
1688 return IRegExp2_QueryInterface(&This->IRegExp2_iface, riid, ppv);
1689}

◆ RegExp_Release()

static ULONG WINAPI RegExp_Release ( IRegExp *  iface)
static

Definition at line 1697 of file vbregexp.c.

1698{
1699 RegExp2 *This = impl_from_IRegExp(iface);
1700 return IRegExp2_Release(&This->IRegExp2_iface);
1701}

◆ RegExp_Replace()

static HRESULT WINAPI RegExp_Replace ( IRegExp *  iface,
BSTR  sourceString,
BSTR  replaceString,
BSTR pDestString 
)
static

Definition at line 1781 of file vbregexp.c.

1783{
1784 RegExp2 *This = impl_from_IRegExp(iface);
1786
1787 V_VT(&replace) = VT_BSTR;
1788 V_BSTR(&replace) = replaceString;
1789 return IRegExp2_Replace(&This->IRegExp2_iface, sourceString, replace, pDestString);
1790}

◆ RegExp_Test()

static HRESULT WINAPI RegExp_Test ( IRegExp *  iface,
BSTR  sourceString,
VARIANT_BOOL pMatch 
)
static

Definition at line 1775 of file vbregexp.c.

1776{
1777 RegExp2 *This = impl_from_IRegExp(iface);
1778 return IRegExp2_Test(&This->IRegExp2_iface, sourceString, pMatch);
1779}

◆ release_regexp_typelib()

void release_regexp_typelib ( void  )

Definition at line 1849 of file vbregexp.c.

1850{
1851 DWORD i;
1852
1853 for(i=0; i<REGEXP_LAST_tid; i++) {
1854 if(typeinfos[i])
1855 ITypeInfo_Release(typeinfos[i]);
1856 }
1857 if(typelib)
1858 ITypeLib_Release(typelib);
1859}

Referenced by DllMain().

◆ strbuf_append()

static HRESULT strbuf_append ( strbuf_t buf,
const WCHAR str,
DWORD  len 
)
static

Definition at line 1468 of file vbregexp.c.

1469{
1470 if(!len)
1471 return S_OK;
1472
1473 if(!strbuf_ensure_size(buf, buf->len+len))
1474 return E_OUTOFMEMORY;
1475
1476 memcpy(buf->buf+buf->len, str, len*sizeof(WCHAR));
1477 buf->len += len;
1478 return S_OK;
1479}
const WCHAR * str
static BOOL strbuf_ensure_size(strbuf_t *buf, unsigned len)
Definition: vbregexp.c:1445

Referenced by RegExp2_Replace(), and string_replace().

◆ strbuf_ensure_size()

static BOOL strbuf_ensure_size ( strbuf_t buf,
unsigned  len 
)
static

Definition at line 1445 of file vbregexp.c.

1446{
1447 WCHAR *new_buf;
1449
1450 if(len <= buf->size)
1451 return TRUE;
1452
1453 new_size = buf->size ? buf->size<<1 : 16;
1454 if(new_size < len)
1455 new_size = len;
1456 if(buf->buf)
1457 new_buf = realloc(buf->buf, new_size*sizeof(WCHAR));
1458 else
1459 new_buf = malloc(new_size*sizeof(WCHAR));
1460 if(!new_buf)
1461 return FALSE;
1462
1463 buf->buf = new_buf;
1464 buf->size = new_size;
1465 return TRUE;
1466}
#define TRUE
Definition: types.h:120
size_t const new_size
Definition: expand.cpp:66

Referenced by strbuf_append().

◆ string_replace()

BSTR string_replace ( BSTR  string,
BSTR  find,
BSTR  replace,
int  from,
int  cnt,
int  mode 
)

Definition at line 1635 of file vbregexp.c.

1636{
1637 const WCHAR *ptr, *string_end;
1638 strbuf_t buf = { NULL, 0, 0 };
1639 size_t replace_len, find_len;
1640 BSTR ret = NULL;
1641 HRESULT hres = S_OK;
1642 int pos;
1643
1644 string_end = string + SysStringLen(string);
1645 ptr = from > SysStringLen(string) ? string_end : string + from;
1646
1647 find_len = SysStringLen(find);
1648 replace_len = SysStringLen(replace);
1649
1650 while(string_end - ptr >= find_len && cnt && find_len) {
1651 pos = FindStringOrdinal(FIND_FROMSTART, ptr, string_end - ptr,
1652 find, find_len, mode);
1653
1654 if(pos == -1)
1655 break;
1656 else {
1658 if(FAILED(hres))
1659 break;
1660 hres = strbuf_append(&buf, replace, replace_len);
1661 if(FAILED(hres))
1662 break;
1663
1664 ptr = ptr + pos + find_len;
1665 if(cnt != -1)
1666 cnt--;
1667 }
1668 }
1669
1670 if(SUCCEEDED(hres)) {
1671 hres = strbuf_append(&buf, ptr, string_end - ptr);
1672 if(SUCCEEDED(hres))
1673 ret = SysAllocStringLen(buf.buf, buf.len);
1674 }
1675
1676 free(buf.buf);
1677 return ret;
1678}
static TAGID TAGID find
Definition: db.cpp:156
INT WINAPI DECLSPEC_HOTPATCH FindStringOrdinal(DWORD flag, const WCHAR *src, INT src_size, const WCHAR *val, INT val_size, BOOL ignore_case)
Definition: locale.c:5257
GLenum mode
Definition: glext.h:6217
CardRegion * from
Definition: spigame.cpp:19
_In_ size_t cnt
Definition: wcstombs.cpp:43
#define FIND_FROMSTART
Definition: winnls.h:230

Referenced by Global_Replace().

◆ SubMatches_AddRef()

static ULONG WINAPI SubMatches_AddRef ( ISubMatches *  iface)
static

Definition at line 168 of file vbregexp.c.

169{
172
173 TRACE("(%p) ref=%ld\n", This, ref);
174
175 return ref;
176}
static SubMatches * impl_from_ISubMatches(ISubMatches *iface)
Definition: vbregexp.c:135

◆ SubMatches_get__NewEnum()

static HRESULT WINAPI SubMatches_get__NewEnum ( ISubMatches *  iface,
IUnknown **  ppEnum 
)
static

Definition at line 280 of file vbregexp.c.

281{
283 FIXME("(%p)->(%p)\n", This, ppEnum);
284 return E_NOTIMPL;
285}

◆ SubMatches_get_Count()

static HRESULT WINAPI SubMatches_get_Count ( ISubMatches *  iface,
LONG pCount 
)
static

Definition at line 264 of file vbregexp.c.

265{
267
268 TRACE("(%p)->(%p)\n", This, pCount);
269
270 if(!pCount)
271 return E_POINTER;
272
273 if(!This->result)
274 *pCount = 0;
275 else
276 *pCount = This->result->paren_count;
277 return S_OK;
278}

◆ SubMatches_get_Item()

static HRESULT WINAPI SubMatches_get_Item ( ISubMatches *  iface,
LONG  index,
VARIANT pSubMatch 
)
static

Definition at line 236 of file vbregexp.c.

238{
240
241 TRACE("(%p)->(%ld %p)\n", This, index, pSubMatch);
242
243 if(!pSubMatch)
244 return E_POINTER;
245
246 if(!This->result || index<0 || index>=This->result->paren_count)
247 return E_INVALIDARG;
248
249 if(This->result->parens[index].index == -1) {
250 V_VT(pSubMatch) = VT_EMPTY;
251 }else {
252 V_VT(pSubMatch) = VT_BSTR;
253 V_BSTR(pSubMatch) = SysAllocStringLen(
254 This->match+This->result->parens[index].index,
255 This->result->parens[index].length);
256
257 if(!V_BSTR(pSubMatch))
258 return E_OUTOFMEMORY;
259 }
260
261 return S_OK;
262}

◆ SubMatches_GetIDsOfNames()

static HRESULT WINAPI SubMatches_GetIDsOfNames ( ISubMatches *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 212 of file vbregexp.c.

214{
216
217 TRACE("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid),
218 rgszNames, cNames, lcid, rgDispId);
219
220 return ITypeInfo_GetIDsOfNames(typeinfos[SubMatches_tid], rgszNames, cNames, rgDispId);
221}

◆ SubMatches_GetTypeInfo()

static HRESULT WINAPI SubMatches_GetTypeInfo ( ISubMatches *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 204 of file vbregexp.c.

206{
208 FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
209 return E_NOTIMPL;
210}

◆ SubMatches_GetTypeInfoCount()

static HRESULT WINAPI SubMatches_GetTypeInfoCount ( ISubMatches *  iface,
UINT pctinfo 
)
static

Definition at line 194 of file vbregexp.c.

195{
197
198 TRACE("(%p)->(%p)\n", This, pctinfo);
199
200 *pctinfo = 1;
201 return S_OK;
202}

◆ SubMatches_Invoke()

static HRESULT WINAPI SubMatches_Invoke ( ISubMatches *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 223 of file vbregexp.c.

226{
228
229 TRACE("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
230 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
231
232 return ITypeInfo_Invoke(typeinfos[SubMatches_tid], iface, dispIdMember, wFlags,
233 pDispParams, pVarResult, pExcepInfo, puArgErr);
234}

◆ SubMatches_QueryInterface()

static HRESULT WINAPI SubMatches_QueryInterface ( ISubMatches *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 140 of file vbregexp.c.

142{
144
146 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
147 *ppv = &This->ISubMatches_iface;
148 }else if(IsEqualGUID(riid, &IID_IDispatch)) {
149 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
150 *ppv = &This->ISubMatches_iface;
151 }else if(IsEqualGUID(riid, &IID_ISubMatches)) {
152 TRACE("(%p)->(IID_ISubMatches %p)\n", This, ppv);
153 *ppv = &This->ISubMatches_iface;
154 }else if(IsEqualGUID(riid, &IID_IDispatchEx)) {
155 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
156 *ppv = NULL;
157 return E_NOINTERFACE;
158 }else {
159 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
160 *ppv = NULL;
161 return E_NOINTERFACE;
162 }
163
164 IUnknown_AddRef((IUnknown*)*ppv);
165 return S_OK;
166}

◆ SubMatches_Release()

static ULONG WINAPI SubMatches_Release ( ISubMatches *  iface)
static

Definition at line 178 of file vbregexp.c.

179{
182
183 TRACE("(%p) ref=%ld\n", This, ref);
184
185 if(!ref) {
186 free(This->match);
187 free(This->result);
188 free(This);
189 }
190
191 return ref;
192}

◆ VBScriptRegExpFactory_CreateInstance()

HRESULT WINAPI VBScriptRegExpFactory_CreateInstance ( IClassFactory iface,
IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)

Definition at line 1833 of file vbregexp.c.

1834{
1835 IDispatch *regexp;
1836 HRESULT hres;
1837
1838 TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
1839
1840 hres = create_regexp(&regexp);
1841 if(FAILED(hres))
1842 return hres;
1843
1844 hres = IDispatch_QueryInterface(regexp, riid, ppv);
1845 IDispatch_Release(regexp);
1846 return hres;
1847}
HRESULT create_regexp(IDispatch **ret)
Definition: vbregexp.c:1811

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( vbscript  )

Variable Documentation

◆ Match2Vtbl

const IMatch2Vtbl Match2Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI Match2_get_SubMatches(IMatch2 *iface, IDispatch **ppSubMatches)
Definition: vbregexp.c:489
static HRESULT WINAPI Match2_QueryInterface(IMatch2 *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:344
static HRESULT WINAPI Match2_Invoke(IMatch2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:429
static HRESULT WINAPI Match2_get_FirstIndex(IMatch2 *iface, LONG *pFirstIndex)
Definition: vbregexp.c:460
static ULONG WINAPI Match2_Release(IMatch2 *iface)
Definition: vbregexp.c:385
static HRESULT WINAPI Match2_GetTypeInfoCount(IMatch2 *iface, UINT *pctinfo)
Definition: vbregexp.c:400
static HRESULT WINAPI Match2_GetTypeInfo(IMatch2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:410
static HRESULT WINAPI Match2_get_Length(IMatch2 *iface, LONG *pLength)
Definition: vbregexp.c:473
static ULONG WINAPI Match2_AddRef(IMatch2 *iface)
Definition: vbregexp.c:375
static HRESULT WINAPI Match2_get_Value(IMatch2 *iface, BSTR *pValue)
Definition: vbregexp.c:442
static HRESULT WINAPI Match2_GetIDsOfNames(IMatch2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:418

Definition at line 503 of file vbregexp.c.

Referenced by create_match2().

◆ MatchCollection2Vtbl

const IMatchCollection2Vtbl MatchCollection2Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI MatchCollection2_GetIDsOfNames(IMatchCollection2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:856
static HRESULT WINAPI MatchCollection2_Invoke(IMatchCollection2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:867
static ULONG WINAPI MatchCollection2_Release(IMatchCollection2 *iface)
Definition: vbregexp.c:818
static HRESULT WINAPI MatchCollection2_GetTypeInfoCount(IMatchCollection2 *iface, UINT *pctinfo)
Definition: vbregexp.c:838
static HRESULT WINAPI MatchCollection2_get_Count(IMatchCollection2 *iface, LONG *pCount)
Definition: vbregexp.c:898
static HRESULT WINAPI MatchCollection2_get_Item(IMatchCollection2 *iface, LONG index, IDispatch **ppMatch)
Definition: vbregexp.c:880
static HRESULT WINAPI MatchCollection2_get__NewEnum(IMatchCollection2 *iface, IUnknown **ppEnum)
Definition: vbregexp.c:911
static HRESULT WINAPI MatchCollection2_QueryInterface(IMatchCollection2 *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:777
static HRESULT WINAPI MatchCollection2_GetTypeInfo(IMatchCollection2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:848
static ULONG WINAPI MatchCollection2_AddRef(IMatchCollection2 *iface)
Definition: vbregexp.c:808

Definition at line 923 of file vbregexp.c.

Referenced by create_match_collection2().

◆ MatchCollectionEnum_Vtbl

const IEnumVARIANTVtbl MatchCollectionEnum_Vtbl
static
Initial value:
= {
}
static ULONG WINAPI MatchCollectionEnum_AddRef(IEnumVARIANT *iface)
Definition: vbregexp.c:655
static HRESULT WINAPI MatchCollectionEnum_Skip(IEnumVARIANT *iface, ULONG celt)
Definition: vbregexp.c:713
static HRESULT WINAPI MatchCollectionEnum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:634
static HRESULT WINAPI MatchCollectionEnum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
Definition: vbregexp.c:736
static HRESULT WINAPI MatchCollectionEnum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
Definition: vbregexp.c:680
static HRESULT WINAPI MatchCollectionEnum_Reset(IEnumVARIANT *iface)
Definition: vbregexp.c:726
static ULONG WINAPI MatchCollectionEnum_Release(IEnumVARIANT *iface)
Definition: vbregexp.c:665

Definition at line 743 of file vbregexp.c.

Referenced by create_enum_variant_mc2().

◆ MatchCollectionVtbl

const IMatchCollectionVtbl MatchCollectionVtbl
static
Initial value:
= {
}
static HRESULT WINAPI MatchCollection_GetTypeInfo(IMatchCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:965
static ULONG WINAPI MatchCollection_Release(IMatchCollection *iface)
Definition: vbregexp.c:953
static HRESULT WINAPI MatchCollection_GetTypeInfoCount(IMatchCollection *iface, UINT *pctinfo)
Definition: vbregexp.c:959
static HRESULT WINAPI MatchCollection_QueryInterface(IMatchCollection *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:941
static HRESULT WINAPI MatchCollection_GetIDsOfNames(IMatchCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:972
static ULONG WINAPI MatchCollection_AddRef(IMatchCollection *iface)
Definition: vbregexp.c:947
static HRESULT WINAPI MatchCollection_get__NewEnum(IMatchCollection *iface, IUnknown **ppEnum)
Definition: vbregexp.c:1001
static HRESULT WINAPI MatchCollection_get_Item(IMatchCollection *iface, LONG index, IDispatch **ppMatch)
Definition: vbregexp.c:989
static HRESULT WINAPI MatchCollection_get_Count(IMatchCollection *iface, LONG *pCount)
Definition: vbregexp.c:995
static HRESULT WINAPI MatchCollection_Invoke(IMatchCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:980

Definition at line 1007 of file vbregexp.c.

Referenced by create_match_collection2().

◆ MatchVtbl

IMatchVtbl MatchVtbl
static
Initial value:
= {
}
static HRESULT WINAPI Match_GetIDsOfNames(IMatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:552
static HRESULT WINAPI Match_get_FirstIndex(IMatch *iface, LONG *pFirstIndex)
Definition: vbregexp.c:574
static HRESULT WINAPI Match_QueryInterface(IMatch *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:522
static HRESULT WINAPI Match_get_Value(IMatch *iface, BSTR *pValue)
Definition: vbregexp.c:568
static HRESULT WINAPI Match_GetTypeInfoCount(IMatch *iface, UINT *pctinfo)
Definition: vbregexp.c:540
static HRESULT WINAPI Match_GetTypeInfo(IMatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:546
static HRESULT WINAPI Match_Invoke(IMatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:559
static ULONG WINAPI Match_Release(IMatch *iface)
Definition: vbregexp.c:534
static HRESULT WINAPI Match_get_Length(IMatch *iface, LONG *pLength)
Definition: vbregexp.c:580
static ULONG WINAPI Match_AddRef(IMatch *iface)
Definition: vbregexp.c:528

Definition at line 586 of file vbregexp.c.

Referenced by create_match2().

◆ RegExp2Vtbl

const IRegExp2Vtbl RegExp2Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI RegExp2_QueryInterface(IRegExp2 *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:1071
static HRESULT WINAPI RegExp2_GetTypeInfo(IRegExp2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:1139
static HRESULT WINAPI RegExp2_GetIDsOfNames(IRegExp2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:1151
static HRESULT WINAPI RegExp2_put_Global(IRegExp2 *iface, VARIANT_BOOL global)
Definition: vbregexp.c:1259
static HRESULT WINAPI RegExp2_Invoke(IRegExp2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:1162
static HRESULT WINAPI RegExp2_put_IgnoreCase(IRegExp2 *iface, VARIANT_BOOL ignoreCase)
Definition: vbregexp.c:1233
static HRESULT WINAPI RegExp2_Execute(IRegExp2 *iface, BSTR sourceString, IDispatch **ppMatches)
Definition: vbregexp.c:1298
static HRESULT WINAPI RegExp2_get_Multiline(IRegExp2 *iface, VARIANT_BOOL *pMultiline)
Definition: vbregexp.c:1272
static HRESULT WINAPI RegExp2_put_Pattern(IRegExp2 *iface, BSTR pattern)
Definition: vbregexp.c:1193
static HRESULT WINAPI RegExp2_Test(IRegExp2 *iface, BSTR sourceString, VARIANT_BOOL *pMatch)
Definition: vbregexp.c:1393
static HRESULT WINAPI RegExp2_get_IgnoreCase(IRegExp2 *iface, VARIANT_BOOL *pIgnoreCase)
Definition: vbregexp.c:1220
static HRESULT WINAPI RegExp2_get_Pattern(IRegExp2 *iface, BSTR *pPattern)
Definition: vbregexp.c:1175
static HRESULT WINAPI RegExp2_get_Global(IRegExp2 *iface, VARIANT_BOOL *pGlobal)
Definition: vbregexp.c:1246
static HRESULT WINAPI RegExp2_put_Multiline(IRegExp2 *iface, VARIANT_BOOL multiline)
Definition: vbregexp.c:1285
static HRESULT WINAPI RegExp2_GetTypeInfoCount(IRegExp2 *iface, UINT *pctinfo)
Definition: vbregexp.c:1129
static ULONG WINAPI RegExp2_AddRef(IRegExp2 *iface)
Definition: vbregexp.c:1101
static HRESULT WINAPI RegExp2_Replace(IRegExp2 *iface, BSTR source, VARIANT replaceVar, BSTR *ret)
Definition: vbregexp.c:1481
static ULONG WINAPI RegExp2_Release(IRegExp2 *iface)
Definition: vbregexp.c:1111

Definition at line 1614 of file vbregexp.c.

Referenced by create_regexp().

◆ RegExpVtbl

IRegExpVtbl RegExpVtbl
static
Initial value:
= {
}
static HRESULT WINAPI RegExp_GetIDsOfNames(IRegExp *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:1716
static HRESULT WINAPI RegExp_get_Global(IRegExp *iface, VARIANT_BOOL *pGlobal)
Definition: vbregexp.c:1756
static HRESULT WINAPI RegExp_Test(IRegExp *iface, BSTR sourceString, VARIANT_BOOL *pMatch)
Definition: vbregexp.c:1775
static HRESULT WINAPI RegExp_QueryInterface(IRegExp *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:1685
static HRESULT WINAPI RegExp_Execute(IRegExp *iface, BSTR sourceString, IDispatch **ppMatches)
Definition: vbregexp.c:1768
static HRESULT WINAPI RegExp_put_Pattern(IRegExp *iface, BSTR pPattern)
Definition: vbregexp.c:1738
static ULONG WINAPI RegExp_AddRef(IRegExp *iface)
Definition: vbregexp.c:1691
static HRESULT WINAPI RegExp_Invoke(IRegExp *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:1723
static HRESULT WINAPI RegExp_get_IgnoreCase(IRegExp *iface, VARIANT_BOOL *pIgnoreCase)
Definition: vbregexp.c:1744
static HRESULT WINAPI RegExp_put_Global(IRegExp *iface, VARIANT_BOOL pGlobal)
Definition: vbregexp.c:1762
static HRESULT WINAPI RegExp_put_IgnoreCase(IRegExp *iface, VARIANT_BOOL pIgnoreCase)
Definition: vbregexp.c:1750
static HRESULT WINAPI RegExp_Replace(IRegExp *iface, BSTR sourceString, BSTR replaceString, BSTR *pDestString)
Definition: vbregexp.c:1781
static HRESULT WINAPI RegExp_GetTypeInfoCount(IRegExp *iface, UINT *pctinfo)
Definition: vbregexp.c:1703
static ULONG WINAPI RegExp_Release(IRegExp *iface)
Definition: vbregexp.c:1697
static HRESULT WINAPI RegExp_get_Pattern(IRegExp *iface, BSTR *pPattern)
Definition: vbregexp.c:1732
static HRESULT WINAPI RegExp_GetTypeInfo(IRegExp *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:1709

Definition at line 1792 of file vbregexp.c.

Referenced by create_regexp().

◆ SubMatchesVtbl

const ISubMatchesVtbl SubMatchesVtbl
static
Initial value:
= {
}
static HRESULT WINAPI SubMatches_GetTypeInfo(ISubMatches *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbregexp.c:204
static HRESULT WINAPI SubMatches_GetIDsOfNames(ISubMatches *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbregexp.c:212
static HRESULT WINAPI SubMatches_get_Count(ISubMatches *iface, LONG *pCount)
Definition: vbregexp.c:264
static ULONG WINAPI SubMatches_AddRef(ISubMatches *iface)
Definition: vbregexp.c:168
static HRESULT WINAPI SubMatches_get_Item(ISubMatches *iface, LONG index, VARIANT *pSubMatch)
Definition: vbregexp.c:236
static HRESULT WINAPI SubMatches_Invoke(ISubMatches *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbregexp.c:223
static HRESULT WINAPI SubMatches_get__NewEnum(ISubMatches *iface, IUnknown **ppEnum)
Definition: vbregexp.c:280
static HRESULT WINAPI SubMatches_QueryInterface(ISubMatches *iface, REFIID riid, void **ppv)
Definition: vbregexp.c:140
static HRESULT WINAPI SubMatches_GetTypeInfoCount(ISubMatches *iface, UINT *pctinfo)
Definition: vbregexp.c:194
static ULONG WINAPI SubMatches_Release(ISubMatches *iface)
Definition: vbregexp.c:178

Definition at line 287 of file vbregexp.c.

Referenced by create_sub_matches().

◆ tid_ids

REFIID tid_ids[]
static
Initial value:
= {
#define XDIID(iface)
}

Definition at line 41 of file vbregexp.c.

Referenced by init_regexp_typeinfo().

◆ typeinfos

◆ typelib

ITypeLib* typelib
static

Definition at line 47 of file vbregexp.c.