source: rtems/cpukit/libmisc/bspcmdline/bspcmdline.h @ b2bbdb9

4.104.115
Last change on this file since b2bbdb9 was f5c405e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/27/10 at 05:01:03

Minimize includes.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/**
2 *  @file  rtems/bspcmdline.h
3 *
4 *  This include file contains all prototypes and specifications
5 *  related to the BSP Command Line String and associated helper
6 *  routines.  The helpers are useful for locating command line
7 *  type arguments (e.g. --mode) and their associated right
8 *  hand side (e.g. FAST in --mode=FAST).
9 */
10
11/*
12 *  COPYRIGHT (c) 1989-2009.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.com/license/LICENSE.
18 *
19 *  $Id$
20 */
21
22#ifndef __BSP_COMMAND_LINE_h
23#define __BSP_COMMAND_LINE_h
24
25/**
26 *  @defgroup BSPCommandLine BSP Command Line Helpers
27 *
28 *  The BSP Command Line Handler provides a set of routines which assist
29 *  in examining and decoding the Command Line String passed to the BSP
30 *  at boot time.
31 */
32/**@{*/
33
34#include <stddef.h> /* for size_t */
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40
41/**
42 *  @brief Obtain Pointer to BSP Boot Command String
43 *
44 *  This method returns a pointer to the BSP Boot Command String.  It
45 *  is as likely to be NULL as point to a string as most BSPs do not
46 *  have a start environment that provides a boot string.
47 *
48 *  @return This method returns the pointer to the BSP Boot Command String.
49 */
50const char *rtems_bsp_cmdline_get(void);
51
52/**
53 *  @brief Obtain COPY of the Entire Matching Argument
54 *
55 *  This method searches for the argument @a name in the BSP Boot Command
56 *  String and returns a copy of the entire string associated with it in
57 *  @a value up to a string of @a length.  This will include the argument
58 *  and any right hand side portion of the string.  For example, one might
59 *  be returned --mode=FAST if
60 *  searching for --mode.
61 *
62 *  @param[in] name is the arugment to search for
63 *  @param[in] value points to where the contents will
64 *             be placed if located.
65 *  @param[in] length is the maximum length to copy
66 *
67 *  @return This method returns NULL if not found and
68 *          @a value if found.
69 */
70const char *rtems_bsp_cmdline_get_param(
71  const char *name,
72  char       *value,
73  size_t      length
74);
75
76
77/**
78 *  @brief Obtain COPY of the Right Hand Side of the Matching Argument
79 *
80 *  This method searches for the argument @a name in
81 *  the BSP Boot Command String and returns the right hand side
82 *  associated with it in @a value up to a maximum string @a length.
83 *  This will NOT include the argument but only any right hand side
84 *  portion of the string. *  For example, one might be returned FAST if
85 *  searching for --mode.
86 *
87 *  @param[in] name is the arugment to search for
88 *  @param[in] value points to where the contents will
89 *             be placed if located.
90 *  @param[in] length is the maximum length to copy
91 *
92 *  @return This method returns NULL if not found and
93 *          @a value if found.
94 */
95const char *rtems_bsp_cmdline_get_param_rhs(
96  const char *name,
97  char       *value,
98  size_t      length
99);
100
101/**
102 *  @brief Obtain Pointer to the Entire Matching Argument
103 *
104 *  This method searches for the argument @a name in
105 *  the BSP Boot Command String and returns a pointer to the
106 *  entire string associated with it.  This will include the
107 *  argument and any right hand side portion of the string.
108 *  For example, one might be returned --mode=FAST if
109 *  searching for --mode.
110 *
111 *  @param[in] name is the arugment to search for
112 *
113 *  @return This method returns NULL if not found and a pointer
114 *          into the BSP Boot Command String if found.
115 *
116 *  @note The pointer will be to the original BSP Command
117 *        Line string.  Exercise caution when using this.
118 */
119const char *rtems_bsp_cmdline_get_param_raw(
120  const char *name
121);
122
123#ifdef __cplusplus
124}
125#endif
126
127/**@}*/
128#endif
Note: See TracBrowser for help on using the repository browser.