Ignore:
Timestamp:
Jul 23, 2009, 2:32:34 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 5, master
Children:
7611ed8e
Parents:
73dfaf8
Message:

2009-07-23 Joel Sherrill <joel.sherrill@…>

  • libmisc/Makefile.am, libmisc/shell/main_chmod.c, libmisc/shell/main_mdump.c, libmisc/shell/main_medit.c, libmisc/shell/main_mfill.c, libmisc/shell/main_mmove.c, libmisc/shell/main_msdosfmt.c, libmisc/shell/main_mwdump.c, libmisc/shell/main_sleep.c, libmisc/shell/main_umask.c, libmisc/shell/shell_script.c, libmisc/stringto/stringto.h, libmisc/stringto/stringto_template.h: Convert return type from bool to rtems_status_code and add rtems_string_to_pointer. Perform associated clean up and changes for return type change.
  • libmisc/stringto/stringtopointer.c: New file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/stringto/stringto.h

    r73dfaf8 r48751ab  
    1313#define __STRING_TO_A_TYPE_h__
    1414
     15#include <rtems.h>
     16
     17/**
     18 *  @brief Convert String to Pointer (with validation)
     19 *
     20 *  This method converts a string to a pointer (void *) with
     21 *  basic numeric validation.
     22 *
     23 *  @param[in] s is the string to convert
     24 *  @param[in] n points to the variable to place the converted output in
     25 *  @param[in] endptr is used to keep track of the position in the string
     26 *
     27 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     28 *          and *n is filled in.  Otherwise, the status indicates the
     29 *          source of the error.
     30 */
     31rtems_status_code rtems_string_to_pointer(
     32  const char     *s,
     33  void          **n,
     34  char          **endptr
     35);
     36
    1537/**
    1638 *  @brief Convert String to Unsigned Character (with validation)
     
    2446 *  @param[in] base is the expected base of the number
    2547 *
    26  *  @return This method returns true on successful conversion and *n is
    27  *          filled in.
    28  */
    29 bool rtems_string_to_unsigned_char(
     48 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     49 *          and *n is filled in.  Otherwise, the status indicates the
     50 *          source of the error.
     51 */
     52rtems_status_code rtems_string_to_unsigned_char(
    3053  const char     *s,
    3154  unsigned char  *n,
     
    4467 *  @param[in] base is the expected base of the number
    4568 *
    46  *  @return This method returns true on successful conversion and *n is
    47  *          filled in.
    48  */
    49 bool rtems_string_to_int(
     69 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     70 *          and *n is filled in.  Otherwise, the status indicates the
     71 *          source of the error.
     72 */
     73rtems_status_code rtems_string_to_int(
    5074  const char  *s,
    5175  int         *n,
     
    6589 *  @param[in] base is the expected base of the number
    6690 *
    67  *  @return This method returns true on successful conversion and *n is
    68  *          filled in.
    69  */
    70 bool rtems_string_to_long(
     91 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     92 *          and *n is filled in.  Otherwise, the status indicates the
     93 *          source of the error.
     94 */
     95rtems_status_code rtems_string_to_long(
    7196  const char  *s,
    7297  long        *n,
     
    86111 *  @param[in] base is the expected base of the number
    87112 *
    88  *  @return This method returns true on successful conversion and *n is
    89  *          filled in.
    90  */
    91 bool rtems_string_to_unsigned_long(
     113 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     114 *          and *n is filled in.  Otherwise, the status indicates the
     115 *          source of the error.
     116 */
     117rtems_status_code rtems_string_to_unsigned_long(
    92118  const char     *s,
    93119  unsigned long  *n,
     
    107133 *  @param[in] base is the expected base of the number
    108134 *
    109  *  @return This method returns true on successful conversion and *n is
    110  *          filled in.
    111  */
    112 bool rtems_string_to_long_long(
     135 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     136 *          and *n is filled in.  Otherwise, the status indicates the
     137 *          source of the error.
     138 */
     139rtems_status_code rtems_string_to_long_long(
    113140  const char  *s,
    114141  long long   *n,
     
    128155 *  @param[in] base is the expected base of the number
    129156 *
    130  *  @return This method returns true on successful conversion and *n is
    131  *          filled in.
    132  */
    133 bool rtems_string_to_unsigned_long_long(
     157 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     158 *          and *n is filled in.  Otherwise, the status indicates the
     159 *          source of the error.
     160 */
     161rtems_status_code rtems_string_to_unsigned_long_long(
    134162  const char           *s,
    135163  unsigned long long   *n,
     
    147175 *  @param[in] endptr is used to keep track of the position in the string
    148176 *
    149  *  @return This method returns true on successful conversion and *n is
    150  *          filled in.
    151  */
    152 bool rtems_string_to_float(
     177 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     178 *          and *n is filled in.  Otherwise, the status indicates the
     179 *          source of the error.
     180 */
     181rtems_status_code rtems_string_to_float(
    153182  const char   *s,
    154183  float        *n,
     
    165194 *  @param[in] endptr is used to keep track of the position in the string
    166195 *
    167  *  @return This method returns true on successful conversion and *n is
    168  *          filled in.
    169  */
    170 bool rtems_string_to_double(
     196 *  @return This method returns RTEMS_SUCCESSFUL on successful conversion
     197 *          and *n is filled in.  Otherwise, the status indicates the
     198 *          source of the error.
     199 */
     200rtems_status_code rtems_string_to_double(
    171201  const char   *s,
    172202  double       *n,
Note: See TracChangeset for help on using the changeset viewer.