Changeset 4913fd95a2644edfe73fff9ef73f04178c4aad53

Show
Ignore:
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:
1 modified

Legend:

Unmodified
Added
Removed
  • src/rr_runtime.c

    r3562ab6 r4913fd9  
    977977                               crl_context_table *arg_ctx ) 
    978978{ 
     979  crl_symbol_obj *retval = NULL; 
    979980  crl_assert( call->type == OP_CALL_GOTO ); 
    980981  if( (*functor_def)->type == STRUCTURE_FUNCTION_DEF ) 
    981982    { 
    982       crl_symbol_obj *retval = NULL; 
    983983      // create argument context and do argument passing! 
    984984      // then call function and return 
     
    10901090  else if( (*functor_def)->type == TYPE_BUILTIN_CALLBACK ) 
    10911091    { 
     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        } 
    10921109    } 
    10931110  else 
     
    10961113                (*functor_def)->type ); 
    10971114    } 
     1115 
    10981116  return retval; 
    10991117}