mb_check |
status_t mb_check( int status )
This is defined as a Macro and check is the status returned is MB_FUNC_OK and if not returns an error.
Example
///////////////////////////////////////////////////////////////////////////// // int _std_rnd( mb_interpreter_t* s, void** l ) { /* Get a random value among 0 ~ 1 */
int result = MB_FUNC_OK; real_t rnd = (real_t)0.0f;
mb_assert( s && l );
mb_check( mb_attempt_func_begin( s, l ) ); mb_check( mb_attempt_func_end( s, l ) );
rnd = (real_t)( ( (real_t)(rand() % 101) ) / 100.0f ); mb_check( mb_push_real( s, l, rnd ) );
return result; } endfunc
|