Skip to content

Instantly share code, notes, and snippets.

@aviat
Created April 17, 2019 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aviat/9bd5f642c68e193527b26b19f798411c to your computer and use it in GitHub Desktop.
Save aviat/9bd5f642c68e193527b26b19f798411c to your computer and use it in GitHub Desktop.
const static char wrapper_template_func[] =
"$args = \\sqreen\\internal\\func_get_args(); "
"try { "
"\\sqreen\\internal\\userland_pre_cbs(...$args); "
"$ret = " FUNC_PREFIX "%s(...$args); "
"$GLOBALS['" RETVAL_GLOBAL "'] = $ret; "
"\\sqreen\\internal\\userland_post_cbs(...$args); "
"unset($GLOBALS['" RETVAL_GLOBAL "']); "
"return $ret; "
"} catch (" EXCEPTION_TOP_CLASS " $e) { "
"\\sqreen\\internal\\userland_fail_cbs(...$args); "
"throw $e; "
"}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment