From d4e9bb339360cb7d6ece5b1b60c08c8611bac19c Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Wed, 24 Feb 2016 23:33:34 +0100 Subject: executor improvements --- execute.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 execute.h (limited to 'execute.h') diff --git a/execute.h b/execute.h new file mode 100644 index 0000000..03d19d3 --- /dev/null +++ b/execute.h @@ -0,0 +1,21 @@ +#pragma once + +#define S7_IH_HANDLER_PARAMS_REST INTERNAL_FUNCTION_PARAMETERS +#define S7_IH_HANDLER_PARAMS suhosin_internal_function_handler *ih, S7_IH_HANDLER_PARAMS_REST +#define S7_IH_HANDLER_PARAM_PASSTHRU ih, INTERNAL_FUNCTION_PARAM_PASSTHRU + +#define S7_IH_FN(fname) suhosin_ih_ ## fname +#define S7_IH_FUNCTION(fname) int S7_IH_FN(fname)(S7_IH_HANDLER_PARAMS) +#define S7_IH_ENTRY(php_fname, fname, arg1, arg2, arg3) { php_fname, S7_IH_FN(fname), (void*)(arg1), (void*)(arg2), (void*)(arg3) }, +#define S7_IH_ENTRY0(php_fname, fname) S7_IH_ENTRY(php_fname, fname, NULL, NULL, NULL) +#define S7_IH_ENTRY0i(fname) S7_IH_ENTRY0(#fname, fname) + +typedef struct _suhosin_internal_function_handler { + char *name; + int (*handler)(struct _suhosin_internal_function_handler *ih, S7_IH_HANDLER_PARAMS_REST); + void *arg1; + void *arg2; + void *arg3; +} suhosin_internal_function_handler; + +S7_IH_FUNCTION(preg_replace); -- cgit v1.3