Changeset 4913fd95a2644edfe73fff9ef73f04178c4aad53
- Timestamp:
- 05/15/10 01:28:14 (2 years ago)
- Author:
- redbrain <redbrain@…>
- Parents:
- 3562ab60496cd6b7915f3fa98581db759b627673
- Children:
- 8ec48d25f9b61b0b11332cf1fe073cc49300fdb0
- git-committer:
- redbrain <redbrain@crules.org> / 2010-05-15T01:28:14Z+0100
- Message:
-
finalizing the builtin type api
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r3562ab6
|
r4913fd9
|
|
| 977 | 977 | crl_context_table *arg_ctx ) |
| 978 | 978 | { |
| | 979 | crl_symbol_obj *retval = NULL; |
| 979 | 980 | crl_assert( call->type == OP_CALL_GOTO ); |
| 980 | 981 | if( (*functor_def)->type == STRUCTURE_FUNCTION_DEF ) |
| 981 | 982 | { |
| 982 | | crl_symbol_obj *retval = NULL; |
| 983 | 983 | // create argument context and do argument passing! |
| 984 | 984 | // then call function and return |
| … |
… |
|
| 1090 | 1090 | else if( (*functor_def)->type == TYPE_BUILTIN_CALLBACK ) |
| 1091 | 1091 | { |
| | 1092 | struct crl_builtin_function_def_t * cb = (*functor_def)->op_a.callback; |
| | 1093 | unsigned int n_args = 0; |
| | 1094 | if( call->op_b_t == TYPE_ARGUMENTS ) |
| | 1095 | { |
| | 1096 | n_args = crl_dd_stack_get_size( call->op_b.stack_table ); |
| | 1097 | } |
| | 1098 | unsigned int n_params = callback->n_parameters; |
| | 1099 | |
| | 1100 | if( n_args >= n_args ) |
| | 1101 | { |
| | 1102 | member_function *callback__ = cb->callback; |
| | 1103 | retval = callback__( call, ...... ); |
| | 1104 | } |
| | 1105 | else |
| | 1106 | { |
| | 1107 | crl_fatal("function <%s> requires <%i> parameters <%i> were passed!\n", ); |
| | 1108 | } |
| 1092 | 1109 | } |
| 1093 | 1110 | else |
| … |
… |
|
| 1096 | 1113 | (*functor_def)->type ); |
| 1097 | 1114 | } |
| | 1115 | |
| 1098 | 1116 | return retval; |
| 1099 | 1117 | } |