--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:

> 
> regexPlugin210_100701.zip

Re callouts, I'm having trouble figuring out some declarations.

Bruce, maybe you can help.

I need to get the exported global symbol out of pcre.dll, pcre_callout, so I 
can assign my function entry point to it.

pcre_callout is defined in pcreglobals.c:

PCRE_EXP_DATA_DEFN int   (*pcre_callout)(pcre_callout_block *) = NULL;

pcre_internal.h defines
#define PCRE_EXP_DATA_DEFN  __declspec(dllexport)

so I need to get pcre_callout; 

PCRE_CALLOUT_FN_PTR pToPcreCallout = 
 (PCRE_CALLOUT_FN_PTR) GetProcAddress(hModule, "pcre_callout");

which succeeds.  Bt the critical proble is how to define 
PCRE_CALLOUT_FN_PTR.  At the moment I have

typedef int (WINAPI ** PCRE_CALLOUT_FN_PTR)(pcre_callout_block *);

So, should it be WINAPI ( __stdcall) or __cdecl?

Have I got level of indirection right?

Parallel declares for all the callable (as opposed to settable) entry points in 
pcre.cll work fine e.g.

typedef pcre * (WINAPI * PCRE_COMPILE_FN)(const char *, int, 
  const char **, int *,  const unsigned char *);

But not sure if I've got it right for an entry point that I'm supposed to set.  
In fact, almost certainly not got it right, cause once set, pcre_callout 
crashes first time it's called by pcre.


Sheri, perhaps you can expose my ignorance on pcre discussion group, unless 
anyone else has any suggestions.










Reply via email to