#ifndef _F_limit_h
#define _F_limit_h
-// include pre-requirements
+// Include pre-requirements.
#define _GNU_SOURCE
// Libc includes.
#ifndef _FL_control_group_h
#define _FL_control_group_h
-// include pre-requirements
+// Include pre-requirements.
#define _GNU_SOURCE
// Libc includes.
extern "C" {
#endif
-#ifndef _di_fl_conversion_string_to_binary_signed_
- f_status_t fl_conversion_string_to_binary_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_binary_signed_
+ f_status_t fl_conversion_dynamic_partial_to_binary_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_binary_signed(string, range, negative, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_binary_signed(dynamic.string + range.start, (range.stop - range.start) + 1, negative, number);
}
-#endif // _di_fl_conversion_string_to_binary_signed_
+#endif // _di_fl_conversion_dynamic_partial_to_binary_signed_
-#ifndef _di_fl_conversion_string_to_binary_unsigned_
- f_status_t fl_conversion_string_to_binary_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_binary_unsigned_
+ f_status_t fl_conversion_dynamic_partial_to_binary_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_binary_unsigned(string, range, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_binary_unsigned(dynamic.string + range.start, (range.stop - range.start) + 1, number);
}
-#endif // _di_fl_conversion_string_to_binary_unsigned_
+#endif // _di_fl_conversion_dynamic_partial_to_binary_unsigned_
-#ifndef _di_fl_conversion_string_to_decimal_signed_
- f_status_t fl_conversion_string_to_decimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_decimal_signed_
+ f_status_t fl_conversion_dynamic_partial_to_decimal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_decimal_signed(string, range, negative, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_decimal_signed(dynamic.string + range.start, (range.stop - range.start) + 1, negative, number);
}
-#endif // _di_fl_conversion_string_to_decimal_signed_
+#endif // _di_fl_conversion_dynamic_partial_to_decimal_signed_
-#ifndef _di_fl_conversion_string_to_decimal_unsigned_
- f_status_t fl_conversion_string_to_decimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_decimal_unsigned_
+ f_status_t fl_conversion_dynamic_partial_to_decimal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_decimal_unsigned(string, range, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_decimal_unsigned(dynamic.string + range.start, (range.stop - range.start) + 1, number);
}
-#endif // _di_fl_conversion_string_to_decimal_unsigned_
+#endif // _di_fl_conversion_dynamic_partial_to_decimal_unsigned_
-#ifndef _di_fl_conversion_string_to_duodecimal_signed_
- f_status_t fl_conversion_string_to_duodecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_duodecimal_signed_
+ f_status_t fl_conversion_dynamic_partial_to_duodecimal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_duodecimal_signed(string, range, negative, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_duodecimal_signed(dynamic.string + range.start, (range.stop - range.start) + 1, negative, number);
}
-#endif // _di_fl_conversion_string_to_duodecimal_signed_
+#endif // _di_fl_conversion_dynamic_partial_to_duodecimal_signed_
-#ifndef _di_fl_conversion_string_to_duodecimal_unsigned_
- f_status_t fl_conversion_string_to_duodecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_
+ f_status_t fl_conversion_dynamic_partial_to_duodecimal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_duodecimal_unsigned(string, range, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_duodecimal_unsigned(dynamic.string + range.start, (range.stop - range.start) + 1, number);
}
-#endif // _di_fl_conversion_string_to_duodecimal_unsigned_
+#endif // _di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_
-#ifndef _di_fl_conversion_string_to_hexidecimal_signed_
- f_status_t fl_conversion_string_to_hexidecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_hexidecimal_signed_
+ f_status_t fl_conversion_dynamic_partial_to_hexidecimal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_hexidecimal_signed(string, range, negative, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_hexidecimal_signed(dynamic.string + range.start, (range.stop - range.start) + 1, negative, number);
}
-#endif // _di_fl_conversion_string_to_hexidecimal_signed_
+#endif // _di_fl_conversion_dynamic_partial_to_hexidecimal_signed_
-#ifndef _di_fl_conversion_string_to_hexidecimal_unsigned_
- f_status_t fl_conversion_string_to_hexidecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_
+ f_status_t fl_conversion_dynamic_partial_to_hexidecimal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_hexidecimal_unsigned(string, range, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_hexidecimal_unsigned(dynamic.string + range.start, (range.stop - range.start) + 1, number);
}
-#endif // _di_fl_conversion_string_to_hexidecimal_unsigned_
+#endif // _di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_
-#ifndef _di_fl_conversion_string_to_octal_signed_
- f_status_t fl_conversion_string_to_octal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_octal_signed_
+ f_status_t fl_conversion_dynamic_partial_to_octal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_octal_signed(string, range, negative, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_octal_signed(dynamic.string + range.start, (range.stop - range.start) + 1, negative, number);
}
-#endif // _di_fl_conversion_string_to_octal_signed_
+#endif // _di_fl_conversion_dynamic_partial_to_octal_signed_
-#ifndef _di_fl_conversion_string_to_octal_unsigned_
- f_status_t fl_conversion_string_to_octal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_octal_unsigned_
+ f_status_t fl_conversion_dynamic_partial_to_octal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_conversion_string_to_octal_unsigned(string, range, number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_octal_unsigned(dynamic.string + range.start, (range.stop - range.start) + 1, number);
}
-#endif // _di_fl_conversion_string_to_octal_unsigned_
+#endif // _di_fl_conversion_dynamic_partial_to_octal_unsigned_
-#ifndef _di_fl_conversion_string_to_number_signed_
- f_status_t fl_conversion_string_to_number_signed(const f_string_t string, const f_string_range_t range, f_number_signed_t *number) {
+#ifndef _di_fl_conversion_dynamic_partial_to_number_signed_
+ f_status_t fl_conversion_dynamic_partial_to_number_signed(const f_string_static_t dynamic, const f_string_range_t range, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string[0]) {
+ if (!dynamic.used || range.start > range.stop) {
return F_data_not;
}
- uint8_t width = 0;
- f_array_length_t width_max = 0;
- uint8_t mode = 0;
- int8_t vector = 0; // 0 for assumed positive, 1 for explicit positive, -1 for negative.
- f_array_length_t j = 0;
- f_array_length_t offset = 0;
- f_status_t status = F_none;
-
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
-
- width = macro_f_utf_byte_width_is(string[i]);
-
- if (!width) {
- if (isspace(string[i])) {
- if (!mode && !vector) {
- ++offset;
-
- continue;
- }
-
- return F_status_set_error(F_number);
- }
- }
- else {
- if (!mode && !vector) {
- width_max = (range.stop - i) + 1;
-
- status = f_utf_is_whitespace(string + i, width_max);
-
- if (status == F_true) {
- offset = i + 1;
-
- continue;
- }
-
- if (F_status_is_error(status)) {
- if (status == F_status_set_error(F_maybe)) {
- status = F_status_set_error(F_complete_not_utf);
- }
-
- return status;
- }
- }
-
- return F_status_set_error(F_number);
- }
-
- if (string[i] == 0x30) {
-
- // skip past all NULLs.
- for (j = i + 1; j <= range.stop; ++j) {
- if (string[j]) break;
- } // for
-
- // Immediate next value must be either a number, 'x', 'X', 'd', 'D', 'o', 'O', 'b', or 'B'.
- if (j > range.stop) {
- *number = 0;
- return F_none;
- }
- else if (string[j] > 0x2f && string[j] < 0x3a) {
- mode = 10;
- }
- else if (string[j] == 0x78 || string[j] == 0x58) {
- mode = 16;
- offset += 2;
- }
- else if (string[j] == 0x44 || string[j] == 0x64) {
- mode = 12;
- offset += 2;
- }
- else if (string[j] == 0x6f || string[j] == 0x4f) {
- mode = 8;
- offset += 2;
- }
- else if (string[j] == 0x62 || string[j] == 0x42) {
- mode = 2;
- offset += 2;
- }
- else if (string[j] == 0x2e) {
- return F_status_set_error(F_number_decimal);
- }
- else {
- return F_status_set_error(F_number);
- }
-
- break;
- }
-
- // plus sign is only allowed as the first non-whitespace character.
- if (string[i] == 0x2b) {
- if (!mode && !vector) {
- vector = 1;
- ++offset;
- }
- else {
- return F_status_set_error(F_number);
- }
- }
-
- // negative sign is not allowed.
- if (string[i] == 0x2d) {
- if (!mode && !vector) {
- vector = -1;
- ++offset;
- }
- else {
- return F_status_set_error(F_number);
- }
- }
-
- if (f_conversion_character_is_decimal(string[i]) == F_true) {
- mode = 10;
- break;
- }
-
- return F_status_set_error(F_number);
- } // for
-
- if (!mode) {
- return F_status_set_error(F_number);
- }
+ return private_fl_conversion_dynamic_to_number_signed(dynamic.string + range.start, (range.stop - range.start) + 1, number);
+ }
+#endif // _di_fl_conversion_dynamic_partial_to_number_signed_
- f_string_range_t location_offset = f_string_range_t_initialize;
- location_offset.start = range.start + offset;
- location_offset.stop = range.stop;
+#ifndef _di_fl_conversion_dynamic_partial_to_number_unsigned_
+ f_status_t fl_conversion_dynamic_partial_to_number_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
- if (range.start + offset > range.stop) {
- return F_status_set_error(F_number);
+ if (!dynamic.used || range.start > range.stop) {
+ return F_data_not;
}
- if (mode == 10) {
- return private_fl_conversion_string_to_decimal_signed(string, location_offset, vector == -1, number);
- }
+ return private_fl_conversion_dynamic_to_number_unsigned(dynamic.string + range.start, (range.stop - range.start) + 1, number);
+ }
+#endif // _di_fl_conversion_dynamic_partial_to_number_unsigned_
- if (mode == 16) {
- return private_fl_conversion_string_to_hexidecimal_signed(string, location_offset, vector == -1, number);
- }
+#ifndef _di_fl_conversion_dynamic_to_binary_signed_
+ f_status_t fl_conversion_dynamic_to_binary_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
- if (mode == 12) {
- return private_fl_conversion_string_to_duodecimal_signed(string, location_offset, vector == -1, number);
+ if (!dynamic.used) {
+ return F_data_not;
}
- if (mode == 8) {
- return private_fl_conversion_string_to_octal_signed(string, location_offset, vector == -1, number);
+ return private_fl_conversion_dynamic_to_binary_signed(dynamic.string, dynamic.used, negative, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_binary_signed_
+
+#ifndef _di_fl_conversion_dynamic_to_binary_unsigned_
+ f_status_t fl_conversion_dynamic_to_binary_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- return private_fl_conversion_string_to_binary_signed(string, location_offset, vector == -1, number);
+ return private_fl_conversion_dynamic_to_binary_unsigned(dynamic.string, dynamic.used, number);
}
-#endif // _di_fl_conversion_string_to_number_signed_
+#endif // _di_fl_conversion_dynamic_to_binary_unsigned_
-#ifndef _di_fl_conversion_string_to_number_unsigned_
- f_status_t fl_conversion_string_to_number_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#ifndef _di_fl_conversion_dynamic_to_decimal_signed_
+ f_status_t fl_conversion_dynamic_to_decimal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number) {
#ifndef _di_level_1_parameter_checking_
- if (!string) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string[0]) {
+ if (!dynamic.used) {
return F_data_not;
}
- uint8_t width = 0;
- f_array_length_t width_max = 0;
- uint8_t mode = 0;
- f_array_length_t j = 0;
- f_array_length_t offset = 0;
- f_status_t status = F_none;
- int8_t sign_found = 0;
-
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
-
- width = macro_f_utf_byte_width_is(string[i]);
-
- if (!width) {
- if (isspace(string[i])) {
- if (!mode) {
- ++offset;
-
- continue;
- }
-
- return F_status_set_error(F_number);
- }
- }
- else {
- if (!mode) {
- width_max = (range.stop - i) + 1;
-
- status = f_utf_is_whitespace(string + i, width_max);
-
- if (status == F_true) {
- offset = i + 1;
-
- continue;
- }
-
- if (F_status_is_error(status)) {
- if (status == F_status_set_error(F_maybe)) {
- status = F_status_set_error(F_complete_not_utf);
- }
-
- return status;
- }
- }
-
- return F_status_set_error(F_number);
- }
-
- if (string[i] == 0x30) {
-
- // skip past all NULLs.
- for (j = i + 1; j <= range.stop; ++j) {
- if (string[j]) break;
- } // for
-
- // Immediate next value must be either a number, 'x', 'X', 'd', 'D', 'o', 'O', 'b', or 'B'.
- if (j > range.stop) {
- *number = 0;
-
- return F_none;
- }
- else if (string[j] > 0x2f && string[j] < 0x3a) {
- mode = 10;
- }
- else if (string[j] == 0x78 || string[j] == 0x58) {
- mode = 16;
- offset += 2;
- }
- else if (string[j] == 0x44 || string[j] == 0x64) {
- mode = 12;
- offset += 2;
- }
- else if (string[j] == 0x6f || string[j] == 0x4f) {
- mode = 8;
- offset += 2;
- }
- else if (string[j] == 0x62 || string[j] == 0x42) {
- mode = 2;
- offset += 2;
- }
- else if (string[j] == 0x2e) {
- return F_status_set_error(F_number_decimal);
- }
- else {
- return F_status_set_error(F_number);
- }
-
- break;
- }
-
- if (string[i] == 0x2b) {
- ++offset;
- sign_found = 1;
- }
-
- if (string[i] == 0x2d) {
- ++offset;
- sign_found = -1;
- }
-
- if (f_conversion_character_is_decimal(string[i]) == F_true) {
- mode = 10;
- break;
- }
-
- return F_status_set_error(F_number);
- } // for
-
- if (!mode) {
- return F_status_set_error(F_number);
+ return private_fl_conversion_dynamic_to_decimal_signed(dynamic.string, dynamic.used, negative, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_decimal_signed_
+
+#ifndef _di_fl_conversion_dynamic_to_decimal_unsigned_
+ f_status_t fl_conversion_dynamic_to_decimal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- f_string_range_t location_offset = f_string_range_t_initialize;
- location_offset.start = range.start + offset;
- location_offset.stop = range.stop;
+ return private_fl_conversion_dynamic_to_decimal_unsigned(dynamic.string, dynamic.used, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_decimal_unsigned_
- if (range.start + offset > range.stop) {
- return F_status_set_error(F_number);
+#ifndef _di_fl_conversion_dynamic_to_duodecimal_signed_
+ f_status_t fl_conversion_dynamic_to_duodecimal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- if (mode == 10) {
- status = private_fl_conversion_string_to_decimal_unsigned(string, location_offset, number);
+ return private_fl_conversion_dynamic_to_duodecimal_signed(dynamic.string, dynamic.used, negative, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_duodecimal_signed_
+
+#ifndef _di_fl_conversion_dynamic_to_duodecimal_unsigned_
+ f_status_t fl_conversion_dynamic_to_duodecimal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- else if (mode == 16) {
- status = private_fl_conversion_string_to_hexidecimal_unsigned(string, location_offset, number);
+
+ return private_fl_conversion_dynamic_to_duodecimal_unsigned(dynamic.string, dynamic.used, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_duodecimal_unsigned_
+
+#ifndef _di_fl_conversion_dynamic_to_hexidecimal_signed_
+ f_status_t fl_conversion_dynamic_to_hexidecimal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- else if (mode == 12) {
- status = private_fl_conversion_string_to_duodecimal_unsigned(string, location_offset, number);
+
+ return private_fl_conversion_dynamic_to_hexidecimal_signed(dynamic.string, dynamic.used, negative, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_hexidecimal_signed_
+
+#ifndef _di_fl_conversion_dynamic_to_hexidecimal_unsigned_
+ f_status_t fl_conversion_dynamic_to_hexidecimal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- else if (mode == 8) {
- status = private_fl_conversion_string_to_octal_unsigned(string, location_offset, number);
+
+ return private_fl_conversion_dynamic_to_hexidecimal_unsigned(dynamic.string, dynamic.used, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_hexidecimal_unsigned_
+
+#ifndef _di_fl_conversion_dynamic_to_octal_signed_
+ f_status_t fl_conversion_dynamic_to_octal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- else {
- status = private_fl_conversion_string_to_binary_unsigned(string, location_offset, number);
+
+ return private_fl_conversion_dynamic_to_octal_signed(dynamic.string, dynamic.used, negative, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_octal_signed_
+
+#ifndef _di_fl_conversion_dynamic_to_octal_unsigned_
+ f_status_t fl_conversion_dynamic_to_octal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (!dynamic.used) {
+ return F_data_not;
}
- // +/- signs are not allowed.
- if (sign_found) {
- if (status == F_none) {
- if (sign_found == -1) {
- return F_status_set_error(F_number_negative);
- }
+ return private_fl_conversion_dynamic_to_octal_unsigned(dynamic.string, dynamic.used, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_octal_unsigned_
- return F_status_set_error(F_number_positive);
- }
+#ifndef _di_fl_conversion_dynamic_to_number_signed_
+ f_status_t fl_conversion_dynamic_to_number_signed(const f_string_static_t dynamic, f_number_signed_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
- return F_status_set_error(F_number);
+ if (!dynamic.used) {
+ return F_data_not;
}
- return status;
+ return private_fl_conversion_dynamic_to_number_signed(dynamic.string, dynamic.used, number);
}
-#endif // _di_fl_conversion_string_to_number_unsigned_
+#endif // _di_fl_conversion_dynamic_to_number_signed_
+
+#ifndef _di_fl_conversion_dynamic_to_number_unsigned_
+ f_status_t fl_conversion_dynamic_to_number_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!number) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+ if (!dynamic.used) {
+ return F_data_not;
+ }
+
+ return private_fl_conversion_dynamic_to_number_unsigned(dynamic.string, dynamic.used, number);
+ }
+#endif // _di_fl_conversion_dynamic_to_number_unsigned_
#ifdef __cplusplus
} // extern "C"
#endif
/**
* Convert a series of positive or negative binary number characters into a f_number_signed_t.
*
- * This will stop at one of the following: location.stop or a non-digit.
+ * This will stop at one of the following: range.stop or a non-digit.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
- * @param location
+ * @param range
* The start/stop range to convert.
* @param negative
* Set to 0 to treat string as a positive number, 1 for as a negative number.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_binary_signed_
- extern f_status_t fl_conversion_string_to_binary_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // _di_fl_conversion_string_to_binary_signed_
+#ifndef _di_fl_conversion_dynamic_partial_to_binary_signed_
+ extern f_status_t fl_conversion_dynamic_partial_to_binary_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_binary_signed_
/**
* Convert a series of positive binary number characters into a f_number_unsigned_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_overflow (with error bit) on integer overflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_binary_unsigned_
- extern f_status_t fl_conversion_string_to_binary_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // _di_fl_conversion_string_to_binary_unsigned_
+#ifndef _di_fl_conversion_dynamic_partial_to_binary_unsigned_
+ extern f_status_t fl_conversion_dynamic_partial_to_binary_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_binary_unsigned_
/**
* Convert a series of positive or negative decimal number characters into an f_number_signed_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_decimal_signed_
- extern f_status_t fl_conversion_string_to_decimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // _di_fl_conversion_string_to_decimal_signed_
+#ifndef _di_fl_conversion_dynamic_partial_to_decimal_signed_
+ extern f_status_t fl_conversion_dynamic_partial_to_decimal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_decimal_signed_
/**
* Convert a series of positive decimal number characters into an f_number_unsigned_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_overflow (with error bit) on integer overflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_decimal_unsigned_
- extern f_status_t fl_conversion_string_to_decimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // _di_fl_conversion_string_to_decimal_unsigned_
+#ifndef _di_fl_conversion_dynamic_partial_to_decimal_unsigned_
+ extern f_status_t fl_conversion_dynamic_partial_to_decimal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_decimal_unsigned_
/**
* Convert a series of positive or negative duodecimal number characters into an f_number_signed_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_duodecimal_signed_
- extern f_status_t fl_conversion_string_to_duodecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // _di_fl_conversion_string_to_duodecimal_signed_
+#ifndef _di_fl_conversion_dynamic_partial_to_duodecimal_signed_
+ extern f_status_t fl_conversion_dynamic_partial_to_duodecimal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_duodecimal_signed_
/**
* Convert a series of positive duodecimal number characters into an f_number_unsigned_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_overflow (with error bit) on integer overflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_duodecimal_unsigned_
- extern f_status_t fl_conversion_string_to_duodecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // _di_fl_conversion_string_to_duodecimal_unsigned_
+#ifndef _di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_
+ extern f_status_t fl_conversion_dynamic_partial_to_duodecimal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_
/**
* Convert a series of positive or negative hexidecimal number characters into an f_number_signed_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_hexidecimal_signed_
- extern f_status_t fl_conversion_string_to_hexidecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // _di_fl_conversion_string_to_hexidecimal_signed_
+#ifndef _di_fl_conversion_dynamic_partial_to_hexidecimal_signed_
+ extern f_status_t fl_conversion_dynamic_partial_to_hexidecimal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_hexidecimal_signed_
/**
* Convert a series of positive hexidecimal number characters into an f_number_unsigned_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_overflow (with error bit) on integer overflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_hexidecimal_unsigned_
- extern f_status_t fl_conversion_string_to_hexidecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // _di_fl_conversion_string_to_hexidecimal_unsigned_
+#ifndef _di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_
+ extern f_status_t fl_conversion_dynamic_partial_to_hexidecimal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_
/**
* Convert a series of positive or negative octal number characters into an f_number_signed_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_overflow (with error bit) on integer overflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_octal_signed_
- extern f_status_t fl_conversion_string_to_octal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // _di_fl_conversion_string_to_octal_signed_
+#ifndef _di_fl_conversion_dynamic_partial_to_octal_signed_
+ extern f_status_t fl_conversion_dynamic_partial_to_octal_signed(const f_string_static_t dynamic, const f_string_range_t range, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_octal_signed_
/**
* Convert a series of positive octal number characters into an f_number_unsigned_t.
* This will ignore NULL values.
* This will not process signed statuses (+/-).
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
* F_number_overflow (with error bit) on integer overflow.
* F_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_fl_conversion_string_to_octal_unsigned_
- extern f_status_t fl_conversion_string_to_octal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // _di_fl_conversion_string_to_octal_unsigned_
+#ifndef _di_fl_conversion_dynamic_partial_to_octal_unsigned_
+ extern f_status_t fl_conversion_dynamic_partial_to_octal_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_octal_unsigned_
/**
* Convert a series of positive or negative number characters into an f_number_signed_t.
* This function is similar to strtoll(), 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.
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
*
* @see strtoll()
*/
-#ifndef _di_fl_conversion_string_to_number_signed_
- extern f_status_t fl_conversion_string_to_number_signed(const f_string_t string, const f_string_range_t range, f_number_signed_t *number);
-#endif // _di_fl_conversion_string_to_number_signed_
+#ifndef _di_fl_conversion_dynamic_partial_to_number_signed_
+ extern f_status_t fl_conversion_dynamic_partial_to_number_signed(const f_string_static_t dynamic, const f_string_range_t range, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_number_signed_
/**
* Convert a series of positive number characters into an f_number_unsigned_t.
* 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.
*
- * @param string
+ * @param dynamic
* The string to convert.
* @param range
* The start/stop range to convert.
*
* @see strtoull()
*/
-#ifndef _di_fl_conversion_string_to_number_unsigned_
- extern f_status_t fl_conversion_string_to_number_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // _di_fl_conversion_string_to_number_unsigned_
+#ifndef _di_fl_conversion_dynamic_partial_to_number_unsigned_
+ extern f_status_t fl_conversion_dynamic_partial_to_number_unsigned(const f_string_static_t dynamic, const f_string_range_t range, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_partial_to_number_unsigned_
+/**
+ * Convert a series of positive or negative binary number characters into a f_number_signed_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param negative
+ * Set to 0 to treat string as a positive number, 1 for as a negative number.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the binary string was converted to an signed long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-binary values being found.
+ * F_number_decimal (with error bit) if number has a decimal digit.
+ * F_number_overflow (with error bit) on integer overflow.
+ * F_number_underflow (with error bit) on integer underflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_fl_conversion_dynamic_to_binary_signed_
+ extern f_status_t fl_conversion_dynamic_to_binary_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_to_binary_signed_
+
+/**
+ * Convert a series of positive binary number characters into a f_number_unsigned_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the binary string was converted to an unsigned long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-binary values being found.
+ * 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.
+ */
+#ifndef _di_fl_conversion_dynamic_to_binary_unsigned_
+ extern f_status_t fl_conversion_dynamic_to_binary_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_to_binary_unsigned_
+
+/**
+ * Convert a series of positive or negative decimal number characters into an f_number_signed_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param negative
+ * Set to 0 to treat string as a positive number, 1 for as a negative number.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the decimal string was converted to an signed long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-decimal values being found.
+ * F_number_decimal (with error bit) if number has a decimal digit.
+ * F_number_overflow (with error bit) on integer overflow.
+ * F_number_underflow (with error bit) on integer underflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_fl_conversion_dynamic_to_decimal_signed_
+ extern f_status_t fl_conversion_dynamic_to_decimal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_to_decimal_signed_
+
+/**
+ * Convert a series of positive decimal number characters into an f_number_unsigned_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the decimal string was converted to an unsigned long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-decimal values being found.
+ * 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.
+ */
+#ifndef _di_fl_conversion_dynamic_to_decimal_unsigned_
+ extern f_status_t fl_conversion_dynamic_to_decimal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_to_decimal_unsigned_
+
+/**
+ * Convert a series of positive or negative duodecimal number characters into an f_number_signed_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param negative
+ * Set to 0 to treat string as a positive number, 1 for as a negative number.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the duodecimal string was converted to an signed long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-duodecimal values being found.
+ * F_number_decimal (with error bit) if number has a decimal digit.
+ * F_number_overflow (with error bit) on integer overflow.
+ * F_number_underflow (with error bit) on integer underflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_fl_conversion_dynamic_to_duodecimal_signed_
+ extern f_status_t fl_conversion_dynamic_to_duodecimal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_to_duodecimal_signed_
+
+/**
+ * Convert a series of positive duodecimal number characters into an f_number_unsigned_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the duodecimal string was converted to an unsigned long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-duodecimal values being found.
+ * 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.
+ */
+#ifndef _di_fl_conversion_dynamic_to_duodecimal_unsigned_
+ extern f_status_t fl_conversion_dynamic_to_duodecimal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_to_duodecimal_unsigned_
+
+/**
+ * Convert a series of positive or negative hexidecimal number characters into an f_number_signed_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param negative
+ * Set to 0 to treat string as a positive number, 1 for as a negative number.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the hexidecimal string was converted to an signed long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-hexidecimal values being found.
+ * F_number_decimal (with error bit) if number has a decimal digit.
+ * F_number_overflow (with error bit) on integer overflow.
+ * F_number_underflow (with error bit) on integer underflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_fl_conversion_dynamic_to_hexidecimal_signed_
+ extern f_status_t fl_conversion_dynamic_to_hexidecimal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_to_hexidecimal_signed_
+
+/**
+ * Convert a series of positive hexidecimal number characters into an f_number_unsigned_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the hexidecimal string was converted to an unsigned long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-hexidecimal values being found.
+ * 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.
+ */
+#ifndef _di_fl_conversion_dynamic_to_hexidecimal_unsigned_
+ extern f_status_t fl_conversion_dynamic_to_hexidecimal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_to_hexidecimal_unsigned_
+
+/**
+ * Convert a series of positive or negative octal number characters into an f_number_signed_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param negative
+ * Set to 0 to treat string as a positive number, 1 for as a negative number.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the octal string was converted to an signed long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-octal values being found.
+ * 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.
+ */
+#ifndef _di_fl_conversion_dynamic_to_octal_signed_
+ extern f_status_t fl_conversion_dynamic_to_octal_signed(const f_string_static_t dynamic, const bool negative, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_to_octal_signed_
+
+/**
+ * Convert a series of positive octal number characters into an f_number_unsigned_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none if the octal string was converted to an unsigned long.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * F_number (with error bit) if no conversion was made due to non-octal values being found.
+ * 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.
+ */
+#ifndef _di_fl_conversion_dynamic_to_octal_unsigned_
+ extern f_status_t fl_conversion_dynamic_to_octal_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_to_octal_unsigned_
+
+/**
+ * Convert a series of positive or negative number characters into an f_number_signed_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will process signed statuses (+/-).
+ * This will detect based types as follows:
+ * - hexidecimals begin with either '0x' or '0X'.
+ * - duodecimals begin with either '0d' or '0D'.
+ * - octals begin with either '0o' or '0O'.
+ * - binaries begin with either '0b' or '0B'.
+ * - decimal is used for all other cases.
+ *
+ * Leading 0's and whitespace are ignored.
+ * Whitespace after the first digit is considered invalid.
+ *
+ * This function is similar to strtoll(), 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.
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * 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_number_underflow (with error bit) on integer underflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see strtoll()
+ */
+#ifndef _di_fl_conversion_dynamic_to_number_signed_
+ extern f_status_t fl_conversion_dynamic_to_number_signed(const f_string_static_t dynamic, f_number_signed_t * const number);
+#endif // _di_fl_conversion_dynamic_to_number_signed_
+
+/**
+ * Convert a series of positive number characters into an f_number_unsigned_t.
+ *
+ * This will stop at one of the following: a non-digit.
+ * This will ignore NULL values.
+ * This will not process signed statuses (+/-).
+ * This will detect based types as follows:
+ * - hexidecimals begin with either '0x' or '0X'.
+ * - duodecimals begin with either '0d' or '0D'.
+ * - octals begin with either '0o' or '0O'.
+ * - binaries begin with either '0b' or '0B'.
+ * - decimal is used for all other cases.
+ *
+ * Leading 0's and whitespace are ignored.
+ * Whitespace after the first digit is considered invalid.
+ *
+ * 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.
+ *
+ * @param dynamic
+ * The string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * 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_negative (with error bit) on negative value.
+ * F_number_positive (with error bit) on positive value (has a +, such as '+1', when only '1' is valid here).
+ * F_number_overflow (with error bit) on integer overflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see strtoull()
+ */
+#ifndef _di_fl_conversion_dynamic_to_number_unsigned_
+ extern f_status_t fl_conversion_dynamic_to_number_unsigned(const f_string_static_t dynamic, f_number_unsigned_t * const number);
+#endif // _di_fl_conversion_dynamic_to_number_unsigned_
#ifdef __cplusplus
} // extern "C"
extern "C" {
#endif
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_number_unsigned_)
- f_status_t private_fl_conversion_string_to_binary_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ f_status_t private_fl_conversion_dynamic_to_binary_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_binary_signed_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_binary_unsigned_)
- f_status_t private_fl_conversion_string_to_binary_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ f_status_t private_fl_conversion_dynamic_to_binary_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_binary_unsigned_)
-
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_decimal_signed_)
- f_status_t private_fl_conversion_string_to_decimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ f_status_t private_fl_conversion_dynamic_to_decimal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_decimal_signed_)
-
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_decimal_unsigned_)
- f_status_t private_fl_conversion_string_to_decimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ f_status_t private_fl_conversion_dynamic_to_decimal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_decimal_unsigned_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_duodecimal_signed_)
- f_status_t private_fl_conversion_string_to_duodecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ f_status_t private_fl_conversion_dynamic_to_duodecimal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_duodecimal_signed_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_duodecimal_unsigned_)
- f_status_t private_fl_conversion_string_to_duodecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ f_status_t private_fl_conversion_dynamic_to_duodecimal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_duodecimal_unsigned_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_hexidecimal_signed_)
- f_status_t private_fl_conversion_string_to_hexidecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ f_status_t private_fl_conversion_dynamic_to_hexidecimal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
} // for
*number = converted;
+
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_hexidecimal_signed_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_hexidecimal_unsigned_)
- f_status_t private_fl_conversion_string_to_hexidecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ f_status_t private_fl_conversion_dynamic_to_hexidecimal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
} // for
*number = converted;
+
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_hexidecimal_unsigned_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_octal_signed_)
- f_status_t private_fl_conversion_string_to_octal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number) {
-
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ f_status_t private_fl_conversion_dynamic_to_octal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_octal_signed_)
-
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_octal_unsigned_)
- f_status_t private_fl_conversion_string_to_octal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number) {
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
- if (!string[0]) {
- return F_data_not;
- }
+#if !defined(_di_fl_conversion_dynamic_partial_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ f_status_t private_fl_conversion_dynamic_to_octal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) {
uint8_t digits = 0;
uint8_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (string[i] == 0x2e) {
return F_status_set_error(F_number_decimal);
return F_none;
}
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !defined(_di_fl_conversion_string_to_octal_unsigned_)
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+
+#if !defined(_di_fl_conversion_dynamic_to_number_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_)
+ f_status_t private_fl_conversion_dynamic_to_number_signed(const f_string_t string, const f_array_length_t length, f_number_signed_t * const number) {
+
+ uint8_t width = 0;
+ f_array_length_t width_max = 0;
+ uint8_t mode = 0;
+ int8_t vector = 0; // 0 for assumed positive, 1 for explicit positive, -1 for negative.
+ f_array_length_t j = 0;
+ f_array_length_t offset = 0;
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = 0; i < length; ++i) {
+
+ width = macro_f_utf_byte_width_is(string[i]);
+
+ if (!width) {
+ if (isspace(string[i])) {
+ if (!mode && !vector) {
+ ++offset;
+
+ continue;
+ }
+
+ return F_status_set_error(F_number);
+ }
+ }
+ else {
+ if (!mode && !vector) {
+ width_max = length - i;
+
+ status = f_utf_is_whitespace(string + i, width_max);
+
+ if (status == F_true) {
+ offset = i + 1;
+
+ continue;
+ }
+
+ if (F_status_is_error(status)) {
+ if (status == F_status_set_error(F_maybe)) {
+ status = F_status_set_error(F_complete_not_utf);
+ }
+
+ return status;
+ }
+ }
+
+ return F_status_set_error(F_number);
+ }
+
+ if (string[i] == 0x30) {
+
+ // Skip past all NULLs.
+ for (j = i + 1; j < length; ++j) {
+ if (string[j]) break;
+ } // for
+
+ // Immediate next value must be either a number, 'x', 'X', 'd', 'D', 'o', 'O', 'b', or 'B'.
+ if (j >= length) {
+ *number = 0;
+ return F_none;
+ }
+ else if (string[j] > 0x2f && string[j] < 0x3a) {
+ mode = 10;
+ }
+ else if (string[j] == 0x78 || string[j] == 0x58) {
+ mode = 16;
+ offset += 2;
+ }
+ else if (string[j] == 0x44 || string[j] == 0x64) {
+ mode = 12;
+ offset += 2;
+ }
+ else if (string[j] == 0x6f || string[j] == 0x4f) {
+ mode = 8;
+ offset += 2;
+ }
+ else if (string[j] == 0x62 || string[j] == 0x42) {
+ mode = 2;
+ offset += 2;
+ }
+ else if (string[j] == 0x2e) {
+ return F_status_set_error(F_number_decimal);
+ }
+ else {
+ return F_status_set_error(F_number);
+ }
+
+ break;
+ }
+
+ // Plus sign is only allowed as the first non-whitespace character.
+ if (string[i] == 0x2b) {
+ if (!mode && !vector) {
+ vector = 1;
+ ++offset;
+ }
+ else {
+ return F_status_set_error(F_number);
+ }
+ }
+
+ // Negative sign is not allowed.
+ if (string[i] == 0x2d) {
+ if (!mode && !vector) {
+ vector = -1;
+ ++offset;
+ }
+ else {
+ return F_status_set_error(F_number);
+ }
+ }
+
+ if (f_conversion_character_is_decimal(string[i]) == F_true) {
+ mode = 10;
+ break;
+ }
+
+ return F_status_set_error(F_number);
+ } // for
+
+ if (!mode) {
+ return F_status_set_error(F_number);
+ }
+
+ if (offset >= length) {
+ return F_status_set_error(F_number);
+ }
+
+ if (mode == 10) {
+ return private_fl_conversion_dynamic_to_decimal_signed(string + offset, length - offset, vector == -1, number);
+ }
+
+ if (mode == 16) {
+ return private_fl_conversion_dynamic_to_hexidecimal_signed(string + offset, length - offset, vector == -1, number);
+ }
+
+ if (mode == 12) {
+ return private_fl_conversion_dynamic_to_duodecimal_signed(string + offset, length - offset, vector == -1, number);
+ }
+
+ if (mode == 8) {
+ return private_fl_conversion_dynamic_to_octal_signed(string + offset, length - offset, vector == -1, number);
+ }
+
+ return private_fl_conversion_dynamic_to_binary_signed(string + offset, length - offset, vector == -1, number);
+ }
+#endif // !defined(_di_fl_conversion_dynamic_to_number_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_)
+
+#if !defined(_di_fl_conversion_dynamic_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_)
+ f_status_t private_fl_conversion_dynamic_to_number_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) {
+
+ uint8_t width = 0;
+ f_array_length_t width_max = 0;
+ uint8_t mode = 0;
+ f_array_length_t j = 0;
+ f_array_length_t offset = 0;
+ f_status_t status = F_none;
+ int8_t sign_found = 0;
+
+ for (f_array_length_t i = 0; i < length; ++i) {
+
+ width = macro_f_utf_byte_width_is(string[i]);
+
+ if (!width) {
+ if (isspace(string[i])) {
+ if (!mode) {
+ ++offset;
+
+ continue;
+ }
+
+ return F_status_set_error(F_number);
+ }
+ }
+ else {
+ if (!mode) {
+ width_max = length - i;
+
+ status = f_utf_is_whitespace(string + i, width_max);
+
+ if (status == F_true) {
+ offset = i + 1;
+
+ continue;
+ }
+
+ if (F_status_is_error(status)) {
+ if (status == F_status_set_error(F_maybe)) {
+ status = F_status_set_error(F_complete_not_utf);
+ }
+
+ return status;
+ }
+ }
+
+ return F_status_set_error(F_number);
+ }
+
+ if (string[i] == 0x30) {
+
+ // Skip past all NULLs.
+ for (j = i + 1; j < length; ++j) {
+ if (string[j]) break;
+ } // for
+
+ // Immediate next value must be either a number, 'x', 'X', 'd', 'D', 'o', 'O', 'b', or 'B'.
+ if (j >= length) {
+ *number = 0;
+
+ return F_none;
+ }
+ else if (string[j] > 0x2f && string[j] < 0x3a) {
+ mode = 10;
+ }
+ else if (string[j] == 0x78 || string[j] == 0x58) {
+ mode = 16;
+ offset += 2;
+ }
+ else if (string[j] == 0x44 || string[j] == 0x64) {
+ mode = 12;
+ offset += 2;
+ }
+ else if (string[j] == 0x6f || string[j] == 0x4f) {
+ mode = 8;
+ offset += 2;
+ }
+ else if (string[j] == 0x62 || string[j] == 0x42) {
+ mode = 2;
+ offset += 2;
+ }
+ else if (string[j] == 0x2e) {
+ return F_status_set_error(F_number_decimal);
+ }
+ else {
+ return F_status_set_error(F_number);
+ }
+
+ break;
+ }
+
+ if (string[i] == 0x2b) {
+ ++offset;
+ sign_found = 1;
+ }
+
+ if (string[i] == 0x2d) {
+ ++offset;
+ sign_found = -1;
+ }
+
+ if (f_conversion_character_is_decimal(string[i]) == F_true) {
+ mode = 10;
+ break;
+ }
+
+ return F_status_set_error(F_number);
+ } // for
+
+ if (!mode) {
+ return F_status_set_error(F_number);
+ }
+
+ if (offset >= length) {
+ return F_status_set_error(F_number);
+ }
+
+ if (mode == 10) {
+ status = private_fl_conversion_dynamic_to_decimal_unsigned(string + offset, length - offset, number);
+ }
+ else if (mode == 16) {
+ status = private_fl_conversion_dynamic_to_hexidecimal_unsigned(string + offset, length - offset, number);
+ }
+ else if (mode == 12) {
+ status = private_fl_conversion_dynamic_to_duodecimal_unsigned(string + offset, length - offset, number);
+ }
+ else if (mode == 8) {
+ status = private_fl_conversion_dynamic_to_octal_unsigned(string + offset, length - offset, number);
+ }
+ else {
+ status = private_fl_conversion_dynamic_to_binary_unsigned(string + offset, length - offset, number);
+ }
+
+ // +/- signs are not allowed.
+ if (sign_found) {
+ if (status == F_none) {
+ if (sign_found == -1) {
+ return F_status_set_error(F_number_negative);
+ }
+
+ return F_status_set_error(F_number_positive);
+ }
+
+ return F_status_set_error(F_number);
+ }
+
+ return status;
+ }
+#endif // !defined(_di_fl_conversion_dynamic_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_)
#ifdef __cplusplus
} // extern "C"
#endif
/**
- * Private implementation of fl_conversion_string_to_binary_signed().
+ * Private implementation of fl_conversion_dynamic_to_binary_signed().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param location
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param negative
* Set to 0 to treat string as a positive number, 1 for as a negative number.
* @param number
* F_number_overflow (with error bit) on integer overflow.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see fl_conversion_dynamic_partial_to_binary_signed()
+ * @see fl_conversion_dynamic_partial_to_number_signed()
+ * @see fl_conversion_dynamic_to_binary_signed()
+ * @see fl_conversion_dynamic_to_number_signed()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_binary_signed_)
- extern f_status_t private_fl_conversion_string_to_binary_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_binary_signed_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ extern f_status_t private_fl_conversion_dynamic_to_binary_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_binary_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
/**
- * Private implementation of fl_conversion_string_to_binary_unsigned().
+ * Private implementation of fl_conversion_dynamic_to_binary_unsigned().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param number
* This will store the value of the converted string.
* This value is only changed on success.
* 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.
+ *
+ * @see fl_conversion_dynamic_partial_to_binary_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
+ * @see fl_conversion_dynamic_to_binary_unsigned()
+ * @see fl_conversion_dynamic_to_number_unsigned()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_binary_unsigned_)
- extern f_status_t private_fl_conversion_string_to_binary_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_binary_unsigned_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ extern f_status_t private_fl_conversion_dynamic_to_binary_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_binary_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
/**
- * Private implementation of fl_conversion_string_to_decimal_signed().
+ * Private implementation of fl_conversion_dynamic_to_decimal_signed().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param negative
* Set to 0 to treat string as a positive number, 1 for as a negative number.
* @param number
* F_number_overflow (with error bit) on integer overflow.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see fl_conversion_dynamic_partial_to_decimal_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
+ * @see fl_conversion_dynamic_to_decimal_unsigned()
+ * @see fl_conversion_dynamic_to_number_unsigned()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_decimal_signed_)
- extern f_status_t private_fl_conversion_string_to_decimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_decimal_signed_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ extern f_status_t private_fl_conversion_dynamic_to_decimal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_decimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
/**
- * Private implementation of fl_conversion_string_to_decimal_unsigned().
+ * Private implementation of fl_conversion_dynamic_to_decimal_unsigned().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param number
* This will store the value of the converted string.
* This value is only changed on success.
* 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.
+ *
+ * @see fl_conversion_dynamic_partial_to_decimal_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
+ * @see fl_conversion_dynamic_to_decimal_unsigned()
+ * @see fl_conversion_dynamic_to_number_unsigned()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_decimal_unsigned_)
- extern f_status_t private_fl_conversion_string_to_decimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_decimal_unsigned_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ extern f_status_t private_fl_conversion_dynamic_to_decimal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_decimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
/**
- * Private implementation of fl_conversion_string_to_duodecimal_signed().
+ * Private implementation of fl_conversion_dynamic_to_duodecimal_signed().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param negative
* Set to 0 to treat string as a positive number, 1 for as a negative number.
* @param number
* F_number_overflow (with error bit) on integer overflow.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see fl_conversion_dynamic_partial_to_duodecimal_signed()
+ * @see fl_conversion_dynamic_partial_to_number_signed()
+ * @see fl_conversion_dynamic_to_duodecimal_signed()
+ * @see fl_conversion_dynamic_to_number_signed()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_duodecimal_signed_)
- extern f_status_t private_fl_conversion_string_to_duodecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_duodecimal_signed_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ extern f_status_t private_fl_conversion_dynamic_to_duodecimal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
/**
- * Private implementation of fl_conversion_string_to_duodecimal_unsigned().
+ * Private implementation of fl_conversion_dynamic_to_duodecimal_unsigned().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param number
* This will store the value of the converted string.
* This value is only changed on success.
* 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.
+ *
+ * @see fl_conversion_dynamic_partial_to_duodecimal_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
+ * @see fl_conversion_dynamic_to_duodecimal_unsigned()
+ * @see fl_conversion_dynamic_to_number_unsigned()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_duodecimal_unsigned_)
- extern f_status_t private_fl_conversion_string_to_duodecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_duodecimal_unsigned_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ extern f_status_t private_fl_conversion_dynamic_to_duodecimal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_duodecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
/**
- * Private implementation of fl_conversion_string_to_hexidecimal_signed().
+ * Private implementation of fl_conversion_dynamic_to_hexidecimal_signed().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param negative
* Set to 0 to treat string as a positive number, 1 for as a negative number.
* @param number
* F_number_overflow (with error bit) on integer overflow.
* F_number_underflow (with error bit) on integer underflow.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see fl_conversion_dynamic_partial_to_hexidecimal_signed()
+ * @see fl_conversion_dynamic_partial_to_number_signed()
+ * @see fl_conversion_dynamic_to_hexidecimal_signed()
+ * @see fl_conversion_dynamic_to_number_signed()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_hexidecimal_signed_)
- extern f_status_t private_fl_conversion_string_to_hexidecimal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_hexidecimal_signed_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ extern f_status_t private_fl_conversion_dynamic_to_hexidecimal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
/**
- * Private implementation of fl_conversion_string_to_hexidecimal_unsigned().
+ * Private implementation of fl_conversion_dynamic_to_hexidecimal_unsigned().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param number
* This will store the value of the converted string.
* This value is only changed on success.
* 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.
+ *
+ * @see fl_conversion_dynamic_partial_to_hexidecimal_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
+ * @see fl_conversion_dynamic_to_hexidecimal_unsigned()
+ * @see fl_conversion_dynamic_to_number_unsigned()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_hexidecimal_unsigned_)
- extern f_status_t private_fl_conversion_string_to_hexidecimal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_hexidecimal_unsigned_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ extern f_status_t private_fl_conversion_dynamic_to_hexidecimal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_hexidecimal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
/**
- * Private implementation of fl_conversion_string_to_octal_signed().
+ * Private implementation of fl_conversion_dynamic_to_octal_signed().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param negative
* Set to 0 to treat string as a positive number, 1 for as a negative number.
* @param 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.
+ *
+ * @see fl_conversion_dynamic_partial_to_octal_signed()
+ * @see fl_conversion_dynamic_partial_to_number_signed()
+ * @see fl_conversion_dynamic_to_octal_signed()
+ * @see fl_conversion_dynamic_to_number_signed()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_octal_signed_)
- extern f_status_t private_fl_conversion_string_to_octal_signed(const f_string_t string, const f_string_range_t range, const bool negative, f_number_signed_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_octal_signed_)
+#if !defined(_di_fl_conversion_dynamic_partial_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
+ extern f_status_t private_fl_conversion_dynamic_to_octal_signed(const f_string_t string, const f_array_length_t length, const bool negative, f_number_signed_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_) || !defined(_di_fl_conversion_dynamic_to_octal_signed_) || !defined(_di_fl_conversion_dynamic_to_number_signed_)
/**
- * Private implementation of fl_conversion_string_to_octal_unsigned().
+ * Private implementation of fl_conversion_dynamic_to_octal_unsigned().
*
* Intended to be shared to each of the different implementation variations.
*
* @param string
* The string to convert.
- * @param range
- * The start/stop range to convert.
+ * @param length
+ * The length of the string to convert.
* @param number
* This will store the value of the converted string.
* This value is only changed on success.
* 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.
+ *
+ * @see fl_conversion_dynamic_partial_to_octal_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
+ * @see fl_conversion_dynamic_to_octal_unsigned()
+ * @see fl_conversion_dynamic_to_number_unsigned()
+ */
+#if !defined(_di_fl_conversion_dynamic_partial_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+ extern f_status_t private_fl_conversion_dynamic_to_octal_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_partial_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_to_octal_unsigned_) || !defined(_di_fl_conversion_dynamic_to_number_unsigned_)
+
+/**
+ * Private implementation of fl_conversion_dynamic_to_number_signed().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param string
+ * The string to convert.
+ * @param length
+ * The length of the string to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * 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_number_underflow (with error bit) on integer underflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#if !defined(_di_fl_conversion_dynamic_to_number_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_)
+ extern f_status_t private_fl_conversion_dynamic_to_number_signed(const f_string_t string, const f_array_length_t length, f_number_signed_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_to_number_signed_) || !defined(_di_fl_conversion_dynamic_partial_to_number_signed_)
+
+/**
+ * Private implementation of fl_conversion_dynamic_to_number_unsigned().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param string
+ * The string to convert.
+ * @param range
+ * The start/stop range to convert.
+ * @param number
+ * This will store the value of the converted string.
+ * This value is only changed on success.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if string starts with a null (length is 0).
+ *
+ * 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_negative (with error bit) on negative value.
+ * F_number_positive (with error bit) on positive value (has a +, such as '+1', when only '1' is valid here).
+ * F_number_overflow (with error bit) on integer overflow.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see strtoull()
*/
-#if !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_octal_unsigned_)
- extern f_status_t private_fl_conversion_string_to_octal_unsigned(const f_string_t string, const f_string_range_t range, f_number_unsigned_t *number);
-#endif // !defined(_di_fl_conversion_string_to_binary_signed_) || !defined(_di_fl_conversion_string_to_number_signed_) || !(_di_fl_conversion_string_to_octal_unsigned_)
+#if !defined(_di_fl_conversion_dynamic_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_)
+ extern f_status_t private_fl_conversion_dynamic_to_number_unsigned(const f_string_t string, const f_array_length_t length, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_conversion_dynamic_to_number_unsigned_) || !defined(_di_fl_conversion_dynamic_partial_to_number_unsigned_)
#ifdef __cplusplus
} // extern "C"
#ifndef _FL_execute_h
#define _FL_execute_h
-// include pre-requirements
+// Include pre-requirements.
#define _GNU_SOURCE
// Libc includes.
#ifndef _FLL_execute_h
#define _FLL_execute_h
-// include pre-requirements
+// Include pre-requirements.
#define _GNU_SOURCE
// Libc includes.
if (main->parameters.array[byte_dump_parameter_width_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[byte_dump_parameter_width_e].values.array[main->parameters.array[byte_dump_parameter_width_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
-
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(argv[index], &number);
if (F_status_is_error(status) || number < 1 || number >= 0xfb) {
flockfile(main->error.to.stream);
if (main->parameters.array[byte_dump_parameter_first_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[byte_dump_parameter_first_e].values.array[main->parameters.array[byte_dump_parameter_first_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
-
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(argv[index], &number);
if (F_status_is_error(status) || number > F_number_t_size_unsigned_d) {
flockfile(main->error.to.stream);
if (main->parameters.array[byte_dump_parameter_last_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[byte_dump_parameter_last_e].values.array[main->parameters.array[byte_dump_parameter_last_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
-
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(argv[index], &number);
if (F_status_is_error(status) || number < 0 || number > F_number_t_size_unsigned_d) {
flockfile(main->error.to.stream);
if (!isspace(pid_buffer.string[range.stop])) break;
} // for
- status = fl_conversion_string_to_decimal_unsigned(pid_buffer.string, range, &number);
+ status = fl_conversion_dynamic_partial_to_decimal_unsigned(pid_buffer, range, &number);
if (F_status_is_error_not(status) && number == pid) {
status = f_file_remove(path);
if (!isspace(pid_buffer.string[range.stop])) break;
} // for
- status = fl_conversion_string_to_decimal_unsigned(pid_buffer.string, range, &number);
+ status = fl_conversion_dynamic_partial_to_decimal_unsigned(pid_buffer, range, &number);
if (F_status_is_error_not(status)) {
*pid = (pid_t) number;
f_number_unsigned_t number = 0;
- f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, range, &number);
+ f_status_t status = fl_conversion_dynamic_partial_to_number_unsigned(buffer, range, &number);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_number) {
f_number_unsigned_t number = 0;
- f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, range, &number);
+ f_status_t status = fl_conversion_dynamic_partial_to_number_unsigned(buffer, range, &number);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_number) {
* Errors (with error bit) from: f_file_stream_close().
* Errors (with error bit) from: f_file_stream_open().
* Errors (with error bit) from: f_file_stream_read().
- * Errors (with error bit) from: fl_conversion_string_to_decimal_unsigned()
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_decimal_unsigned()
*/
#ifndef _di_controller_file_pid_delete_
f_status_t controller_file_pid_delete(const pid_t pid, const f_string_static_t path) F_attribute_visibility_internal_d;
* Errors (with error bit) from: f_file_stream_close().
* Errors (with error bit) from: f_file_stream_open().
* Errors (with error bit) from: f_file_stream_read().
- * Errors (with error bit) from: fl_conversion_string_to_decimal_unsigned()
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_decimal_unsigned()
*/
#ifndef _di_controller_file_pid_read_
f_status_t controller_file_pid_read(const f_string_static_t path, pid_t * const pid) F_attribute_visibility_internal_d;
* F_number_too_large (with error bit) if the given ID is too large.
*
* Errors (with error bit) from: f_account_id_by_name().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* @see f_account_id_by_name()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*/
#ifndef _di_controller_get_id_user_
f_status_t controller_get_id_user(const f_string_static_t buffer, const f_string_range_t range, controller_cache_t * const cache, uid_t * const id) F_attribute_visibility_internal_d;
* F_number_too_large (with error bit) if the given ID is too large.
*
* Errors (with error bit) from: f_account_group_id_by_name().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* @see f_account_group_id_by_name()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*/
#ifndef _di_controller_get_id_group_
f_status_t controller_get_id_group(const f_string_static_t buffer, const f_string_range_t range, controller_cache_t * const cache, gid_t * const id) F_attribute_visibility_internal_d;
}
if (action->status == F_none) {
- const f_string_range_t range = macro_f_string_range_t_initialize(action->parameters.array[1].used);
-
- status = fl_conversion_string_to_number_unsigned(action->parameters.array[1].string, range, &action->number);
+ status = fl_conversion_dynamic_to_number_unsigned(action->parameters.array[1], &action->number);
if (F_status_is_error(status) || status == F_data_not) {
action->number = 0;
}
if (F_status_set_fine(status) == F_memory_not) {
- controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, global.thread);
+ controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, global.thread);
status_action = status;
+
break;
}
status = F_status_set_error(F_valid_not);
}
else {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, cache->content_action.array[++(*index)], &parsed);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, cache->content_action.array[++(*index)], &parsed);
if (F_status_set_fine(status) == F_number_positive) {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, controller_range_after_number_sign(cache->buffer_item, cache->content_action.array[*index]), &parsed);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, controller_range_after_number_sign(cache->buffer_item, cache->content_action.array[*index]), &parsed);
}
if (status == F_data_not) {
break;
}
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, cache->content_actions.array[i].array[j], &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, cache->content_actions.array[i].array[j], &number);
if (F_status_set_fine(status) == F_number_positive) {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[j]), &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[j]), &number);
// Restore error on parameter problem.
if (F_status_set_fine(status) == F_parameter) {
}
}
else {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "fl_conversion_string_to_number_signed", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_signed", F_true, F_false);
status = F_status_set_error(status);
for (j = 1; j < 3; ++j, number = 0) {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, cache->content_actions.array[i].array[j], &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, cache->content_actions.array[i].array[j], &number);
if (F_status_set_fine(status) == F_number_positive) {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[j]), &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[j]), &number);
// Restore error on parameter problem.
if (F_status_set_fine(status) == F_parameter) {
}
}
else {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "fl_conversion_string_to_number_signed", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_signed", F_true, F_false);
status = F_status_set_error(status);
f_number_signed_t number = 0;
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, cache->content_actions.array[i].array[1], &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, cache->content_actions.array[i].array[1], &number);
if (F_status_set_fine(status) == F_number_positive) {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[1]), &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[1]), &number);
// Restore error on parameter problem.
if (F_status_set_fine(status) == F_parameter) {
}
}
else {
- controller_rule_print_error(global.thread, global.main->error, cache->action, status, "fl_conversion_string_to_number_signed", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, status, "fl_conversion_dynamic_partial_to_number_signed", F_true, F_false);
status = F_status_set_error(status);
if (F_status_is_error_not(status_return)) {
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(cache->buffer_item.string, cache->content_actions.array[i].array[1], &number);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(cache->buffer_item, cache->content_actions.array[i].array[1], &number);
if (F_status_set_fine(status) == F_number_positive) {
- status = fl_conversion_string_to_number_unsigned(cache->buffer_item.string, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[1]), &number);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(cache->buffer_item, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[1]), &number);
// Restore error on parameter problem.
if (F_status_set_fine(status) == F_parameter) {
cache->action.line_action = ++cache->action.line_item;
- controller_rule_print_error(global.thread, global.main->error, cache->action, status, "fl_conversion_string_to_number_signed", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, status, "fl_conversion_dynamic_partial_to_number_signed", F_true, F_false);
}
if (F_status_is_error_not(status_return)) {
else if (type == controller_rule_setting_type_nice_e) {
f_number_signed_t number = 0;
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, cache->content_actions.array[i].array[0], &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, cache->content_actions.array[i].array[0], &number);
if (F_status_set_fine(status) == F_number_positive) {
- status = fl_conversion_string_to_number_signed(cache->buffer_item.string, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[0]), &number);
+ status = fl_conversion_dynamic_partial_to_number_signed(cache->buffer_item, controller_range_after_number_sign(cache->buffer_item, cache->content_actions.array[i].array[0]), &number);
// Restore error on parameter problem.
if (F_status_set_fine(status) == F_parameter) {
}
}
else {
- controller_rule_print_error(global.thread, global.main->error, cache->action, status, "fl_conversion_string_to_number_signed", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, status, "fl_conversion_dynamic_partial_to_number_signed", F_true, F_false);
status = F_status_set_error(status);
if (F_status_is_error_not(status_return)) {
*
* F_valid_not (with error bit) on failure due to invalid value.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_signed().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_signed().
*
* @see controller_rule_action_read()
- * @see fl_conversion_string_to_number_signed()
+ * @see fl_conversion_dynamic_partial_to_number_signed()
*/
#ifndef _di_controller_rule_action_read_rerun_number_
extern f_status_t controller_rule_action_read_rerun_number(const controller_global_t global, const f_string_t name, controller_cache_t * const cache, f_array_length_t * const index, f_number_unsigned_t * const number) F_attribute_visibility_internal_d;
status = F_status_set_error(F_failure);
}
else {
- status = fl_conversion_string_to_number_unsigned(arguments.array[i].string, range, &number_left);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(arguments.array[i], range, &number_left);
}
if (F_status_is_error_not(status)) {
status = F_status_set_error(F_failure);
}
else {
- status = fl_conversion_string_to_number_unsigned(arguments.array[i].string, range, &number_right);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(arguments.array[i], range, &number_right);
}
}
else {
* @return
* F_none on success.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*/
#ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_
extern f_status_t fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, const f_string_dynamics_t arguments, fake_state_process_t *state_process) F_attribute_visibility_internal_d;
status_number = F_status_set_error(F_failure);
}
else {
- status_number = fl_conversion_string_to_number_unsigned(arguments.array[i].string, range, &number);
+ status_number = fl_conversion_dynamic_partial_to_number_unsigned(arguments.array[i], range, &number);
}
}
else {
#ifndef _di_fake_make_get_id_group_
f_status_t fake_make_get_id_group(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, gid_t *id) {
- const f_string_range_t range = macro_f_string_range_t_initialize(buffer.used);
-
f_number_unsigned_t number = 0;
- f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, range, &number);
+ f_status_t status = fl_conversion_dynamic_to_number_unsigned(buffer, &number);
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
return F_none;
}
- fll_error_print(print, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true);
+ fll_error_print(print, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true);
return F_status_set_error(status);
}
else if (number > F_type_size_32_unsigned_d) {
#ifndef _di_fake_make_get_id_owner_
f_status_t fake_make_get_id_owner(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, uid_t *id) {
- const f_string_range_t range = macro_f_string_range_t_initialize(buffer.used);
-
f_number_unsigned_t number = 0;
- f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, range, &number);
+ f_status_t status = fl_conversion_dynamic_to_number_unsigned(buffer, &number);
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
return F_none;
}
- fll_error_print(print, status, "fl_conversion_string_to_number_unsigned", F_true);
+ fll_error_print(print, status, "fl_conversion_dynamic_to_number_unsigned", F_true);
return F_status_set_error(status);
}
else if (number > F_type_size_32_unsigned_d) {
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(data.argv[index], range, &data.delimit_depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_list_read_long_delimit_s, data.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_basic_list_read_long_delimit_s, data.argv[index]);
break;
}
else {
position_depth = main->parameters.array[fss_basic_list_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[position_depth], &data->depths.array[i].depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_list_read_long_depth_s, data->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_basic_list_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_basic_list_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[data->depths.array[i].index_at], &data->depths.array[i].value_at);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_list_read_long_at_s, data->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_basic_list_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
+ const f_status_t status = fl_conversion_dynamic_to_number_unsigned(data->argv[index], number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: fl_string_rip().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* Errors (with error bit) from: fss_basic_list_read_depths_resize().
*
* @see f_string_append()
* @see fl_string_rip()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_basic_list_read_depths_resize()
*/
* F_true on success and the parameter was found (and is valid).
* F_false on success and the parameter was not found.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_basic_list_read_depths_resize()
*/
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(data.argv[index], range, &data.delimit_depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_delimit_s, data.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_basic_read_long_delimit_s, data.argv[index]);
break;
}
else {
position_depth = main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[position_depth], &data->depths.array[i].depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_depth_s, data->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_basic_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[data->depths.array[i].index_at], &data->depths.array[i].value_at);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_at_s, data->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_basic_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
+ const f_status_t status = fl_conversion_dynamic_to_number_unsigned(data->argv[index], number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: fl_string_rip().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* Errors (with error bit) from: fss_basic_read_depths_resize().
*
* @see f_string_append()
* @see fl_string_rip()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_basic_read_depths_resize()
*/
* F_true on success and the parameter was found (and is valid).
* F_false on success and the parameter was not found.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_basic_read_depths_resize()
*/
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &main->delimit_depth);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(argv[index], range, &main->delimit_depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_delimit_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_embedded_list_read_long_delimit_s, argv[index]);
}
}
}
}
if (values_type[i] == fss_embedded_list_read_parameter_depth_e || values_type[i] == fss_embedded_list_read_parameter_at_e) {
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[values_order[i]].used);
-
- status = fl_conversion_string_to_number_unsigned(argv[values_order[i]].string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(argv[values_order[i]], &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_depth_s, argv[values_order[i]]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_embedded_list_read_long_depth_s, argv[values_order[i]]);
return status;
}
if (main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_select_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_select_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, &select);
+ status = fl_conversion_dynamic_to_number_unsigned(main->parameters.arguments.array[index], &select);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_select_s, main->parameters.arguments.array[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_embedded_list_read_long_select_s, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_line_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_line_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, &line);
+ status = fl_conversion_dynamic_to_number_unsigned(main->parameters.arguments.array[index], &line);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_line_s, main->parameters.arguments.array[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_embedded_list_read_long_line_s, main->parameters.arguments.array[index]);
return status;
}
range.start = 1;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(argv[index], range, &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_write_long_ignore_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_embedded_list_write_long_ignore_s, argv[index]);
return status;
}
range.start = 1;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(argv[index], range, &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_write_long_ignore_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_embedded_list_write_long_ignore_s, argv[index]);
return status;
}
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(data.argv[index], range, &data.delimit_depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_delimit_s, data.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_extended_list_read_long_delimit_s, data.argv[index]);
break;
}
else {
position_depth = main->parameters.array[fss_extended_list_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[position_depth], &data->depths.array[i].depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_depth_s, data->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_extended_list_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_extended_list_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[data->depths.array[i].index_at], &data->depths.array[i].value_at);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_at_s, data->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_extended_list_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
+ const f_status_t status = fl_conversion_dynamic_to_number_unsigned(data->argv[index], number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: fl_string_rip().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* Errors (with error bit) from: fss_extended_list_read_depths_resize().
*
* @see f_string_append()
* @see fl_string_rip()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_extended_list_read_depths_resize()
*/
* F_true on success and the parameter was found (and is valid).
* F_false on success and the parameter was not found.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_extended_list_read_depths_resize()
*/
range.start = 1;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(argv[index], range, &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_write_long_ignore_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_extended_list_write_long_ignore_s, argv[index]);
return status;
}
range.start = 1;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(argv[index], range, &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_write_long_ignore_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_extended_list_write_long_ignore_s, argv[index]);
return status;
}
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(data.argv[index], range, &data.delimit_depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_delimit_s, data.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_extended_read_long_delimit_s, data.argv[index]);
break;
}
else {
position_depth = main->parameters.array[fss_extended_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[position_depth], &data->depths.array[i].depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_depth_s, data->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_extended_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_extended_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[data->depths.array[i].index_at], &data->depths.array[i].value_at);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_at_s, data->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_extended_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
+ const f_status_t status = fl_conversion_dynamic_to_number_unsigned(data->argv[index], number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: fl_string_rip().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* Errors (with error bit) from: fss_extended_read_depths_resize().
*
* @see f_string_append()
* @see fl_string_rip()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_extended_read_depths_resize()
*/
* F_true on success and the parameter was found (and is valid).
* F_false on success and the parameter was not found.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_extended_read_depths_resize()
*/
}
else if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_identify_parameter_line_e].values.array[main->parameters.array[fss_identify_parameter_line_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(data.argv[index].used);
- status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.line);
+ status = fl_conversion_dynamic_to_number_unsigned(data.argv[index], &data.line);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, data.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_identify_long_line_s, data.argv[index]);
}
}
}
} // for
{
- const f_status_t status = fl_conversion_string_to_hexidecimal_unsigned(data->name.string, range, &number);
+ const f_status_t status = fl_conversion_dynamic_partial_to_hexidecimal_unsigned(data->name, range, &number);
if (F_status_is_error(status)) return status;
}
* F_true on match.
* F_false on no match.
*
- * Errors (with error bit) from fl_conversion_string_to_hexidecimal_unsigned().
+ * Errors (with error bit) from fl_conversion_dynamic_partial_to_hexidecimal_unsigned().
* Errors (with error bit) from fl_string_dynamic_compare_string().
*
- * @see fl_conversion_string_to_hexidecimal_unsigned()
+ * @see fl_conversion_dynamic_partial_to_hexidecimal_unsigned()
* @see fl_string_dynamic_compare_string()
*/
#ifndef _di_fss_identify_process_name_compare_
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_dynamic_partial_to_number_unsigned(data.argv[index], range, &data.delimit_depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_delimit_s, data.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_number_unsigned", F_true, fss_payload_read_long_delimit_s, data.argv[index]);
break;
}
else {
position_depth = main->parameters.array[fss_payload_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[position_depth], &data->depths.array[i].depth);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_depth_s, data->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_payload_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_payload_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
-
- status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_dynamic_to_number_unsigned(data->argv[data->depths.array[i].index_at], &data->depths.array[i].value_at);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_at_s, data->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, fss_payload_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
+ const f_status_t status = fl_conversion_dynamic_to_number_unsigned(data->argv[index], number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: fl_string_rip().
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
* Errors (with error bit) from: fss_payload_read_depths_resize().
*
* @see f_string_append()
* @see fl_string_rip()
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_payload_read_depths_resize()
*/
* F_true on success and the parameter was found (and is valid).
* F_false on success and the parameter was not found.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: fl_conversion_dynamic_partial_to_number_unsigned().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * @see fl_conversion_dynamic_partial_to_number_unsigned()
*
* @see fss_payload_read_depths_resize()
*/
f_status_t status = F_none;
{
- const f_string_range_t range = macro_f_string_range_t_initialize(value.used);
-
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(value.string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(value, &number);
if (status == F_none) {
fl_print_format("%[invalid name%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
#ifndef _di_fss_status_code_convert_number_
f_status_t fss_status_code_convert_number(fll_program_data_t * const main, const f_string_static_t value, f_number_unsigned_t *number) {
- const f_string_range_t range = macro_f_string_range_t_initialize(value.used);
-
- f_status_t status = fl_conversion_string_to_number_unsigned(value.string, range, number);
+ f_status_t status = fl_conversion_dynamic_to_number_unsigned(value, number);
if (*number > F_status_size_max_with_signal) {
fl_print_format("%[out of range%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
}
else if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[iki_read_parameter_at_e].values.array[main->parameters.array[iki_read_parameter_at_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(argv[index], &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, iki_read_long_at_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, iki_read_long_at_s, argv[index]);
status = F_status_set_error(F_parameter);
}
}
else if (main->parameters.array[iki_read_parameter_line_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[iki_read_parameter_line_e].values.array[main->parameters.array[iki_read_parameter_line_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(argv[index], &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, iki_read_long_line_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_dynamic_to_number_unsigned", F_true, iki_read_long_line_s, argv[index]);
status = F_status_set_error(F_parameter);
}
f_status_t status = F_none;
{
- const f_string_range_t range = macro_f_string_range_t_initialize(value.used);
-
f_number_unsigned_t number = 0;
- status = fl_conversion_string_to_number_unsigned(value.string, range, &number);
+ status = fl_conversion_dynamic_to_number_unsigned(value, &number);
if (status == F_none) {
fl_print_format("%[invalid name%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
#ifndef _di_status_code_convert_number_
f_status_t status_code_convert_number(fll_program_data_t * const main, const f_string_static_t value, f_number_unsigned_t *number) {
- const f_string_range_t range = macro_f_string_range_t_initialize(value.used);
-
- f_status_t status = fl_conversion_string_to_number_unsigned(value.string, range, number);
+ f_status_t status = fl_conversion_dynamic_to_number_unsigned(value, number);
if (*number > F_status_size_max_with_signal) {
fl_print_format("%[out of range%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);