aboutsummaryrefslogtreecommitdiffstats
path: root/man3/libsimple_strtoi.3
blob: fb9abcfd5bc747ceee88fff9a248e3b444df4b01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
.TH LIBSIMPLE_STRTOI 3 libsimple
.SH NAME
libsimple_strto{i,h,hh,z,i8,i16,i32,i64} \- parse a string as a signed integer

.SH SYNOPSIS
.nf
#include <libsimple.h>

signed int libsimple_strtoi(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
signed short int libsimple_strtoh(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
signed char libsimple_strtohh(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
inline ssize_t libsimple_strtoz(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
int_least8_t libsimple_strtoi8(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
int_least16_t libsimple_strtoi16(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
int_least32_t libsimple_strtoi32(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);
int_least64_t libsimple_strtoi64(const char *\fInptr\fP, char **\fIend\fP, int \fIbase\fP);

#ifndef strtoi
# define strtoi libsimple_strtoi
#endif
#ifndef strtoh
# define strtoh libsimple_strtoh
#endif
#ifndef strtohh
# define strtohh libsimple_strtohh
#endif
#ifndef strtoz
# define strtoz libsimple_strtoz
#endif
#ifndef strtoi8
# define strtoi8 libsimple_strtoi8
#endif
#ifndef strtoi16
# define strtoi16 libsimple_strtoi16
#endif
#ifndef strtoi32
# define strtoi32 libsimple_strtoi32
#endif
#ifndef strtoi64
# define strtoi64 libsimple_strtoi64
#endif
.fi
.PP
Link with
.IR \-lsimple .

.SH DESCRIPTION
The
.BR libsimple_strtoi ()
function is a version of the
.BR strtol (3)
function, that returns a
.BR "signed int" .
.PP
The
.BR libsimple_strtoh ()
function is a version of the
.BR strtol (3)
function, that returns a
.BR "signed short int" .
.PP
The
.BR libsimple_strtohh ()
function is a version of the
.BR strtol (3)
function, that returns a
.BR "signed char" .
.PP
The
.BR libsimple_strtoz ()
function is a version of the
.BR strtol (3)
function, that returns a
.BR ssize_t .
.PP
The
.BR libsimple_strtoi8 ()
function is a version of the
.BR strtol (3)
function, that returns an
.B int_least8_t
restricted to the range of
.BR int8_t .
.PP
The
.BR libsimple_strtoi16 ()
function is a version of the
.BR strtol (3)
function, that returns an
.B int_least16_t
restricted to the range of
.BR int16_t .
.PP
The
.BR libsimple_strtoi32 ()
function is a version of the
.BR strtol (3)
function, that returns an
.B int_least32_t
restricted to the range of
.BR int32_t .
.PP
The
.BR libsimple_strtoi64 ()
function is a version of the
.BR strtol (3)
function, that returns an
.B int_least64_t
restricted to the range of
.BR int64_t .

.SH RETURN VALUE
See
.BR strtol (3).

.SH ERRORS
See
.BR strtol (3).

.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
.TS
allbox;
lb lb lb
l l l.
Interface	Attribute	Value
T{
.BR libsimple_strtoi (),
.br
.BR libsimple_strtoh (),
.br
.BR libsimple_strtohh (),
.br
.BR libsimple_strtoz (),
.br
.BR libsimple_strtoi8 (),
.br
.BR libsimple_strtoi16 (),
.br
.BR libsimple_strtoi32 (),
.br
.BR libsimple_strtoi64 ()
T}	Thread safety	MT-Safe
T{
.BR libsimple_strtoi (),
.br
.BR libsimple_strtoh (),
.br
.BR libsimple_strtohh (),
.br
.BR libsimple_strtoz (),
.br
.BR libsimple_strtoi8 (),
.br
.BR libsimple_strtoi16 (),
.br
.BR libsimple_strtoi32 (),
.br
.BR libsimple_strtoi64 ()
T}	Async-signal safety	AS-Safe
T{
.BR libsimple_strtoi (),
.br
.BR libsimple_strtoh (),
.br
.BR libsimple_strtohh (),
.br
.BR libsimple_strtoz (),
.br
.BR libsimple_strtoi8 (),
.br
.BR libsimple_strtoi16 (),
.br
.BR libsimple_strtoi32 (),
.br
.BR libsimple_strtoi64 ()
T}	Async-cancel safety	AC-Safe
.TE

.SH EXAMPLES
None.

.SH APPLICATION USAGE
None.

.SH RATIONALE
None.

.SH FUTURE DIRECTIONS
None.

.SH NOTES
None.

.SH HISTORY
libsimple 1.4

.SH BUGS
None.

.SH SEE ALSO
.BR libsimple_strtou (3),
.BR strtol (3),
.BR strtoll (3)