P99
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
c
d
e
f
i
l
m
n
r
s
t
w
Functions
c
e
f
i
n
r
Variables
Typedefs
Related Functions
Files
File List
Globals
All
0
1
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
i
j
l
m
n
p
r
s
t
u
v
w
Variables
Typedefs
_
b
c
d
e
f
i
l
m
o
p
r
s
t
u
v
Enumerations
Enumerator
Macros
0
1
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Examples
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
p99
p99_str.h
Go to the documentation of this file.
1
/* This may look like nonsense, but it really is -*- mode: C; coding: utf-8 -*- */
2
/* */
3
/* Except for parts copied from previous work and as explicitly stated below, */
4
/* the authors and copyright holders for this work are as follows: */
5
/* (C) copyright 2010-2012 Jens Gustedt, INRIA, France */
6
/* (C) copyright 2012 William Morris */
7
/* */
8
/* This file is free software; it is part of the P99 project. */
9
/* */
10
/* Licensed under the Apache License, Version 2.0 (the "License"); */
11
/* you may not use this file except in compliance with the License. */
12
/* You may obtain a copy of the License at */
13
/* */
14
/* http://www.apache.org/licenses/LICENSE-2.0 */
15
/* */
16
/* Unless required by applicable law or agreed to in writing, software */
17
/* distributed under the License is distributed on an "AS IS" BASIS, */
18
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
19
/* See the License for the specific language governing permissions and */
20
/* limitations under the License. */
21
/* */
22
/*
23
** p99_str.h
24
**
25
** Made by Jens Gustedt
26
** Login <gustedt@damogran.loria.fr>
27
**
28
** Started on Thu Oct 7 14:57:47 2010 Jens Gustedt
29
** Last update Thu Oct 7 14:57:47 2010 Jens Gustedt
30
*/
31
32
#ifndef P99_STR_H_
33
# define P99_STR_H_
34
42
#include "
p99_classification.h
"
43
44
#define P00_DEFINE_STR3(CODE) \
45
p99_inline \
46
P99_BUILTIN_TYPE(CODE) P99_PASTE2(str2, CODE)(char const* p00_nptr, size_t* p00_pos, unsigned p00_base) { \
47
char *p00_eptr; \
48
P99_BUILTIN_TYPE(CODE) p00_ret = (strto ## CODE)(p00_nptr, (p00_pos ? &p00_eptr : 0), p00_base); \
49
if (p00_pos) *p00_pos = p00_eptr - p00_nptr; \
50
return p00_ret; \
51
} \
52
P99_MACRO_END(P00_DEFINE_STR3, CODE)
53
54
#define P00_STR3_0(X) P00_DEFINE_STR3(X)
55
#define P00_STR3_1(...) P99_SEP(P00_STR3_0, __VA_ARGS__)
56
57
#ifndef P00_DOXYGEN
58
P00_STR3_1(l, ll, ul, ull, uz, t, j, uj);
59
#endif
60
61
P00_C99_DEFARG_DOCU(
str2l
,
long
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
65
#define str2l(...) P99_CALL_DEFARG(str2l, 3, __VA_ARGS__)
66
#define str2l_defarg_1() 0
67
#define str2l_defarg_2() 0
68
69
P00_C99_DEFARG_DOCU(
str2ll
,
long
long
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
73
#define str2ll(...) P99_CALL_DEFARG(str2ll, 3, __VA_ARGS__)
74
#define str2ll_defarg_1() 0
75
#define str2ll_defarg_2() 0
76
77
P00_C99_DEFARG_DOCU(
str2ul
,
unsigned
long
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
81
#define str2ul(...) P99_CALL_DEFARG(str2ul, 3, __VA_ARGS__)
82
#define str2ul_defarg_1() 0
83
#define str2ul_defarg_2() 0
84
85
P00_C99_DEFARG_DOCU(
str2ull
,
unsigned
long
long
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
89
#define str2ull(...) P99_CALL_DEFARG(str2ull, 3, __VA_ARGS__)
90
#define str2ull_defarg_1() 0
91
#define str2ull_defarg_2() 0
92
93
P00_C99_DEFARG_DOCU(
str2uz
,
size_t
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
97
#define str2uz(...) P99_CALL_DEFARG(str2uz, 3, __VA_ARGS__)
98
#define str2uz_defarg_1() 0
99
#define str2uz_defarg_2() 0
100
101
P00_C99_DEFARG_DOCU(
str2t
,
ptrdiff_t
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
105
#define str2t(...) P99_CALL_DEFARG(str2t, 3, __VA_ARGS__)
106
#define str2t_defarg_1() 0
107
#define str2t_defarg_2() 0
108
109
P00_C99_DEFARG_DOCU(
str2j
, intmax_t,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
113
#define str2j(...) P99_CALL_DEFARG(str2j, 3, __VA_ARGS__)
114
#define str2j_defarg_1() 0
115
#define str2j_defarg_2() 0
116
117
P00_C99_DEFARG_DOCU(
str2uj
,
uintmax_t
,
char
const
*p00_nptr,
size_t
*p00_pos,
unsigned
p00_base)
121
#define str2uj(...) P99_CALL_DEFARG(str2uj, 3, __VA_ARGS__)
122
#define str2uj_defarg_1() 0
123
#define str2uj_defarg_2() 0
124
125
#define P00_DEFINE_STR2(CODE) \
126
p99_inline \
127
P99_BUILTIN_TYPE(CODE) P99_PASTE2(str2, CODE)(char const* p00_nptr, size_t* p00_pos) { \
128
char *p00_eptr; \
129
P99_BUILTIN_TYPE(CODE) p00_ret = (strto ## CODE)(p00_nptr, (p00_pos ? &p00_eptr : 0)); \
130
if (p00_pos) *p00_pos = p00_eptr - p00_nptr; \
131
return p00_ret; \
132
} \
133
P99_MACRO_END(P00_DEFINE_STR2, CODE)
134
135
#define P00_STR2_0(X) P00_DEFINE_STR2(X)
136
#define P00_STR2_1(...) P99_SEP(P00_STR2_0, __VA_ARGS__)
137
138
P00_STR2_1(
f
,
d
,
ld
);
139
140
P00_C99_DEFARG_DOCU(
str2f
,
float
,
char
const
*p00_nptr,
size_t
*p00_pos)
143
#define str2f(...) P99_CALL_DEFARG(str2f, 2, __VA_ARGS__)
144
#define str2f_defarg_1() 0
145
146
P00_C99_DEFARG_DOCU(
str2d
,
double
,
char
const
*p00_nptr,
size_t
*p00_pos)
149
#define str2d(...) P99_CALL_DEFARG(str2d, 2, __VA_ARGS__)
150
#define str2d_defarg_1() 0
151
152
P00_C99_DEFARG_DOCU(
str2ld
,
long
double
,
char
const
*p00_nptr,
size_t
*p00_pos)
155
#define str2ld(...) P99_CALL_DEFARG(str2ld, 2, __VA_ARGS__)
156
#define str2ld_defarg_1() 0
157
158
159
160
#endif
/* !P99_STR_H_ */
str2ull
#define str2ull(...)
Definition:
p99_str.h:89
uintmax_t
uintmax_t
Definition:
p99_str.h:117
str2l
#define str2l(...)
f
f
Definition:
p99_str.h:138
str2ld
#define str2ld(...)
str2d
#define str2d(...)
Definition:
p99_str.h:149
str2j
#define str2j(...)
ptrdiff_t
ptrdiff_t
Definition:
p99_str.h:101
ld
ld
Definition:
p99_str.h:138
str2uz
#define str2uz(...)
str2f
#define str2f(...)
str2ll
#define str2ll(...)
Definition:
p99_str.h:73
str2ul
#define str2ul(...)
str2t
#define str2t(...)
Definition:
p99_str.h:105
str2uj
#define str2uj(...)
Definition:
p99_str.h:121
d
d
Definition:
p99_str.h:138
p99_classification.h
classification of different types of token sequences
Generated by
1.8.17