open62541 1.4.15
Open source implementation of OPC UA
Loading...
Searching...
No Matches
parse_num.h
Go to the documentation of this file.
1#ifndef ATOI_H
2#define ATOI_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#if !defined(_MSC_VER) || _MSC_VER >= 1800
9# include <stddef.h>
10# include <stdint.h>
11# include <stdbool.h> /* C99 Boolean */
12#else
13# include "ms_stdint.h"
14# if !defined(__bool_true_false_are_defined)
15# define bool unsigned char
16# define true 1
17# define false 0
18# define __bool_true_false_are_defined
19# endif
20#endif
21
22/** Parse integer numbers. Returns the number of parsed digits until the first
23 * non-valid character. Returns 0 upon failure.
24 *
25 * Hex numbers start with 0x.
26 * Signed numbers may have a +/- prefix. */
27
28size_t parseUInt64(const char *str, size_t size, uint64_t *result);
29size_t parseInt64(const char *str, size_t size, int64_t *result);
30size_t parseDouble(const char *str, size_t size, double *result);
31
32#ifdef __cplusplus
33}
34#endif
35
36#endif /* ATOI_H */
37
size_t parseInt64(const char *str, size_t size, int64_t *result)
size_t parseUInt64(const char *str, size_t size, uint64_t *result)
Parse integer numbers.
size_t parseDouble(const char *str, size_t size, double *result)