I ported the PCRE2 open source library to the mainframe (works like a charm.) Now my task is to provide an API for old style languages that are used in that environment. One thing that I have to do is provide a 8 character max shorthand names to the available API functions. (I know that you are rolling your eyes, but that's the nature of the beast What I do is to wrap the native long name function with a shorthand name function with identical signature.
For example:
The original package has
Code:
PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data);
I wrap it with:
Code:
extern PCRE2_SPTR GETMARK(pcre2_match_data *match_data);
.
.
PCRE2_SPTR GETMARK(pcre2_match_data *match_data)
{
return pcre2_get_mark(match_data);
}
So now the old style languages may CALL "GETMARK" ...
This solution works fine and is the desirable solution. But here is the problem, one of the functions have a signature that I do not understand and certainly do not know how to wrap as described above:
Code:
pcre2_general_context *pcre2_general_context_create(
void *(*private_malloc)(PCRE2_SIZE, void *),
void (*private_free)(void *, void *), void *memory_data);
Do you have any idea how to do the wrapper:
Code:
pcre2_general_context *GENCNTCR(
void *(*private_malloc)(PCRE2_SIZE, void *),
void (*private_free)(void *, void *), void *memory_data)
{
return .......;
}
Thank you
ZA