source: rtems/cpukit/libmisc/stringto/stringtopointer.c @ a8f0d94

5
Last change on this file since a8f0d94 was cfe8f7a, checked in by Sebastian Huber <sebastian.huber@…>, on 04/27/20 at 14:14:06

doxygen: Switch @brief and @ingroup

This order change fixes the Latex documentation build via Doxygen.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup libmisc_conv_help Conversion Helpers
5 *
6 * @brief Convert String to Pointer (with validation)
7 */
8
9/*
10 *  COPYRIGHT (c) 2009.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  Copyright (c) 2011  Ralf Corsépius, Ulm, Germany.
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.org/license/LICENSE.
18 */
19
20#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include <errno.h>
25#include <stdlib.h>
26#include <limits.h>
27#include <stdint.h>
28
29#include <rtems/stringto.h>
30
31/*
32 *  Instantiate an error checking wrapper for strtoul/strtoull (void *)
33 */
34
35#if (UINTPTR_MAX == ULONG_MAX)
36#define STRTOFUNC(a,b,c)        rtems_string_to_unsigned_long(a, (unsigned long*) b, c, 0)
37#elif (UINTPTR_MAX == ULONG_LONG_MAX)
38#define STRTOFUNC(a,b,c)        rtems_string_to_unsigned_long_long(a, (unsigned long long*) b, c, 0)
39#elif (UINTPTR_MAX == UINT_MAX)
40#define STRTOFUNC(a,b,c)        rtems_string_to_unsigned_int(a, (unsigned int*) b, c, 0)
41#else
42/* Fallback to unsigned long */
43#define STRTOFUNC(a,b,c)        rtems_string_to_unsigned_long(a, (unsigned long*) b, c, 0)
44#endif
45
46rtems_status_code rtems_string_to_pointer (
47  const char *s,
48  void **n,
49  char **endptr
50)
51{
52  return STRTOFUNC( s, n, endptr );
53}
Note: See TracBrowser for help on using the repository browser.