Make the is white space functions accept "strict" to be more consistent with how other functions operation.
For the next development release I want to consider separate functions to avoid passing a boolean as a parameter to do this (for performance reasons).
This changes behavior in some cases and if I did something wrong then there will be a regression.
Look out for white space regressions specifically in the FSS programs.
return status;
}
- status = f_fss_fail_utf_to_false(state, f_utf_is_whitespace(buffer.string + range.start, width_max));
+ status = f_fss_fail_utf_to_false(state, f_utf_is_whitespace(buffer.string + range.start, width_max, F_false));
if (status == F_false) {
status = f_fss_fail_utf_to_false(state, f_utf_is_control(buffer.string + range.start, width_max));
continue;
}
- status = f_fss_fail_utf_to_false(state, f_utf_is_whitespace(buffer.string + range->start, width_max));
+ status = f_fss_fail_utf_to_false(state, f_utf_is_whitespace(buffer.string + range->start, width_max, F_false));
if (status == F_false) {
status = f_fss_fail_utf_to_false(state, f_utf_is_control(buffer.string + range->start, width_max));
return F_false;
}
- if (private_f_utf_character_is_whitespace(sequence)) {
+ if (private_f_utf_character_is_whitespace(sequence, F_true)) {
return F_false;
}
return F_false;
}
- if (private_f_utf_character_is_whitespace(sequence)) {
+ if (private_f_utf_character_is_whitespace(sequence, F_true)) {
return F_false;
}
return F_false;
}
- if (private_f_utf_character_is_whitespace(sequence)) {
+ if (private_f_utf_character_is_whitespace(sequence, F_true)) {
return F_false;
}
#endif
#if !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
- f_status_t private_f_utf_character_is_whitespace(const f_utf_char_t sequence) {
+ f_status_t private_f_utf_character_is_whitespace(const f_utf_char_t sequence, const bool strict) {
if (macro_f_utf_char_t_width_is(sequence) == 2) {
if (macro_f_utf_char_t_width_is(sequence) == 3) {
+ if (macro_f_utf_char_t_to_char_1(sequence) == 0xe1) {
+ if (strict) {
+
+ // Ogham: U+1680 (isn't whitespace but is technically considered one: ( )).
+ if (sequence == 0xe19a8000) {
+ return F_true;
+ }
+ }
+
+ return F_false;
+ }
+
if (macro_f_utf_char_t_to_char_1(sequence) == 0xe2) {
// General Punctuation: U+2000 to U+200A.
}
#endif // !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_)
+#if !defined(_di_f_utf_character_is_whitespace_zero_width_) || !defined(_di_f_utf_is_whitespace_zero_width_)
+ f_status_t private_f_utf_character_is_whitespace_zero_width(const f_utf_char_t sequence) {
+
+ // General Punctuation: U+200B (isn't whitespace but is intentended to be interpreted as one in certain circumstances).
+ if (sequence == 0xe2808b00) {
+ return F_true;
+ }
+
+ return F_false;
+ }
+#endif // !defined(_di_f_utf_character_is_whitespace_zero_width_) || !defined(_di_f_utf_is_whitespace_zero_width_)
+
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param sequence
* The byte sequence to validate as a character.
+ * @param strict
+ * When TRUE, include all appropriate characters by type as per Unicode.
+ * When FALSE, non-white space characters that are treated as white space by Unicode are not treated as white space.
*
* @return
* F_true if a UTF-8 white space.
* @see f_utf_is_whitespace()
*/
#if !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
- extern f_status_t private_f_utf_character_is_whitespace(const f_utf_char_t sequence) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_whitespace(const f_utf_char_t sequence, const bool strict) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
/**
extern f_status_t private_f_utf_character_is_whitespace_other(const f_utf_char_t sequence) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_)
+/**
+ * Private implementation of f_utf_character_is_whitespace_zero_width().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * This expects the character width to be of at least size 2.
+ *
+ * @param sequence
+ * The byte sequence to validate as a character.
+ *
+ * @return
+ * F_true if a UTF-8 white space other.
+ * F_false if not a UTF-8 white space other.
+ *
+ * F_utf_fragment (with error bit) if character is a UTF-8 fragment.
+ * F_utf_not (with error bit) if unicode is an invalid Unicode character.
+ *
+ * @see f_utf_character_is_whitespace_zero_width()
+ * @see f_utf_is_whitespace_zero_width()
+ */
+#if !defined(_di_f_utf_character_is_whitespace_zero_width_) || !defined(_di_f_utf_is_whitespace_zero_width_)
+ extern f_status_t private_f_utf_character_is_whitespace_zero_width(const f_utf_char_t sequence) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_character_is_whitespace_zero_width_) || !defined(_di_f_utf_is_whitespace_zero_width_)
+
#ifdef __cplusplus
} // extern "C"
#endif
return F_false;
}
- if (private_f_utf_character_is_whitespace(utf)) {
+ if (private_f_utf_character_is_whitespace(utf, F_true)) {
return F_false;
}
#endif // _di_f_utf_is_valid_
#ifndef _di_f_utf_is_whitespace_
- f_status_t f_utf_is_whitespace(const f_string_t sequence, const f_array_length_t width_max) {
+ f_status_t f_utf_is_whitespace(const f_string_t sequence, const f_array_length_t width_max, const bool strict) {
#ifndef _di_level_0_parameter_checking_
if (width_max < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (F_status_is_error(status)) return status;
}
- return private_f_utf_character_is_whitespace(utf);
+ return private_f_utf_character_is_whitespace(utf, strict);
}
if (isspace(*sequence)) return F_true;
}
#endif // _di_f_utf_is_whitespace_other_
+#ifndef _di_f_utf_is_whitespace_zero_width_
+ f_status_t f_utf_is_whitespace_zero_width(const f_string_t sequence, const f_array_length_t width_max) {
+ #ifndef _di_level_0_parameter_checking_
+ if (width_max < 1) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (macro_f_utf_byte_width_is(*sequence)) {
+ if (macro_f_utf_byte_width_is(*sequence) > width_max) {
+ return F_status_set_error(F_complete_not_utf);
+ }
+
+ if (macro_f_utf_byte_width_is(*sequence) == 1) {
+ return F_status_set_error(F_utf_fragment);
+ }
+
+ f_utf_char_t utf = 0;
+
+ {
+ const f_status_t status = private_f_utf_char_to_character(sequence, width_max, &utf);
+ if (F_status_is_error(status)) return status;
+ }
+
+ return private_f_utf_character_is_whitespace_zero_width(utf);
+ }
+
+ // There are no ASCII whitespace zero-width.
+ return F_false;
+ }
+#endif // _di_f_utf_is_whitespace_zero_width_
+
#ifndef _di_f_utf_is_wide_
f_status_t f_utf_is_wide(const f_string_t sequence, const f_array_length_t width_max) {
* @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
+ * @param strict
+ * When TRUE, include all appropriate characters by type as per Unicode.
+ * When FALSE, non-white space characters that are treated as white space by Unicode are not treated as white space.
*
* @return
* F_true if a UTF-8 white space.
* @see isspace()
*/
#ifndef _di_f_utf_is_whitespace_
- extern f_status_t f_utf_is_whitespace(const f_string_t sequence, const f_array_length_t width_max);
+ extern f_status_t f_utf_is_whitespace(const f_string_t sequence, const f_array_length_t width_max, const bool strict);
#endif // _di_f_utf_is_whitespace_
/**
* Can be anything greater than 0.
*
* @return
- * F_true if a UTF-8 white space.
- * F_false if not a UTF-8 white space.
+ * F_true if a UTF-8 (modifier) white space.
+ * F_false if not a UTF-8 (modifier) white space.
*
* F_complete_not_utf (with error bit set) if character is an incomplete UTF-8 sequence.
* F_maybe (with error bit) if this could be a white space but width is not long enough.
* Can be anything greater than 0.
*
* @return
- * F_true if a UTF-8 white space.
- * F_false if not a UTF-8 white space.
+ * F_true if a UTF-8 (other) white space.
+ * F_false if not a UTF-8 (other) white space.
*
* F_complete_not_utf (with error bit set) if character is an incomplete UTF-8 sequence.
* F_maybe (with error bit) if this could be a white space but width is not long enough.
#endif // _di_f_utf_is_whitespace_other_
/**
+ * Check to see if the entire byte block of the character is an other type of UTF-8 space character.
+ *
+ * This is a list of white space that are actually zero-width space (which is not a space), such as Zero-Width Space (U+200B).
+ *
+ * @param sequence
+ * The byte sequence to validate as a character.
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
+ * The maximum width available for checking.
+ * Can be anything greater than 0.
+ *
+ * @return
+ * F_true if a UTF-8 (zero-width) white space.
+ * F_false if not a UTF-8 (zero-width) white space.
+ *
+ * F_complete_not_utf (with error bit set) if character is an incomplete UTF-8 sequence.
+ * F_maybe (with error bit) if this could be a white space but width is not long enough.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_utf_fragment (with error bit) if character is a UTF-8 fragment.
+ * F_utf_not (with error bit) if Unicode is an invalid Unicode character.
+ */
+#ifndef _di_f_utf_is_whitespace_zero_width_
+ extern f_status_t f_utf_is_whitespace_zero_width(const f_string_t sequence, const f_array_length_t width_max);
+#endif // _di_f_utf_is_whitespace_zero_width_
+
+/**
* Get whether or not the UTF-8 character is a wide character on display.
*
* This is not the wide as in width in bytes that the codepoint takes up in UTF-8.
return F_false;
}
- if (private_f_utf_character_is_whitespace(sequence)) {
+ if (private_f_utf_character_is_whitespace(sequence, F_true)) {
return F_false;
}
#endif // _di_f_utf_character_is_valid_
#ifndef _di_f_utf_character_is_whitespace_
- f_status_t f_utf_character_is_whitespace(const f_utf_char_t sequence) {
+ f_status_t f_utf_character_is_whitespace(const f_utf_char_t sequence, const bool strict) {
if (macro_f_utf_char_t_width_is(sequence)) {
if (macro_f_utf_char_t_width_is(sequence) == 1) {
return F_status_set_error(F_utf_fragment);
}
- return private_f_utf_character_is_whitespace(sequence);
+ return private_f_utf_character_is_whitespace(sequence, strict);
}
if (isspace(macro_f_utf_char_t_to_char_1(sequence))) {
}
#endif // _di_f_utf_character_is_whitespace_other_
+#ifndef _di_f_utf_character_is_whitespace_zero_width_
+ f_status_t f_utf_character_is_whitespace_zero_width(const f_utf_char_t sequence) {
+
+ if (macro_f_utf_char_t_width_is(sequence)) {
+ if (macro_f_utf_char_t_width_is(sequence) == 1) {
+ return F_status_set_error(F_utf_fragment);
+ }
+
+ return private_f_utf_character_is_whitespace_zero_width(sequence);
+ }
+
+ // There are no ASCII whitespace zero-width.
+ return F_false;
+ }
+#endif // _di_f_utf_character_is_whitespace_zero_width_
+
#ifndef _di_f_utf_character_is_wide_
f_status_t f_utf_character_is_wide(const f_utf_char_t sequence) {
*
* @param sequence
* The byte sequence to validate as a character.
+ * @param strict
+ * When TRUE, include all appropriate characters by type as per Unicode.
+ * When FALSE, non-white space characters that are treated as white space by Unicode are not treated as white space.
*
* @return
* F_true if a UTF-8 white space.
* @see isspace()
*/
#ifndef _di_f_utf_character_is_whitespace_
- extern f_status_t f_utf_character_is_whitespace(const f_utf_char_t sequence);
+ extern f_status_t f_utf_character_is_whitespace(const f_utf_char_t sequence, const bool strict);
#endif // _di_f_utf_character_is_whitespace_
/**
* The byte sequence to validate as a character.
*
* @return
- * F_true if a UTF-8 modifier character.
- * F_false if not a UTF-8 modifier character.
+ * F_true if a UTF-8 (modifier) white space character.
+ * F_false if not a UTF-8 (modifier) white space character.
*
* F_utf_fragment (with error bit) if character is a UTF-8 fragment.
* F_utf_not (with error bit) if unicode is an invalid Unicode character.
*
* F_utf_fragment (with error bit) if character is a UTF-8 fragment.
* F_utf_not (with error bit) if unicode is an invalid Unicode character.
- *
- * @see isspace()
*/
#ifndef _di_f_utf_character_is_whitespace_other_
extern f_status_t f_utf_character_is_whitespace_other(const f_utf_char_t sequence);
#endif // _di_f_utf_character_is_whitespace_other_
/**
+ * Check to see if the entire byte block of the character is an other type of UTF-8 space character.
+ *
+ * This is a list of white space that are actually zero-width space (which is not a space), such as Zero-Width Space (U+200B).
+ *
+ * @param sequence
+ * The byte sequence to validate as a character.
+ *
+ * @return
+ * F_true if a UTF-8 (zero-width) white space.
+ * F_false if not a UTF-8 (zero-width) white space.
+ *
+ * F_utf_fragment (with error bit) if character is a UTF-8 fragment.
+ * F_utf_not (with error bit) if unicode is an invalid Unicode character.
+ */
+#ifndef _di_f_utf_character_is_whitespace_zero_width_
+ extern f_status_t f_utf_character_is_whitespace_zero_width(const f_utf_char_t sequence);
+#endif // _di_f_utf_character_is_whitespace_zero_width_
+
+/**
* Get whether or not the UTF-8 character is a wide character on display.
*
* This is not the wide as in width in bytes that the codepoint takes up in UTF-8.
if (!mode && !vector) {
width_max = length - i;
- status = f_utf_is_whitespace(string + i, width_max);
+ status = f_utf_is_whitespace(string + i, width_max, F_false);
if (status == F_true) {
offset = i + 1;
if (!mode) {
width_max = length - i;
- status = f_utf_is_whitespace(string + i, width_max);
+ status = f_utf_is_whitespace(string + i, width_max, F_false);
if (status == F_true) {
offset = i + 1;
continue;
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
}
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
continue;
}
- status = f_utf_is_whitespace(string + j, stop - j);
+ status = f_utf_is_whitespace(string + j, stop - j, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
continue;
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
// Determine if this is an end of string white space that needs to be trimmed.
if (status == F_true || !string[i]) {
continue;
}
- status = f_utf_is_whitespace(string + j, stop - j);
+ status = f_utf_is_whitespace(string + j, stop - j, F_false);
if (F_status_is_error(status)) break;
if (status == F_false && string[j]) break;
continue;
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
// Determine if this is an end of string white space that needs to be trimmed.
if (status == F_true || !string[i]) {
continue;
}
- status = f_utf_is_whitespace(string + j, stop - j);
+ status = f_utf_is_whitespace(string + j, stop - j, F_false);
if (F_status_is_error(status)) break;
if (status == F_false && string[j]) break;
continue;
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_is_whitespace(string + i, stop - i);
+ status = f_utf_is_whitespace(string + i, stop - i, F_false);
// Determine if this is an end of string white space that needs to be trimmed.
if (status == F_true || !string[i]) {
continue;
}
- status = f_utf_is_whitespace(string + j, stop - j);
+ status = f_utf_is_whitespace(string + j, stop - j, F_false);
if (F_status_is_error(status)) break;
if (status == F_false && string[j]) break;
continue;
}
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
while (i < length) {
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
continue;
}
- status = f_utf_is_whitespace(string + j, length - j);
+ status = f_utf_is_whitespace(string + j, length - j, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
continue;
}
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
// Consider invalid data not-white space.
if (F_status_is_error(status)) break;
while (i < length) {
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
// Determine if this is an end of string white space that needs to be trimmed.
if (status == F_true || !string[i]) {
continue;
}
- status = f_utf_is_whitespace(string + j, length - j);
+ status = f_utf_is_whitespace(string + j, length - j, F_false);
if (F_status_is_error(status)) break;
if (status == F_false && string[j]) break;
continue;
}
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
// Consider invalid data not-white space.
if (F_status_is_error(status)) break;
while (i < length) {
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
// Determine if this is an end of string white space that needs to be trimmed.
if (status == F_true || !string[i]) {
continue;
}
- status = f_utf_is_whitespace(string + j, length - j);
+ status = f_utf_is_whitespace(string + j, length - j, F_false);
if (F_status_is_error(status)) break;
if (status == F_false && string[j]) break;
continue;
}
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
if (F_status_is_error(status) || status == F_false) break;
if (status == F_false) {
while (i < length) {
- status = f_utf_is_whitespace(string + i, length - i);
+ status = f_utf_is_whitespace(string + i, length - i, F_false);
// Determine if this is an end of string white space that needs to be trimmed.
if (status == F_true || !string[i]) {
continue;
}
- status = f_utf_is_whitespace(string + j, length - j);
+ status = f_utf_is_whitespace(string + j, length - j, F_false);
if (F_status_is_error(status)) break;
if (status == F_false && string[j]) break;
width_max = (stop1 - i1) + 1;
- status = f_utf_is_whitespace(string1 + i1, width_max);
+ status = f_utf_is_whitespace(string1 + i1, width_max, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
width_max = (stop2 - i2) + 1;
- status = f_utf_is_whitespace(string2 + i2, width_max);
+ status = f_utf_is_whitespace(string2 + i2, width_max, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
width_max = (stop1 - j) + 1;
- status = f_utf_is_whitespace(string1 + j, width_max);
+ status = f_utf_is_whitespace(string1 + j, width_max, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
width_max = (stop2 - j) + 1;
- status = f_utf_is_whitespace(string2 + j, width_max);
+ status = f_utf_is_whitespace(string2 + j, width_max, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
while (i1 < stop1 && !string1[i1]) ++i1;
if (i1 == stop1) break;
- status = f_utf_is_whitespace(string1 + i1, (stop1 - i1) + 1);
+ status = f_utf_is_whitespace(string1 + i1, (stop1 - i1) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
while (i2 < stop2 && !string2[i2]) ++i2;
if (i2 == stop2) break;
- status = f_utf_is_whitespace(string2 + i2, (stop2 - i2) + 1);
+ status = f_utf_is_whitespace(string2 + i2, (stop2 - i2) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
while (j < stop1 && !string1[j]) ++j;
if (j == stop1) break;
- status = f_utf_is_whitespace(string1 + j, (stop1 - j) + 1);
+ status = f_utf_is_whitespace(string1 + j, (stop1 - j) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
while (j < stop2 && !string2[j]) ++j;
if (j == stop2) break;
- status = f_utf_is_whitespace(string2 + j, (stop2 - j) + 1);
+ status = f_utf_is_whitespace(string2 + j, (stop2 - j) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
while (*start < *stop && !string[*start]) ++(*start);
if (*start > *stop) break;
- status = f_utf_is_whitespace(string + *start, (*stop - *start) + 1);
+ status = f_utf_is_whitespace(string + *start, (*stop - *start) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
if (*stop == *start) break;
- status = f_utf_is_whitespace(string + *stop, (stop_original - *stop) + 1);
+ status = f_utf_is_whitespace(string + *stop, (stop_original - *stop) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
} // for
if (*stop == *start) {
- status = f_utf_is_whitespace(string + *stop, (stop_original - *stop) + 1);
+ status = f_utf_is_whitespace(string + *stop, (stop_original - *stop) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_parameter) return status;
f_array_length_t width_max = (range->stop - range->start) + 1;
- while (buffer.string[range->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + range->start, width_max)) == F_false) {
+ while (buffer.string[range->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + range->start, width_max, F_false)) == F_false) {
if (F_status_is_error(status)) return status;
for (; range->start <= range->stop; ) {
- status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
+ status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
// The end of line, whitespace, or range stop point are the only valid stop points.
if (range->start <= range->stop) {
- status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
+ status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1, F_false);
if (F_status_is_error(status)) {
if (id) {
f_array_length_t width_max = (range->stop - range->start) + 1;
- while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) {
+ while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max, F_false)) == F_false) {
if (F_status_is_error(status)) return status;
while (i1 < stop1 && !string1[i1]) ++i1;
if (i1 == stop1) break;
- status = f_utf_character_is_whitespace(string1[i1]);
+ status = f_utf_character_is_whitespace(string1[i1], F_false);
if (F_status_is_error(status)) {
while (i2 < stop2 && !string2[i2]) ++i2;
if (i2 == stop2) break;
- status = f_utf_character_is_whitespace(string2[i2]);
+ status = f_utf_character_is_whitespace(string2[i2], F_false);
if (F_status_is_error(status)) {
while (j < stop1 && !string1[j]) ++j;
if (j == stop1) break;
- status = f_utf_character_is_whitespace(string1[j]);
+ status = f_utf_character_is_whitespace(string1[j], F_false);
if (F_status_is_error(status)) {
// ignore possibly invalid UTF-8 codes.
while (j < stop2 && !string2[j]) ++j;
if (j == stop2) break;
- status = f_utf_character_is_whitespace(string2[j]);
+ status = f_utf_character_is_whitespace(string2[j], F_false);
if (F_status_is_error(status)) {
while (*start < *stop && !source[*start]) ++(*start);
if (*start > *stop) break;
- status = f_utf_character_is_whitespace(source[*start]);
+ status = f_utf_character_is_whitespace(source[*start], F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
if (!source[*stop]) continue;
if (*stop == *start) break;
- status = f_utf_character_is_whitespace(source[*stop]);
+ status = f_utf_character_is_whitespace(source[*stop], F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
} // for
if (*stop == *start) {
- status = f_utf_character_is_whitespace(source[*stop]);
+ status = f_utf_character_is_whitespace(source[*stop], F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf_fragment);
}
- while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) {
+ while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start], F_false)) == F_false) {
if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_utf_char_t_eol_s) return F_none_eol;
return F_found_not;
}
- f_status_t status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
+ f_status_t status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1, F_false);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
}
}
}
- else if (f_utf_character_is_whitespace(sequence.string[i]) == F_true) {
+ else if (f_utf_character_is_whitespace(sequence.string[i], F_true) == F_true) {
if (data->main->parameters.array[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
f_print_dynamic_raw(f_string_ascii_period_s, data->main->output.to.stream);
}
status = F_space;
}
else if (macro_f_utf_byte_width_is(*unicode.string)) {
- status = f_utf_is_whitespace(unicode.string, 4);
+ status = f_utf_is_whitespace(unicode.string, 4, F_true);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_complete_not_utf || F_status_set_fine(status) == F_utf_fragment) {
}
else {
if (unicode.string[0] < 0x30 || unicode.string[0] > (0x39 && unicode.string[0] < 0x41) || (unicode.string[0] > 0x46 && unicode.string[0] < 0x61) || unicode.string[0] > 0x66) {
- status = f_utf_is_whitespace(unicode.string, 4);
+ status = f_utf_is_whitespace(unicode.string, 4, F_true);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_complete_not_utf || F_status_set_fine(status) == F_utf_fragment) {