]> Kevux Git Server - fll/blob
2a6b1a9d84bd55d8ea9777f7106fd63bf582582b
[fll] /
1 .TH fl_conversion_dynamic_partial_to_unsigned_detect "3" "January 2026" "FLL - Featureless Linux Library 0.8.0 - Level 1" "Library Functions"
2 .SH "NAME"
3 fl_conversion_dynamic_partial_to_unsigned_detect \-
4 .SH SYNOPSIS
5 .nf
6 .B #include <conversion.h>
7 .sp
8 \fBf_status_t fl_conversion_dynamic_partial_to_unsigned_detect\fP(
9     \fBconst fl_conversion_data_t \fP\fIdata\fP,
10     \fBconst f_string_static_t    \fP\fIbuffer\fP,
11     \fBconst f_range_t            \fP\fIrange\fP,
12     \fBf_number_unsigned_t *const \fP\fInumber\fP
13 );
14 .fi
15 .SH DESCRIPTION
16 .PP
17 Convert a series of positive number characters into an f_number_unsigned_t.
18 .PP
19 Decimal is used for all other cases.
20 .PP
21 Leading 0's and whitespace are ignored. Whitespace after the first digit is considered invalid.
22 .PP
23 This function is similar to strtoull(), but the behavior of error handling and special bases are different. In particular, octals are specified here with '0b' prefix or '0B' prefix instead of the ridiculous '0' prefix. Negative values are reported as such instead of being converted into the unsigned equivalent.
24 .PP
25 F_base_not (with error bit) if no supported or valid base unit is provided. F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment is found. F_number (with error bit) if parameter is not a number. F_number_decimal (with error bit) if number has a decimal digit. F_number_overflow (with error bit) on integer overflow. F_parameter (with error bit) if a parameter is invalid.
26 .SH PARAMETERS
27 .TP
28 .B data
29 Conversion data for specifying things such as treating this as a negative number. This auto-detects the base and negative, ignoring the base number and negative flag.
30
31 .TP
32 .B buffer
33 The string to convert.
34
35 .TP
36 .B range
37 The start/stop range to convert.
38
39 .TP
40 .B number
41 This will store the value of the converted string. This value is only changed on success.
42
43 .SH STRUCTURES
44 .SS ""
45 .PP
46 .sp
47 .PP
48 Provide a structure for customizing conversion settings for a conversion function to use.
49 .PP
50 flag: Store flags from fl_conversion_data_flag_*.
51 .sp
52 .RS
53 .nf
54 \fB
55 struct fl_conversion_data_t {
56   uint8_t  \fIbase\fP;
57   uint16_t \fIflag\fP;
58 };
59 \fP
60 .fi
61 .RE
62 .SS ""
63 .PP
64 .sp
65 .PP
66 A string that is analogous to f_string_dynamic_t but intended for static-only uses.
67 .PP
68 The f_string_static_t type should always have size set to 0 to represent that it is a static string. This allows for easier integration with f_string_dynamic_t.
69 .PP
70 If size is set to some value other than 0 for a static string, then take special care not to intermix it with f_string_dynamic_t.
71 .PP
72 A special macro_f_string_static_t_initialize_1() is provided to easily initialize a static string. A special macro_f_string_static_t_initialize_2() is provided to easily initialize a static string with an identical used and size.
73 .PP
74 size: Total amount of space available.
75 .sp
76 .RS
77 .nf
78 \fB
79 struct f_string_static_t {
80   f_string_t          \fIstring\fP;
81   f_number_unsigned_t \fIused\fP;
82   f_number_unsigned_t \fIsize\fP;
83 };
84 \fP
85 .fi
86 .RE
87 .SS ""
88 .PP
89 .sp
90 .PP
91 A structure designating a start and stop range for some string.
92 .PP
93 In general, this project uses the start and stop position inclusively, meaning that a range of 0 to 1 would include positions 0 and position 1. Therefore, a range from 0 to 0 would be include position 0. Set start to some value larger than stop to designate that there is no range (such as start = 1, stop = 0).
94 .PP
95 stop: The inclusive stop position.
96 .sp
97 .RS
98 .nf
99 \fB
100 struct f_range_t {
101   f_number_unsigned_t \fIstart\fP;
102   f_number_unsigned_t \fIstop\fP;
103 };
104 \fP
105 .fi
106 .RE
107 .SH RETURN VALUE
108 .PP
109 F_okay on success. F_data_not if string starts with a null (length is 0). F_number_negative on negative value (has a -, such as '-1'). F_number_positive on positive value (has a +, such as '+1').
110 .SH SEE ALSO
111 .PP
112 .nh
113 .ad l
114 \fIconversion.h\fP(3), \fIfl_conversion_dynamic_partial_to_signed\fP(3), \fIfl_conversion_dynamic_partial_to_signed_detect\fP(3), \fIfl_conversion_dynamic_partial_to_unsigned\fP(3), \fIfl_conversion_dynamic_partial_to_unsigned_detect\fP(3), \fIfl_conversion_dynamic_to_signed\fP(3), \fIfl_conversion_dynamic_to_signed_detect\fP(3), \fIfl_conversion_dynamic_to_unsigned\fP(3), \fIfl_conversion_dynamic_to_unsigned_detect\fP(3), \fIf_number_unsigned_t\fP, \fIstrtoull()\fP
115 .ad
116 .hy
117 .SH AUTHOR
118 Written by Kevin Day.
119 .SH COPYRIGHT
120 .PP
121 Copyright \(co 2007-2026 Kevin Day, GNU LGPL Version 2.1 or later.