This implements the double support as a wrapper to the printf() functionality.
Future versions will ideally impliment this internally.
I observed that there is some incorrect logic with the "width" and the "precision".
The logic appears to be asserting that they are XOR to each other.
In actuality they are OR to each other and both can be provided.
Rename "output" to "stream".
This seems slightly more accurate to me.
I considered using "file" but that is heavily used by the f_file_t rather than the FILE *.
#ifndef _di_f_conversion_data_t_
typedef struct {
uint8_t base;
- uint8_t flag;
+ uint16_t flag;
int width;
} f_conversion_data_t;
* Define flags used by f_conversion_data_t.
*
* f_conversion_data_flag_*:
- * - align_left: Use left-justification.
- * - base_prepend: Prepend the base character, such as "0x", or "0X", defaulting to lowercase (this includes base 10) (does nothing for unsupported base units).
- * - base_upper: Any alphabet characters in the number are made uppercase rather than lowercase and when *_base_prepend flag is used, use uppercase in the base prepend.
- * - sign_always: Always show the signs ("+" or "-").
- * - sign_pad: If the sign is not to be shown, then add a space as a placeholder (ignored when *_sign_always is used).
- * - zeros_leading: If the number has fewer digits that specified in the padding, then display leading zeros to fill the pad length.
+ * - align_left: Use left-justification.
+ * - base_prepend: Prepend the base character, such as "0x", or "0X", defaulting to lowercase (this includes base 10) (does nothing for unsupported base units).
+ * - base_upper: Any alphabet characters in the number are made uppercase rather than lowercase and when *_base_prepend flag is used, use uppercase in the base prepend.
+ * - exponent: Use exponent rather than decimal for printing double values.
+ * - exponent_either: Use either exponent or decimila for printing double values.
+ * - exponent_upper: When using exponent, display the exponent 'e' as uppercase 'E'.
+ * - sign_always: Always show the signs ("+" or "-").
+ * - sign_pad: If the sign is not to be shown, then add a space as a placeholder (ignored when *_sign_always is used).
+ * - zeros_leading: If the number has fewer digits that specified in the padding, then display leading zeros to fill the pad length.
*
* Supported base prepend base units:
* - base 2: 0b, 0B.
* - base 16: 0x, 0X.
*/
#ifndef _di_f_conversion_data_flag_
- #define F_conversion_data_flag_align_left_d 0x1
- #define F_conversion_data_flag_base_prepend_d 0x2
- #define F_conversion_data_flag_base_upper_d 0x4
- #define F_conversion_data_flag_sign_always_d 0x8
- #define F_conversion_data_flag_sign_pad_d 0x10
- #define F_conversion_data_flag_zeros_leading_d 0x20
+ #define F_conversion_data_flag_align_left_d 0x1
+ #define F_conversion_data_flag_base_prepend_d 0x2
+ #define F_conversion_data_flag_base_upper_d 0x4
+ #define F_conversion_data_flag_exponent_d 0x8
+ #define F_conversion_data_flag_exponent_either_d 0x10
+ #define F_conversion_data_flag_exponent_upper_d 0x20
+ #define F_conversion_data_flag_sign_always_d 0x40
+ #define F_conversion_data_flag_sign_pad_d 0x80
+ #define F_conversion_data_flag_zeros_leading_d 0x100
#endif // _di_f_conversion_data_flag_
#ifdef __cplusplus
* Provide basic format flags.
*
* f_print_format_flag_*:
- * - align_left: "-", Use left-justification.
- * - convert: "#", Use alternate form conversion (prefixing 0b/0B, 0o/0O, 0t/0T, 0d/0D, 0x/0X).
- * - ignore_index: ";", Ignore characters in the given positions from a f_array_length_t (only applies to static/dynamic string arguments but not character arguments).
- * - ignore_range: ":", Ignore characters in the given ranges from a f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
- * - precision: Designates that a precision is in use.
- * - range: "/", Print only the given range of a string, specified by f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
- * - sign_always: "+", Always show the signs (+ or -).
- * - sign_pad: " ", Add a space where a sign would be if the sign is not displayed.
- * - trim: "=", Trim leading and trailing whitespaces (only applies to static/dynamic string arguments but not character arguments).
- * - uppercase: Display any base units as uppercase.
- * - width: Designates that a width is in use.
- * - zeros_leading: "0", Use leading zeros.
+ * - align_left: "-", Use left-justification.
+ * - convert: "#", Use alternate form conversion (prefixing 0b/0B, 0o/0O, 0t/0T, 0d/0D, 0x/0X). @fixme this might not be needed given that there are explicit base conversion support.
+ * - exponent: Use exponent rather than decimal for printing double values.
+ * - exponent_either: Use either exponent or decimila for printing double values.
+ * - exponent_upper: When using exponent, display the exponent 'e' as uppercase 'E'.
+ * - ignore_index: ";", Ignore characters in the given positions from a f_array_length_t (only applies to static/dynamic string arguments but not character arguments).
+ * - ignore_range: ":", Ignore characters in the given ranges from a f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
+ * - precision: ".*", Designates that a precision is in use.
+ * - precision_value: Designates that a precision is specified in the function value (parameter).
+ * - range: "/", Print only the given range of a string, specified by f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
+ * - sign_always: "+", Always show the signs (+ or -).
+ * - sign_pad: " ", Add a space where a sign would be if the sign is not displayed.
+ * - trim: "=", Trim leading and trailing whitespaces (only applies to static/dynamic string arguments but not character arguments).
+ * - uppercase: Display any base units as uppercase.
+ * - width: Designates that a width is in use.
+ * - width_value: "*", Designates that a width is specified in the function value (parameter).
+ * - zeros_leading: "0", Use leading zeros.
*
* @see fprintf()
*/
#ifndef _di_f_print_format_flag_
- #define F_print_format_flag_align_left_d 0x1
- #define F_print_format_flag_convert_d 0x2
- #define F_print_format_flag_ignore_index_d 0x4
- #define F_print_format_flag_ignore_range_d 0x8
- #define F_print_format_flag_precision_d 0x10
- #define F_print_format_flag_range_d 0x20
- #define F_print_format_flag_sign_always_d 0x40
- #define F_print_format_flag_sign_pad_d 0x80
- #define F_print_format_flag_trim_d 0x100
- #define F_print_format_flag_uppercase_d 0x200
- #define F_print_format_flag_width_d 0x400
- #define F_print_format_flag_zeros_leading_d 0x800
+ #define F_print_format_flag_align_left_d 0x1
+ #define F_print_format_flag_convert_d 0x2
+ #define F_print_format_flag_exponent_d 0x4
+ #define F_print_format_flag_exponent_either_d 0x8
+ #define F_print_format_flag_exponent_upper_d 0x10
+ #define F_print_format_flag_ignore_index_d 0x20
+ #define F_print_format_flag_ignore_range_d 0x40
+ #define F_print_format_flag_precision_d 0x80
+ #define F_print_format_flag_precision_value_d 0x100
+ #define F_print_format_flag_range_d 0x200
+ #define F_print_format_flag_sign_always_d 0x40
+ #define F_print_format_flag_sign_pad_d 0x800
+ #define F_print_format_flag_trim_d 0x1000
+ #define F_print_format_flag_uppercase_d 0x2000
+ #define F_print_format_flag_width_d 0x4000
+ #define F_print_format_flag_width_value_d 0x8000
+ #define F_print_format_flag_zeros_leading_d 0x10000
#endif // _di_f_print_format_flags_
/**
* Provide type format flags.
*
- * @todo float and double support will likely be something like: "%d", "%dl", and "%dll" for float, double, and long double, respectively.
- * @todo there may be support in the future for min/max type sizes, such that "%n" = min, "%m" = max, and "%niii" = min int8_t.
+ * @todo There may be support in the future for min/max type sizes, such that "%n" = min, "%m" = max, and "%niii" = min int8_t.
*
* f_print_format_type_*:
- * - character: "c", Type is a 1-byte unsigned character.
- * - character_safe: "C", Type is a 1-byte unsigned character, where control characters and invalid UTF-8 are replaced.
- * - color_after: "]", Type is a f_color_set_t such that the f_color_set_t.after is used.
- * - color_before: "[", Type is a f_color_set_t such that the f_color_set_t.begin is used.
- * - signed_8: "iii", "III", Type is a int8_t digit.
- * - signed_16: "ii", "II", Type is a int16_t digit.
- * - signed_32: "i", "I", Type is a int32_t digit.
- * - signed_64: "il", "IL", Type is a signed int64_t digit.
- * - signed_128: "ill", "ILL", Type is a f_int_128_t digit.
- * - number: "in", "IN", Type is a f_number_signed_t digit.
- * - size: "z", "Z", Type is a size_t digit.
- * - string: "s", Type is a NULL terminated string, where the string is printed as-is.
- * - string_safe: "S", Type is a NULL terminated string, where control characters and other problems are handled.
- * - string_static: "q", Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed).
- * - string_static_raw: "r", Type is a f_string_static_t or f_string_dynamic_t and NULLs (and all other control characters) are printed.
- * - string_static_safe: "Q", Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, where control characters and other problems are handled.
- * - string_static_safe_raw: "R", Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, where control characters and other problems are handled.
- * - unsigned_8: "uii", "UII", Type is a uint8_t digit.
- * - unsigned_16: "ui", "UI", Type is a uint16_t digit.
- * - unsigned_32: "u", "U", Type is a uint32_t digit.
- * - unsigned_64: "ul", "UL", Type is a uint64_t digit.
- * - unsigned_128: "ull", "ULL", Type is a f_uint_128_t digit.
- * - unsigned_number: "un", "UN", Type is a f_number_unsigned_t digit (which by default is what f_array_length_t is a type of).
+ * - character: "c", Type is a 1-byte unsigned character.
+ * - character_safe: "C", Type is a 1-byte unsigned character, where control characters and invalid UTF-8 are replaced.
+ * - color_after: "]", Type is a f_color_set_t such that the f_color_set_t.after is used.
+ * - color_before: "[", Type is a f_color_set_t such that the f_color_set_t.begin is used.
+ * - double_32 "d", "D", Type is a double (32-bit).
+ * - double_64 "dl", "DL", Type is a long double (64-bit).
+ * - signed_8: "iii", "III", Type is a int8_t digit.
+ * - signed_16: "ii", "II", Type is a int16_t digit.
+ * - signed_32: "i", "I", Type is a int32_t digit.
+ * - signed_64: "il", "IL", Type is a signed int64_t digit.
+ * - signed_128: "ill", "ILL", Type is a f_int_128_t digit.
+ * - number: "in", "IN", Type is a f_number_signed_t digit.
+ * - size: "z", "Z", Type is a size_t digit.
+ * - string: "s", Type is a NULL terminated string, where the string is printed as-is.
+ * - string_safe: "S", Type is a NULL terminated string, where control characters and other problems are handled.
+ * - string_static: "q", Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed).
+ * - string_static_raw: "r", Type is a f_string_static_t or f_string_dynamic_t and NULLs (and all other control characters) are printed.
+ * - string_static_safe: "Q", Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, where control characters and other problems are handled.
+ * - string_static_safe_raw: "R", Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, where control characters and other problems are handled.
+ * - unsigned_8: "uii", "UII", Type is a uint8_t digit.
+ * - unsigned_16: "ui", "UI", Type is a uint16_t digit.
+ * - unsigned_32: "u", "U", Type is a uint32_t digit.
+ * - unsigned_64: "ul", "UL", Type is a uint64_t digit.
+ * - unsigned_128: "ull", "ULL", Type is a f_uint_128_t digit.
+ * - unsigned_number: "un", "UN", Type is a f_number_unsigned_t digit (which by default is what f_array_length_t is a type of).
*
* @see fprintf()
*/
f_print_format_type_character_safe,
f_print_format_type_color_after,
f_print_format_type_color_before,
+ f_print_format_type_double_32,
+ f_print_format_type_double_64,
f_print_format_type_signed_8,
f_print_format_type_signed_16,
f_print_format_type_signed_32,
// 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) {
} // 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_binary_signed_)
} // 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_binary_unsigned_)
} // 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_decimal_signed_)
} // 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_decimal_unsigned_)
} // 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_duodecimal_signed_)
} // 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_duodecimal_unsigned_)
} // 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_octal_signed_)
} // 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_octal_unsigned_)
#endif
#ifndef _di_fl_print_format_
- f_status_t fl_print_format(const f_string_t string, FILE *output, ...) {
+ f_status_t fl_print_format(const f_string_t string, FILE *stream, ...) {
#ifndef _di_level_1_parameter_checking_
if (!string) return 0;
- if (!output) return 0;
+ if (!stream) return 0;
#endif // _di_level_1_parameter_checking_
f_status_t status = F_none;
va_list ap;
- va_start(ap, output);
+ va_start(ap, stream);
for (f_string_t current = string; *current; current += 1) {
if (*current == f_string_ascii_percent_s[0]) {
current += 1;
- current = private_fl_print_format_convert(current, output, &ap, &status);
+ current = private_fl_print_format_convert(current, stream, &ap, &status);
if (F_status_is_error(status)) break;
}
else {
- if (!fputc_unlocked(*current, output)) {
+ if (!fputc_unlocked(*current, stream)) {
break;
}
}
#endif // _di_fl_print_format_
#ifndef _di_fl_print_format_convert_
- f_string_t fl_print_format_convert(const f_string_t string, FILE *output, va_list *ap, f_status_t *status) {
+ f_string_t fl_print_format_convert(const f_string_t string, FILE *stream, va_list *ap, f_status_t *status) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return 0;
+ if (!stream) return 0;
if (!ap) return 0;
#endif // _di_level_1_parameter_checking_
- return private_fl_print_format_convert(string, output, ap, status);
+ return private_fl_print_format_convert(string, stream, ap, status);
}
#endif // _di_fl_print_format_convert_
#ifndef _di_fl_print_string_va_
- f_status_t fl_print_string_va(const f_string_t string, FILE *output, va_list *ap) {
+ f_status_t fl_print_string_va(const f_string_t string, FILE *stream, va_list *ap) {
#ifndef _di_level_1_parameter_checking_
if (!string) return 0;
- if (!output) return 0;
+ if (!stream) return 0;
if (!ap) return 0;
#endif // _di_level_1_parameter_checking_
if (*current == f_string_ascii_percent_s[0]) {
current += 1;
- current = private_fl_print_format_convert(current, output, ap, &status);
+ current = private_fl_print_format_convert(current, stream, ap, &status);
if (F_status_is_error(status)) break;
}
else {
- if (!fputc_unlocked(*current, output)) {
+ if (!fputc_unlocked(*current, stream)) {
break;
}
}
#endif // _di_fl_print_string_va_
#ifndef _di_fl_print_trim_
- f_status_t fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *output) {
+ f_status_t fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
return F_data_not;
}
- return private_fl_print_trim(string, length, output);
+ return private_fl_print_trim(string, length, stream);
}
#endif // _di_fl_print_trim_
#ifndef _di_fl_print_trim_raw_
- f_status_t fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *output) {
+ f_status_t fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
return F_data_not;
}
- return private_fl_print_trim_raw(string, length, output);
+ return private_fl_print_trim_raw(string, length, stream);
}
#endif // _di_fl_print_trim_raw_
#ifndef _di_fl_print_trim_safely_
- f_status_t fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *output) {
+ f_status_t fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
return F_data_not;
}
- return private_fl_print_trim_safely(string, length, output);
+ return private_fl_print_trim_safely(string, length, stream);
}
#endif // _di_fl_print_trim_safely_
#ifndef _di_fl_print_trim_dynamic_
- f_status_t fl_print_trim_dynamic(const f_string_static_t buffer, FILE *output) {
+ f_status_t fl_print_trim_dynamic(const f_string_static_t buffer, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
return F_data_not;
}
- return private_fl_print_trim(buffer.string, buffer.used, output);
+ return private_fl_print_trim(buffer.string, buffer.used, stream);
}
#endif // _di_fl_print_trim_dynamic_
#ifndef _di_fl_print_trim_dynamic_raw_
- f_status_t fl_print_trim_dynamic_raw(const f_string_static_t buffer, FILE *output) {
+ f_status_t fl_print_trim_dynamic_raw(const f_string_static_t buffer, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
return F_data_not;
}
- return private_fl_print_trim_raw(buffer.string, buffer.used, output);
+ return private_fl_print_trim_raw(buffer.string, buffer.used, stream);
}
#endif // _di_fl_print_trim_dynamic_raw_
#ifndef _di_fl_print_trim_dynamic_safely_
- f_status_t fl_print_trim_dynamic_safely(const f_string_static_t buffer, FILE *output) {
+ f_status_t fl_print_trim_dynamic_safely(const f_string_static_t buffer, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
return F_data_not;
}
- return private_fl_print_trim_safely(buffer.string, buffer.used, output);
+ return private_fl_print_trim_safely(buffer.string, buffer.used, stream);
}
#endif // _di_fl_print_trim_dynamic_safely_
#ifndef _di_fl_print_trim_dynamic_partial_
- f_status_t fl_print_trim_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, FILE *output) {
+ f_status_t fl_print_trim_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
length = buffer.used - range.start;
}
- return private_fl_print_trim(buffer.string + range.start, length, output);
+ return private_fl_print_trim(buffer.string + range.start, length, stream);
}
#endif // _di_fl_print_trim_dynamic_partial_
#ifndef _di_fl_print_trim_dynamic_partial_raw_
- f_status_t fl_print_trim_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, FILE *output) {
+ f_status_t fl_print_trim_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
length = buffer.used - range.start;
}
- return private_fl_print_trim_raw(buffer.string + range.start, length, output);
+ return private_fl_print_trim_raw(buffer.string + range.start, length, stream);
}
#endif // _di_fl_print_trim_dynamic_partial_raw_
#ifndef _di_fl_print_trim_dynamic_partial_safely_
- f_status_t fl_print_trim_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, FILE *output) {
+ f_status_t fl_print_trim_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
length = buffer.used - range.start;
}
- return private_fl_print_trim_safely(buffer.string + range.start, length, output);
+ return private_fl_print_trim_safely(buffer.string + range.start, length, stream);
}
#endif // _di_fl_print_trim_dynamic_partial_safely_
#ifndef _di_fl_print_trim_except_
- f_status_t fl_print_trim_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *output) {
+ f_status_t fl_print_trim_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in(string, offset, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in(string, offset, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_
#ifndef _di_fl_print_trim_except_raw_
- f_status_t fl_print_trim_except_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *output) {
+ f_status_t fl_print_trim_except_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_raw_
#ifndef _di_fl_print_trim_except_safely_
- f_status_t fl_print_trim_except_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *output) {
+ f_status_t fl_print_trim_except_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_safely_
#ifndef _di_fl_print_trim_except_dynamic_
- f_status_t fl_print_trim_except_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in(buffer.string, 0, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in(buffer.string, 0, buffer.used, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_dynamic_
#ifndef _di_fl_print_trim_except_dynamic_raw_
- f_status_t fl_print_trim_except_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_raw(buffer.string, 0, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(buffer.string, 0, buffer.used, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_dynamic_raw_
#ifndef _di_fl_print_trim_except_dynamic_safely_
- f_status_t fl_print_trim_except_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_safely(buffer.string, 0, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(buffer.string, 0, buffer.used, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_dynamic_safely_
#ifndef _di_fl_print_trim_except_in_
- f_status_t fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
return F_data_not;
}
- return private_fl_print_trim_except_in(string, offset, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in(string, offset, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_
#ifndef _di_fl_print_trim_except_in_raw_
- f_status_t fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
return F_data_not;
}
- return private_fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_raw_
#ifndef _di_fl_print_trim_except_in_safely_
- f_status_t fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!string || !length) {
return F_data_not;
}
- return private_fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_safely_
#ifndef _di_fl_print_trim_except_in_dynamic_
- f_status_t fl_print_trim_except_in_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
return F_data_not;
}
- return private_fl_print_trim_except_in(buffer.string, 0, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in(buffer.string, 0, buffer.used, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_dynamic_
#ifndef _di_fl_print_trim_except_in_dynamic_raw_
- f_status_t fl_print_trim_except_in_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
return F_data_not;
}
- return private_fl_print_trim_except_in_raw(buffer.string, 0, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(buffer.string, 0, buffer.used, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_dynamic_raw_
#ifndef _di_fl_print_trim_except_in_dynamic_safely_
- f_status_t fl_print_trim_except_in_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used) {
return F_data_not;
}
- return private_fl_print_trim_except_in_safely(buffer.string, 0, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(buffer.string, 0, buffer.used, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_dynamic_safely_
#ifndef _di_fl_print_trim_except_in_dynamic_partial_
- f_status_t fl_print_trim_except_in_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
length = buffer.used - range.start;
}
- return private_fl_print_trim_except_in(buffer.string, range.start, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in(buffer.string, range.start, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_dynamic_partial_
#ifndef _di_fl_print_trim_except_in_dynamic_partial_raw_
- f_status_t fl_print_trim_except_in_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
length = buffer.used - range.start;
}
- return private_fl_print_trim_except_in_raw(buffer.string, range.start, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(buffer.string, range.start, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_dynamic_partial_raw_
#ifndef _di_fl_print_trim_except_in_dynamic_partial_safely_
- f_status_t fl_print_trim_except_in_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t fl_print_trim_except_in_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
length = buffer.used - range.start;
}
- return private_fl_print_trim_except_in_safely(buffer.string, range.start, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(buffer.string, range.start, length, except_at, except_in, stream);
}
#endif // _di_fl_print_trim_except_in_dynamic_partial_safely_
#ifndef _di_fl_print_trim_except_dynamic_partial_
- f_status_t fl_print_trim_except_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in(buffer.string, range.start, length, except, except_in, output);
+ return private_fl_print_trim_except_in(buffer.string, range.start, length, except, except_in, stream);
}
#endif // _di_fl_print_trim_except_dynamic_partial_
#ifndef _di_fl_print_trim_except_dynamic_partial_raw_
- f_status_t fl_print_trim_except_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_raw(buffer.string, range.start, length, except, except_in, output);
+ return private_fl_print_trim_except_in_raw(buffer.string, range.start, length, except, except_in, stream);
}
#endif // _di_fl_print_trim_except_dynamic_partial_raw_
#ifndef _di_fl_print_trim_except_dynamic_partial_safely_
- f_status_t fl_print_trim_except_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *stream) {
#ifndef _di_level_1_parameter_checking_
- if (!output) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_safely(buffer.string, range.start, length, except, except_in, output);
+ return private_fl_print_trim_except_in_safely(buffer.string, range.start, length, except, except_in, stream);
}
#endif // _di_fl_print_trim_except_dynamic_partial_safely_
* The order in which basic format flags are processed in regards parameters is a present order irrespective to the order specified.
* The basic format flags "/", ";", and ":" are examples of this.
*
+ * Floating and double floating format flags may be immediately followed by one of:
+ * - "e": Round and convert to [-]d.ddde±dd (exponent notation).
+ * - "E": Round and convert to [-]d.dddE±dd (exponent notation).
+ * - "g": Round and convert to notation of either decimal or exponent.
+ * - "G": Round and convert to notation of either decimal or exponent.
+ *
+ * The default format is decimal: [-]ddd.ddd.
+ *
+ * The case-sensitivity of above, such as 'e' vs 'E,' does not replace or relate to the case-sensitivity meaning of 'd' or 'D'.
+ * Instead, when 'e' is specified 'e' is used (such as such as [-]d.ddde±dd), but when 'E' is specified, then 'E' is used (such as [-]d.dddE±dd).
+ *
+ * Note: Currently the float/double implementation does not support the notation modes except integer (default) or hexidecimal.
+ * This is not intended but is simply a result of the temporary use of sprintf() to perform these operations.
+ * Once a custom implementation is provided, replacing snprintf(), then this can properly support the notation modes.
+ * Therefore, this function is supposed to support notation modes and does not yet do this (@fixme/@todo).
+ *
+ * This "%$" sequence is used to prevent characters from being interpreted.
+ * For example, consider "%de" vs "%d%$e".
+ * The first case "%de" is interpretted as a double using the "e" notation.
+ * The second case "%d%$e" is interpretted as a double followed by the letter "e".
+ *
* For these basic format flags ("/", ";", and ":"), the order is always processed as:
- * 1) static/dynamic string.
- * 2) partial range.
- * 3) ignore at.
- * 4) ignore in.
+ * 1) static/dynamic string.
+ * 2) partial range.
+ * 3) ignore at.
+ * 4) ignore in.
*
* Uppercase base format flags designates to print the base designation in uppercase and lowercase base format flags designate to print the base designation in lowercase.
* There are 5 support base format flags:
- * - binary: 0b/0B, representing base-2 units.
- * - octal: 0o/0O, representing base-8 units (note that this is a letter O, and not a zero).
- * - decimal: 0t/0T, representing base-10 units (this is the default when no base is specified, in which case the 0t/0T is not printed).
- * - duodecimal: 0d/0D, representing base-12 units.
- * - hexidecimal: 0x/0X, representing base-16 units.
+ * - binary: 0b/0B, representing base-2 units.
+ * - octal: 0o/0O, representing base-8 units (note that this is a letter O, and not a zero).
+ * - decimal: 0t/0T, representing base-10 units (this is the default when no base is specified, in which case the 0t/0T is not printed).
+ * - duodecimal: 0d/0D, representing base-12 units.
+ * - hexidecimal: 0x/0X, representing base-16 units.
*
* When printing digits, using lowercase designates to print alphabetic digits in lowercase and using uppercase designates to print alphabetic digits in uppercase.
*
* To keep the design simple, this does not support index position variable replacement like fprintf() does (such as '%1$', '%2$', etc..).
*
* Basic Format Flags:
- * - "-": Use left-justification.
- * - "#": Use alternate form conversion (prefixing 0b/0B, 0o/0O, 0t/0T, 0d/0D, 0x/0X).
- * - ";": Ignore characters in the given positions from a f_array_length_t (only applies to static/dynamic string arguments but not character arguments).
- * - ":": Ignore characters in the given ranges from a f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
- * - "/", Print only the given range of a string, specified by f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
- * - "+", Always show the signs (+ or -).
- * - " ", Add a space where a sign would be if the sign is not displayed (this is the space character).
- * - "=", Trim leading and trailing whitespaces (only applies to static/dynamic string arguments but not character arguments).
- * - "0" to "9", The width to use, however if a leading 0 is used, then a 0 is printed in each leading digit as needed.
+ * - "-": Use left-justification.
+ * - "#": Use alternate form conversion (prefixing 0b/0B, 0o/0O, 0t/0T, 0d/0D, 0x/0X).
+ * - ";": Ignore characters in the given positions from a f_array_length_t (only applies to static/dynamic string arguments but not character arguments).
+ * - ":": Ignore characters in the given ranges from a f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
+ * - "/", Print only the given range of a string, specified by f_string_range_t (only applies to static/dynamic string arguments but not character arguments).
+ * - "+", Always show the signs (+ or -).
+ * - " ", Add a space where a sign would be if the sign is not displayed (this is the space character).
+ * - "=", Trim leading and trailing whitespaces (only applies to static/dynamic string arguments but not character arguments).
+ * - "0" to "9", The width to use, however if a leading 0 is used, then a 0 is printed in each leading digit as needed.
+ * - "*", For number-based values, designates that the width is specified in the parameter (order is: (width, value)).
+ * - ".*", For number-based values, designates that the precision is specified in the parameter (order is: (precision, value), but if *.* is specified, then order is: (width, precision, value)).
*
* Base Format Flags:
- * - "!": Display digits in Binary notation.
- * - "@": Display digits in Octal notation.
- * - "^": Display digits in Decimal notation.
- * - "&": Display digits in Duodecimal notation.
- * - "_": Display digits in Hexidecimal notation.
+ * - "!": Display digits in Binary notation.
+ * - "@": Display digits in Octal notation.
+ * - "^": Display digits in Decimal notation.
+ * - "&": Display digits in Duodecimal notation.
+ * - "_": Display digits in Hexidecimal notation.
+ *
+ * Special Format Flags:
+ * - "$": Ignore flag.
+ * - "%": Use left-justification.
*
* Type Format Flags:
- * - "c": Type is a 1-byte unsigned character.
- * - "C": Type is a 1-byte unsigned character, where control characters and invalid UTF-8 are replaced.
- * - "[": Type is a f_color_set_t such that the f_color_set_t.begin is used.
- * - "]": Type is a f_color_set_t such that the f_color_set_t.after is used.
- * - "iii" "III": Type is a int8_t digit.
- * - "ii", "II": Type is a int16_t digit.
- * - "i", "I": Type is a int32_t digit.
- * - "il", "IL": Type is a signed int64_t digit.
- * - "ill", "ILL": Type is a f_int_128_t digit.
- * - "in", "IN": Type is a f_number_signed_t digit.
- * - "z", "Z": Type is a size_t digit.
- * - "s": Type is a NULL terminated string, where the string is printed as-is.
- * - "S": Type is a NULL terminated string, where control characters and invalid UTF-8 are replaced.
- * - "q": Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed).
- * - "Q": Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed), where control characters and invalid UTF-8 are replaced.
- * - "r": Type is a f_string_static_t or f_string_dynamic_t and NULLs (and all other control characters) are printed.
- * - "R": Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, but control characters and invalid UTF-8 are replaced. @todo not yet implemented.
- * - "uii", "UII": Type is a uint8_t digit.
- * - "ui", "UI": Type is a uint16_t digit.
- * - "u", "U": Type is a uint32_t digit.
- * - "ul", "UL": Type is a uint64_t digit.
- * - "ull", "ULL": Type is a f_uint_128_t digit.
- * - "un", "UN": Type is a f_number_unsigned_t digit (which by default is what f_array_length_t is a type of).
+ * - "d", "D": Type is a double digit (32-bit), may be immediately followed by an "e", "E", "g", or "G".
+ * - "dl", "DL": Type is a long double digit (64-bit), may be immediately followed by an "e", "E", "g", or "G".
+ * - "c": Type is a 1-byte unsigned character.
+ * - "C": Type is a 1-byte unsigned character, where control characters and invalid UTF-8 are replaced.
+ * - "[": Type is a f_color_set_t such that the f_color_set_t.begin is used.
+ * - "]": Type is a f_color_set_t such that the f_color_set_t.after is used.
+ * - "iii" "III": Type is a int8_t digit.
+ * - "ii", "II": Type is a int16_t digit.
+ * - "i", "I": Type is a int32_t digit.
+ * - "il", "IL": Type is a signed int64_t digit.
+ * - "ill", "ILL": Type is a f_int_128_t digit.
+ * - "in", "IN": Type is a f_number_signed_t digit.
+ * - "z", "Z": Type is a size_t digit.
+ * - "s": Type is a NULL terminated string, where the string is printed as-is.
+ * - "S": Type is a NULL terminated string, where control characters and invalid UTF-8 are replaced.
+ * - "q": Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed).
+ * - "Q": Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed), where control characters and invalid UTF-8 are replaced.
+ * - "r": Type is a f_string_static_t or f_string_dynamic_t and NULLs (and all other control characters) are printed.
+ * - "R": Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, but control characters and invalid UTF-8 are replaced. @todo not yet implemented.
+ * - "uii", "UII": Type is a uint8_t digit.
+ * - "ui", "UI": Type is a uint16_t digit.
+ * - "u", "U": Type is a uint32_t digit.
+ * - "ul", "UL": Type is a uint64_t digit.
+ * - "ull", "ULL": Type is a f_uint_128_t digit.
+ * - "un", "UN": Type is a f_number_unsigned_t digit (which by default is what f_array_length_t is a type of).
*
* The following are control characters and their replacements for "safe" printing (unknown is used for invalid UTF-8 sequences):
- * - "␆": Acknowledge.
- * - "␕": Negative Acknowledge.
- * - "␈": Backspace.
- * - "␇": Bell.
- * - "␘": Cancel.
- * - "␍": Carriage Return.
- * - "␐": Data Link Escape.
- * - "␡": Delete.
- * - "␑": Device Control 1.
- * - "␒": Device Control 2.
- * - "␓": Device Control 3.
- * - "␔": Device Control 4.
- * - "␙": End of Medium.
- * - "␃": End of Text.
- * - "␄": End of Transmission.
- * - "␗": End of Transmission Block.
- * - "␅": Enquiry.
- * - "␛": Escape.
- * - "␌": Form Feed.
- * - "␊": Line Feed.
- * - "␀": Null.
- * - "␜": Separator File.
- * - "␝": Separator Group.
- * - "␞": Separator Record.
- * - "␟": Separator Unit.
- * - "␏": Shift In.
- * - "␎": Shift Out.
- * - "␁": Start Of Header.
- * - "␂": Start Of Text.
- * - "␚": Substitute.
- * - "␖": Synchronous Idle.
- * - "␉": Tab.
- * - "␋": Vertical Tab.
- * - "�": Unknown.
+ * - "␆": Acknowledge.
+ * - "␕": Negative Acknowledge.
+ * - "␈": Backspace.
+ * - "␇": Bell.
+ * - "␘": Cancel.
+ * - "␍": Carriage Return.
+ * - "␐": Data Link Escape.
+ * - "␡": Delete.
+ * - "␑": Device Control 1.
+ * - "␒": Device Control 2.
+ * - "␓": Device Control 3.
+ * - "␔": Device Control 4.
+ * - "␙": End of Medium.
+ * - "␃": End of Text.
+ * - "␄": End of Transmission.
+ * - "␗": End of Transmission Block.
+ * - "␅": Enquiry.
+ * - "␛": Escape.
+ * - "␌": Form Feed.
+ * - "␊": Line Feed.
+ * - "␀": Null.
+ * - "␜": Separator File.
+ * - "␝": Separator Group.
+ * - "␞": Separator Record.
+ * - "␟": Separator Unit.
+ * - "␏": Shift In.
+ * - "␎": Shift Out.
+ * - "␁": Start Of Header.
+ * - "␂": Start Of Text.
+ * - "␚": Substitute.
+ * - "␖": Synchronous Idle.
+ * - "␉": Tab.
+ * - "␋": Vertical Tab.
+ * - "�": Unknown/Invalid.
*
* This print function does not use locking, be sure something like flockfile() and funlockfile() are appropriately called.
*
- * @todo float/double support is not yet implemented, but is intended to eventually be supported.
- *
* @param string
* The formatted string to process and output.
* This is a NULL terminated string.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
* @param ...
* Additional arguments relating to the string.
*
* @see fprintf()
* @see fputc_unlocked()
+ * @see snprintf()
* @see va_start()
* @see va_end()
*
* @see f_print_terminated()
*/
#ifndef _di_fl_print_format_
- extern f_status_t fl_print_format(const f_string_t string, FILE *output, ...);
+ extern f_status_t fl_print_format(const f_string_t string, FILE *stream, ...);
#endif // _di_fl_print_format_
/**
* @param string
* The current character position within the string.
* This pointer might be updated by this function.
- * @param output
- * The file stream to output to, including standard streams such as stdout and stderr.
+ * @param stream
+ * The file stream to stream to, including standard streams such as stdout and stderr.
* @param ap
* The variable arguments list.
* @param status
* @see f_print_terminated()
*/
#ifndef _di_fl_print_format_convert_
- extern f_string_t fl_print_format_convert(const f_string_t string, FILE *output, va_list *ap, f_status_t *status);
+ extern f_string_t fl_print_format_convert(const f_string_t string, FILE *stream, va_list *ap, f_status_t *status);
#endif // _di_fl_print_format_convert_
/**
*
* @param string
* The formatted string to process and output.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
* @param ap
* The variable list.
* @see fl_print_format()
*/
#ifndef _di_fl_print_string_va_
- extern f_status_t fl_print_string_va(const f_string_t string, FILE *output, va_list *ap);
+ extern f_status_t fl_print_string_va(const f_string_t string, FILE *stream, va_list *ap);
#endif // _di_fl_print_string_va_
/**
* The string to output.
* @param length
* The total number of characters to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_
- extern f_status_t fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *output);
+ extern f_status_t fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *stream);
#endif // _di_fl_print_trim_
/**
* The string to output.
* @param length
* The total number of characters to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_raw_
- extern f_status_t fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *output);
+ extern f_status_t fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *stream);
#endif // _di_fl_print_trim_raw_
/**
* The string to output.
* @param length
* The total number of characters to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_safely_
- extern f_status_t fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *output);
+ extern f_status_t fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *stream);
#endif // _di_fl_print_trim_safely_
/**
*
* @param buffer
* The string to output.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_dynamic_
- extern f_status_t fl_print_trim_dynamic(const f_string_static_t buffer, FILE *output);
+ extern f_status_t fl_print_trim_dynamic(const f_string_static_t buffer, FILE *stream);
#endif // _di_fl_print_trim_dynamic_
/**
*
* @param buffer
* The string to output.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_dynamic_raw_
- extern f_status_t fl_print_trim_dynamic_raw(const f_string_static_t buffer, FILE *output);
+ extern f_status_t fl_print_trim_dynamic_raw(const f_string_static_t buffer, FILE *stream);
#endif // _di_fl_print_trim_dynamic_raw_
/**
*
* @param buffer
* The string to output.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_dynamic_safely_
- extern f_status_t fl_print_trim_dynamic_safely(const f_string_static_t buffer, FILE *output);
+ extern f_status_t fl_print_trim_dynamic_safely(const f_string_static_t buffer, FILE *stream);
#endif // _di_fl_print_trim_dynamic_safely_
/**
* The string to output.
* @param range
* The range within the provided string to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_dynamic_partial_
- extern f_status_t fl_print_trim_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, FILE *output);
+ extern f_status_t fl_print_trim_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, FILE *stream);
#endif // _di_fl_print_trim_dynamic_partial_
/**
* The string to output.
* @param range
* The range within the provided string to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_dynamic_partial_raw_
- extern f_status_t fl_print_trim_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, FILE *output);
+ extern f_status_t fl_print_trim_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, FILE *stream);
#endif // _di_fl_print_trim_dynamic_partial_raw_
/**
* The string to output.
* @param range
* The range within the provided string to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_dynamic_partial_safely_
- extern f_status_t fl_print_trim_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, FILE *output);
+ extern f_status_t fl_print_trim_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, FILE *stream);
#endif // _di_fl_print_trim_dynamic_partial_safely_
/**
* @param except_at
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_
- extern f_status_t fl_print_trim_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *output);
+ extern f_status_t fl_print_trim_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *stream);
#endif // _di_fl_print_trim_except_
/**
* @param except_at
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_raw_
- extern f_status_t fl_print_trim_except_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *output);
+ extern f_status_t fl_print_trim_except_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *stream);
#endif // _di_fl_print_trim_except_raw_
/**
* @param except_at
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_safely_
- extern f_status_t fl_print_trim_except_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *output);
+ extern f_status_t fl_print_trim_except_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, FILE *stream);
#endif // _di_fl_print_trim_except_safely_
/**
* @param except_at
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_dynamic_
- extern f_status_t fl_print_trim_except_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output);
+ extern f_status_t fl_print_trim_except_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *stream);
#endif // _di_fl_print_trim_except_dynamic_
/**
* @param except_at
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_dynamic_raw_
- extern f_status_t fl_print_trim_except_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output);
+ extern f_status_t fl_print_trim_except_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *stream);
#endif // _di_fl_print_trim_except_dynamic_raw_
/**
* @param except_at
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_dynamic_safely_
- extern f_status_t fl_print_trim_except_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output);
+ extern f_status_t fl_print_trim_except_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *stream);
#endif // _di_fl_print_trim_except_dynamic_safely_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_
- extern f_status_t fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_raw_
- extern f_status_t fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_raw_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_safely_
- extern f_status_t fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_safely_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_dynamic_
- extern f_status_t fl_print_trim_except_in_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_dynamic_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_dynamic_raw_
- extern f_status_t fl_print_trim_except_in_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_dynamic_raw(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_dynamic_raw_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_dynamic_safely_
- extern f_status_t fl_print_trim_except_in_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_dynamic_safely(const f_string_static_t buffer, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_dynamic_safely_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_dynamic_partial_
- extern f_status_t fl_print_trim_except_in_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_dynamic_partial_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_dynamic_partial_raw_
- extern f_status_t fl_print_trim_except_in_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_dynamic_partial_raw_
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_in_dynamic_partial_safely_
- extern f_status_t fl_print_trim_except_in_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output);
+ extern f_status_t fl_print_trim_except_in_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream);
#endif // _di_fl_print_trim_except_in_dynamic_partial_safely_
/**
* @param except
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_dynamic_partial_
- extern f_status_t fl_print_trim_except_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fl_print_trim_except_dynamic_partial(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *stream);
#endif // _di_fl_print_trim_except_dynamic_partial_
/**
* @param except
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_dynamic_partial_raw_
- extern f_status_t fl_print_trim_except_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fl_print_trim_except_dynamic_partial_raw(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *stream);
#endif // _di_fl_print_trim_except_dynamic_partial_raw_
/**
* @param except
* An array of locations within the given string to not print.
* The array of locations is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fputc_unlocked()
*/
#ifndef _di_fl_print_trim_except_dynamic_partial_safely_
- extern f_status_t fl_print_trim_except_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fl_print_trim_except_dynamic_partial_safely(const f_string_static_t buffer, const f_string_range_t range, const f_array_lengths_t except, FILE *stream);
#endif // _di_fl_print_trim_except_dynamic_partial_safely_
#ifdef __cplusplus
#endif
#if !defined(_di_fl_print_format_) || !defined(_di_fl_print_format_convert_)
- f_string_t private_fl_print_format_convert(f_string_t string, FILE *output, va_list *ap, f_status_t *status) {
+ f_string_t private_fl_print_format_convert(f_string_t string, FILE *stream, va_list *ap, f_status_t *status) {
const f_string_t start = string;
*status = F_none;
uint8_t base = 10;
- uint16_t flag = 0;
+ uint32_t flag = 0;
uint8_t type = 0;
unsigned int width = 1;
// The first percent found represents a literal '%' to be printed, otherwise return as invalid.
if (string == start) {
- if (!fputc_unlocked(f_string_ascii_percent_s[0], output)) {
+ if (!fputc_unlocked(f_string_ascii_percent_s[0], stream)) {
*status = F_status_set_error(F_output);
}
}
continue;
}
else if (*string == f_string_ascii_asterisk_s[0]) {
- // @fixme what should I do here? review the fprintf() docs.
+ flag |= F_print_format_flag_width_d | F_print_format_flag_width_value_d;
continue;
}
else if (*string == f_string_ascii_plus_s[0]) {
++string;
- if (*string < 0x30 || *string > 0x39) {
+ if (*string == f_string_ascii_asterisk_s[0]) {
+ flag |= F_print_format_flag_precision_d | F_print_format_flag_precision_value_d;
+ }
+ else if (*string < 0x30 || *string > 0x39) {
*status = F_status_set_error(F_valid_not);
return string;
}
+ else {
+ string = private_fl_print_convert_number(string, ap, &precision, status);
+ if (F_status_is_error(*status)) return string;
- string = private_fl_print_convert_number(string, ap, &precision, status);
- if (F_status_is_error(*status)) return string;
+ --string;
- --string;
+ flag |= F_print_format_flag_precision_d;
+ }
continue;
}
if (*string == f_string_ascii_C_s[0]) {
char value[1] = { (char) va_arg(*ap, int) };
- *status = f_print_safely(value, 1, output);
+ *status = f_print_safely(value, 1, stream);
return string;
}
+ else if (*string == f_string_ascii_D_s[0]) {
+ type = f_print_format_type_double_32;
+ flag |= F_print_format_flag_uppercase_d;
+
+ if (*(string + 1)) {
+ if (*(string + 1) == f_string_ascii_L_s[0]) {
+ type = f_print_format_type_double_64;
+
+ if (*(string + 2) == f_string_ascii_e_s[0]) {
+ flag |= F_print_format_flag_exponent_d;
+ string += 2;
+ }
+ else if (*(string + 2) == f_string_ascii_E_s[0]) {
+ flag |= F_print_format_flag_exponent_d | F_print_format_flag_exponent_upper_d;
+ string += 2;
+ }
+ else if (*(string + 2) == f_string_ascii_g_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d;
+ string += 2;
+ }
+ else if (*(string + 2) == f_string_ascii_G_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d | F_print_format_flag_exponent_upper_d;
+ string += 2;
+ }
+ else {
+ ++string;
+ }
+ }
+ else if (*(string + 1) == f_string_ascii_e_s[0]) {
+ flag |= F_print_format_flag_exponent_d;
+ ++string;
+ }
+ else if (*(string + 1) == f_string_ascii_E_s[0]) {
+ flag |= F_print_format_flag_exponent_d | F_print_format_flag_exponent_upper_d;
+ ++string;
+ }
+ else if (*(string + 1) == f_string_ascii_g_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d;
+ ++string;
+ }
+ else if (*(string + 1) == f_string_ascii_G_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d | F_print_format_flag_exponent_upper_d;
+ ++string;
+ }
+ }
+ }
else if (*string == f_string_ascii_I_s[0]) {
type = f_print_format_type_signed_32;
flag |= F_print_format_flag_uppercase_d;
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_safely(value.string, partial.start, length, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ *status = f_print_except_in_safely(value.string, partial.start, length, except_at, except_in, stream);
}
}
else if (flag & F_print_format_flag_ignore_range_d) {
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_safely(value.string, partial.start, length, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ *status = f_print_except_in_safely(value.string, partial.start, length, except_at, except_in, stream);
}
}
else {
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_safely(value.string + partial.start, length, output);
+ *status = private_fl_print_trim_safely(value.string + partial.start, length, stream);
}
else {
- *status = f_print_safely(value.string + partial.start, length, output);
+ *status = f_print_safely(value.string + partial.start, length, stream);
}
}
}
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_safely(value.string, 0, value.used, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_safely(value.string, 0, value.used, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_dynamic_safely(value, except_at, except_in, output);
+ *status = f_print_except_in_dynamic_safely(value, except_at, except_in, stream);
}
}
else if (flag & F_print_format_flag_ignore_range_d) {
const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_safely(value.string, 0, value.used, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_safely(value.string, 0, value.used, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_dynamic_safely(value, except_at, except_in, output);
+ *status = f_print_except_in_dynamic_safely(value, except_at, except_in, stream);
}
}
else {
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_safely(value.string, value.used, output);
+ *status = private_fl_print_trim_safely(value.string, value.used, stream);
}
else {
- *status = f_print_dynamic_safely(value, output);
+ *status = f_print_dynamic_safely(value, stream);
}
}
else if (*string == f_string_ascii_S_s[0]) {
const f_string_t value = va_arg(*ap, f_string_t);
- *status = f_print_safely_terminated(value, output);
+ *status = f_print_safely_terminated(value, stream);
return string;
}
const f_color_set_t value = va_arg(*ap, f_color_set_t);
if (value.before) {
- *status = f_print_terminated(value.before->string, output);
+ *status = f_print_terminated(value.before->string, stream);
}
return string;
const f_color_set_t value = va_arg(*ap, f_color_set_t);
if (value.after) {
- *status = f_print_terminated(value.after->string, output);
+ *status = f_print_terminated(value.after->string, stream);
}
return string;
if (*string == f_string_ascii_c_s[0]) {
const char value = (char) va_arg(*ap, uint32_t);
- if (!fputc_unlocked(value, output)) {
+ if (!fputc_unlocked(value, stream)) {
*status = F_status_set_error(F_output);
}
return string;
}
+ else if (*string == f_string_ascii_d_s[0]) {
+ type = f_print_format_type_double_32;
+
+ if (*(string + 1)) {
+ if (*(string + 1) == f_string_ascii_L_s[0]) {
+ type = f_print_format_type_double_64;
+
+ if (*(string + 2) == f_string_ascii_e_s[0]) {
+ flag |= F_print_format_flag_exponent_d;
+ string += 2;
+ }
+ else if (*(string + 2) == f_string_ascii_E_s[0]) {
+ flag |= F_print_format_flag_exponent_d | F_print_format_flag_exponent_upper_d;
+ string += 2;
+ }
+ else if (*(string + 2) == f_string_ascii_g_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d;
+ string += 2;
+ }
+ else if (*(string + 2) == f_string_ascii_G_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d | F_print_format_flag_exponent_upper_d;
+ string += 2;
+ }
+ else {
+ ++string;
+ }
+ }
+ else if (*(string + 1) == f_string_ascii_e_s[0]) {
+ flag |= F_print_format_flag_exponent_d;
+ ++string;
+ }
+ else if (*(string + 1) == f_string_ascii_E_s[0]) {
+ flag |= F_print_format_flag_exponent_d | F_print_format_flag_exponent_upper_d;
+ ++string;
+ }
+ else if (*(string + 1) == f_string_ascii_g_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d;
+ ++string;
+ }
+ else if (*(string + 1) == f_string_ascii_G_s[0]) {
+ flag |= F_print_format_flag_exponent_either_d | F_print_format_flag_exponent_upper_d;
+ ++string;
+ }
+ }
+ }
else if (*string == f_string_ascii_i_s[0]) {
type = f_print_format_type_signed_32;
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in(value.string, partial.start, length, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in(value.string, partial.start, length, except_at, except_in, stream);
}
else {
- *status = f_print_except_in(value.string, partial.start, length, except_at, except_in, output);
+ *status = f_print_except_in(value.string, partial.start, length, except_at, except_in, stream);
}
}
else if (flag & F_print_format_flag_ignore_range_d) {
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in(value.string, partial.start, length, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in(value.string, partial.start, length, except_at, except_in, stream);
}
else {
- *status = f_print_except_in(value.string, partial.start, length, except_at, except_in, output);
+ *status = f_print_except_in(value.string, partial.start, length, except_at, except_in, stream);
}
}
else {
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim(value.string + partial.start, length, output);
+ *status = private_fl_print_trim(value.string + partial.start, length, stream);
}
else {
- *status = f_print(value.string + partial.start, length, output);
+ *status = f_print(value.string + partial.start, length, stream);
}
}
}
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in(value.string, 0, value.used, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in(value.string, 0, value.used, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_dynamic(value, except_at, except_in, output);
+ *status = f_print_except_in_dynamic(value, except_at, except_in, stream);
}
}
else if (flag & F_print_format_flag_ignore_range_d) {
const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in(value.string, 0, value.used, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in(value.string, 0, value.used, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_dynamic(value, except_at, except_in, output);
+ *status = f_print_except_in_dynamic(value, except_at, except_in, stream);
}
}
else {
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim(value.string, value.used, output);
+ *status = private_fl_print_trim(value.string, value.used, stream);
}
else {
- *status = f_print_dynamic(value, output);
+ *status = f_print_dynamic(value, stream);
}
}
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_raw(value.string, partial.start, length, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ *status = f_print_except_in_raw(value.string, partial.start, length, except_at, except_in, stream);
}
}
else if (flag & F_print_format_flag_ignore_range_d) {
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_raw(value.string, partial.start, length, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ *status = f_print_except_in_raw(value.string, partial.start, length, except_at, except_in, stream);
}
}
else {
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_raw(value.string + partial.start, length, output);
+ *status = private_fl_print_trim_raw(value.string + partial.start, length, stream);
}
else {
- *status = f_print_raw(value.string + partial.start, length, output);
+ *status = f_print_raw(value.string + partial.start, length, stream);
}
}
}
}
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_raw(value.string, 0, value.used, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_raw(value.string, 0, value.used, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_dynamic_raw(value, except_at, except_in, output);
+ *status = f_print_except_in_dynamic_raw(value, except_at, except_in, stream);
}
}
else if (flag & F_print_format_flag_ignore_range_d) {
const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_except_in_raw(value.string, 0, value.used, except_at, except_in, output);
+ *status = private_fl_print_trim_except_in_raw(value.string, 0, value.used, except_at, except_in, stream);
}
else {
- *status = f_print_except_in_dynamic_raw(value, except_at, except_in, output);
+ *status = f_print_except_in_dynamic_raw(value, except_at, except_in, stream);
}
}
else {
if (flag & F_print_format_flag_trim_d) {
- *status = private_fl_print_trim_raw(value.string, value.used, output);
+ *status = private_fl_print_trim_raw(value.string, value.used, stream);
}
else {
- *status = f_print_dynamic_raw(value, output);
+ *status = f_print_dynamic_raw(value, stream);
}
}
else if (*string == f_string_ascii_s_s[0]) {
const f_string_t value = va_arg(*ap, f_string_t);
- *status = f_print_terminated(value, output);
+ *status = f_print_terminated(value, stream);
return string;
}
conversion_data.flag |= F_conversion_data_flag_zeros_leading_d;
}
+ if (flag & F_print_format_flag_width_value_d) {
+ width = va_arg(*ap, int);
+ }
+
+ if (flag & F_print_format_flag_precision_value_d) {
+ precision = va_arg(*ap, int);
+ }
+
+ // @fixme precision and with can be used togethor, see: "'%10.2f'".
if (flag & F_print_format_flag_width_d) {
conversion_data.width = width;
}
}
if (type == f_print_format_type_signed_number) {
- *status = f_conversion_number_signed_print(va_arg(*ap, f_number_signed_t), conversion_data, output);
+ *status = f_conversion_number_signed_print(va_arg(*ap, f_number_signed_t), conversion_data, stream);
}
else if (type == f_print_format_type_signed_64) {
- *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(*ap, int64_t), conversion_data, output);
+ *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(*ap, int64_t), conversion_data, stream);
}
else if (type == f_print_format_type_signed_128) {
- *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(*ap, f_int_128_t), conversion_data, output);
+ *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(*ap, f_int_128_t), conversion_data, stream);
}
else if (type == f_print_format_type_signed_32) {
- *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(*ap, int32_t), conversion_data, output);
+ *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(*ap, int32_t), conversion_data, stream);
}
else if (type == f_print_format_type_signed_16) {
const int16_t value = (int16_t) va_arg(*ap, int);
- *status = f_conversion_number_signed_print((f_number_signed_t) value, conversion_data, output);
+ *status = f_conversion_number_signed_print((f_number_signed_t) value, conversion_data, stream);
}
else if (type == f_print_format_type_signed_8) {
const int8_t value = (int8_t) va_arg(*ap, int);
- *status = f_conversion_number_signed_print((f_number_signed_t) value, conversion_data, output);
+ *status = f_conversion_number_signed_print((f_number_signed_t) value, conversion_data, stream);
}
else if (type == f_print_format_type_size) {
- *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, size_t), conversion_data, output);
+ *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, size_t), conversion_data, stream);
}
else if (type == f_print_format_type_unsigned_32) {
- *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, uint32_t), conversion_data, output);
+ *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, uint32_t), conversion_data, stream);
}
else if (type == f_print_format_type_unsigned_16) {
const uint16_t value = (uint16_t) va_arg(*ap, unsigned);
- *status = f_conversion_number_unsigned_print((f_number_unsigned_t) value, conversion_data, output);
+ *status = f_conversion_number_unsigned_print((f_number_unsigned_t) value, conversion_data, stream);
}
else if (type == f_print_format_type_unsigned_8) {
const uint8_t value = (uint8_t) va_arg(*ap, unsigned);
- *status = f_conversion_number_unsigned_print((f_number_unsigned_t) value, conversion_data, output);
+ *status = f_conversion_number_unsigned_print((f_number_unsigned_t) value, conversion_data, stream);
}
else if (type == f_print_format_type_unsigned_64) {
- *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, uint64_t), conversion_data, output);
+ *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, uint64_t), conversion_data, stream);
}
else if (type == f_print_format_type_unsigned_128) {
- *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, f_uint_128_t), conversion_data, output);
+ *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(*ap, f_uint_128_t), conversion_data, stream);
}
else if (type == f_print_format_type_unsigned_number) {
- *status = f_conversion_number_unsigned_print(va_arg(*ap, f_number_unsigned_t), conversion_data, output);
+ *status = f_conversion_number_unsigned_print(va_arg(*ap, f_number_unsigned_t), conversion_data, stream);
+ }
+ else if (type == f_print_format_type_double_32 || type == f_print_format_type_double_64) {
+ int f = 0;
+ char format[32];
+ char buffer[128];
+
+ format[f++] = '%';
+
+ if (flag & F_print_format_flag_sign_always_d) {
+ format[f++] = '+';
+ }
+ else if (flag & F_print_format_flag_sign_pad_d) {
+ format[f++] = ' ';
+ }
+
+ if (flag & F_print_format_flag_align_left_d) {
+ format[f++] = '-';
+ }
+
+ if (flag & F_print_format_flag_zeros_leading_d) {
+ format[f++] = '0';
+ }
+
+ if (flag & F_print_format_flag_width_d) {
+ format[f++] = '*';
+ }
+
+ if (flag & F_print_format_flag_precision_d) {
+ format[f++] = '.';
+ format[f++] = '*';
+ }
+
+ if (flag & F_print_format_flag_exponent_d) {
+ if (flag & F_print_format_flag_exponent_upper_d) {
+ format[f++] = 'E';
+ }
+ else {
+ format[f++] = 'e';
+ }
+ }
+ else if (flag & F_print_format_flag_exponent_either_d) {
+ if (flag & F_print_format_flag_exponent_upper_d) {
+ format[f++] = 'G';
+ }
+ else {
+ format[f++] = 'g';
+ }
+ }
+ else {
+ format[f++] = 'f';
+ }
+
+ format[f] = 0;
+
+ if (type == f_print_format_type_double_32) {
+ const double value = va_arg(*ap, double);
+
+ if (flag & F_print_format_flag_width_d) {
+ if (flag & F_print_format_flag_precision_d) {
+ snprintf(buffer, 128, format, width, precision, value);
+ }
+ else {
+ snprintf(buffer, 128, format, width, value);
+ }
+ }
+ else if (flag & F_print_format_flag_precision_d) {
+ snprintf(buffer, 128, format, precision, value);
+ }
+ else {
+ snprintf(buffer, 128, format, value);
+ }
+ }
+ else {
+ const long double value = va_arg(*ap, long double);
+
+ if (flag & F_print_format_flag_width_d) {
+ if (flag & F_print_format_flag_precision_d) {
+ snprintf(buffer, 128, format, width, precision, value);
+ }
+ else {
+ snprintf(buffer, 128, format, width, value);
+ }
+ }
+ else if (flag & F_print_format_flag_precision_d) {
+ snprintf(buffer, 128, format, precision, value);
+ }
+ else {
+ snprintf(buffer, 128, format, value);
+ }
+ }
+
+ *status = f_print_terminated(buffer, stream);
}
return string;
for (*number = 0; *string; string += 1) {
- if (*string > 0x29 && *string < 0x40) {
+ if (*string > 0x2f && *string < 0x3a) {
*number *= 10;
*number += 0xf & *string;
}
#endif // !defined(_di_fl_print_format_) || !defined(_di_fl_print_format_convert_)
#if !defined(_di_fl_print_trim_except_) || !defined(_di_fl_print_trim_except_dynamic_) || !defined(_di_fl_print_trim_except_dynamic_partial_) || !defined(_di_fl_print_trim_except_in_) || !defined(_di_fl_print_trim_except_in_dynamic_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_)
- f_status_t private_fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t private_fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
f_array_length_t i = offset;
f_array_length_t j = 0;
return F_status_set_error(F_complete_not_utf_stop);
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
return F_status_set_error(F_utf_not);
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
#endif // !defined(_di_fl_print_trim_except_) || !defined(_di_fl_print_trim_except_dynamic_) || !defined(_di_fl_print_trim_except_dynamic_partial_) || !defined(_di_fl_print_trim_except_in_) || !defined(_di_fl_print_trim_except_in_dynamic_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_)
#if !defined(_di_fl_print_trim_except_raw_) || !defined(_di_fl_print_trim_except_dynamic_raw_) || !defined(_di_fl_print_trim_except_dynamic_partial_raw_) || !defined(_di_fl_print_trim_except_in_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_raw_)
- f_status_t private_fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t private_fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
f_array_length_t i = offset;
f_array_length_t j = 0;
continue;
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1 && i + 1 < length) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2 && i + 2 < length) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3 && i + 3 < length) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
if (i >= length) break;
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1 && i + 1 < length) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2 && i + 2 < length) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3 && i + 3 < length) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
#endif // !defined(_di_fl_print_trim_except_raw_) || !defined(_di_fl_print_trim_except_dynamic_raw_) || !defined(_di_fl_print_trim_except_dynamic_partial_raw_) || !defined(_di_fl_print_trim_except_in_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_raw_)
#if !defined(_di_fl_print_trim_except_safely_) || !defined(_di_fl_print_trim_except_dynamic_safely_) || !defined(_di_fl_print_trim_except_dynamic_partial_safely_) || !defined(_di_fl_print_trim_except_in_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_safely_)
- f_status_t private_fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) {
+ f_status_t private_fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) {
f_array_length_t i = offset;
f_array_length_t j = 0;
}
if (i + macro_f_utf_byte_width(string[i]) >= length) {
- if (!fputc_unlocked(f_print_sequence_unknown_s[0], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[0], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[1], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[1], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[2], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[2], stream)) {
return F_status_set_error(F_output);
}
status = f_utf_is_valid(string + i, length - i);
if (status == F_true) {
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
}
}
else {
- if (!fputc_unlocked(f_print_sequence_unknown_s[0], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[0], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[1], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[1], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[2], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[2], stream)) {
return F_status_set_error(F_output);
}
}
}
if (status == F_false || i + macro_f_utf_byte_width(string[i]) >= length) {
- if (!fputc_unlocked(f_print_sequence_unknown_s[0], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[0], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[1], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[1], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[2], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[2], stream)) {
return F_status_set_error(F_output);
}
continue;
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
#endif // !defined(_di_fl_print_trim_except_safely_) || !defined(_di_fl_print_trim_except_dynamic_safely_) || !defined(_di_fl_print_trim_except_dynamic_partial_safely_) || !defined(_di_fl_print_trim_except_in_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_safely_)
#if !defined(_di_fl_print_trim_) || !defined(_di_fl_print_trim_dynamic_) || !defined(_di_fl_print_trim_dynamic_partial_)
- f_status_t private_fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *output) {
+ f_status_t private_fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *stream) {
f_array_length_t i = 0;
f_array_length_t j = 0;
return F_status_set_error(F_complete_not_utf_stop);
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
}
// @todo change logic to use single fwrite() based on byte width rather than multiple fputc...
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
#endif // !defined(_di_fl_print_trim_) || !defined(_di_fl_print_trim_dynamic_) || !defined(_di_fl_print_trim_dynamic_partial_)
#if !defined(_di_fl_print_trim_raw_) || !defined(_di_fl_print_trim_dynamic_raw_) || !defined(_di_fl_print_trim_dynamic_partial_raw_)
- f_status_t private_fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *output) {
+ f_status_t private_fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *stream) {
f_array_length_t i = 0;
f_array_length_t j = 0;
// print all processed whitespace (note: control characters are not whitespace so no checks for this are needed).
while (i < j) {
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1 && i + 1 < length) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2 && i + 2 < length) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3 && i + 3 < length) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
if (i >= length) break;
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1 && i + 1 < length) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2 && i + 2 < length) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3 && i + 3 < length) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
#endif // !defined(_di_fl_print_trim_raw_) || !defined(_di_fl_print_trim_dynamic_raw_) || !defined(_di_fl_print_trim_dynamic_partial_raw_)
#if !defined(_di_fl_print_trim_safely_) || !defined(_di_fl_print_trim_dynamic_safely_) || !defined(_di_fl_print_trim_dynamic_partial_safely_)
- f_status_t private_fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *output) {
+ f_status_t private_fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *stream) {
f_array_length_t i = 0;
f_array_length_t j = 0;
while (i < j) {
if (i + macro_f_utf_byte_width(string[i]) >= length) {
- if (!fputc_unlocked(f_print_sequence_unknown_s[0], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[0], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[1], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[1], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[2], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[2], stream)) {
return F_status_set_error(F_output);
}
status = f_utf_is_valid(string + i, length - i);
if (status == F_true) {
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
}
}
else {
- if (!fputc_unlocked(f_print_sequence_unknown_s[0], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[0], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[1], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[1], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[2], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[2], stream)) {
return F_status_set_error(F_output);
}
}
}
if (status == F_false || i + macro_f_utf_byte_width(string[i]) >= length) {
- if (!fputc_unlocked(f_print_sequence_unknown_s[0], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[0], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[1], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[1], stream)) {
return F_status_set_error(F_output);
}
- if (!fputc_unlocked(f_print_sequence_unknown_s[2], output)) {
+ if (!fputc_unlocked(f_print_sequence_unknown_s[2], stream)) {
return F_status_set_error(F_output);
}
continue;
}
- if (!fputc_unlocked(string[i], output)) {
+ if (!fputc_unlocked(string[i], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 1) {
- if (!fputc_unlocked(string[i + 1], output)) {
+ if (!fputc_unlocked(string[i + 1], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 2) {
- if (!fputc_unlocked(string[i + 2], output)) {
+ if (!fputc_unlocked(string[i + 2], stream)) {
return F_status_set_error(F_output);
}
if (macro_f_utf_byte_width(string[i]) > 3) {
- if (!fputc_unlocked(string[i + 3], output)) {
+ if (!fputc_unlocked(string[i + 3], stream)) {
return F_status_set_error(F_output);
}
}
*
* @param string
* The current character position within the string.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
* @param ap
* The variable arguments list.
* @see private_fl_print_convert_number()
*/
#if !defined(_di_fl_print_format_) || !defined(_di_fl_print_format_convert_)
- extern f_string_t private_fl_print_format_convert(f_string_t string, FILE *output, va_list *ap, f_status_t *status) F_attribute_visibility_internal_d;
+ extern f_string_t private_fl_print_format_convert(f_string_t string, FILE *stream, va_list *ap, f_status_t *status) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_format_) || !defined(_di_fl_print_format_convert_)
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fl_print_trim_except_in_dynamic_partial()
*/
#if !defined(_di_fl_print_trim_except_) || !defined(_di_fl_print_trim_except_dynamic_) || !defined(_di_fl_print_trim_except_dynamic_partial_) || !defined(_di_fl_print_trim_except_in_) || !defined(_di_fl_print_trim_except_in_dynamic_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_)
- extern f_status_t private_fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) F_attribute_visibility_internal_d;
+ extern f_status_t private_fl_print_trim_except_in(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_trim_except_) || !defined(_di_fl_print_trim_except_dynamic_) || !defined(_di_fl_print_trim_except_dynamic_partial_) || !defined(_di_fl_print_trim_except_in_) || !defined(_di_fl_print_trim_except_in_dynamic_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_)
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fl_print_trim_except_in_dynamic_partial_raw()
*/
#if !defined(_di_fl_print_trim_except_raw_) || !defined(_di_fl_print_trim_except_dynamic_raw_) || !defined(_di_fl_print_trim_except_dynamic_partial_raw_) || !defined(_di_fl_print_trim_except_in_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_raw_)
- extern f_status_t private_fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) F_attribute_visibility_internal_d;
+ extern f_status_t private_fl_print_trim_except_in_raw(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_trim_except_raw_) || !defined(_di_fl_print_trim_except_dynamic_raw_) || !defined(_di_fl_print_trim_except_dynamic_partial_raw_) || !defined(_di_fl_print_trim_except_in_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_raw_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_raw_)
/**
* @param except_in
* An array of ranges within the string to not print.
* The array of ranges is required/assumed to be in linear order.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fl_print_trim_except_in_dynamic_partial_safely()
*/
#if !defined(_di_fl_print_trim_except_safely_) || !defined(_di_fl_print_trim_except_dynamic_safely_) || !defined(_di_fl_print_trim_except_dynamic_partial_safely_) || !defined(_di_fl_print_trim_except_in_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_safely_)
- extern f_status_t private_fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) F_attribute_visibility_internal_d;
+ extern f_status_t private_fl_print_trim_except_in_safely(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *stream) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_trim_except_safely_) || !defined(_di_fl_print_trim_except_dynamic_safely_) || !defined(_di_fl_print_trim_except_dynamic_partial_safely_) || !defined(_di_fl_print_trim_except_in_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_safely_) || !defined(_di_fl_print_trim_except_in_dynamic_partial_safely_)
/**
* The string to output.
* @param length
* The total number of characters to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fl_print_trim_dynamic_partial()
*/
#if !defined(_di_fl_print_trim_) || !defined(_di_fl_print_trim_dynamic_) || !defined(_di_fl_print_trim_dynamic_partial_)
- extern f_status_t private_fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *output) F_attribute_visibility_internal_d;
+ extern f_status_t private_fl_print_trim(const f_string_t string, const f_array_length_t length, FILE *stream) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_trim_) || !defined(_di_fl_print_trim_dynamic_) || !defined(_di_fl_print_trim_dynamic_partial_)
/**
* The string to output.
* @param length
* The total number of characters to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fl_print_trim_dynamic_partial_raw()
*/
#if !defined(_di_fl_print_trim_raw_) || !defined(_di_fl_print_trim_dynamic_raw_) || !defined(_di_fl_print_trim_dynamic_partial_raw_)
- extern f_status_t private_fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *output) F_attribute_visibility_internal_d;
+ extern f_status_t private_fl_print_trim_raw(const f_string_t string, const f_array_length_t length, FILE *stream) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_trim_raw_) || !defined(_di_fl_print_trim_dynamic_raw_) || !defined(_di_fl_print_trim_dynamic_partial_raw_)
/**
* The string to output.
* @param length
* The total number of characters to print.
- * @param output
+ * @param stream
* The file stream to output to, including standard streams such as stdout and stderr.
*
* @return
* @see fl_print_trim_dynamic_partial_safely()
*/
#if !defined(_di_fl_print_trim_safely_) || !defined(_di_fl_print_trim_dynamic_safely_) || !defined(_di_fl_print_trim_dynamic_partial_safely_)
- extern f_status_t private_fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *output) F_attribute_visibility_internal_d;
+ extern f_status_t private_fl_print_trim_safely(const f_string_t string, const f_array_length_t length, FILE *stream) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_print_trim_safely_) || !defined(_di_fl_print_trim_dynamic_safely_) || !defined(_di_fl_print_trim_dynamic_partial_safely_)
#ifdef __cplusplus