??‘
??‘
??‘
??‘
??‘
Part III: Extending the Possibilities
570
Most of the time, this function will probably be a little overkill. You can, however, choose an easier, more
readable route, thanks to a series of functions, each one oriented to the number of parameters required
by the function you want to call. These are val_call0 , val_call1 , val_call2 , val_call3 , and
val_callN . val_callN is very much the same as val_callEx , only without the exception and this
parameters. This can work well, as you will likely very rarely require the use of these two parameters:
val_callN( val_func, & val_args, intNumArgs );
The other functions accept the number of parameters as specified by their name, such as:
val_call0( val_func )
val_call1( val_func, val_arg );
val_call2( val_func, val_arg1, val_arg2 );
val_call3( val_func, val_arg1, val_arg2, val_arg3);
All of these functions will return a value struct if successful, even if that value is a val_null .
Managing Neko Primitives
Much of dealing with building C/C++ libraries for Neko involves the many data type conversions,
which you have already learned earlier in this chapter.
Pages:
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060