const char *rtems_bsp_cmdline_get_param_rhs(
  const char *name,
  char       *value,
  size_t      length
)
{
  const char *p;
  const char *rhs;
  char       *d;

  p = rtems_bsp_cmdline_get_param( name, value, length );
  if ( !p )
    return NULL;

  rhs = &p[strlen(name)];
  if ( *rhs != '=' )
    return NULL;

  rhs++;
  if ( *rhs == '\"' )
    rhs++;
  for ( d=value ; *rhs ; )
    *d++ = *rhs++;
  if ( *(d-1) == '\"' )
    d--;
  *d = '\0';

  return value;
}
Example #2
0
void print_arg(
  const char *param
)
{
  const char *p;
  char        value[80];
  size_t      length;

  printf( "\nLooking for param=(%s)\n", param );

  length = sizeof(value);
  p = rtems_bsp_cmdline_get_param( param, value, length );
  if ( !p ) {
    printf( "Did not locate param=(%s)\n", param );
    return;
  }

  p = rtems_bsp_cmdline_get_param_rhs( param, value, length );
  if ( !p ) {
    printf( "param=(%s) has no right hand side\n", param );
  } else {
    printf( "param=(%s) has right hand side of %s\n", param, p );
  }
  
}