source: rtems/cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c @ b2bbdb9

4.104.11
Last change on this file since b2bbdb9 was b2bbdb9, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 27, 2010 at 5:01:30 AM

Add HAVE_CONFIG_H support to let files receive configure defines.

  • Property mode set to 100644
File size: 836 bytes
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <string.h>
17
18#include <rtems/bspcmdline.h>
19
20const char *rtems_bsp_cmdline_get_param_rhs(
21  const char *name,
22  char       *value,
23  size_t      length
24)
25{
26  const char *p;
27  const char *rhs;
28  char       *d;
29
30  p = rtems_bsp_cmdline_get_param( name, value, length );
31  if ( !p )
32    return NULL;
33
34  rhs = &p[strlen(name)];
35  if ( *rhs != '=' )
36    return NULL;
37
38  rhs++;
39  if ( *rhs == '\"' )
40    rhs++;
41  for ( d=value ; *rhs ; )
42    *d++ = *rhs++;
43  if ( *(d-1) == '\"' )
44    d--;
45  *d = '\0';
46
47  return value;
48}
Note: See TracBrowser for help on using the repository browser.