Method::print_fd_arg_list: skip user pointer arguments
Currently, the number of arguments is reduced by one in call
of a callback, meaning that the (presumed unique) user pointer
is never considered by Method::print_arg.
However, this only works if there is only a single callback
(and there are no other arguments following the callback and
the user pointer).
To be able to support exported functions with multiple callbacks
(each with its own user pointer), a user pointer needs
to be skipped for every callback argument.
Replace the "print_arg" callback of Method::print_arg_list
by a "print_arg_skip_next" that indicates whether the next
argument should be skipped.
Method::print_fd_arg_list uses this callback to skip
the user pointers following the callbacks in the exported functions.
print_callback_args in template_cpp.cc does not skip
any arguments since it is responsible for printing a callback and
callbacks are assumed not to have any callback arguments themselves.
Signed-off-by: Sven Verdoolaege <sven@cerebras.net>