source: rtems/cpukit/libmisc/stringto/stringto.h @ 21242c2

4.115
Last change on this file since 21242c2 was 21242c2, checked in by Joel Sherrill <joel.sherrill@…>, on 06/24/11 at 17:52:58

2011-06-24 Joel Sherrill <joel.sherrill@…>

  • include/rtems/bspIo.h, include/rtems/concat.h, include/rtems/endian.h, include/rtems/fs.h, include/rtems/irq.h, include/rtems/pci.h, include/rtems/userenv.h, libblock/include/rtems/flashdisk.h, libblock/include/rtems/nvdisk-sram.h, libblock/include/rtems/nvdisk.h, libcsupport/include/clockdrv.h, libcsupport/include/console.h, libcsupport/include/iosupp.h, libcsupport/include/spurious.h, libcsupport/include/motorola/mc68230.h, libcsupport/include/rtems/assoc.h, libcsupport/include/rtems/error.h, libcsupport/include/rtems/framebuffer.h, libcsupport/include/rtems/gxx_wrappers.h, libcsupport/include/rtems/libcsupport.h, libcsupport/include/rtems/libio_.h, libcsupport/include/rtems/malloc.h, libcsupport/include/rtems/termiostypes.h, libcsupport/include/sys/statvfs.h, libcsupport/include/sys/termios.h, libcsupport/include/sys/utsname.h, libcsupport/include/zilog/z8036.h, libcsupport/include/zilog/z8530.h, libcsupport/include/zilog/z8536.h, libfs/src/imfs/imfs.h, libfs/src/pipe/pipe.h, libmisc/capture/capture-cli.h, libmisc/capture/capture.h, libmisc/cpuuse/cpuuse.h, libmisc/devnull/devnull.h, libmisc/devnull/devzero.h, libmisc/dumpbuf/dumpbuf.h, libmisc/fb/fb.h, libmisc/fb/mw_uid.h, libmisc/mouse/mouse_parser.h, libmisc/shell/shellconfig.h, libmisc/stringto/stringto.h, libmisc/untar/untar.h, libnetworking/memory.h, posix/include/aio.h, posix/include/mqueue.h, posix/include/semaphore.h, posix/include/rtems/posix/aio_misc.h, posix/include/rtems/posix/barrier.h, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/config.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/posixapi.h, posix/include/rtems/posix/priority.h, posix/include/rtems/posix/psignal.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/ptimer.h, posix/include/rtems/posix/rwlock.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/sigset.h, posix/include/rtems/posix/spinlock.h, posix/include/rtems/posix/threadsup.h, posix/include/rtems/posix/time.h, posix/include/rtems/posix/timer.h, posix/inline/rtems/posix/barrier.inl, posix/inline/rtems/posix/cond.inl, posix/inline/rtems/posix/mqueue.inl, posix/inline/rtems/posix/mutex.inl, posix/inline/rtems/posix/priority.inl, posix/inline/rtems/posix/pthread.inl, posix/inline/rtems/posix/rwlock.inl, posix/inline/rtems/posix/semaphore.inl, posix/inline/rtems/posix/spinlock.inl, posix/inline/rtems/posix/timer.inl, rtems/mainpage.h, rtems/include/rtems/rtems/barrier.h, rtems/include/rtems/rtems/object.h, rtems/include/rtems/rtems/timer.h, rtems/inline/rtems/rtems/barrier.inl, rtems/inline/rtems/rtems/timer.inl, rtems/src/semtranslatereturncode.c, sapi/include/rtems/config.h, sapi/include/rtems/fatal.h, sapi/include/rtems/mptables.h, score/include/rtems/score/object.h, score/include/rtems/score/priority.h, score/inline/rtems/score/object.inl, score/inline/rtems/score/priority.inl: Add @file Doxygen directives and descriptions to files which originated with RTEMS. This improves the file list page generated by Doxygen.
  • Property mode set to 100644
File size: 7.8 KB
Line 
1/**
2 * @file rtems/stringto.h
3 *
4 * This file defines the interface to a set of string conversion helpers.
5 */
6
7/*
8 *  COPYRIGHT (c) 2009-2011.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#ifndef _RTEMS_STRINGTO_H
19#define _RTEMS_STRINGTO_H
20
21#include <rtems.h>
22
23/**
24 *  @brief Convert String to Pointer (with validation)
25 *
26 *  This method converts a string to a pointer (void *) with
27 *  basic numeric validation.
28 *
29 *  @param[in] s is the string to convert
30 *  @param[in] n points to the variable to place the converted output in
31 *  @param[in] endptr is used to keep track of the position in the string
32 *
33 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
34 *          and *n is filled in.  Otherwise, the status indicates the
35 *          source of the error.
36 */
37rtems_status_code rtems_string_to_pointer(
38  const char     *s,
39  void          **n,
40  char          **endptr
41);
42
43/**
44 *  @brief Convert String to Unsigned Character (with validation)
45 *
46 *  This method converts a string to an unsigned character with
47 *  range validation.
48 *
49 *  @param[in] s is the string to convert
50 *  @param[in] n points to the variable to place the converted output in
51 *  @param[in] endptr is used to keep track of the position in the string
52 *  @param[in] base is the expected base of the number
53 *
54 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
55 *          and *n is filled in.  Otherwise, the status indicates the
56 *          source of the error.
57 */
58rtems_status_code rtems_string_to_unsigned_char(
59  const char     *s,
60  unsigned char  *n,
61  char          **endptr,
62  int             base
63);
64
65/**
66 *  @brief Convert String to Int (with validation)
67 *
68 *  This method converts a string to an int with range validation.
69 *
70 *  @param[in] s is the string to convert
71 *  @param[in] n points to the variable to place the converted output in
72 *  @param[in] endptr is used to keep track of the position in the string
73 *  @param[in] base is the expected base of the number
74 *
75 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
76 *          and *n is filled in.  Otherwise, the status indicates the
77 *          source of the error.
78 */
79rtems_status_code rtems_string_to_int(
80  const char  *s,
81  int         *n,
82  char       **endptr,
83  int          base
84);
85
86/**
87 *  @brief Convert String to Unsigned Int (with validation)
88 *
89 *  This method converts a string to an unsigned int with range validation.
90 *
91 *  @param[in] s is the string to convert
92 *  @param[in] n points to the variable to place the converted output in
93 *  @param[in] endptr is used to keep track of the position in the string
94 *  @param[in] base is the expected base of the number
95 *
96 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
97 *          and *n is filled in.  Otherwise, the status indicates the
98 *          source of the error.
99 */
100rtems_status_code rtems_string_to_unsigned_int(
101  const char    *s,
102  unsigned int  *n,
103  char         **endptr,
104  int            base
105);
106
107/**
108 *  @brief Convert String to Long (with validation)
109 *
110 *  This method converts a string to a long with
111 *  range validation.
112 *
113 *  @param[in] s is the string to convert
114 *  @param[in] n points to the variable to place the converted output in
115 *  @param[in] endptr is used to keep track of the position in the string
116 *  @param[in] base is the expected base of the number
117 *
118 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
119 *          and *n is filled in.  Otherwise, the status indicates the
120 *          source of the error.
121 */
122rtems_status_code rtems_string_to_long(
123  const char  *s,
124  long        *n,
125  char       **endptr,
126  int          base
127);
128
129/**
130 *  @brief Convert String to Unsigned Long (with validation)
131 *
132 *  This method converts a string to an unsigned long with
133 *  range validation.
134 *
135 *  @param[in] s is the string to convert
136 *  @param[in] n points to the variable to place the converted output in
137 *  @param[in] endptr is used to keep track of the position in the string
138 *  @param[in] base is the expected base of the number
139 *
140 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
141 *          and *n is filled in.  Otherwise, the status indicates the
142 *          source of the error.
143 */
144rtems_status_code rtems_string_to_unsigned_long(
145  const char     *s,
146  unsigned long  *n,
147  char          **endptr,
148  int             base
149);
150
151/**
152 *  @brief Convert String to Long Long (with validation)
153 *
154 *  This method converts a string to a long long with
155 *  range validation.
156 *
157 *  @param[in] s is the string to convert
158 *  @param[in] n points to the variable to place the converted output in
159 *  @param[in] endptr is used to keep track of the position in the string
160 *  @param[in] base is the expected base of the number
161 *
162 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
163 *          and *n is filled in.  Otherwise, the status indicates the
164 *          source of the error.
165 */
166rtems_status_code rtems_string_to_long_long(
167  const char  *s,
168  long long   *n,
169  char       **endptr,
170  int          base
171);
172
173/**
174 *  @brief Convert String to Unsigned Long Long (with validation)
175 *
176 *  This method converts a string to an unsigned character with
177 *  range validation.
178 *
179 *  @param[in] s is the string to convert
180 *  @param[in] n points to the variable to place the converted output in
181 *  @param[in] endptr is used to keep track of the position in the string
182 *  @param[in] base is the expected base of the number
183 *
184 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
185 *          and *n is filled in.  Otherwise, the status indicates the
186 *          source of the error.
187 */
188rtems_status_code rtems_string_to_unsigned_long_long(
189  const char           *s,
190  unsigned long long   *n,
191  char                **endptr,
192  int                   base
193);
194
195/**
196 *  @brief Convert String to Float (with validation)
197 *
198 *  This method converts a string to a float with range validation.
199 *
200 *  @param[in] s is the string to convert
201 *  @param[in] n points to the variable to place the converted output in
202 *  @param[in] endptr is used to keep track of the position in the string
203 *
204 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
205 *          and *n is filled in.  Otherwise, the status indicates the
206 *          source of the error.
207 */
208rtems_status_code rtems_string_to_float(
209  const char   *s,
210  float        *n,
211  char        **endptr
212);
213
214/**
215 *  @brief Convert String to Double (with validation)
216 *
217 *  This method converts a string to a double with range validation.
218 *
219 *  @param[in] s is the string to convert
220 *  @param[in] n points to the variable to place the converted output in
221 *  @param[in] endptr is used to keep track of the position in the string
222 *
223 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
224 *          and *n is filled in.  Otherwise, the status indicates the
225 *          source of the error.
226 */
227rtems_status_code rtems_string_to_double(
228  const char   *s,
229  double       *n,
230  char        **endptr
231);
232
233/**
234 *  @brief Convert String to long double (with validation)
235 *
236 *  This method converts a string to a long double with range validation.
237 *
238 *  @param[in] s is the string to convert
239 *  @param[in] n points to the variable to place the converted output in
240 *  @param[in] endptr is used to keep track of the position in the string
241 *
242 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
243 *          and *n is filled in.  Otherwise, the status indicates the
244 *          source of the error.
245 */
246rtems_status_code rtems_string_to_long_double(
247  const char   *s,
248  long double  *n,
249  char        **endptr
250);
251
252#endif
Note: See TracBrowser for help on using the repository browser.