4.104.115
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 | #include <rtems/bspcmdline.h> |
---|
13 | |
---|
14 | const char *rtems_bsp_cmdline_get_param_rhs( |
---|
15 | const char *name, |
---|
16 | char *value, |
---|
17 | size_t length |
---|
18 | ) |
---|
19 | { |
---|
20 | const char *p; |
---|
21 | const char *rhs; |
---|
22 | char *d; |
---|
23 | |
---|
24 | p = rtems_bsp_cmdline_get_param( name, value, length ); |
---|
25 | if ( !p ) |
---|
26 | return NULL; |
---|
27 | |
---|
28 | rhs = &p[strlen(name)]; |
---|
29 | if ( *rhs != '=' ) |
---|
30 | return NULL; |
---|
31 | |
---|
32 | rhs++; |
---|
33 | if ( *rhs == '\"' ) |
---|
34 | rhs++; |
---|
35 | for ( d=value ; *rhs ; ) |
---|
36 | *d++ = *rhs++; |
---|
37 | if ( *(d-1) == '\"' ) |
---|
38 | d--; |
---|
39 | *d = '\0'; |
---|
40 | |
---|
41 | return value; |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.