The f_conversion_character_* functions should accept uint8_t instead of f_number_unsigned_t.
Implement the "/" character to designate the a partial range.
The "*_except*" string processing functions must accept an offset.
I was really hoping to avoid adding additional parameters but then I realized that I have to have a start offset.
The "except" positions and ranges are relative to the actual start and not the offset start.
The previous behavior of applying an offset to the string before passing results in the entire except positions and ranges to be invalid for any offset greater than 0.
Have F_eos (with error bit set) returned for when end of string is reached while calling fl_print_string_convert().
Rewrite the static/dynamic string argument printing logic.
Update private_fl_print_convert_number() to use bitwise operations rather than comparisons.
Convert the controller program.
Add missing "controller_string_value" and related to controller program.
#endif // _di_f_conversion_character_is_octal_
#ifndef _di_f_conversion_character_to_binary_
- f_status_t f_conversion_character_to_binary(const char character, f_number_unsigned_t *number) {
+ f_status_t f_conversion_character_to_binary(const char character, uint8_t *number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_binary_
#ifndef _di_f_conversion_character_to_decimal_
- f_status_t f_conversion_character_to_decimal(const char character, f_number_unsigned_t *number) {
+ f_status_t f_conversion_character_to_decimal(const char character, uint8_t *number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_decimal_
#ifndef _di_f_conversion_character_to_duodecimal_
- f_status_t f_conversion_character_to_duodecimal(const char character, f_number_unsigned_t *number) {
+ f_status_t f_conversion_character_to_duodecimal(const char character, uint8_t *number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_duodecimal_
#ifndef _di_f_conversion_character_to_hexidecimal_
- f_status_t f_conversion_character_to_hexidecimal(const char character, f_number_unsigned_t *number) {
+ f_status_t f_conversion_character_to_hexidecimal(const char character, uint8_t *number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_hexidecimal_
#ifndef _di_f_conversion_character_to_octal_
- f_status_t f_conversion_character_to_octal(const char character, f_number_unsigned_t *number) {
+ f_status_t f_conversion_character_to_octal(const char character, uint8_t *number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_binary_
- extern f_status_t f_conversion_character_to_binary(const char character, f_number_unsigned_t *number);
+ extern f_status_t f_conversion_character_to_binary(const char character, uint8_t *number);
#endif // _di_f_conversion_character_to_binary_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_decimal_
- extern f_status_t f_conversion_character_to_decimal(const char character, f_number_unsigned_t *number);
+ extern f_status_t f_conversion_character_to_decimal(const char character, uint8_t *number);
#endif // _di_f_conversion_character_to_decimal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_duodecimal_
- extern f_status_t f_conversion_character_to_duodecimal(const char character, f_number_unsigned_t *number);
+ extern f_status_t f_conversion_character_to_duodecimal(const char character, uint8_t *number);
#endif // _di_f_conversion_character_to_duodecimal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_hexidecimal_
- extern f_status_t f_conversion_character_to_hexidecimal(const char character, f_number_unsigned_t *number);
+ extern f_status_t f_conversion_character_to_hexidecimal(const char character, uint8_t *number);
#endif // _di_f_conversion_character_to_hexidecimal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_octal_
- extern f_status_t f_conversion_character_to_octal(const char character, f_number_unsigned_t *number);
+ extern f_status_t f_conversion_character_to_octal(const char character, uint8_t *number);
#endif // _di_f_conversion_character_to_octal_
/**
/**
* Provide basic format flags.
*
+ * @todo be sure to document that the "/", ";", and ":" use pre-defined orders, so "%/;:Q" and "%:/;Q" would be processed in the same (pre-defined) order (which is 1: static/dynamic string, 2: partial range, 3: ignore ats, 4: ignore ins).
+ *
* 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).
#define f_print_format_flag_ignore_index 0x4
#define f_print_format_flag_ignore_range 0x8
#define f_print_format_flag_precision 0x10
- #define f_print_format_flag_sign_always 0x20
- #define f_print_format_flag_sign_pad 0x40
- #define f_print_format_flag_trim 0x80
- #define f_print_format_flag_uppercase 0x100
- #define f_print_format_flag_width 0x200
- #define f_print_format_flag_zeros_leading 0x400
+ #define f_print_format_flag_range 0x20
+ #define f_print_format_flag_sign_always 0x40
+ #define f_print_format_flag_sign_pad 0x80
+ #define f_print_format_flag_trim 0x100
+ #define f_print_format_flag_uppercase 0x200
+ #define f_print_format_flag_width 0x400
+ #define f_print_format_flag_zeros_leading 0x800
#endif // _di_f_print_format_flags_
/**
#endif // _di_f_print_dynamic_partial_safely_
#ifndef _di_f_print_except_
- f_status_t f_print_except(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t f_print_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_data_not;
}
- return private_f_print_except(string, 0, length, except, output);
+ return private_f_print_except(string, offset, length, except, output);
}
#endif // _di_f_print_except_
#ifndef _di_f_print_except_raw_
- f_status_t f_print_except_raw(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t f_print_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, FILE *output) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_data_not;
}
- return private_f_print_except_raw(string, 0, length, except, output);
+ return private_f_print_except_raw(string, offset, length, except, output);
}
#endif // _di_f_print_except_raw_
#ifndef _di_f_print_except_safely_
- f_status_t f_print_except_safely(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t f_print_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, FILE *output) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_data_not;
}
- return private_f_print_except_safely(string, 0, length, except, output);
+ return private_f_print_except_safely(string, offset, length, except, output);
}
#endif // _di_f_print_except_safely_
#endif // _di_f_print_except_dynamic_safely_
#ifndef _di_f_print_except_in_
- f_status_t f_print_except_in(const f_string_t string, 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 f_print_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) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_data_not;
}
- return private_f_print_except_in(string, 0, length, except_at, except_in, output);
+ return private_f_print_except_in(string, offset, length, except_at, except_in, output);
}
#endif // _di_f_print_except_in_
#ifndef _di_f_print_except_in_raw_
- f_status_t f_print_except_in_raw(const f_string_t string, 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 f_print_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) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_data_not;
}
- return private_f_print_except_in_raw(string, 0, length, except_at, except_in, output);
+ return private_f_print_except_in_raw(string, offset, length, except_at, except_in, output);
}
#endif // _di_f_print_except_in_raw_
#ifndef _di_f_print_except_in_safely_
- f_status_t f_print_except_in_safely(const f_string_t string, 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 f_print_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) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_data_not;
}
- return private_f_print_except_in_safely(string, 0, length, except_at, except_in, output);
+ return private_f_print_except_in_safely(string, offset, length, except_at, except_in, output);
}
#endif // _di_f_print_except_in_safely_
/**
* Similar to a c-library printf, except that this will only print a specific range.
*
+ * An offset is provided because the except position is expected to be relative to the start position, without the offset applied.
+ *
* Will not stop at NULL.
* Will not print NULL.
* Will not print any 1-byte character at a location specified in except array.
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see fwrite_unlocked()
*/
#ifndef _di_f_print_except_
- extern f_status_t f_print_except(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t f_print_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
#endif // _di_f_print_except_
/**
* Similar to a c-library printf, except that this will only print a specific range.
*
+ * An offset is provided because the except position is expected to be relative to the start position, without the offset applied.
+ *
* Will not stop at NULL.
* Will print NULL.
* Will not print any 1-byte character at a location specified in except array.
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see fwrite_unlocked()
*/
#ifndef _di_f_print_except_raw_
- extern f_status_t f_print_except_raw(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t f_print_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, FILE *output);
#endif // _di_f_print_except_raw_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see f_utf_is_valid()
*/
#ifndef _di_f_print_except_safely_
- extern f_status_t f_print_except_safely(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t f_print_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, FILE *output);
#endif // _di_f_print_except_safely_
/**
/**
* Similar to a c-library printf, except that this will only print a specific range.
*
+ * An offset is provided because the except_at/except_int positions are expected to be relative to the start position, without the offset applied.
+ *
* Will not stop at NULL.
* Will not print NULL.
* Will not print any 1-byte character at a location specified in except_at array.
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see fwrite_unlocked()
*/
#ifndef _di_f_print_except_in_
- extern f_status_t f_print_except_in(const f_string_t string, 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 f_print_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);
#endif // _di_f_print_except_in_
/**
* Similar to a c-library printf, except that this will only print a specific range.
*
+ * An offset is provided because the except_at/except_int positions are expected to be relative to the start position, without the offset applied.
+ *
* Will not stop at NULL.
* Will print NULL.
* Will not print any 1-byte character at a location specified in except_at array.
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see fwrite_unlocked()
*/
#ifndef _di_f_print_except_in_raw_
- extern f_status_t f_print_except_in_raw(const f_string_t string, 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 f_print_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);
#endif // _di_f_print_except_in_raw_
/**
* Control characters are converted to the Unicode control character symbols, including NULL.
* UTF-8 sequences with invalid widths are converted to the unknown character '�'.
*
+ * An offset is provided because the except_at/except_int positions are expected to be relative to the start position, without the offset applied.
+ *
* Will not stop at NULL.
* Will print NULL (as a control character symbol).
* Will not print any 1-byte character at a location specified in except_at array.
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see f_utf_is_valid()
*/
#ifndef _di_f_print_except_in_safely_
- extern f_status_t f_print_except_in_safely(const f_string_t string, 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 f_print_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);
#endif // _di_f_print_except_in_safely_
/**
for (register f_array_length_t i = 0; i < length; ) {
- total = strlen(string + start);
+ total = strnlen(string + start, length - start);
if (total) {
if (fwrite_unlocked(string + start, 1, total, output) == -1) {
for (register f_array_length_t i = 0; i < length; ) {
- total = strlen(string + start);
+ total = strnlen(string + start, length - start);
if (total) {
if (fwrite_unlocked(string + start, 1, total, output) == -1) {
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
digits = 1;
if (negative) {
- converted = 0 - digit;
+ converted = (f_number_unsigned_t) (0 - digit);
}
else {
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
}
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
}
else if (digit) {
digits = 1;
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
else if (string[i]) {
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
digits = 1;
if (negative) {
- converted = 0 - digit;
+ converted = (f_number_unsigned_t) (0 - digit);
}
else {
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
}
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
}
else if (digit) {
digits = 1;
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
else if (string[i]) {
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
digits = 1;
if (negative) {
- converted = 0 - digit;
+ converted = (f_number_unsigned_t) (0 - digit);
}
else {
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
}
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
}
else if (digit) {
digits = 1;
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
else if (string[i]) {
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
digits = 1;
if (negative) {
- converted = 0 - digit;
+ converted = (f_number_unsigned_t) (0 - digit);
}
else {
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
}
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
}
else if (digit) {
digits = 1;
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
else if (string[i]) {
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
digits = 1;
if (negative) {
- converted = 0 - digit;
+ converted = (f_number_unsigned_t) (0 - digit);
}
else {
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
}
}
uint8_t digits = 0;
- f_number_unsigned_t digit = 0;
+ uint8_t digit = 0;
f_number_unsigned_t converted = 0;
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
}
else if (digit) {
digits = 1;
- converted = digit;
+ converted = (f_number_unsigned_t) digit;
}
}
else if (string[i]) {
#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 length, const f_array_lengths_t except, 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in(string, length, except, except_in, output);
+ return private_fl_print_trim_except_in(string, offset, length, except_at, except_in, output);
}
#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 length, const f_array_lengths_t except, 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_raw(string, length, except, except_in, output);
+ return private_fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, output);
}
#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 length, const f_array_lengths_t except, 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_safely(string, length, except, except_in, output);
+ return private_fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, output);
}
#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, FILE *output) {
+ f_status_t fl_print_trim_except_dynamic(const f_string_static_t buffer, const f_array_lengths_t except_at, FILE *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in(buffer.string, buffer.used, except, except_in, output);
+ return private_fl_print_trim_except_in(buffer.string, 0, buffer.used, except_at, except_in, output);
}
#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, 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_raw(buffer.string, buffer.used, except, except_in, output);
+ return private_fl_print_trim_except_in_raw(buffer.string, 0, buffer.used, except_at, except_in, output);
}
#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, 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
const f_string_ranges_t except_in = f_string_ranges_t_initialize;
- return private_fl_print_trim_except_in_safely(buffer.string, buffer.used, except, except_in, output);
+ return private_fl_print_trim_except_in_safely(buffer.string, 0, buffer.used, except_at, except_in, output);
}
#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 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not;
}
- return private_fl_print_trim_except_in(string, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in(string, offset, length, except_at, except_in, output);
}
#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 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not;
}
- return private_fl_print_trim_except_in_raw(string, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, output);
}
#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 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 *output) {
#ifndef _di_level_1_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not;
}
- return private_fl_print_trim_except_in_safely(string, length, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, output);
}
#endif // _di_fl_print_trim_except_in_safely_
return F_data_not;
}
- return private_fl_print_trim_except_in(buffer.string, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in(buffer.string, 0, buffer.used, except_at, except_in, output);
}
#endif // _di_fl_print_trim_except_in_dynamic_
return F_data_not;
}
- return private_fl_print_trim_except_in_raw(buffer.string, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in_raw(buffer.string, 0, buffer.used, except_at, except_in, output);
}
#endif // _di_fl_print_trim_except_in_dynamic_raw_
return F_data_not;
}
- return private_fl_print_trim_except_in_safely(buffer.string, buffer.used, except_at, except_in, output);
+ return private_fl_print_trim_except_in_safely(buffer.string, 0, buffer.used, except_at, except_in, output);
}
#endif // _di_fl_print_trim_except_in_dynamic_safely_
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, output);
}
#endif // _di_fl_print_trim_except_in_dynamic_partial_
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, output);
}
#endif // _di_fl_print_trim_except_in_dynamic_partial_raw_
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, output);
}
#endif // _di_fl_print_trim_except_in_dynamic_partial_safely_
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, output);
}
#endif // _di_fl_print_trim_except_dynamic_partial_
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, output);
}
#endif // _di_fl_print_trim_except_dynamic_partial_raw_
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, output);
}
#endif // _di_fl_print_trim_except_dynamic_partial_safely_
*
* Will not stop at NULL.
* Will not print NULL.
- * Will not print any 1-byte character at a location specified in except array.
+ * Will not print any 1-byte character at a location specified in except_at array.
*
* NULL characters are treated as whitespace for the purpose of trimming.
*
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
- * @param 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
* @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 length, const f_array_lengths_t except, 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 *output);
#endif // _di_fl_print_trim_except_
/**
*
* Will not stop at NULL.
* Will print NULL.
- * Will not print any 1-byte character at a location specified in except array.
+ * Will not print any 1-byte character at a location specified in except_at array.
*
* All UTF-8 characters, invalid or not, are printed as is, except for trimmed characters.
* Invalid UTF-8 characters are not considered whitespace for the purpose of trimming.
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
- * @param 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
* @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 length, const f_array_lengths_t except, 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 *output);
#endif // _di_fl_print_trim_except_raw_
/**
*
* Will not stop at NULL.
* Will print NULL (as a control character symbol).
- * Will not print any 1-byte character at a location specified in except array.
+ * Will not print any 1-byte character at a location specified in except_at array.
*
* NULL characters are treated as whitespace for the purpose of trimming.
*
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
- * @param 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
* @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 length, const f_array_lengths_t except, 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 *output);
#endif // _di_fl_print_trim_except_safely_
/**
* Will not stop at NULL.
* Will not print NULL.
* Will print the entire dynamic string, except for leading/trailing whitespace.
- * Will not print any 1-byte character at a location specified in except array.
+ * Will not print any 1-byte character at a location specified in except_at array.
*
* NULL characters are treated as whitespace for the purpose of trimming.
*
*
* @param buffer
* The string to output.
- * @param 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
* @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, 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 *output);
#endif // _di_fl_print_trim_except_dynamic_
/**
* Will not stop at NULL.
* Will print NULL.
* Will print the entire dynamic string, except for leading/trailing whitespace.
- * Will not print any 1-byte character at a location specified in except array.
+ * Will not print any 1-byte character at a location specified in except_at array.
*
* All UTF-8 characters, invalid or not, are printed as is, except for trimmed characters.
* Invalid UTF-8 characters are not considered whitespace for the purpose of trimming.
*
* @param buffer
* The string to output.
- * @param 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
* @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, 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 *output);
#endif // _di_fl_print_trim_except_dynamic_raw_
/**
* Will not stop at NULL.
* Will print NULL (as a control character symbol).
* Will print the entire dynamic string, except for leading/trailing whitespace.
- * Will not print any 1-byte character at a location specified in except array.
+ * Will not print any 1-byte character at a location specified in except_at array.
*
* NULL characters are treated as whitespace for the purpose of trimming.
*
*
* @param buffer
* The string to output.
- * @param 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
* @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, 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 *output);
#endif // _di_fl_print_trim_except_dynamic_safely_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @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 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 *output);
#endif // _di_fl_print_trim_except_in_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @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 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 *output);
#endif // _di_fl_print_trim_except_in_raw_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @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 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 *output);
#endif // _di_fl_print_trim_except_in_safely_
/**
*
* @param buffer
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @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.
// An unpaired '%' character must not be at the end of the string.
if (!*string) {
- *status = F_status_set_error(F_valid_not);
+ *status = F_status_set_error(F_eos);
+
return string;
}
// 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)) {
- return string;
+ *status = F_status_set_error(F_output);
}
}
+ else {
+ *status = F_status_set_error(F_valid_not);
+ }
- *status = F_status_set_error(F_valid_not);
return string;
}
else if (*string == f_string_ascii_ampersand_s[0]) {
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
}
else if (*string == f_string_ascii_period_s[0]) {
if (!*(string + 1)) {
- *status = F_status_set_error(F_valid_not);
+ *status = F_status_set_error(F_eos);
+
return string;
}
if (*string < 0x30 || *string > 0x39) {
*status = F_status_set_error(F_valid_not);
+
return string;
}
continue;
}
+ else if (*string == f_string_ascii_slash_forward_s[0]) {
+ flag |= f_print_format_flag_range;
+
+ continue;
+ }
else if (*string > 0x2f && *string < 0x3a) {
if (!(flag & f_print_format_flag_width)) {
if (*string == f_string_ascii_0_s[0]) {
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
else if (*string == f_string_ascii_Q_s[0]) {
const f_string_static_t value = va_arg(*ap, f_string_static_t);
- if (flag & f_print_format_flag_trim) {
+ if (flag & f_print_format_flag_range) {
+ const f_string_range_t partial = va_arg(*ap, f_string_range_t);
+
if (flag & f_print_format_flag_ignore_index) {
+ const f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
+ f_string_ranges_t except_in = f_string_ranges_t_initialize;
+
if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ except_in = va_arg(*ap, f_string_ranges_t);
+ }
- *status = private_fl_print_trim_except_in_safely(value.string, value.used, except_at, except_in, output);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
return string;
}
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = f_string_ranges_t_initialize;
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = private_fl_print_trim_except_in_safely(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ }
}
+ else if (flag & f_print_format_flag_ignore_range) {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = f_array_lengths_t_initialize;
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
+
+ return string;
+ }
+
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = private_fl_print_trim_except_in_safely(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_safely(value.string, partial.start, length, except_at, except_in, output);
+ }
}
+ else {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- *status = private_fl_print_trim_safely(value.string, value.used, output);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
- return string;
- }
+ return string;
+ }
- if (flag & f_print_format_flag_ignore_index) {
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = f_print_except_in_safely(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_safely(value.string + partial.start, length, output);
+ }
+ else {
+ *status = f_print_safely(value.string + partial.start, length, output);
+ }
}
-
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
+ }
+ else if (flag & f_print_format_flag_ignore_index) {
+ const f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
f_string_ranges_t except_in = f_string_ranges_t_initialize;
- *status = f_print_except_in_safely(value.string, value.used, except_at, except_in, output);
+ if (flag & f_print_format_flag_ignore_range) {
+ except_in = va_arg(*ap, f_string_ranges_t);
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_safely(value.string, 0, value.used, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_dynamic_safely(value, except_at, except_in, output);
+ }
}
+ else if (flag & f_print_format_flag_ignore_range) {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = f_array_lengths_t_initialize;
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
-
- *status = f_print_except_in_safely(value.string, value.used, except_at, except_in, output);
-
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_safely(value.string, 0, value.used, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_dynamic_safely(value, except_at, except_in, output);
+ }
+ }
+ else {
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_safely(value.string, value.used, output);
+ }
+ else {
+ *status = f_print_dynamic_safely(value, output);
+ }
}
-
- *status = f_print_dynamic_safely(value, output);
return string;
}
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
else if (*string == f_string_ascii_q_s[0]) {
const f_string_static_t value = va_arg(*ap, f_string_static_t);
- if (flag & f_print_format_flag_trim) {
+ if (flag & f_print_format_flag_range) {
+ const f_string_range_t partial = va_arg(*ap, f_string_range_t);
+
if (flag & f_print_format_flag_ignore_index) {
+ const f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
+ f_string_ranges_t except_in = f_string_ranges_t_initialize;
+
if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ except_in = va_arg(*ap, f_string_ranges_t);
+ }
- *status = private_fl_print_trim_except_in(value.string, value.used, except_at, except_in, output);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
return string;
}
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = f_string_ranges_t_initialize;
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = private_fl_print_trim_except_in(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in(value.string, partial.start, length, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in(value.string, partial.start, length, except_at, except_in, output);
+ }
}
+ else if (flag & f_print_format_flag_ignore_range) {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = f_array_lengths_t_initialize;
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
- *status = private_fl_print_trim_except_in(value.string, value.used, except_at, except_in, output);
+ return string;
+ }
- return string;
+ f_array_length_t length = (partial.stop - partial.start) + 1;
+
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
+
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in(value.string, partial.start, length, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in(value.string, partial.start, length, except_at, except_in, output);
+ }
}
+ else {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- *status = private_fl_print_trim(value.string, value.used, output);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
- return string;
- }
+ return string;
+ }
- if (flag & f_print_format_flag_ignore_index) {
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = f_print_except_in(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim(value.string + partial.start, length, output);
+ }
+ else {
+ *status = f_print(value.string + partial.start, length, output);
+ }
}
-
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
+ }
+ else if (flag & f_print_format_flag_ignore_index) {
+ const f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
f_string_ranges_t except_in = f_string_ranges_t_initialize;
- *status = f_print_except_in(value.string, value.used, except_at, except_in, output);
+ if (flag & f_print_format_flag_ignore_range) {
+ except_in = va_arg(*ap, f_string_ranges_t);
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in(value.string, 0, value.used, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_dynamic(value, except_at, except_in, output);
+ }
}
+ else if (flag & f_print_format_flag_ignore_range) {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = f_array_lengths_t_initialize;
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
-
- *status = f_print_except_in(value.string, value.used, except_at, except_in, output);
-
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in(value.string, 0, value.used, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_dynamic(value, except_at, except_in, output);
+ }
+ }
+ else {
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim(value.string, value.used, output);
+ }
+ else {
+ *status = f_print_dynamic(value, output);
+ }
}
-
- *status = f_print_dynamic(value, output);
return string;
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
else {
if (*string == f_string_ascii_r_s[0]) {
-
- // raw static/dynamic string.
const f_string_static_t value = va_arg(*ap, f_string_static_t);
- if (flag & f_print_format_flag_trim) {
+ if (flag & f_print_format_flag_range) {
+ const f_string_range_t partial = va_arg(*ap, f_string_range_t);
+
if (flag & f_print_format_flag_ignore_index) {
+ const f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
+ f_string_ranges_t except_in = f_string_ranges_t_initialize;
+
if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ except_in = va_arg(*ap, f_string_ranges_t);
+ }
- *status = private_fl_print_trim_except_in_raw(value.string, value.used, except_at, except_in, output);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
return string;
}
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = f_string_ranges_t_initialize;
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = private_fl_print_trim_except_in_raw(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ }
}
+ else if (flag & f_print_format_flag_ignore_range) {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = f_array_lengths_t_initialize;
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
+
+ return string;
+ }
+
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = private_fl_print_trim_except_in_raw(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_raw(value.string, partial.start, length, except_at, except_in, output);
+ }
}
+ else {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- *status = private_fl_print_trim_raw(value.string, value.used, output);
+ if (partial.start > partial.start) {
+ *status = F_data_not;
- return string;
- }
+ return string;
+ }
- if (flag & f_print_format_flag_ignore_index) {
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
+ f_array_length_t length = (partial.stop - partial.start) + 1;
- *status = f_print_except_in_raw(value.string, value.used, except_at, except_in, output);
+ if (length + partial.start > value.used) {
+ length = value.used - partial.start;
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_raw(value.string + partial.start, length, output);
+ }
+ else {
+ *status = f_print_raw(value.string + partial.start, length, output);
+ }
}
-
- f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
+ }
+ else if (flag & f_print_format_flag_ignore_index) {
+ const f_array_lengths_t except_at = va_arg(*ap, f_array_lengths_t);
f_string_ranges_t except_in = f_string_ranges_t_initialize;
- *status = f_print_except_in_raw(value.string, value.used, except_at, except_in, output);
+ if (flag & f_print_format_flag_ignore_range) {
+ except_in = va_arg(*ap, f_string_ranges_t);
+ }
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_raw(value.string, 0, value.used, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_dynamic_raw(value, except_at, except_in, output);
+ }
}
+ else if (flag & f_print_format_flag_ignore_range) {
+ const f_array_lengths_t except_at = f_array_lengths_t_initialize;
+ const f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
- if (flag & f_print_format_flag_ignore_range) {
- f_array_lengths_t except_at = f_array_lengths_t_initialize;
- f_string_ranges_t except_in = va_arg(*ap, f_string_ranges_t);
-
- *status = f_print_except_in_raw(value.string, value.used, except_at, except_in, output);
-
- return string;
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_except_in_raw(value.string, 0, value.used, except_at, except_in, output);
+ }
+ else {
+ *status = f_print_except_in_dynamic_raw(value, except_at, except_in, output);
+ }
+ }
+ else {
+ if (flag & f_print_format_flag_trim) {
+ *status = private_fl_print_trim_raw(value.string, value.used, output);
+ }
+ else {
+ *status = f_print_dynamic_raw(value, output);
+ }
}
-
- *status = f_print_dynamic_raw(value, output);
return string;
}
}
else {
*status = F_status_set_error(F_valid_not);
+
return string;
}
}
} // for
*status = F_status_set_error(F_valid_not);
+
return string;
}
#endif // !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_)
for (*number = 0; *string; string += 1) {
- if (*string == f_string_ascii_0_s[0]) {
- *number *= 10;
- }
- else if (*string == f_string_ascii_1_s[0]) {
- *number *= 10;
- *number += 1;
- }
- else if (*string == f_string_ascii_2_s[0]) {
- *number *= 10;
- *number += 2;
- }
- else if (*string == f_string_ascii_3_s[0]) {
- *number *= 10;
- *number += 3;
- }
- else if (*string == f_string_ascii_4_s[0]) {
- *number *= 10;
- *number += 4;
- }
- else if (*string == f_string_ascii_5_s[0]) {
+ if (*string > 0x29 && *string < 0x40) {
*number *= 10;
- *number += 5;
- }
- else if (*string == f_string_ascii_6_s[0]) {
- *number *= 10;
- *number += 6;
- }
- else if (*string == f_string_ascii_7_s[0]) {
- *number *= 10;
- *number += 7;
- }
- else if (*string == f_string_ascii_8_s[0]) {
- *number *= 10;
- *number += 8;
- }
- else if (*string == f_string_ascii_9_s[0]) {
- *number *= 10;
- *number += 9;
+ *number += 0xf & *string;
}
else if (*string == f_string_ascii_asterisk_s[0]) {
*number = va_arg(*ap, unsigned int);
#endif // !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_)
#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 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 *output) {
- f_array_length_t i = 0;
+ f_array_length_t i = offset;
f_array_length_t j = 0;
f_array_length_t at = 0;
f_array_length_t at2 = 0;
#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 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 *output) {
- f_array_length_t i = 0;
+ f_array_length_t i = offset;
f_array_length_t j = 0;
f_array_length_t at = 0;
f_array_length_t at2 = 0;
#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 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 *output) {
- f_array_length_t i = 0;
+ f_array_length_t i = offset;
f_array_length_t j = 0;
f_array_length_t at = 0;
f_array_length_t at2 = 0;
*
* F_none on success.
*
+ * F_eos (with error bit) on failure because end of string found and cannot process further.
* F_output (with error bit) on failure to print to the output file.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf_not (with error bit) if character is an invalid UTF-8 character.
- * F_valid_not (with error bit) on invalid syntax (such as terminating the string on a single '%').
+ * F_valid_not (with error bit) on invalid syntax.
*
* Success from: f_print_dynamic().
* Success from: f_print_dynamic_raw().
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @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 length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) f_attribute_visibility_internal;
+ 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;
#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 string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @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 length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) f_attribute_visibility_internal;
+ 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;
#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 string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @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 length, const f_array_lengths_t except_at, const f_string_ranges_t except_in, FILE *output) f_attribute_visibility_internal;
+ 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;
#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 (print.verbosity != f_console_verbosity_quiet) {
flockfile(print.to.stream);
- fl_print_string("%c%[%S(", print.to.stream, f_string_eol_s[0], print.context, print.prefix);
- fl_print_string("%[%ui%]%[", print.to.stream, print.notable, status, print.notable, print.context);
+ fl_print_string("%c%[%S(%]", print.to.stream, f_string_eol_s[0], print.context, print.prefix, print.context);
+ fl_print_string("%[%ui%]%[)", print.to.stream, print.notable, status, print.notable, print.context);
private_fll_error_print_function(print, function);
- fl_print_string(").%]%c", print.to.stream, print.context, f_string_eol_s[0]);
+ fl_print_string(".%]%c", print.to.stream, print.context, f_string_eol_s[0]);
funlockfile(print.to.stream);
}
void private_fll_error_print_function(const fll_error_print_t print, const f_string_t function) {
if (function) {
- fl_print_string(" when calling function %]", print.to.stream, print.context);
+ fl_print_string(" when calling function%] ", print.to.stream, print.context);
fl_print_string("%[%S%]", print.to.stream, print.notable, function, print.notable);
fl_print_string("%[()", print.to.stream, print.context);
}
#endif // _di_fll_print_dynamic_partial_safely_
#ifndef _di_fll_print_except_
- f_status_t fll_print_except(const f_string_t buffer, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t fll_print_except(const f_string_t buffer, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
flockfile(output);
- const f_status_t status = f_print_except(buffer, length, except, output);
+ const f_status_t status = f_print_except(buffer, offset, length, except, output);
funlockfile(output);
#endif // _di_fll_print_except_
#ifndef _di_fll_print_except_raw_
- f_status_t fll_print_except_raw(const f_string_t buffer, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t fll_print_except_raw(const f_string_t buffer, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
flockfile(output);
- const f_status_t status = f_print_except_raw(buffer, length, except, output);
+ const f_status_t status = f_print_except_raw(buffer, offset, length, except, output);
funlockfile(output);
#endif // _di_fll_print_except_raw_
#ifndef _di_fll_print_except_safely_
- f_status_t fll_print_except_safely(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t fll_print_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, FILE *output) {
flockfile(output);
- const f_status_t status = f_print_except_safely(string, length, except, output);
+ const f_status_t status = f_print_except_safely(string, offset, length, except, output);
funlockfile(output);
#endif // _di_fll_print_except_dynamic_safely_
#ifndef _di_fll_print_except_in_
- f_status_t fll_print_except_in(const f_string_t string, 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 fll_print_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) {
flockfile(output);
- const f_status_t status = f_print_except_in(string, length, except_at, except_in, output);
+ const f_status_t status = f_print_except_in(string, offset, length, except_at, except_in, output);
funlockfile(output);
#endif // _di_fll_print_except_in_
#ifndef _di_fll_print_except_in_raw_
- f_status_t fll_print_except_in_raw(const f_string_t string, 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 fll_print_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) {
flockfile(output);
- const f_status_t status = f_print_except_in_raw(string, length, except_at, except_in, output);
+ const f_status_t status = f_print_except_in_raw(string, offset, length, except_at, except_in, output);
funlockfile(output);
#endif // _di_fll_print_except_in_raw_
#ifndef _di_fll_print_except_in_safely_
- f_status_t fll_print_except_in_safely(const f_string_t string, 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 fll_print_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) {
flockfile(output);
- const f_status_t status = f_print_except_in_safely(string, length, except_at, except_in, output);
+ const f_status_t status = f_print_except_in_safely(string, offset, length, except_at, except_in, output);
funlockfile(output);
#endif // _di_fll_print_trim_dynamic_partial_safely_
#ifndef _di_fll_print_trim_except_
- f_status_t fll_print_trim_except(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t fll_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, FILE *output) {
flockfile(output);
- const f_status_t status = fl_print_trim_except(string, length, except, output);
+ const f_status_t status = fl_print_trim_except(string, offset, length, except, output);
funlockfile(output);
#endif // _di_fll_print_trim_except_
#ifndef _di_fll_print_trim_except_raw_
- f_status_t fll_print_trim_except_raw(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t fll_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, FILE *output) {
flockfile(output);
- const f_status_t status = fl_print_trim_except_raw(string, length, except, output);
+ const f_status_t status = fl_print_trim_except_raw(string, offset, length, except, output);
funlockfile(output);
#endif // _di_fll_print_trim_except_raw_
#ifndef _di_fll_print_trim_except_safely_
- f_status_t fll_print_trim_except_safely(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output) {
+ f_status_t fll_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, FILE *output) {
flockfile(output);
- const f_status_t status = fl_print_trim_except_safely(string, length, except, output);
+ const f_status_t status = fl_print_trim_except_safely(string, offset, length, except, output);
funlockfile(output);
#endif // _di_fll_print_trim_except_dynamic_safely_
#ifndef _di_fll_print_trim_except_in_
- f_status_t fll_print_trim_except_in(const f_string_t string, 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 fll_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) {
flockfile(output);
- const f_status_t status = fl_print_trim_except_in(string, length, except_at, except_in, output);
+ const f_status_t status = fl_print_trim_except_in(string, offset, length, except_at, except_in, output);
funlockfile(output);
#endif // _di_fll_print_trim_except_in_
#ifndef _di_fll_print_trim_except_in_raw_
- f_status_t fll_print_trim_except_in_raw(const f_string_t string, 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 fll_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) {
flockfile(output);
- const f_status_t status = fl_print_trim_except_in_raw(string, length, except_at, except_in, output);
+ const f_status_t status = fl_print_trim_except_in_raw(string, offset, length, except_at, except_in, output);
funlockfile(output);
#endif // _di_fll_print_trim_except_in_raw_
#ifndef _di_fll_print_trim_except_in_safely_
- f_status_t fll_print_trim_except_in_safely(const f_string_t string, 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 fll_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) {
flockfile(output);
- const f_status_t status = fl_print_trim_except_in_safely(string, length, except_at, except_in, output);
+ const f_status_t status = fl_print_trim_except_in_safely(string, offset, length, except_at, except_in, output);
funlockfile(output);
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see f_print_except()
*/
#ifndef _di_fll_print_except_
- extern f_status_t fll_print_except(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fll_print_except(const f_string_t string, const f_array_length_t offset, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
#endif // _di_fll_print_except_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see f_print_except_raw()
*/
#ifndef _di_fll_print_except_raw_
- extern f_status_t fll_print_except_raw(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fll_print_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, FILE *output);
#endif // _di_fll_print_except_raw_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see f_print_except_safely()
*/
#ifndef _di_fll_print_except_safely_
- extern f_status_t fll_print_except_safely(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fll_print_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, FILE *output);
#endif // _di_fll_print_except_safely_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see f_print_except_in()
*/
#ifndef _di_fll_print_except_in_
- extern f_status_t fll_print_except_in(const f_string_t string, 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 fll_print_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);
#endif // _di_fll_print_except_in_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see f_print_except_in_raw()
*/
#ifndef _di_fll_print_except_in_raw_
- extern f_status_t fll_print_except_in_raw(const f_string_t string, 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 fll_print_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);
#endif // _di_fll_print_except_in_raw_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see f_print_except_in_safely()
*/
#ifndef _di_fll_print_except_in_safely_
- extern f_status_t fll_print_except_in_safely(const f_string_t string, 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 fll_print_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);
#endif // _di_fll_print_except_in_safely_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see fl_print_trim_except()
*/
#ifndef _di_fll_print_trim_except_
- extern f_status_t fll_print_trim_except(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fll_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, FILE *output);
#endif // _di_fll_print_trim_except_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see fl_print_trim_except_raw()
*/
#ifndef _di_fll_print_trim_except_raw_
- extern f_status_t fll_print_trim_except_raw(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fll_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, FILE *output);
#endif // _di_fll_print_trim_except_raw_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except
* @see fl_print_trim_except_safely()
*/
#ifndef _di_fll_print_trim_except_safely_
- extern f_status_t fll_print_trim_except_safely(const f_string_t string, const f_array_length_t length, const f_array_lengths_t except, FILE *output);
+ extern f_status_t fll_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, FILE *output);
#endif // _di_fll_print_trim_except_safely_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see fl_print_trim_except_in()
*/
#ifndef _di_fll_print_trim_except_in_
- extern f_status_t fll_print_trim_except_in(const f_string_t string, 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 fll_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);
#endif // _di_fll_print_trim_except_in_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see fl_print_trim_except_in_raw()
*/
#ifndef _di_fll_print_trim_except_in_raw_
- extern f_status_t fll_print_trim_except_in_raw(const f_string_t string, 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 fll_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);
#endif // _di_fll_print_trim_except_in_raw_
/**
*
* @param string
* The string to output.
+ * @param offset
+ * The inclusive start point to start printing.
* @param length
* The total number of characters to print.
* @param except_at
* @see fl_print_trim_except_in_safely()
*/
#ifndef _di_fll_print_trim_except_in_safely_
- extern f_status_t fll_print_trim_except_in_safely(const f_string_t string, 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 fll_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);
#endif // _di_fll_print_trim_except_in_safely_
/**
flockfile(main->error.to.stream);
fl_print_string("%c%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
- fl_print_string("%[%s%s%]", main->error.to.stream, main->context.notable, f_console_symbol_long_enable_s, controller_long_settings, main->context.notable);
+ fl_print_string("%[%s%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_settings, main->context.set.notable);
fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
funlockfile(main->error.to.stream);
}
}
- if (main->parameters[controller_parameter_pid].result == f_console_result_found) {
- if (main->error.verbosity != f_console_verbosity_quiet) {
- flockfile(main->error.to.stream);
+ if (F_status_is_error_not(status)) {
+ if (main->parameters[controller_parameter_pid].result == f_console_result_found) {
+ if (main->error.verbosity != f_console_verbosity_quiet) {
+ flockfile(main->error.to.stream);
- fl_print_string("%c%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
- fl_print_string("%[%s%s%]", main->error.to.stream, main->context.notable, f_console_symbol_long_enable_s, controller_long_pid, main->context.notable);
- fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+ fl_print_string("%c%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%s%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_pid, main->context.set.notable);
+ fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->error.to.stream);
- }
+ funlockfile(main->error.to.stream);
+ }
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters[controller_parameter_pid].locations.used) {
- const f_array_length_t location = main->parameters[controller_parameter_pid].values.array[main->parameters[controller_parameter_pid].values.used - 1];
+ status = F_status_set_error(F_parameter);
+ }
+ else if (main->parameters[controller_parameter_pid].locations.used) {
+ const f_array_length_t location = main->parameters[controller_parameter_pid].values.array[main->parameters[controller_parameter_pid].values.used - 1];
- if (strnlen(arguments.argv[location], f_console_parameter_size)) {
- status = fll_path_canonical(arguments.argv[location], &setting.path_pid);
+ if (strnlen(arguments.argv[location], f_console_parameter_size)) {
+ status = fll_path_canonical(arguments.argv[location], &setting.path_pid);
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true);
+ if (F_status_is_error(status)) {
+ fll_error_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true);
+ }
}
- }
- else {
- if (main->warning.verbosity == f_console_verbosity_debug) {
- flockfile(main->warning.to.stream);
+ else {
+ if (main->warning.verbosity == f_console_verbosity_debug) {
+ flockfile(main->warning.to.stream);
- fl_print_string("%c%[%SThe parameter '%]", main->warning.to.stream, f_string_eol_s[0], main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
- fl_print_string("%[%s%s%]", main->warning.to.stream, main->context.notable, f_console_symbol_long_enable_s, controller_long_pid, main->context.notable);
- fl_print_string("%[' must be a file path but instead is an empty string, falling back to the default.%]%c", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s[0]);
+ fl_print_string("%c%[%SThe parameter '%]", main->warning.to.stream, f_string_eol_s[0], main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
+ fl_print_string("%[%s%s%]", main->warning.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_pid, main->context.set.notable);
+ fl_print_string("%[' must be a file path but instead is an empty string, falling back to the default.%]%c", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s[0]);
- funlockfile(main->warning.to.stream);
+ funlockfile(main->warning.to.stream);
+ }
}
}
}
// a pid file path is required.
- if (!setting.path_pid.used) {
+ if (F_status_is_error_not(status) && !setting.path_pid.used) {
if (main->parameters[controller_parameter_init].result == f_console_result_found) {
status = f_string_append(controller_path_pid_init, controller_path_pid_init_length, &setting.path_pid);
}
}
- if (main->parameters[controller_parameter_control].result == f_console_result_found) {
- if (main->error.verbosity != f_console_verbosity_quiet) {
- flockfile(main->error.to.stream);
-
- fl_print_string("%c%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
- fl_print_string("%[%s%s%]", main->error.to.stream, main->context.notable, f_console_symbol_long_enable_s, controller_long_control, main->context.notable);
- fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+ if (F_status_is_error_not(status)) {
+ if (main->parameters[controller_parameter_control].result == f_console_result_found) {
+ if (main->error.verbosity != f_console_verbosity_quiet) {
+ flockfile(main->error.to.stream);
- funlockfile(main->error.to.stream);
- }
+ fl_print_string("%c%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%s%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_control, main->context.set.notable);
+ fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters[controller_parameter_control].locations.used) {
- const f_array_length_t location = main->parameters[controller_parameter_control].values.array[main->parameters[controller_parameter_control].values.used - 1];
+ funlockfile(main->error.to.stream);
+ }
- if (strnlen(arguments.argv[location], f_console_parameter_size)) {
- status = fll_path_canonical(arguments.argv[location], &setting.path_control);
+ status = F_status_set_error(F_parameter);
+ }
+ else if (main->parameters[controller_parameter_control].locations.used) {
+ const f_array_length_t location = main->parameters[controller_parameter_control].values.array[main->parameters[controller_parameter_control].values.used - 1];
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true);
- }
- else {
- status = f_string_append_assure(f_path_separator, 1, &setting.path_control);
+ if (strnlen(arguments.argv[location], f_console_parameter_size)) {
+ status = fll_path_canonical(arguments.argv[location], &setting.path_control);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true);
}
else {
- status = f_string_dynamic_terminate_after(&setting.path_control);
+ status = f_string_append_assure(f_path_separator, 1, &setting.path_control);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true);
+ }
+ else {
+ status = f_string_dynamic_terminate_after(&setting.path_control);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
+ }
}
}
}
- }
- else {
- if (main->warning.verbosity == f_console_verbosity_debug) {
- flockfile(main->warning.to.stream);
+ else {
+ if (main->warning.verbosity == f_console_verbosity_debug) {
+ flockfile(main->warning.to.stream);
- fl_print_string("%c%[%SThe parameter '%]", main->warning.to.stream, f_string_eol_s[0], main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
- fl_print_string("%[%s%s%]", main->warning.to.stream, main->context.notable, f_console_symbol_long_enable_s, controller_long_control, main->context.notable);
- fl_print_string("%[' must be a file directory path but instead is an empty string, falling back to the default.%]%c", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s[0]);
+ fl_print_string("%c%[%SThe parameter '%]", main->warning.to.stream, f_string_eol_s[0], main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
+ fl_print_string("%[%s%s%]", main->warning.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_control, main->context.set.notable);
+ fl_print_string("%[' must be a file directory path but instead is an empty string, falling back to the default.%]%c", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s[0]);
- funlockfile(main->warning.to.stream);
+ funlockfile(main->warning.to.stream);
+ }
}
}
}
- if (main->parameters[controller_parameter_daemon].result == f_console_result_found) {
+ if (F_status_is_error_not(status) && main->parameters[controller_parameter_daemon].result == f_console_result_found) {
if (main->parameters[controller_parameter_validate].result == f_console_result_found) {
if (main->error.verbosity != f_console_verbosity_quiet) {
flockfile(main->error.to.stream);
fl_print_string("%c%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
fl_print_string("%[' must not be specified with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_string("%[%s%s%]", main->error.to.stream, main->context.notable, f_console_symbol_long_enable_s, controller_long_daemon, main->context.notable);
+ fl_print_string("%[%s%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_daemon, main->context.set.notable);
fl_print_string("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
funlockfile(main->error.to.stream);
status = controller_thread_main(main, &setting);
}
- // ensure a newline is always put at the end of the program execution, unless in quiet mode.
+ // Ensure a newline is always put at the end of the program execution, unless in quiet mode.
if (!(status == F_child || status == F_signal)) {
if (F_status_is_error(status) && main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
+ f_print_terminated(f_string_eol_s, main->error.to.stream);
}
}
const f_string_t controller_string_use_s = controller_string_use;
const f_string_t controller_string_user_s = controller_string_user;
const f_string_t controller_string_utility_s = controller_string_utility;
+ const f_string_t controller_string_value_s = controller_string_value;
const f_string_t controller_string_wait_s = controller_string_wait;
const f_string_t controller_string_want_s = controller_string_want;
const f_string_t controller_string_wish_s = controller_string_wish;
#define controller_string_use "use"
#define controller_string_user "user"
#define controller_string_utility "utility"
+ #define controller_string_value "value"
#define controller_string_wait "wait"
#define controller_string_want "want"
#define controller_string_wish "wish"
#define controller_string_use_length 3
#define controller_string_user_length 4
#define controller_string_utility_length 7
+ #define controller_string_value_length 5
#define controller_string_wait_length 4
#define controller_string_want_length 4
#define controller_string_wish_length 4
extern const f_string_t controller_string_use_s;
extern const f_string_t controller_string_user_s;
extern const f_string_t controller_string_utility_s;
+ extern const f_string_t controller_string_value_s;
extern const f_string_t controller_string_wait_s;
extern const f_string_t controller_string_want_s;
extern const f_string_t controller_string_wish_s;
status = f_file_stream_open(path.string, f_file_open_mode_truncate_s, &file);
if (F_status_is_error(status)) return status;
- fprintf(file.stream, "%d%c", pid, f_string_eol_s[0]);
+ fll_print_string("%i%c", file.stream, pid, f_string_eol_s[0]);
f_file_stream_close(F_true, &file);
if (global.main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sMultiple '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s);
- fprintf(global.main->warning.to.stream, "%s%s%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string, controller_string_ready_s, global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s' %s item actions detected; only the first will be used.%s%c", global.main->warning.context.before->string, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%sMultiple '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_string("%[%s%]", global.main->warning.to.stream, global.main->warning.notable, controller_string_ready_s, global.main->warning.notable);
+ fl_print_string("%[' %s item actions detected; only the first will be used.%]%c", global.main->warning.to.stream, global.main->warning.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->warning.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item named '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, entry->items.array[i].name.string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s' cannot be executed because recursion is not allowed.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%c%[%sThe %s item named '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, entry->items.array[i].name, global.main->error.notable);
+ fl_print_string("%[' cannot be executed because recursion is not allowed.%]%c", global.main->error.to.stream, global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item named '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, actions->array[cache->ats.array[at_j]].parameters.array[0].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s' does not exist.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%c%[%sThe %s item named '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->error.notable);
+ fl_print_string("%[' does not exist.%]%c", global.main->error.to.stream, global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Processing %s%s item '", (failsafe ? "failsafe " : ""), is_entry ? controller_string_entry_s : controller_string_exit_s);
+ flockfile(global->main->output.stream);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, cache->action.name_item.string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ fl_print_string("%cProcessing %s%s item '", global->main->output.stream, f_string_eol_s[0], failsafe ? "failsafe " : "", is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%Q%]'.%c", global->main->output.stream, global->main->context.set.notable, cache->action.name_item, global->main->context.set.notable, f_string_eol_s[0]);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "The %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, cache->action.name_action.string, global->main->context.set.title.after->string);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cThe %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%Q%]", global->main->output.stream, global->main->context.set.title, cache->action.name_action, global->main->context.set.title);
if (entry_action->parameters.used) {
- fprintf(global->main->output.stream, "%s", f_string_space_s);
- fprintf(global->main->output.stream, "%s", global->main->context.set.notable.before->string);
+ fl_print_string(" %[", global->main->output.stream, global->main->context.set.notable);
+
controller_entry_action_parameters_print(global->main->output.stream, entry_actions->array[cache->ats.array[at_j]]);
- fprintf(global->main->output.stream, "%s", global->main->context.set.notable.after->string);
+
+ fl_print_string("%]", global->main->output.stream, global->main->context.set.notable);
}
- fprintf(global->main->output.stream, "' is %s and is in a %sfailed%s state, skipping execution.%c", entry_action->code & controller_entry_rule_code_require ? "required" : "optional", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("' is %s and is in a %[failed%] state, skipping execution.%c", global->main->output.stream, entry_action->code & controller_entry_rule_code_require ? "required" : "optional", f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
}
- else if (entry_action->code & controller_entry_rule_code_require) {
- if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- fprintf(global->main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->error.to.stream, "%s%sThe %s item action '", global->main->error.context.before->string, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->error.to.stream, "%s%s%s", global->main->error.context.after->string, global->main->error.notable.before->string, cache->action.name_action.string);
-
- if (entry_action->parameters.used) {
- fprintf(global->main->error.to.stream, "%s", f_string_space_s);
- controller_entry_action_parameters_print(global->main->error.to.stream, entry_actions->array[cache->ats.array[at_j]]);
- }
-
- fprintf(global->main->error.to.stream, "%s%s' is ", global->main->error.notable.after->string, global->main->error.context.before->string);
- fprintf(global->main->error.to.stream, "%s%srequired%s", global->main->error.context.after->string, global->main->error.notable.before->string, global->main->error.notable.after->string);
- fprintf(global->main->error.to.stream, "%s and is in a ", global->main->error.context.before->string);
- fprintf(global->main->error.to.stream, "%s%sfailed%s", global->main->error.context.after->string, global->main->error.notable.before->string, global->main->error.notable.after->string);
- fprintf(global->main->error.to.stream, "%s state, skipping execution.%s%c", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
-
- controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
+ else if ((entry_action->code & controller_entry_rule_code_require) && global->main->error.verbosity != f_console_verbosity_quiet || global->main->warning.verbosity == f_console_verbosity_verbose || global->main->warning.verbosity == f_console_verbosity_debug) {
+ fll_error_print_t *output = 0;
- controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
+ if (entry_action->code & controller_entry_rule_code_require) {
+ output = &global->main->error;
+ }
+ else {
+ output = &global->main->warning;
}
- return F_status_is_error(F_require);
- }
- else if (global->main->warning.verbosity == f_console_verbosity_verbose || global->main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->warning.to.stream, "%s%sThe %s item action '", global->main->warning.context.before->string, global->main->warning.prefix ? global->main->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->warning.to.stream, "%s%s%s", global->main->warning.context.after->string, global->main->warning.notable.before->string, cache->action.name_action.string);
+ flockfile(output->to.stream);
+
+ fl_print_string("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (entry_action->parameters.used) {
- fprintf(global->main->warning.to.stream, "%s", f_string_space_s);
- controller_entry_action_parameters_print(global->main->warning.to.stream, entry_actions->array[cache->ats.array[at_j]]);
+ fl_print_string(" %[%S%]", output->to.stream, output->notable, entry_actions->array[cache->ats.array[at_j]], output->notable);
}
- fprintf(global->main->warning.to.stream, "%s%s' is ", global->main->warning.notable.after->string, global->main->warning.context.before->string);
- fprintf(global->main->warning.to.stream, "%s%srequired%s", global->main->warning.context.after->string, global->main->warning.notable.before->string, global->main->warning.notable.after->string);
- fprintf(global->main->warning.to.stream, "%s and is in a ", global->main->warning.context.before->string);
- fprintf(global->main->warning.to.stream, "%s%sfailed%s", global->main->warning.context.after->string, global->main->warning.notable.before->string, global->main->warning.notable.after->string);
- fprintf(global->main->warning.to.stream, "%s state, skipping execution.%s%c", global->main->warning.context.before->string, global->main->warning.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%[' is%] %[required%]", output->to.stream, output->context, output->context, output->notable, output->notable);
+ fl_print_string(" %[and is in a%] %[failed%]", output->to.stream, output->context, output->context, output->notable, output->notable);
+ fl_print_string(" %[state, skipping execution.%]%c", output->to.stream, output->context, output->context, f_string_eol_s[0]);
- controller_entry_error_print_cache(is_entry, global->main->warning, cache->action);
+ controller_entry_error_print_cache(is_entry, *output, cache->action);
- controller_print_unlock_flush(global->main->warning.to.stream, &global->thread->lock.print);
+ funlockfile(output->to.stream);
+
+ controller_print_unlock_flush(output->to.stream, &global->thread->lock.print);
+
+ if (entry_action->code & controller_entry_rule_code_require) {
+ return F_status_is_error(F_require);
+ }
}
}
else {
- if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found) {
- if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "The %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, cache->action.name_action.string, global->main->context.set.title.after->string);
-
- if (entry_action->parameters.used) {
- fprintf(global->main->output.stream, "%s", f_string_space_s);
- fprintf(global->main->output.stream, "%s", global->main->context.set.notable.before->string);
- controller_entry_action_parameters_print(global->main->output.stream, entry_actions->array[cache->ats.array[at_j]]);
- fprintf(global->main->output.stream, "%s", global->main->context.set.notable.after->string);
- }
-
- fprintf(global->main->output.stream, "' is in a %sfailed%s state, skipping.%c", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
+ if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found && global->main->error.verbosity != f_console_verbosity_quiet || global->main->warning.verbosity == f_console_verbosity_debug || global->main->error.verbosity == f_console_verbosity_verbose) {
+ fll_error_print_t *output = 0;
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found && global->main->error.verbosity != f_console_verbosity_quiet) {
+ output = &global->main->error;
}
- }
- else if (global->main->warning.verbosity == f_console_verbosity_debug || global->main->error.verbosity == f_console_verbosity_verbose) {
+ else {
+ output = &global->main->warning;
+ }
+
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->warning.to.stream, "%s%sThe %s item action '", global->main->warning.context.before->string, global->main->warning.prefix ? global->main->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->warning.to.stream, "%s%s", global->main->warning.notable.before->string, cache->action.name_action.string);
+ flockfile(output->to.stream);
+
+ fl_print_string("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (entry_action->parameters.used) {
- fprintf(global->main->warning.to.stream, "%s", f_string_space_s);
- controller_entry_action_parameters_print(global->main->warning.to.stream, entry_actions->array[cache->ats.array[at_j]]);
+ fl_print_string(" %[%S%]", output->to.stream, output->notable, entry_actions->array[cache->ats.array[at_j]], output->notable);
}
- fprintf(global->main->warning.to.stream, "%s' is in a ", global->main->warning.notable.after->string);
- fprintf(global->main->warning.to.stream, "%s%sfailed%s", global->main->warning.context.after->string, global->main->warning.notable.before->string, global->main->warning.notable.after->string);
- fprintf(global->main->warning.to.stream, "%s state, skipping.%s%c", global->main->warning.context.before->string, global->main->warning.context.after->string, f_string_eol_s[0]);
+ fl_print_string(" %[is in a%] %[failed%]", output->to.stream, output->context, output->context, output->notable, output->notable);
+ fl_print_string(" %[state, skipping.%]%c", output->to.stream, output->context, output->context, f_string_eol_s[0]);
- controller_entry_error_print_cache(is_entry, global->main->warning, cache->action);
+ controller_entry_error_print_cache(is_entry, *output, cache->action);
- controller_print_unlock_flush(global->main->warning.to.stream, &global->thread->lock.print);
+ funlockfile(output->to.stream);
+
+ controller_print_unlock_flush(output->to.stream, &global->thread->lock.print);
}
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Waiting before processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, controller_string_ready_s, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cWaiting before processing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title);
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, controller_string_ready_s, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cWaiting before processing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title);
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Ignoring %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, controller_string_ready_s, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "', state already is ready.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cIgnoring %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title);
+ fl_print_string("', state already is ready.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
else if (entry_action->type == controller_entry_action_type_item) {
if (entry_action->number == 0 || entry_action->number >= entry->items.used || failsafe && entry_action->number == global->setting->failsafe_item_id) {
- // This should not happen if the pre-process is working as designed, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
+ // This should not happen if the pre-process is working as intended, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->error.to.stream, "%s%sInvalid %s item index ", global->main->error.context.before->string, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->error.to.stream, "%s%s%llu%s", global->main->error.context.after->string, global->main->error.notable.before->string, entry_action->number, global->main->error.notable.after->string);
- fprintf(global->main->error.to.stream, "%s detected.%s%c", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global->main->error.to.stream);
+
+ fl_print_string("%c%[Invalid %s item index '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global->main->error.context);
+ fl_print_string("%[%ul%]", global->main->error.to.stream, global->main->error.notable, entry_action->number, global->main->error.notable);
+ fl_print_string("%[' detected.%]%c", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
+ funlockfile(global->main->error.to.stream);
+
controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Processing %s item '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, cache->action.name_item.string, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cProcessing %s item '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%Q%]", global->main->output.stream, global->main->context.set.title, cache->action.name_item, global->main->context.set.title);
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "%s %s item rule '", entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, alias_rule.string, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%c%s %s item rule '", global->main->output.stream, f_string_eol_s[0], entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing", is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%Q%]", global->main->output.stream, global->main->context.set.title, alias_rule, global->main->context.set.title);
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "%s is executing '", is_entry ? controller_string_entry_s : controller_string_exit_s);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%c%s is executing '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s", global->main->context.set.title.before->string);
for (f_array_length_t k = 0; k < entry_action->parameters.used; ++k) {
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, entry_action->parameters.array[k].string, global->main->context.set.title.after->string);
+ fl_print_string("%[%Q%]", global->main->output.stream, global->main->context.set.title, entry_action->parameters.array[k], global->main->context.set.title);
if (k + 1 < entry_action->parameters.used) {
- fprintf(global->main->output.stream, " ");
+ f_print_character(f_string_space_s[0], global->main->output.stream);
}
} // for
- fprintf(global->main->output.stream, "%s'.%c", global->main->context.set.title.after->string, f_string_eol_s[0]);
+
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->error.to.stream, "%s%sExecution failed, unable to find program or script ", global->main->error.context.before->string, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s);
- fprintf(global->main->error.to.stream, "%s%s%s%s", global->main->error.context.after->string, global->main->error.notable.before->string, entry_action->parameters.array[0].string, global->main->error.notable.after->string);
- fprintf(global->main->error.to.stream, "%s.%s%c", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global->main->error.to.stream);
+
+ fl_print_string("%c%[%SExecution failed, unable to find program or script '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
+ fl_print_string("%[%Q%]", global->main->error.to.stream, global->main->error.notable, entry_action->parameters.array[0], global->main->error.notable);
+ fl_print_string("$['.%]%c", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
+ funlockfile(global->main->error.to.stream);
+
controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
}
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->error.to.stream, "%s%sExecution failed with return value of ", global->main->error.context.before->string, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s);
- fprintf(global->main->error.to.stream, "%s%s%d%s", global->main->error.context.after->string, global->main->error.notable.before->string, result, global->main->error.notable.after->string);
- fprintf(global->main->error.to.stream, "%s.%s%c", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global->main->error.to.stream);
+
+ fl_print_string("%c%[%SExecution failed with return value of '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
+ fl_print_string("%[%i%]", global->main->error.to.stream, global->main->error.notable, result, global->main->error.notable);
+ fl_print_string("$['.%]%c", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
+ funlockfile(global->main->error.to.stream);
+
controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, controller_string_timeout_s, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "' setting '");
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.important.before->string, code, global->main->context.set.important.after->string);
- fprintf(global->main->output.stream, "' to '");
- fprintf(global->main->output.stream, "%s%llu%s", global->main->context.set.important.before->string, entry_action->number, global->main->context.set.important.after->string);
- fprintf(global->main->output.stream, "' MegaTime (milliseconds).%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cProcessing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%s%]' setting '", global->main->output.stream, global->main->context.set.title, controller_string_timeout_s, global->main->context.set.title);
+ fl_print_string("%[%S%]' to '", global->main->output.stream, global->main->context.set.important, code, global->main->context.set.important);
+ fl_print_string("%[%ul%]' MegaTime (milliseconds).%c", global->main->output.stream, global->main->context.set.important, entry_action->number, global->main->context.set.important, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if (global->main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->warning.to.stream, "%s%sFailsafe may not be specified when running in failsafe, ignoring.%s%c", global->main->warning.context.before->string, global->main->warning.prefix ? global->main->warning.prefix : f_string_empty_s, global->main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global->main->error.to.stream);
+
+ fl_print_string("%c%[%SFailsafe may not be specified when running in failsafe, ignoring.%]%c", global->main->warning.to.stream, f_string_eol_s[0], global->main->warning.context, global->main->warning.prefix ? global->main->warning.prefix : f_string_empty_s, global->main->warning.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->warning, cache->action);
+ funlockfile(global->main->warning.to.stream);
+
controller_print_unlock_flush(global->main->warning.to.stream, &global->thread->lock.print);
}
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->error.to.stream, "%s%sInvalid %s item index ", global->main->error.context.before->string, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->error.to.stream, "%s%s%llu%s", global->main->error.context.after->string, global->main->error.notable.before->string, entry_action->number, global->main->error.notable.after->string);
- fprintf(global->main->error.to.stream, "%s detected.%s%c", global->main->error.context.before->string, global->main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global->main->error.to.stream);
+
+ fl_print_string("%c%[%SInvalid %s item index '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, global->main->error.context);
+ fl_print_string("%[%ul%]", global->main->error.to.stream, global->main->error.notable, entry_action->number, global->main->error.notable);
+ fl_print_string("%[' detected.%]%c", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
+ funlockfile(global->main->error.to.stream);
+
controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, controller_string_failsafe_s, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "' setting value to '");
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.important.before->string, entry->items.array[global->setting->failsafe_item_id].name.string, global->main->context.set.important.after->string);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cProcessing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%s%]' setting value to '", global->main->output.stream, global->main->context.set.title, controller_string_failsafe_s, global->main->context.set.title);
+ fl_print_string("%[%Q%]", global->main->output.stream, global->main->context.set.important, entry->items.array[global->setting->failsafe_item_id].name, global->main->context.set.important);
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(global->main->output.stream);
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
if ((global->main->parameters[controller_parameter_simulate].result == f_console_result_found && global->main->error.verbosity != f_console_verbosity_quiet) || global->main->error.verbosity == f_console_verbosity_verbose) {
f_thread_mutex_lock(&global->thread->lock.print);
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global->main->output.stream, "Done processing %s item '", is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global->main->output.stream, "%s%s%s", global->main->context.set.title.before->string, controller_string_main_s, global->main->context.set.title.after->string);
- fprintf(global->main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(global->main->output.stream);
+
+ fl_print_string("%cDone processing %s item '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_string("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_main_s, global->main->context.set.title);
+ fl_print_string("'.%c", global->main->output.stream, f_string_eol_s[0]);
// failsafe should not print the extra newline because the failure exit from controller_main should handle this.
if (!failsafe) {
- fprintf(global->main->output.stream, "%c", f_string_eol_s[0]);
+ f_print_terminated(f_string_eol_s, global->main->output.stream);
}
+ funlockfile(global->main->output.stream);
+
controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
}
for (;;) {
- // @fixme there needs to be a dynamic string equivalent of: f_print_safely_terminated().
- fll_print_dynamic(stream, action.parameters.array[index]);
+ f_print_dynamic_safely(action.parameters.array[index], stream);
++index;
if (index == action.parameters.used) break;
- fprintf(stream, "%s", f_string_space_s);
+ f_print_terminated(f_string_space_s, stream);
} // for
}
#endif // _di_controller_entry_action_parameters_print_
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- fprintf(global.main->warning.to.stream, "%s%sUnknown %s item action '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic(global.main->warning.to.stream, cache->action.name_action); // @todo needs a f_print_safely_terminated().
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SUnknown %s item action '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->warning.context);
+ fl_print_string("%[%S%]'", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
+
+ funlockfile(global.main->warning.to.stream);
}
continue;
action->status = F_status_set_error(F_parameter);
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, cache->action.name_action.string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s' requires ", global.main->error.context.before->string);
+ fl_print_string("%c%[%SThe %s item action '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.context, cache->action.name_action, global.main->error.context);
+ fl_print_string("%[' requires ", global.main->error.to.stream, global.main->error.context);
if (at_least == at_most) {
- fprintf(global.main->error.to.stream, "exactly ");
+ f_print_terminated("exactly ", global.main->error.to.stream);
}
- fprintf(global.main->error.to.stream, "%s%s%llu%s", global.main->error.context.after->string, global.main->error.notable.before->string, at_least, global.main->error.notable.after->string);
+ fl_print_string("%]%[%ul%]", global.main->error.to.stream, global.main->error.context, global.main->error.notable, at_least, global.main->error.notable);
if (action->type == controller_entry_action_type_consider || controller_entry_action_type_is_rule(action->type)) {
- fprintf(global.main->error.to.stream, "%s or more parameters.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%[' or more parameters.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
}
else {
if (at_least == at_most) {
- fprintf(global.main->error.to.stream, "%s parameters.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%[' parameters.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
}
else {
- fprintf(global.main->error.to.stream, "%s to ", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%llu%s", global.main->error.context.after->string, global.main->error.notable.before->string, at_most, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s parameters.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%[ to %]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%ul%]", global.main->error.to.stream, global.main->error.notable, at_most, global.main->error.notable);
+ fl_print_string("%[' parameters.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
}
}
+
+ funlockfile(global.main->error.to.stream);
}
}
else {
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action must not have an empty string for a path (the first parameter).%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context.after->string, f_string_eol_s[0]);
+ fll_print_string("%c%[%SThe %s item action must not have an empty string for a path (the first parameter).%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
}
}
break;
}
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action second parameter '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, action->parameters.array[1].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ fl_print_string("%c%[%SThe %s item action second parameter '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[1], global.main->error.notable);
+ fl_print_string("%[' must be a base path name, such as '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_path, global.main->error.notable);
+ fl_print_string("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s' must be a base path name, such as '", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, cache->buffer_path.string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ funlockfile(global.main->error.to.stream);
}
action->status = F_status_set_error(F_parameter);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action must not have an empty string for a rule name (the second parameter).%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context.after->string, f_string_eol_s[0]);
+ fll_print_string("%c%[%SThe %s item action must not have an empty string for a rule name (the second parameter).%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
}
}
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action third parameter (and beyond) must be one of '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_asynchronous_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s', '", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_require_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s', or '", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_wait_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' but instead has '", global.main->error.context.before->string);
-
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, action->parameters.array[j].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
-
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe %s item action third parameter (and beyond) must be one of '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_asynchronous_s, global.main->error.notable);
+ fl_print_string("%[', '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_require_s, global.main->error.notable);
+ fl_print_string("%[', or '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_wait_s, global.main->error.notable);
+ fl_print_string("%[' but instead has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[j], global.main->error.notable);
+ fl_print_string("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
}
}
} // for
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action may not specify the reserved item '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_main_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe %s item action may not specify the reserved item '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_main_s, global.main->error.notable);
+ fl_print_string("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
}
}
}
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action must have one of '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_kill_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s', '", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_start_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s', or '", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_stop_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' but instead has '", global.main->error.context.before->string);
-
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, action->parameters.array[0].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
-
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe %s item action must have one of '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_kill_s, global.main->error.notable);
+ fl_print_string("%[', '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_start_s, global.main->error.notable);
+ fl_print_string("%[', or '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_stop_s, global.main->error.notable);
+ fl_print_string("%[' but instead has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[0], global.main->error.notable);
+ fl_print_string("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
}
}
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action parameter '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, action->parameters.array[1].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ fl_print_string("%c%[%SThe %s item action parameter '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[1], global.main->error.notable);
+ fl_print_string("%[' is not a valid supported number.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s' is not a valid supported number.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ funlockfile(global.main->error.to.stream);
}
}
}
action->status = F_status_set_error(F_supported_not);
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item action may only have '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_wait_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' but instead has '", global.main->error.context.before->string);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, action->parameters.array[0].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ fl_print_string("%c%[%SThe %s item action may only have '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_wait_s, global.main->error.notable);
+ fl_print_string("%[' but instead has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[0], global.main->error.notable);
+ fl_print_string("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ funlockfile(global.main->error.to.stream);
}
}
}
#endif // _di_controller_entry_error_print_
#ifndef _di_controller_entry_error_print_cache_
- void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache) {
+ void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t output, const controller_cache_action_t cache) {
- fprintf(print.to.stream, "%c", f_string_eol_s[0]);
- fprintf(print.to.stream, "%s%sWhile processing ", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s);
+ fl_print_string("%c%[%SWhile processing ", output.to.stream, f_string_eol_s[0], output.context, output.prefix);
if (cache.name_action.used) {
- fprintf(print.to.stream, "action '");
-
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, cache.name_action.string);
- fprintf(print.to.stream, "%s", print.notable.after->string);
-
- fprintf(print.to.stream, "%s' on line ", print.context.before->string);
- fprintf(print.to.stream, "%s%s%llu%s", print.context.after->string, print.notable.before->string, cache.line_action, print.notable.after->string);
- fprintf(print.to.stream, "%s for ", print.context.before->string);
+ fl_print_string("action '%]", output.to.stream, output.context);
+ fl_print_string("%[%Q%]", output.to.stream, output.context, cache.name_action, output.context);
+ fl_print_string("%[' on line%] ", output.to.stream, output.context, output.context);
+ fl_print_string("%[%ul%]", output.to.stream, output.notable, cache.line_action, output.notable);
+ fl_print_string("%[ for ", output.to.stream, output.context);
}
if (cache.name_item.used) {
- fprintf(print.to.stream, "%s item '", is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, cache.name_item.string);
- fprintf(print.to.stream, "%s", print.notable.after->string);
-
- fprintf(print.to.stream, "%s' on line ", print.context.before->string);
- fprintf(print.to.stream, "%s%s%llu%s", print.context.after->string, print.notable.before->string, cache.line_item, print.notable.after->string);
- fprintf(print.to.stream, "%s for ", print.context.before->string);
+ fl_print_string("%s item '%]", output.to.stream, is_entry ? controller_string_entry_s : controller_string_exit_s, output.context);
+ fl_print_string("%[%Q%]", output.to.stream, output.notable, cache.name_item, output.notable);
+ fl_print_string("%[' on line%] ", output.to.stream, output.context, output.context);
+ fl_print_string("%[%ul%]", output.to.stream, output.notable, cache.line_item, output.notable);
+ fl_print_string("%[ for ", output.to.stream, output.context);
}
if (cache.name_file.used) {
- fprintf(print.to.stream, "%s file '", is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, cache.name_file.string);
- fprintf(print.to.stream, "%s", print.notable.after->string);
-
- fprintf(print.to.stream, "%s'.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%s file '%]", output.to.stream, is_entry ? controller_string_entry_s : controller_string_exit_s, output.context);
+ fl_print_string("%[%Q%]%['", output.to.stream, output.notable, cache.name_file, output.notable, output.context);
}
+
+ fl_print_string(".%]%c", output.to.stream, output.context, f_string_eol_s[0]);
}
#endif // _di_controller_entry_error_print_cache_
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s file is empty.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context.after->string, f_string_eol_s[0]);
+ fll_print_string("%c%[%SThe %s file is empty.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sIgnoring duplicate %s item '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, cache->action.name_file.string);
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
+ flockfile(global.main->warning.to.stream);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%c%[%SIgnoring duplicate %s item '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->warning.context);
+ fl_print_string("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_file, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe required %s item '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_string_main_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' was not found.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe required %s item '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_string_main_s, global.main->error.notable);
+ fl_print_string("%[' was not found.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe required %s item '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
-
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, action->parameters.array[0].string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s' does not exist.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%c%[%SThe required %s item '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[0], global.main->error.notable);
+ fl_print_string("%[' does not exist.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (is_entry && fl_string_dynamic_compare_string(controller_string_mode_s, cache->action.name_action, controller_string_mode_length) == F_equal_to) {
if (cache->content_actions.array[i].used < 0 || cache->content_actions.array[i].used > 1) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe %s item setting '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ flockfile(global.main->error.to.stream);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- f_print_safely_terminated(global.main->error.to.stream, cache->action.name_action.string);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
+ fl_print_string("%c%[%SThe %s item setting '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
+ fl_print_string("%[' requires exactly %]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[1%]", global.main->error.to.stream, global.main->error.notable, global.main->error.notable);
+ fl_print_string("%[' parameter.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s' requires exactly ", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%d%s", global.main->error.context.after->string, global.main->error.notable.before->string, 1, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s parameter.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ funlockfile(global.main->error.to.stream);
}
continue;
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- fprintf(global.main->warning.to.stream, "%s%sUnknown %s item setting value '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic_partial(global.main->warning.to.stream, cache->buffer_file, cache->content_actions.array[i].array[0]);
- fprintf(global.main->warning.to.stream, "%s%s for %s item setting '", global.main->warning.notable.after->string, global.main->warning.context.before->string, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic(global.main->warning.to.stream, cache->action.name_action); // @todo needs safe print dynamic
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%Sfor %s item setting '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->warning.context);
+ fl_print_string("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->warning.to.stream);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
}
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- fprintf(global.main->warning.to.stream, "%s%sUnknown %s item setting '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic(global.main->warning.to.stream, cache->action.name_action); // @todo needs safe print dynamic
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SUnknown %s item setting '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->warning.context);
+ fl_print_string("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->warning.to.stream);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
}
* @param is_entry
* If TRUE, then this loads as an entry.
* If FALSE, then this loads as an exit.
- * @param print
+ * @param output
* Designates how printing is to be performed.
* @param cache
* The action cache.
* @see controller_entry_read()
*/
#ifndef _di_controller_entry_error_print_cache_
- extern void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache) f_attribute_visibility_internal;
+ extern void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t output, const controller_cache_action_t cache) f_attribute_visibility_internal;
#endif // _di_controller_entry_error_print_cache_
/**
if (global.main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sAction is empty, nothing to do.%s%c", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SAction is empty, nothing to do.%]%c", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, cache->action, F_true);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
}
f_thread_mutex_lock(&thread->lock.print);
fll_error_print(print, status, function, fallback);
+
+ flockfile(print.to.stream);
+
controller_rule_error_print_cache(print, cache, item);
+ funlockfile(print.to.stream);
+
controller_print_unlock_flush(print.to.stream, &thread->lock.print);
}
}
void controller_rule_error_print_cache(const fll_error_print_t output, const controller_cache_action_t cache, const bool item) {
if (output.verbosity != f_console_verbosity_quiet) {
- fprintf(output.to.stream, "%c", f_string_eol_s[0]);
- fprintf(output.to.stream, "%s%sWhile processing ", output.context.before->string, output.prefix ? output.prefix : f_string_empty_s);
+ fl_print_string("%c%[%SWhile processing ", output.to.stream, f_string_eol_s[0], output.context, output.prefix);
if (cache.name_action.used) {
- fprintf(output.to.stream, "%s '", item ? "action" : "value");
- fprintf(output.to.stream, "%s%s", output.context.after->string, output.notable.before->string);
- fll_print_dynamic(output.to.stream, cache.name_action); // @todo safe dynamic print
- fprintf(output.to.stream, "%s%s' on line ", output.notable.after->string, output.context.before->string);
- fprintf(output.to.stream, "%s%s%llu%s", output.context.after->string, output.notable.before->string, cache.line_action, output.notable.after->string);
- fprintf(output.to.stream, "%s for ", output.context.before->string);
+ fl_print_string("%s '%]", output.to.stream, output.context, item ? controller_string_action_s : controller_string_value_s, output.context);
+ fl_print_string("%[%Q%]", output.to.stream, output.notable, cache.name_action, output.notable);
+ fl_print_string("%[ on line %]", output.to.stream, output.context, output.context);
+ fl_print_string("%[%ul%]", output.to.stream, output.notable, cache.line_action, output.notable);
+ fl_print_string("%[ for ", output.to.stream, output.context);
}
if (cache.name_item.used) {
- fprintf(output.to.stream, "rule %s '", item ? "item" : "setting");
- fprintf(output.to.stream, "%s%s", output.context.after->string, output.notable.before->string);
- fll_print_dynamic(output.to.stream, cache.name_item); // @todo safe dynamic print
- fprintf(output.to.stream, "%s%s' on line ", output.notable.after->string, output.context.before->string);
- fprintf(output.to.stream, "%s%s%llu%s", output.context.after->string, output.notable.before->string, cache.line_item, output.notable.after->string);
- fprintf(output.to.stream, "%s for ", output.context.before->string);
+ fl_print_string("rule %s '%]", output.to.stream, output.context, item ? controller_string_item_s : controller_string_setting_s, output.context);
+ fl_print_string("%[%Q%]", output.to.stream, output.notable, cache.name_item, output.notable);
+ fl_print_string("%[ on line %]", output.to.stream, output.context, output.context);
+ fl_print_string("%[%ul%]", output.to.stream, output.notable, cache.line_item, output.notable);
+ fl_print_string("%[ for ", output.to.stream, output.context);
}
if (cache.name_file.used) {
- fprintf(output.to.stream, "rule file '");
- fprintf(output.to.stream, "%s%s", output.context.after->string, output.notable.before->string);
- fll_print_dynamic(output.to.stream, cache.name_file); // @todo safe dynamic print
- fprintf(output.to.stream, "%s'.%s%c", output.context.before->string, output.context.after->string, f_string_eol_s[0]);
+ fl_print_string("rule file '%]%[%Q%]%['", output.to.stream, output.context, output.notable, cache.name_file, output.notable, output.context);
}
+
+ fl_print_string(".%]%c", output.to.stream, output.context, f_string_eol_s[0]);
}
}
#endif // _di_controller_rule_error_print_cache_
#endif // _di_controller_rule_item_error_print_
#ifndef _di_controller_rule_item_error_print_execute_
- void controller_rule_item_error_print_execute(const fll_error_print_t print, const bool script_is, const f_string_t name, const int code, const f_status_t status) {
+ void controller_rule_item_error_print_execute(const fll_error_print_t output, const bool script_is, const f_string_t name, const int code, const f_status_t status) {
- if (print.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to.stream, "%c", f_string_eol_s[0]);
- fprintf(print.to.stream, "%s%sThe %s '", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s, script_is ? controller_string_script_s : controller_string_program_s);
+ if (output.verbosity != f_console_verbosity_quiet) {
+ flockfile(output.to.stream);
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, name);
- fprintf(print.to.stream, "%s", print.notable.after->string);
+ fl_print_string("%c%[%SThe %s '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, script_is ? controller_string_script_s : controller_string_program_s, output.context);
+ fl_print_string("%[%S%]", output.to.stream, output.notable, name, output.notable);
if (status == F_control_group || status == F_limit || status == F_processor || status == F_schedule) {
- fprintf(print.to.stream, "%s' failed due to a failure to setup the '", print.context.before->string);
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
+ fl_print_string("%[' failed due to a failure to setup the '%]", output.to.stream, output.context, output.context);
+ fl_print_color_before(output.notable, output.to.stream);
if (status == F_control_group) {
- fprintf(print.to.stream, "%s", controller_string_control_group_s);
+ f_print_terminated(controller_string_control_group_s, output.to.stream);
}
else if (status == F_limit) {
- fprintf(print.to.stream, "%s", controller_string_limit_s);
+ f_print_terminated(controller_string_limit_s, output.to.stream);
}
else if (status == F_processor) {
- fprintf(print.to.stream, "%s", controller_string_processor_s);
+ f_print_terminated(controller_string_processor_s, output.to.stream);
}
else if (status == F_schedule) {
- fprintf(print.to.stream, "%s", controller_string_scheduler_s);
+ f_print_terminated(controller_string_scheduler_s, output.to.stream);
}
- fprintf(print.to.stream, "%s", print.notable.after->string);
- fprintf(print.to.stream, "%s'.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ fl_print_color_after(output.notable, output.to.stream);
+ fl_print_string("%['.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
}
else if (code) {
- fprintf(print.to.stream, "%s' failed with the exit code '", print.context.before->string);
- fprintf(print.to.stream, "%s%s%i%s", print.context.after->string, print.notable.before->string, code, print.notable.after->string);
- fprintf(print.to.stream, "%s'.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%[' failed with the exit code '%]", output.to.stream, output.context, output.context);
+ fl_print_string("%[%i%]", output.to.stream, output.notable, code, output.notable);
+ fl_print_string("%['.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
}
else {
- fprintf(print.to.stream, "%s' failed.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ fl_print_string("%[' failed.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
}
+
+ funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_execute_
#ifndef _di_controller_rule_item_error_print_execute_not_found_
- void controller_rule_item_error_print_execute_not_found(const fll_error_print_t print, const bool script_is, const f_string_t name) {
+ void controller_rule_item_error_print_execute_not_found(const fll_error_print_t output, const bool script_is, const f_string_t name) {
- if (print.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to.stream, "%c", f_string_eol_s[0]);
- fprintf(print.to.stream, "%s%sThe %s '", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s, script_is ? controller_string_script_s : controller_string_program_s);
+ if (output.verbosity != f_console_verbosity_quiet) {
+ flockfile(output.to.stream);
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, name);
- fprintf(print.to.stream, "%s", print.notable.after->string);
+ fl_print_string("%c%[%SThe %s '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, script_is ? controller_string_script_s : controller_string_program_s, output.context);
+ fl_print_string("%[%S%]", output.to.stream, output.notable, name, output.notable);
+ fl_print_string("%[' could not be executed because it was not found.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
- fprintf(print.to.stream, "%s' could not be executed because it was not found.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_execute_not_found_
#ifndef _di_controller_rule_item_error_print_need_want_wish_
- void controller_rule_item_error_print_need_want_wish(const fll_error_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) {
+ void controller_rule_item_error_print_need_want_wish(const fll_error_print_t output, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) {
- if (print.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to.stream, "%c", f_string_eol_s[0]);
- fprintf(print.to.stream, "%s%sThe %s rule '", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s, need_want_wish);
+ if (output.verbosity != f_console_verbosity_quiet) {
+ flockfile(output.to.stream);
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, value);
- fprintf(print.to.stream, "%s", print.notable.after->string);
+ fl_print_string("%c%[%SThe %s rule '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, need_want_wish, output.context);
+ fl_print_string("%[%S%]", output.to.stream, output.notable, value, output.notable);
+ fl_print_string("%[' %S.%]%c", output.to.stream, output.context, why, output.context, f_string_eol_s[0]);
- fprintf(print.to.stream, "%s' %s.%s%c", print.context.before->string, why, print.context.after->string, f_string_eol_s[0]);
+ funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_need_want_wish_
#ifndef _di_controller_rule_item_error_print_rule_not_loaded_
- void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t print, const f_string_t alias) {
+ void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t output, const f_string_t alias) {
- if (print.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to.stream, "%c", f_string_eol_s[0]);
- fprintf(print.to.stream, "%s%sThe rule '", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s);
+ if (output.verbosity != f_console_verbosity_quiet) {
+ flockfile(output.to.stream);
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, alias);
- fprintf(print.to.stream, "%s", print.notable.after->string);
+ fl_print_string("%c%[%SThe rule '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, output.context);
+ fl_print_string("%[%S%]", output.to.stream, output.notable, alias, output.notable);
+ fl_print_string("%[' is no longer loaded.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
- fprintf(print.to.stream, "%s' is no longer loaded.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_rule_not_loaded_
#ifndef _di_controller_rule_action_error_missing_pid_
- void controller_rule_action_error_missing_pid(const fll_error_print_t print, const f_string_t alias) {
+ void controller_rule_action_error_missing_pid(const fll_error_print_t output, const f_string_t alias) {
- if (print.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to.stream, "%c", f_string_eol_s[0]);
- fprintf(print.to.stream, "%s%sThe rule '", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s);
+ if (output.verbosity != f_console_verbosity_quiet) {
+ flockfile(output.to.stream);
- fprintf(print.to.stream, "%s%s", print.context.after->string, print.notable.before->string);
- f_print_safely_terminated(print.to.stream, alias);
- fprintf(print.to.stream, "%s", print.notable.after->string);
+ fl_print_string("%c%[%SThe rule '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, output.context);
+ fl_print_string("%[%S%]", output.to.stream, output.notable, alias, output.notable);
+ fl_print_string("%[' is not designating a pid file.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
- fprintf(print.to.stream, "%s' is not designating a pid file.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
+ funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_action_error_missing_pid_
if (global.main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sAction type is unknown, ignoring.%s%c", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SAction type is unknown, ignoring.%]%c", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, process->cache.action, F_true);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->output.stream, "Simulating execution of '");
+ flockfile(global.main->output.stream);
+
+ fl_print_string("%cSimulating execution of '%[", global.main->output.stream, f_string_eol_s[0], global.main->context.set.title);
- fprintf(global.main->output.stream, "%s", global.main->context.title.string);
- f_print_safely_terminated(global.main->output.stream, program ? program : arguments.used && arguments.array[0].used ? arguments.array[0].string : f_string_empty_s);
- fprintf(global.main->output.stream, "%s' with the arguments: '%s", global.main->context.reset.string, global.main->context.important.string);
+ if (program) {
+ f_print_safely_terminated(program, global.main->output.stream);
+ }
+ else {
+ f_print_dynamic_safely(arguments.array[0], global.main->output.stream);
+ }
+
+ fl_print_string("%]' with the arguments: '%[", global.main->output.stream, global.main->context.set.title, global.main->context.set.important);
for (f_array_length_t i = program ? 0 : 1; i < arguments.used; ++i) {
if (program && i || !program && i > 1) {
- fprintf(global.main->output.stream, "%c", f_string_space_s[0]);
+ f_print_terminated(f_string_space_s, global.main->output.stream);
}
- f_print_safely_terminated(global.main->output.stream, arguments.array[i].string);
+ f_print_dynamic_safely(arguments.array[i], global.main->output.stream);
} // for
- fprintf(global.main->output.stream, "%s' from '", global.main->context.reset.string);
+ fl_print_string("%]' from '", global.main->output.stream, global.main->context.set.important);
+ fl_print_string("%[%Q%]'.%c", global.main->output.stream, global.main->context.set.notable, process->rule.name, global.main->context.set.notable, f_string_eol_s[0]);
- fprintf(global.main->output.stream, "%s", global.main->context.notable.string);
- f_print_safely_terminated(global.main->output.stream, process->rule.name.used ? process->rule.name.string : f_string_empty_s);
- fprintf(global.main->output.stream, "%s'.%c", global.main->context.reset.string, f_string_eol_s[0]);
+ funlockfile(global.main->output.stream);
controller_print_unlock_flush(global.main->output.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->output.stream, "Simulating execution of '");
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%cSimulating execution of '%[", global.main->error.to.stream, f_string_eol_s[0], global.main->context.set.title);
- fprintf(global.main->output.stream, "%s", global.main->context.title.string);
- f_print_safely_terminated(global.main->output.stream, program ? program : arguments.used && arguments.array[0].used ? arguments.array[0].string : f_string_empty_s);
- fprintf(global.main->output.stream, "%s' with the arguments: '%s", global.main->context.reset.string, global.main->context.important.string);
+ if (program) {
+ f_print_safely_terminated(program, global.main->error.to.stream);
+ }
+ else {
+ f_print_dynamic_safely(arguments.array[0], global.main->error.to.stream);
+ }
+
+ fl_print_string("%]' with the arguments: '%[", global.main->error.to.stream, global.main->context.set.title, global.main->context.set.important);
for (f_array_length_t i = program ? 0 : 1; i < arguments.used; ++i) {
if (program && i || !program && i > 1) {
- fprintf(global.main->output.stream, "%c", f_string_space_s[0]);
+ f_print_terminated(f_string_space_s, global.main->error.to.stream);
}
- f_print_safely_terminated(global.main->output.stream, arguments.array[i].string);
+ f_print_dynamic_safely(arguments.array[i], global.main->error.to.stream);
} // for
- fprintf(global.main->output.stream, "%s' from '", global.main->context.reset.string);
+ fl_print_string("%]' from '", global.main->error.to.stream, global.main->context.set.important);
+ fl_print_string("%[%Q%]'.%c", global.main->error.to.stream, global.main->context.set.notable, process->rule.name, global.main->context.set.notable, f_string_eol_s[0]);
- fprintf(global.main->output.stream, "%s", global.main->context.notable.string);
- f_print_safely_terminated(global.main->output.stream, process->rule.name.used ? process->rule.name.string : f_string_empty_s);
- fprintf(global.main->output.stream, "%s'.%c", global.main->context.reset.string, f_string_eol_s[0]);
+ funlockfile(global.main->error.to.stream);
- controller_print_unlock_flush(global.main->output.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
// sleep for less than a second to better show simulation of synchronous vs asynchronous.
if (global.main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sUnknown rule item action '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic(global.main->warning.to.stream, cache->action.name_action);
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SUnknown rule item action '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_string("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, cache->action, F_true);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sFSS Extended List is not allowed for the rule item action '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic(global.main->error.to.stream, cache->action.name_action);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SFSS Extended List is not allowed for the rule item action '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
+ fl_print_string("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sUnsupported action type '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_rule_action_type_name(process->action), global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' while attempting to execute rule.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SUnsupported action type '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rule_action_type_name(process->action), global.main->error.notable);
+ fl_print_string("%[' while attempting to execute rule.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe rule '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, process->rule.name.used ? process->rule.name.string : f_string_empty_s, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' has no '", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, controller_rule_action_type_name(process->action).string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' action to execute.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.name, global.main->error.notable);
+ fl_print_string("%[' has no '%]", global.main->error.to.stream, global.main->error.context, process->rule.name, global.main->error.context);
+ fl_print_string("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rule_action_type_name(process->action), global.main->error.notable);
+ fl_print_string("%[' action to execute.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe rule '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, process->rule.alias.string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' is already on the execution dependency stack, this recursion is prohibited.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.alias, global.main->error.notable);
+ fl_print_string("%[' is already on the execution dependency stack, this recursion is prohibited.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->warning.verbosity == f_console_verbosity_debug) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sUnknown rule item '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic(global.main->warning.to.stream, cache->action.name_item);
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SUnknown rule item '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_string("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_item, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, cache->action, F_true);
+ funlockfile(global.main->warning.to.stream);
+
f_thread_mutex_lock(&global.thread->lock.print);
}
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sUnknown rule setting '", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s);
- fprintf(global.main->warning.to.stream, "%s%s", global.main->warning.context.after->string, global.main->warning.notable.before->string);
- fll_print_dynamic(global.main->warning.to.stream, cache->action.name_item);
- fprintf(global.main->warning.to.stream, "%s", global.main->warning.notable.after->string);
- fprintf(global.main->warning.to.stream, "%s'.%s%c", global.main->warning.context.before->string, global.main->warning.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SUnknown rule setting '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_string("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_item, global.main->warning.notable);
+ fl_print_string("%['.%]%c", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->warning, cache->action, F_false);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
if (!cache->content_actions.array[i].used) {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->warning.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->warning.to.stream, "%s%sEmpty rule setting.%s%c", global.main->warning.context.before->string, global.main->warning.prefix ? global.main->warning.prefix : f_string_empty_s, global.main->warning.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->warning.to.stream);
+
+ fl_print_string("%c%[%SEmpty rule setting.%]%c", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->warning, cache->action, F_false);
+ funlockfile(global.main->warning.to.stream);
+
controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
}
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires one or more Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires one or more Content.%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- if (status == F_number_overflow || status == F_number_underflow) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ // get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an unsupported number '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s%s', the number is too large for this system.%s%c", global.main->error.notable.after->string, global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ cache->action.line_action = ++cache->action.line_item;
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
- }
- else {
- f_thread_mutex_lock(&global.thread->lock.print);
+ f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid number '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s%s', only whole numbers are allowed for an affinity value.%s%c", global.main->error.notable.after->string, global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ if (status == F_number_overflow || status == F_number_underflow) {
+ fl_print_string("%c%[%SRule setting has an unsupported number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[', the number is too large for this system.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+ }
+ else {
+ fl_print_string("%c%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[' only whole numbers are allowed for an affinity value.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
}
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
+ controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- cache->action.line_action = ++cache->action.line_item;
+ funlockfile(global.main->error.to.stream);
- controller_rule_item_error_print(global.main->error, cache->action, F_false, global.thread);
+ controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
status = F_status_set_error(F_valid_not);
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires exactly two Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires exactly two Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
++setting_maps->used;
+
continue;
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires two or more Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires two or more Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an unknown option '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[0]);
- fprintf(global.main->error.to.stream, "%s%s'.%s%c", global.main->error.notable.after->string, global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an unknown option '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
+ fl_print_string("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (cache->content_actions.array[i].used != 3) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires three Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires three Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
else {
if (global.main->error.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sUnknown resource limit type '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic(global.main->error.to.stream, cache->action.name_action);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SUnknown resource limit type '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
+ fl_print_string("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_true);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (type == rule->limits.array[j].type) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe resource limit type is already specified.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe resource limit type is already specified%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- if (status == F_number_overflow || status == F_number_underflow) {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an unsupported number '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s%s', the number is too large for this system.%s%c", global.main->error.notable.after->string, global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
- }
- else {
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid number '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s%s', only whole numbers are allowed for a resource limit value.%s%c", global.main->error.notable.after->string, global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
- }
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ if (status == F_number_overflow || status == F_number_underflow) {
+ fl_print_string("%c%[%SRule setting has an unsupported number'%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%S%]", global.main->error.to.stream, global.main->error.notable, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[' the number is too large for this system.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+ }
+ else {
+ fl_print_string("%c%[%SRule setting has an invalid number'%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%S%]", global.main->error.to.stream, global.main->error.notable, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[' only whole numbers are allowed for a resource limit value.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+ }
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (setting_value->used || cache->content_actions.array[i].used != 1) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires exactly one Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires exactly one Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
status = controller_validate_has_graph(*setting_value);
if (status == F_false || F_status_set_fine(status) == F_complete_not_utf) {
+ if (global.main->error.verbosity != f_console_verbosity_quiet) {
+
+ // get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
+
+ cache->action.line_action = ++cache->action.line_item;
+ }
if (status == F_false) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid name '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic(global.main->error.to.stream, *setting_value);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s', there must be at least 1 graph character.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
-
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
+ flockfile(global.main->error.to.stream);
- cache->action.line_action = ++cache->action.line_item;
+ fl_print_string("%c%[%SRule setting has an invalid name '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, *setting_value, global.main->error.notable);
+ fl_print_string("%[', there must be at least 1 graph character.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
}
else {
- f_thread_mutex_lock(&global.thread->lock.print);
// this function should only return F_complete_not_utf on error.
controller_rule_error_print(global.main->error, cache->action, F_complete_not_utf, "controller_validate_has_graph", F_true, F_false, global.thread);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
-
if (F_status_is_error_not(status_return)) {
status_return = status;
}
+
+ controller_rule_item_error_print(global.main->error, cache->action, F_false, global.thread);
}
setting_value->used = 0;
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
-
- cache->action.line_action = ++cache->action.line_item;
-
- controller_rule_item_error_print(global.main->error, cache->action, F_false, global.thread);
-
continue;
}
}
if (cache->content_actions.array[i].used < 1 || cache->content_actions.array[i].used > 2 || rule->has & controller_rule_has_scheduler) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires either one or two Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires either one or two Content.'%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an unknown scheduler '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[0]);
- fprintf(global.main->error.to.stream, "%s%s'.%s%c", global.main->error.notable.after->string, global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an unknown scheduler '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
+ fl_print_string("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if ((zero_only && number) || (!zero_only && (number < 1 || number > 99)) || status == F_data_not || status == F_number || status == F_number_overflow) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
+
+ // get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
+
+ cache->action.line_action = ++cache->action.line_item;
+
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid number '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[1]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
if (zero_only) {
- fprintf(global.main->error.to.stream, "%s%s', only ", global.main->error.notable.after->string, global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s0%s", global.main->error.context.after->string, global.main->error.notable.before->string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s is", global.main->error.context.before->string);
+ fl_print_string("%[', only%] ", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[0%]%[ is", global.main->error.to.stream, global.main->error.notable, global.main->error.notable, global.main->error.context);
}
else {
- fprintf(global.main->error.to.stream, "%s%s', only the whole numbers inclusively between ", global.main->error.notable.after->string, global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s1%s", global.main->error.context.after->string, global.main->error.notable.before->string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s and ", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s99%s", global.main->error.context.after->string, global.main->error.notable.before->string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s are", global.main->error.context.before->string);
+ fl_print_string("%[', only the whole numbers inclusively between%] ", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[1%] %[and%] ", global.main->error.to.stream, global.main->error.notable, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_string("%[99%] %[are", global.main->error.to.stream, global.main->error.notable, global.main->error.notable, global.main->error.context);
}
- fprintf(global.main->error.to.stream, " allowed for the designated scheduler.%s%c", global.main->error.context.after->string, f_string_eol_s[0]);
-
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
-
- cache->action.line_action = ++cache->action.line_item;
+ fl_print_string(" allowed for the designated scheduler.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (cache->content_actions.array[i].used != 1 || type == controller_rule_setting_type_capability && rule->capability || type == controller_rule_setting_type_group && (rule->has & controller_rule_has_group) || type == controller_rule_setting_type_nice && (rule->has & controller_rule_has_nice) || type == controller_rule_setting_type_user && (rule->has & controller_rule_has_user)) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires exactly one Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires exactly one Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic);
if (F_status_is_error(status)) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false, global.thread);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false, global.thread);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
status = f_string_dynamic_terminate_after(&cache->action.generic);
if (F_status_is_error(status)) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false, global.thread);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false, global.thread);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
if (F_status_is_error(status) && F_status_set_fine(status) != F_supported_not) {
if (F_status_set_fine(status) == F_memory_not) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false, global.thread);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false, global.thread);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting failed to process the capabilities.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting failed to process the capabilities.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (number < -20 || number > 19 || status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid number '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[0]);
- fprintf(global.main->error.to.stream, "%s%s', only the whole numbers inclusively between ", global.main->error.notable.after->string, global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s-20%s", global.main->error.context.after->string, global.main->error.notable.before->string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s and ", global.main->error.context.before->string);
- fprintf(global.main->error.to.stream, "%s%s19%s", global.main->error.context.after->string, global.main->error.notable.before->string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s are allowed.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
+ fl_print_string("%[', only the whole numbers inclusively between%] ", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[-20%]", global.main->error.to.stream, global.main->error.notable, global.main->error.notable);
+ fl_print_string(" %[and%] ", global.main->error.to.stream, global.main->error.context, global.main->error.context);
+ fl_print_string("%[19%]", global.main->error.to.stream, global.main->error.notable, global.main->error.notable);
+ fl_print_string(" %[are allowed.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
+ // get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
+
+ cache->action.line_action = ++cache->action.line_item;
+
if (status == F_exist_not) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid user '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[0]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' because no user was found by that name.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid user '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
+ fl_print_string("%[' because no user was found by that name.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid user '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[0]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' because the given ID is too large.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid user '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
+ fl_print_string("%[' because the given ID is too large.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid user '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[0]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' because the given ID is not a valid supported number.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid user '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
+ fl_print_string("%[' because the given ID is not a valid supported number.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
controller_rule_error_print(global.main->error, cache->action, status, "f_account_id_user_by_name", F_true, F_false, global.thread);
}
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
-
- cache->action.line_action = ++cache->action.line_item;
-
controller_rule_item_error_print(global.main->error, cache->action, F_false, global.thread);
if (F_status_is_error_not(status_return)) {
if (type == controller_rule_setting_type_group) {
if (!cache->content_actions.array[i].used) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires one or more Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires one or more Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid group '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' because no group was found by that name.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid group '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[' because no group was found by that name.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid group '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' because the given ID is too large.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid group '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[' because the given ID is too large.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid group '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[j]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' because the given ID is not a valid supported number.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting has an invalid group '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
+ fl_print_string("%[' because the given ID is not a valid supported number.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
status = controller_validate_environment_name(setting_values->array[setting_values->used]);
if (status == F_false || F_status_set_fine(status) == F_complete_not_utf) {
+
+ // get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
+
+ cache->action.line_action = ++cache->action.line_item;
+
if (status == F_false) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting has an invalid environment variable name '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s%s%s", global.main->error.context.after->string, global.main->error.notable.before->string, setting_values->array[setting_values->used].string, global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
-
- cache->action.line_action = ++cache->action.line_item;
+ fl_print_string("%c%[%SRule setting has an invalid environment variable name '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, global.main->error.notable, setting_values->array[setting_values->used], global.main->error.notable);
+ fl_print_string("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
setting_values->array[setting_values->used].used = 0;
- // get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
-
- cache->action.line_action = ++cache->action.line_item;
-
controller_rule_item_error_print(global.main->error, cache->action, F_false, global.thread);
continue;
if (cache->content_actions.array[i].used != 4) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting requires exactly four Content.%s%c", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting requires exactly four Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting's first value has '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[1]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' but only supports %s, %s, %s, %s, %s", global.main->error.context.before->string, controller_string_freeze_s, controller_string_kill_s, controller_string_pause_s, controller_string_reload_s, controller_string_restart_s);
- fprintf(global.main->error.to.stream, "%s, %s, %s, and %s.%s%c", controller_string_resume_s, controller_string_start_s, controller_string_stop_s, controller_string_thaw_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting's first value has '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
+ fl_print_string("%[' but only supports %s, %s, %s, %s, %s", global.main->error.to.stream, global.main->error.context, controller_string_freeze_s, controller_string_kill_s, controller_string_pause_s, controller_string_reload_s, controller_string_restart_s);
+ fl_print_string("%s, %s, %s, and %s.%]%c", global.main->error.to.stream, controller_string_resume_s, controller_string_start_s, controller_string_stop_s, controller_string_thaw_s, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sRule setting's second value has '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[1]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' but only supports %s, %s, and %s.%s%c", global.main->error.context.before->string, controller_string_need_s, controller_string_want_s, controller_string_wish_s, global.main->error.context.after->string, f_string_eol_s[0]);
// get the current line number within the settings item.
cache->action.line_item = line_item;
cache->action.line_action = ++cache->action.line_item;
+ f_thread_mutex_lock(&global.thread->lock.print);
+
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SRule setting's second value has '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
+ fl_print_string("%[' but only supports %s, %s, and %s.%s.%]%c", global.main->error.to.stream, global.main->error.context, controller_string_need_s, controller_string_want_s, controller_string_wish_s, global.main->error.context, f_string_eol_s[0]);
+
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
+ funlockfile(global.main->error.to.stream);
+
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&global.thread->lock.print);
- fprintf(global.main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(global.main->error.to.stream, "%s%sThe rule item action third parameter '", global.main->error.context.before->string, global.main->error.prefix ? global.main->error.prefix : f_string_empty_s);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic_partial(global.main->error.to.stream, cache->buffer_item, cache->content_actions.array[i].array[2]);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s' must be a base path name, such as %llu '", global.main->error.context.before->string, cache->buffer_path.used);
- fprintf(global.main->error.to.stream, "%s%s", global.main->error.context.after->string, global.main->error.notable.before->string);
- fll_print_dynamic(global.main->error.to.stream, cache->buffer_path);
- fprintf(global.main->error.to.stream, "%s", global.main->error.notable.after->string);
- fprintf(global.main->error.to.stream, "%s'.%s%c", global.main->error.context.before->string, global.main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(global.main->error.to.stream);
+
+ fl_print_string("%c%[%SThe rule item action third parameter '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_string("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[2], global.main->error.notable);
+ fl_print_string("%[' must be a base path name, such as %ul '.%]", global.main->error.to.stream, global.main->error.context, cache->buffer_path.used, global.main->error.context);
+ fl_print_string("%[%Q%]", global.main->error.to.stream, cache->buffer_path, global.main->error.notable);
+ fl_print_string("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
+
+ funlockfile(global.main->error.to.stream);
controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
}
default:
if (main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(main->error.to.stream, "%s%sUnsupported action type '", main->error.context.before->string, main->error.prefix ? main->error.prefix : f_string_empty_s);
- fprintf(main->error.to.stream, "%s%s%s%s", main->error.context.after->string, main->error.notable.before->string, controller_rule_action_type_name(action).string, main->error.notable.after->string);
- fprintf(main->error.to.stream, "%s' while attempting to validate rule execution.%s%c", main->error.context.before->string, main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_string("%c%[%SUnsupported action type '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%q%]", main->error.to.stream, main->error.notable, controller_rule_action_type_name(action), main->error.notable);
+ fl_print_string("%[' while attempting to validate rule execution.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(main->error, cache->action, F_true);
+
+ funlockfile(main->error.to.stream);
}
controller_print_unlock_flush(main->error.to.stream, &global.thread->lock.print);
} // for
if (missing) {
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(main->output.stream, "Rule '");
- fprintf(main->output.stream, "%s%s%s", main->context.set.title.before->string, rule.name.used ? rule.name.string : f_string_empty_s, main->context.set.title.after->string);
- fprintf(main->output.stream, "' has no '");
- fprintf(main->output.stream, "%s%s%s", main->context.set.important.before->string, controller_rule_action_type_name(action).string, main->context.set.important.after->string);
- fprintf(main->output.stream, "' action to execute and would '");
- fprintf(main->output.stream, "%s%s%s", main->context.set.important.before->string, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important.after->string);
- fprintf(main->output.stream, "' because it is '");
- fprintf(main->output.stream, "%s%s%s", main->context.set.important.before->string, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important.after->string);
- fprintf(main->output.stream, "'.%c", f_string_eol_s[0]);
+ flockfile(main->output.stream);
+
+ fl_print_string("%cRule '", main->output.stream, f_string_eol_s[0]);
+ fl_print_string("%[%Q%]' has no '", main->output.stream, main->context.set.title, rule.name, main->context.set.title);
+ fl_print_string("%[%q%]' action to execute and would '", main->output.stream, main->context.set.title, controller_rule_action_type_name(action), main->context.set.title);
+ fl_print_string("%[%s%]' because it is '", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important);
+ fl_print_string("%[%s%]'.%c", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important, f_string_eol_s[0]);
+
+ funlockfile(main->output.stream);
}
}
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(main->output.stream, "Rule %s%s%s {%c", main->context.set.title.before->string, rule.alias.used ? rule.alias.string : f_string_empty_s, main->context.set.title.after->string, f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_name_s, main->context.set.important.after->string, rule.name.used ? rule.name.string : f_string_empty_s, f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_how_s, main->context.set.important.after->string, options & controller_process_option_asynchronous ? controller_string_asynchronous_s : controller_string_synchronous_s, f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_wait_s, main->context.set.important.after->string, options & controller_process_option_wait ? controller_string_yes : controller_string_no_s, f_string_eol_s[0]);
+ flockfile(main->output.stream);
- if (f_capability_supported()) {
- fprintf(main->output.stream, " %s%s%s ", main->context.set.important.before->string, controller_string_capability_s, main->context.set.important.after->string);
+ fl_print_string("%cRule %[%Q%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.title, rule.alias, main->context.set.title, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_name_s, main->context.set.important, rule.name, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] %s%c", main->output.stream, main->context.set.important, controller_string_how_s, main->context.set.important, options & controller_process_option_asynchronous ? controller_string_asynchronous_s : controller_string_synchronous_s, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] %s%c", main->output.stream, main->context.set.important, controller_string_wait_s, main->context.set.important, options & controller_process_option_wait ? controller_string_yes : controller_string_no_s, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] ", main->output.stream, main->context.set.important, controller_string_capability_s, main->context.set.important);
+ if (f_capability_supported()) {
if (rule.capability) {
cache->action.generic.used = 0;
if (F_status_is_error_not(f_capability_to_text(rule.capability, &cache->action.generic))) {
- fprintf(main->output.stream, "%s", cache->action.generic.string);
+ f_print_dynamic_safely(cache->action.generic, main->output.stream);
}
}
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
+ f_print_terminated(f_string_eol_s, main->output.stream);
}
else {
- fprintf(main->output.stream, " %s%s%s ", main->context.set.important.before->string, controller_string_capability_s, main->context.set.important.after->string);
- fprintf(main->output.stream, "%s(unsupported)%s%c", main->context.set.warning.before->string, main->context.set.warning.after->string, f_string_eol_s[0]);
+ fl_print_string("%[(unsupported)%]%c", main->output.stream, main->context.set.warning, controller_string_capability_s, main->context.set.warning, f_string_eol_s[0]);
}
- fprintf(main->output.stream, " %s%s%s", main->context.set.important.before->string, controller_string_control_group_s, main->context.set.important.after->string);
+ fl_print_string(" %[%s%]", main->output.stream, main->context.set.important, controller_string_control_group_s, main->context.set.important);
if (rule.has & controller_rule_has_control_group) {
- fprintf(main->output.stream, " %s", rule.control_group.as_new ? controller_string_new_s : controller_string_existing_s);
+ fl_print_string(" %s", main->output.stream, rule.control_group.as_new ? controller_string_new_s : controller_string_existing_s);
for (i = 0; i < rule.control_group.groups.used; ++i) {
if (rule.control_group.groups.array[i].used) {
- fprintf(main->output.stream, "%s", f_string_space_s);
- fll_print_dynamic(main->output.stream, rule.control_group.groups.array[i]);
+ fl_print_string(" %Q", main->output.stream, rule.control_group.groups.array[i]);
}
} // for
}
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s", main->context.set.important.before->string, controller_string_nice_s, main->context.set.important.after->string);
+ fl_print_string("%c %[%s%]", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_nice_s, main->context.set.important);
if (rule.has & controller_rule_has_nice) {
- fprintf(main->output.stream, " %i", rule.nice);
+ fl_print_string(" %i", main->output.stream, rule.nice);
}
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s", main->context.set.important.before->string, controller_string_scheduler_s, main->context.set.important.after->string);
+ fl_print_string("%c %[%s%]", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_scheduler_s, main->context.set.important);
if (rule.has & controller_rule_has_scheduler) {
f_string_t policy = "";
policy = controller_string_round_robin_s;
}
- fprintf(main->output.stream, " %s %i", policy, rule.scheduler.priority);
+ fl_print_string(" %s %i", main->output.stream, policy, rule.scheduler.priority);
}
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_script_s, main->context.set.important.after->string, rule.script.used ? rule.script.string : f_string_empty_s, f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s", main->context.set.important.before->string, controller_string_user_s, main->context.set.important.after->string);
+ fl_print_string("%c %[%s%] %Q%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_script_s, main->context.set.important, rule.script, f_string_eol_s[0]);
+ fl_print_string(" %[%s%]", main->output.stream, main->context.set.important, controller_string_user_s, main->context.set.important);
if (rule.has & controller_rule_has_user) {
- fprintf(main->output.stream, " %i", rule.user);
+ fl_print_string(" %i", main->output.stream, rule.user);
}
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_affinity_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string("%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_affinity_s, main->context.set.important, f_string_eol_s[0]);
for (i = 0; i < rule.affinity.used; ++i) {
- fprintf(main->output.stream, " %i%c", rule.affinity.array[i], f_string_eol_s[0]);
+ fl_print_string(" %i%c", main->output.stream, rule.affinity.array[i], f_string_eol_s[0]);
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_define_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_define_s, main->context.set.important, f_string_eol_s[0]);
for (i = 0; i < rule.define.used; ++i) {
if (rule.define.array[i].name.used && rule.define.array[i].value.used) {
- fprintf(main->output.stream, " %s %s=%s %s%c", rule.define.array[i].name.string, main->context.set.important.before->string, main->context.set.important.after->string, rule.define.array[i].value.string, f_string_eol_s[0]);
+ fl_print_string(" %Q %[=%] %Q%c", main->output.stream, rule.define.array[i].name, main->context.set.important, main->context.set.important, rule.define.array[i].value, f_string_eol_s[0]);
}
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_environment_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_environment_s, main->context.set.important, f_string_eol_s[0]);
for (i = 0; i < rule.environment.used; ++i) {
if (rule.environment.array[i].used) {
- fprintf(main->output.stream, " %s%c", rule.environment.array[i].string, f_string_eol_s[0]);
+ fl_print_string(" %Q%c", main->output.stream, rule.environment.array[i], f_string_eol_s[0]);
}
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_parameter_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_parameter_s, main->context.set.important, f_string_eol_s[0]);
for (i = 0; i < rule.parameter.used; ++i) {
if (rule.parameter.array[i].name.used && rule.parameter.array[i].value.used) {
- fprintf(main->output.stream, " %s %s=%s %s%c", rule.parameter.array[i].name.string, main->context.set.important.before->string, main->context.set.important.after->string, rule.parameter.array[i].value.string, f_string_eol_s[0]);
+ fl_print_string(" %Q %[=%] %Q%c", main->output.stream, rule.parameter.array[i].name, main->context.set.important, main->context.set.important, rule.parameter.array[i].value, f_string_eol_s[0]);
}
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_group_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_group_s, main->context.set.important, f_string_eol_s[0]);
if (rule.has & controller_rule_has_group) {
- fprintf(main->output.stream, " %i%c", rule.group, f_string_eol_s[0]);
+ fl_print_string(" %i%c", main->output.stream, rule.group, f_string_eol_s[0]);
for (i = 0; i < rule.groups.used; ++i) {
- fprintf(main->output.stream, " %i%c", rule.groups.array[i], f_string_eol_s[0]);
+ fl_print_string(" %i%c", main->output.stream, rule.groups.array[i], f_string_eol_s[0]);
} // for
}
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_limit_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_limit_s, main->context.set.important, f_string_eol_s[0]);
for (i = 0; i < rule.limits.used; ++i) {
- fprintf(main->output.stream, " %s %s=%s %llu %llu%c", controller_rule_setting_limit_type_name(rule.limits.array[i].type).string, main->context.set.important.before->string, main->context.set.important.after->string, rule.limits.array[i].value.rlim_cur, rule.limits.array[i].value.rlim_max, f_string_eol_s[0]);
+ fl_print_string(" %Q %[=%] %ul %ul%c", main->output.stream, controller_rule_setting_limit_type_name(rule.limits.array[i].type), main->context.set.important, main->context.set.important, rule.limits.array[i].value.rlim_cur, rule.limits.array[i].value.rlim_max, f_string_eol_s[0]);
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_on_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_on_s, main->context.set.important, f_string_eol_s[0]);
for (i = 0; i < rule.ons.used; ++i) {
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_action_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_action_s, main->context.set.important, f_string_eol_s[0]);
{
f_string_t action = "";
action = controller_string_thaw_s;
}
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_type_s, main->context.set.important.after->string, action, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] %s%c", main->output.stream, main->context.set.important, controller_string_type_s, main->context.set.important, action, f_string_eol_s[0]);
}
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_need_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_need_s, main->context.set.important, f_string_eol_s[0]);
for (j = 0; j < rule.ons.array[i].need.used; ++j) {
if (rule.ons.array[i].need.array[j].used) {
- fprintf(main->output.stream, " %s%c", rule.ons.array[i].need.array[j].string, f_string_eol_s[0]);
+ fl_print_string(" %Q%c", main->output.stream, rule.ons.array[i].need.array[j], f_string_eol_s[0]);
}
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_want_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_want_s, main->context.set.important, f_string_eol_s[0]);
for (j = 0; j < rule.ons.array[i].want.used; ++j) {
if (rule.ons.array[i].want.array[j].used) {
- fprintf(main->output.stream, " %s%c", rule.ons.array[i].want.array[j].string, f_string_eol_s[0]);
+ fl_print_string(" %Q%c", main->output.stream, rule.ons.array[i].want.array[j], f_string_eol_s[0]);
}
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_wish_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_wish_s, main->context.set.important, f_string_eol_s[0]);
for (j = 0; j < rule.ons.array[i].wish.used; ++j) {
if (rule.ons.array[i].wish.array[j].used) {
- fprintf(main->output.stream, " %s%c", rule.ons.array[i].wish.array[j].string, f_string_eol_s[0]);
+ fl_print_string(" %Q%c", main->output.stream, rule.ons.array[i].wish.array[j], f_string_eol_s[0]);
}
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
+ fl_print_string(" }%c }%c", main->output.stream, f_string_eol_s[0], f_string_eol_s[0]);
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
+ fl_print_string(" }%c", main->output.stream, f_string_eol_s[0]);
if (rule.items.used) {
controller_rule_action_t *action = 0;
item = &rule.items.array[i];
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_item_s, main->context.set.important.after->string, f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_type_s, main->context.set.important.after->string, controller_rule_item_type_name(item->type).string, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_item_s, main->context.set.important, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_type_s, main->context.set.important, controller_rule_item_type_name(item->type), f_string_eol_s[0]);
for (j = 0; j < item->actions.used; ++j) {
action = &item->actions.array[j];
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_action_s, main->context.set.important.after->string, f_string_eol_s[0]);
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_type_s, main->context.set.important.after->string, controller_rule_action_type_name(action->type).string, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_action_s, main->context.set.important, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] %q%c", main->output.stream, main->context.set.important, controller_string_type_s, main->context.set.important, controller_rule_action_type_name(action->type), f_string_eol_s[0]);
if (item->type == controller_rule_item_type_script || item->type == controller_rule_item_type_utility) {
- fprintf(main->output.stream, " %s%s%s {%c", main->context.set.important.before->string, controller_string_parameter_s, main->context.set.important.after->string, f_string_eol_s[0]);
+ fl_print_string(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, f_string_eol_s[0]);
parameter = &action->parameters.array[0];
if (parameter->used) {
- fprintf(main->output.stream, " ");
+ f_print_terminated(" ", main->output.stream);
for (k = 0; k < parameter->used; ++k) {
- fprintf(main->output.stream, "%c", parameter->string[k]);
-
- if (parameter->string[k] == f_fss_eol && k + 1 < parameter->used) {
- fprintf(main->output.stream, " ");
+ if (parameter->string[k] == f_fss_eol) {
+ if (k + 1 < parameter->used) {
+ f_print_terminated(f_string_eol_s, main->output.stream);
+ f_print_terminated(" ", main->output.stream);
+ }
+ }
+ else {
+ f_print_character_safely(parameter->string[k], main->output.stream);
}
} // for
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
+ f_print_terminated(f_string_eol_s, main->output.stream);
}
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
+ fl_print_string(" }%c", main->output.stream, f_string_eol_s[0]);
}
else {
for (k = 0; k < action->parameters.used; ++k) {
- fprintf(main->output.stream, " %s%s%s %s%c", main->context.set.important.before->string, controller_string_parameter_s, main->context.set.important.after->string, action->parameters.array[k].string, f_string_eol_s[0]);
+ fl_print_string(" %s%s%s %Q%c", main->output.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s[0]);
} // for
}
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
+ fl_print_string(" }%c", main->output.stream, f_string_eol_s[0]);
} // for
- fprintf(main->output.stream, " }%c", f_string_eol_s[0]);
+ fl_print_string(" }%c", main->output.stream, f_string_eol_s[0]);
} // for
}
- fprintf(main->output.stream, "}%c", f_string_eol_s[0]);
+ fl_print_string("}%c", main->output.stream, f_string_eol_s[0]);
+
+ funlockfile(main->output.stream);
controller_print_unlock_flush(main->output.stream, &global.thread->lock.print);
}
/**
* Print an error or warning message related to the failed execution of some program or script.
*
- * @param print
+ * @param output
* The error or warning output structure.
* @param script_is
* If TRUE, then this represents a script.
* The status code representing the failure (without the error bit set).
*/
#ifndef _di_controller_rule_item_error_print_execute_
- extern void controller_rule_item_error_print_execute(const fll_error_print_t print, const bool script_is, const f_string_t name, const int code, const f_status_t status) f_attribute_visibility_internal;
+ extern void controller_rule_item_error_print_execute(const fll_error_print_t output, const bool script_is, const f_string_t name, const int code, const f_status_t status) f_attribute_visibility_internal;
#endif // _di_controller_rule_item_error_print_execute_
/**
* Print an error or warning message related to the failed execution of some program or script for when the program or script is not found.
*
- * @param print
+ * @param output
* The error or warning output structure.
* @param script_is
* If TRUE, then this represents a script.
* The code returned by the executed program or script.
*/
#ifndef _di_controller_rule_item_error_print_execute_not_found_
- extern void controller_rule_item_error_print_execute_not_found(const fll_error_print_t print, const bool script_is, const f_string_t name) f_attribute_visibility_internal;
+ extern void controller_rule_item_error_print_execute_not_found(const fll_error_print_t output, const bool script_is, const f_string_t name) f_attribute_visibility_internal;
#endif // _di_controller_rule_item_error_print_execute_not_found_
/**
* Print an error or warning message related to need/want/wish settings of some rule.
*
- * @param print
+ * @param output
* The error or warning output structure.
* @param need_want_wish
- * The appropriate string, such as "needs", "wants", or "wishes for" to print when describing this error/warning.
+ * The appropriate string, such as "needs", "wants", or "wishes for" to output when describing this error/warning.
+ * This string is expected to already be "safe" (no control characters, etc..).
* @param value
* The value that is the error or warning.
* @param why
* A short explanation on why this is an error or warning.
*/
#ifndef _di_controller_rule_item_error_print_need_want_wish_
- extern void controller_rule_item_error_print_need_want_wish(const fll_error_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) f_attribute_visibility_internal;
+ extern void controller_rule_item_error_print_need_want_wish(const fll_error_print_t output, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) f_attribute_visibility_internal;
#endif // _di_controller_rule_item_error_print_need_want_wish_
/**
* Print an error or warning message about some rule not being loaded.
*
- * @param print
+ * @param output
* The error or warning output structure.
* @param alias
* The rule alias of the rule that is not loaded.
*/
#ifndef _di_controller_rule_item_error_print_rule_not_loaded_
- extern void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t print, const f_string_t alias) f_attribute_visibility_internal;
+ extern void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t output, const f_string_t alias) f_attribute_visibility_internal;
#endif // _di_controller_rule_item_error_print_rule_not_loaded_
/**
* Print an error or warning message about some rule not having the pid file information.
*
- * @param print
+ * @param output
* The error or warning output structure.
* @param alias
* The rule alias of the rule that is missing the pid file designation.
*/
#ifndef _di_controller_rule_action_error_missing_pid_
- extern void controller_rule_action_error_missing_pid(const fll_error_print_t print, const f_string_t alias) f_attribute_visibility_internal;
+ extern void controller_rule_action_error_missing_pid(const fll_error_print_t output, const f_string_t alias) f_attribute_visibility_internal;
#endif // _di_controller_rule_action_error_missing_pid_
/**
if (main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&thread.lock.print);
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(main->error.to.stream, "%s%sThe pid file '", main->error.context.before->string, main->error.prefix ? main->error.prefix : f_string_empty_s);
- fprintf(main->error.to.stream, "%s%s%s%s", main->error.context.after->string, main->error.notable.before->string, setting->path_pid.string, main->error.notable.after->string);
- fprintf(main->error.to.stream, "%s' must not already exist.%s%c", main->error.context.before->string, main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_string("%c%[%SThe pid file '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%S%]", main->error.to.stream, main->error.notable, setting->path_pid.string, main->error.notable);
+ fl_print_string("%[' must not already exist.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
controller_print_unlock_flush(main->error.to.stream, &thread.lock.print);
}
if (main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&entry->global->thread->lock.print);
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(main->error.to.stream, "%s%sThe pid file '", main->error.context.before->string, main->error.prefix ? main->error.prefix : f_string_empty_s);
- fprintf(main->error.to.stream, "%s%s%s%s", main->error.context.after->string, main->error.notable.before->string, entry->setting->path_pid.string, main->error.notable.after->string);
- fprintf(main->error.to.stream, "%s' must not already exist.%s%c", main->error.context.before->string, main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_string("%c%[%SThe pid file '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%Q%]", main->error.to.stream, main->error.notable, entry->setting->path_pid, main->error.notable);
+ fl_print_string("%[' must not already exist.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
controller_print_unlock_flush(main->error.to.stream, &entry->global->thread->lock.print);
}
if (main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&entry->global->thread->lock.print);
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(main->error.to.stream, "%s%sFailed while processing requested failsafe item '", main->error.context.before->string, main->error.prefix ? main->error.prefix : f_string_empty_s);
- fprintf(main->error.to.stream, "%s%s%s%s", main->error.context.after->string, main->error.notable.before->string, entry->global->setting->entry.items.array[entry->global->setting->failsafe_enabled].name.string, main->error.notable.after->string);
- fprintf(main->error.to.stream, "%s'.%s%c", main->error.context.before->string, main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_string("%c%[%SFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%Q%]", main->error.to.stream, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_enabled].name, main->error.notable);
+ fl_print_string("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
controller_print_unlock_flush(main->error.to.stream, &entry->global->thread->lock.print);
}
if (main->error.verbosity != f_console_verbosity_quiet) {
f_thread_mutex_lock(&entry->global->thread->lock.print);
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
- fprintf(main->error.to.stream, "%s%sFailed while processing requested failsafe item '", main->error.context.before->string, main->error.prefix ? main->error.prefix : f_string_empty_s);
- fprintf(main->error.to.stream, "%s%s%s%s", main->error.context.after->string, main->error.notable.before->string, entry->global->setting->entry.items.array[entry->global->setting->failsafe_enabled].name.string, main->error.notable.after->string);
- fprintf(main->error.to.stream, "%s'.%s%c", main->error.context.before->string, main->error.context.after->string, f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_string("%c%[%SFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_string("%[%Q%]", main->error.to.stream, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_enabled].name, main->error.notable);
+ fl_print_string("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
controller_print_unlock_flush(main->error.to.stream, &entry->global->thread->lock.print);
}