mb_pop_string_or_null

Previous  Next

 

status_t mb_pop_string_or_null( mb_interpreter_t* s, void** l, char** val )

 


 

This function pops a STRING parameter from the interpreter.  This function differs from the mb_pop_string function that it will allow a string value of NULL to be passed as an argument.

 

Example

 

/////////////////////////////////////////////////////////////////////////////

//

LOCAL int _std_upper( mb_interpreter_t* s, void** l )

  {

  char*    pStr = 0;

  char*    arg = 0;

 

  mb_assert( s && l );

 

  mb_check( mb_attempt_open_bracket( s, l ) );

  mb_check( mb_pop_string_or_null( s, l, &arg ) );

  mb_check( mb_attempt_close_bracket( s, l ) );

 

  pStr = safe_strupr( mb_malloc_strcpy( arg ) );

 

  mb_check( mb_push_string( s, l, pStr ) );

 

  return MB_FUNC_OK;

  }

endfunc