The UTF-8 functions have become out of date.
This is part of a series of commits to get it up to date and fix problems.
Fix problems with the string functions observed while performing this update.
#ifndef _di_f_utf_string_length_
typedef f_number_unsigned f_utf_string_length;
+ #define f_utf_string_length_size 0xfffffffffffffffe
+ #define f_utf_string_length_size_max f_type_number_size_max_unsigned
+
#define f_macro_utf_string_length_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_length), length)
#define f_macro_utf_string_length_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_utf_string_length), length)
extern "C" {
#endif
-#if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_)
+#if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_)
f_return_status private_fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination) {
+
if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large);
f_status status = F_none;
return F_none;
}
-#endif // !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_)
+#endif // !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_)
#if !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_)
f_return_status private_fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) {
+
if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large);
f_status status = F_none;
}
#endif // !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_)
-#if !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_)
+#if !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_)
f_return_status private_fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination) {
- if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large);
+
+ if (destination->used + length > f_string_length_size) {
+ return F_status_set_error(F_string_too_large);
+ }
f_status status = F_none;
#if !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_)
f_return_status private_fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) {
- if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large);
+
+ if (destination->used + length > f_string_length_size) {
+ return F_status_set_error(F_string_too_large);
+ }
f_status status = F_none;
for (f_string_length i = 0; i <= length; i++) {
if (i == length) {
if (i > first) {
- f_string_length size = i - first;
+ const f_string_length size = i - first;
- if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large);
+ if (destination->used + size > f_string_length_size) {
+ return F_status_set_error(F_string_too_large);
+ }
- f_string_length total = destination->used + size;
+ const f_string_length total = destination->used + size;
if (total > destination->size) {
f_macro_string_dynamic_resize(status, (*destination), total);
if (source[i] == 0) {
if (i > 0) {
if (i > first) {
- f_string_length size = i - first;
+ const f_string_length size = i - first;
- if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large);
+ if (destination->used + size > f_string_length_size) {
+ return F_status_set_error(F_string_too_large);
+ }
- f_string_length total = destination->used + size;
+ const f_string_length total = destination->used + size;
if (total > destination->size) {
f_macro_string_dynamic_resize(status, (*destination), total);
return F_none;
}
-#endif // !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_)
+#endif // !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_)
#if !defined(_di_fl_string_rip_) || !defined(_di_fl_string_dynamic_rip_) || !defined(_di_fl_string_rip_nulless_) || !defined(_di_fl_string_dynamic_rip_nulless_)
f_return_status private_fl_string_rip_find_range(const f_string source, f_string_length *start, f_string_length *stop) {
- f_string_length stop_original = *stop;
+ const f_string_length stop_original = *stop;
f_status status = F_none;
status = f_utf_is_whitespace(source + *start, (*stop - *start) + 1);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
status = f_utf_is_whitespace(source + *stop, (stop_original - *stop) + 1);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
if (*stop == *start) {
status = f_utf_is_whitespace(source + *stop, (stop_original - *stop) + 1);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
* The source string to append.
* @param length
* Length of source to append.
- * @param stop
- * Inclusive stop point of string to append.
* @param destination
* The destination string the source and glue are appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_string_append()
* @see fl_string_mash()
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_string_append_nulless()
* @see fl_string_mash_nulless()
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_string_prepend()
* @see fl_string_dynamic_prepend()
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_string_prepend_nulless()
* @see fl_string_dynamic_prepend_nulless()
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
return private_fl_string_append(source, length, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (destination->used < length) return private_fl_string_append(source, length, destination);
f_string_length i = 1;
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (destination->used < length) {
return private_fl_string_append_nulless(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
return private_fl_string_append_nulless(source, length, destination);
}
}
#endif // _di_fl_string_compare_trim_
-#ifndef _di_fl_string_dynamic_compare_
- f_return_status fl_string_dynamic_compare(const f_string_static string1, const f_string_static string2) {
- return private_fl_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used);
- }
-#endif // _di_fl_string_dynamic_compare_
-
-#ifndef _di_fl_string_dynamic_compare_trim_
- f_return_status fl_string_dynamic_compare_trim(const f_string_static string1, const f_string_static string2) {
- return private_fl_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used);
- }
-#endif // _di_fl_string_dynamic_compare_trim_
-
#ifndef _di_fl_string_dynamic_append_
f_return_status fl_string_dynamic_append(const f_string_static source, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_string_append(source.string, source.used, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_string_append(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_string_append_nulless(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_string_append_nulless(source.string, source.used, destination);
}
#endif // _di_fl_string_dynamic_append_nulless_
+#ifndef _di_fl_string_dynamic_compare_
+ f_return_status fl_string_dynamic_compare(const f_string_static string1, const f_string_static string2) {
+ return private_fl_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used);
+ }
+#endif // _di_fl_string_dynamic_compare_
+
+#ifndef _di_fl_string_dynamic_compare_trim_
+ f_return_status fl_string_dynamic_compare_trim(const f_string_static string1, const f_string_static string2) {
+ return private_fl_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used);
+ }
+#endif // _di_fl_string_dynamic_compare_trim_
+
#ifndef _di_fl_string_dynamic_mash_
f_return_status fl_string_dynamic_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
const f_status status = private_fl_string_append(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
const f_status status = private_fl_string_append_nulless(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
const f_status status = private_fl_string_prepend(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
const f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_string_length length = (range.stop - range.start) + 1;
+ const f_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_string_append(source.string + range.start, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_string_length length = (range.stop - range.start) + 1;
+ const f_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_string_append_nulless(source.string + range.start, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
-#endif // _di_fl_string_dynamic_append_nulless_
+#endif // _di_fl_string_dynamic_partial_append_nulless_
#ifndef _di_fl_string_dynamic_partial_compare_
f_return_status fl_string_dynamic_partial_compare(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2) {
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_append(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_append_nulless(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_prepend(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
+
+ return private_fl_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_prepend_
+
+#ifndef _di_fl_string_dynamic_partial_prepend_assure_
+ f_return_status fl_string_dynamic_partial_prepend_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used <= range.stop) return F_status_set_error(F_parameter);
+ if (destination == 0) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_string_length length = (range.stop - range.start) + 1;
+ const f_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_string_prepend(source.string + range.start, length, destination);
return F_none;
}
-#endif // _di_fl_string_dynamic_partial_prepend_
+#endif // _di_fl_string_dynamic_partial_prepend_assure_
-#ifndef _di_fl_string_dynamic_partial_prepend_assure_
- f_return_status fl_string_dynamic_partial_prepend_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination) {
+#ifndef _di_fl_string_dynamic_partial_prepend_assure_nulless_
+ f_return_status fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_string_length length = (range.stop - range.start) + 1;
+ const f_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_string_prepend_nulless(source.string + range.start, length, destination);
return F_none;
}
-#endif // _di_fl_string_dynamic_partial_prepend_assure_
-
-#ifndef _di_fl_string_dynamic_partial_prepend_assure_nulless_
- f_return_status fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) {
- #ifndef _di_level_1_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
- if (destination == 0) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
-
- return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
- }
#endif // _di_fl_string_dynamic_partial_prepend_assure_nulless
#ifndef _di_fl_string_dynamic_partial_prepend_nulless_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_string_prepend(source.string, source.used, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_string_prepend(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_string_prepend_nulless(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_string_prepend_nulless(source.string, source.used, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != seek_to_this) {
if (buffer.string[range->start] == f_string_eol[0]) return F_none_eol;
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
unsigned short width = 0;
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
unsigned short width = 0;
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != seek_to_this) {
range->start++;
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_append(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_append_nulless(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_prepend(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination);
-
if (F_status_is_error(status)) return status;
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
return private_fl_string_prepend(source, length, destination);
}
#endif // _di_fl_string_prepend_
-#ifndef _di_fl_string_prepend_nulless_
- f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) {
- #ifndef _di_level_1_parameter_checking_
- if (destination == 0) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (length == 0) return F_data_not;
-
- return private_fl_string_prepend_nulless(source, length, destination);
- }
-#endif // _di_fl_string_prepend_nulless_
-
#ifndef _di_fl_string_prepend_assure_
f_return_status fl_string_prepend_assure(const f_string source, const f_string_length length, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
-
- if (destination->used < length) {
- return private_fl_string_prepend(source, length, destination);
- }
+ if (length == 0) return F_data_not_eos;
+ if (destination->used < length) return private_fl_string_prepend(source, length, destination);
f_string_length i = 0;
f_string_length j = 0;
continue;
}
- if (source[i] != destination->string[i]) {
- return private_fl_string_prepend(source, length, destination);
- }
+ if (source[i] != destination->string[i]) return private_fl_string_prepend(source, length, destination);
i++;
j++;
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
-
- if (destination->used < length) {
- return private_fl_string_prepend_nulless(source, length, destination);
- }
+ if (length == 0) return F_data_not_eos;
+ if (destination->used < length) return private_fl_string_prepend_nulless(source, length, destination);
f_string_length i = 0;
f_string_length j = 0;
continue;
}
- if (source[i] != destination->string[i]) {
- return private_fl_string_prepend_nulless(source, length, destination);
- }
+ if (source[i] != destination->string[i]) return private_fl_string_prepend_nulless(source, length, destination);
i++;
j++;
}
#endif // _di_fl_string_prepend_assure_nulless_
+#ifndef _di_fl_string_prepend_nulless_
+ f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (destination == 0) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (length == 0) return F_data_not_eos;
+
+ return private_fl_string_prepend_nulless(source, length, destination);
+ }
+#endif // _di_fl_string_prepend_nulless_
+
#ifndef _di_fl_string_rip_
f_return_status fl_string_rip(const f_string source, const f_string_length length, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
f_string_length begin = 0;
f_string_length end = length - 1;
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
f_string_length begin = 0;
f_string_length end = length - 1;
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
while (string[range->start] != seek_to_this) {
if (string[range->start] == f_string_eol[0]) return F_none_eol;
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
unsigned short width = 0;
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
unsigned short width = 0;
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
while (string[range->start] != seek_to_this) {
range->start++;
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
*
* UTF-8 is handled within these functions via normal string characters (f_string).
* Unlike f_utf_string, these f_string base functions do not force padding of ASCII or UTF-8 characters.
- * An ASCII character is 1-byte and a 4-byte wide UTF-8 character is 4-byte.
+ * With f_string, a 1-byte wide ASCII character is stored as 1 byte and a 4-byte wide UTF-8 character is stored as 4 bytes.
*
* This shortens the size of the string at the cost of complexity vs f_utf_string.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_append_
extern f_return_status fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_append_assure_
extern f_return_status fl_string_append_assure(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_append_assure_nulless_
extern f_return_status fl_string_append_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_append_nulless_
extern f_return_status fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination);
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors from (with error bit): f_utf_is_whitespace().
+ *
+ * @see f_utf_is_whitespace()
*/
#ifndef _di_fl_string_compare_trim_
extern f_return_status fl_string_compare_trim(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_append_
extern f_return_status fl_string_dynamic_append(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_append_assure_
extern f_return_status fl_string_dynamic_append_assure(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_append_assure_nulless_
extern f_return_status fl_string_dynamic_append_assure_nulless(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_append_nulless_
extern f_return_status fl_string_dynamic_append_nulless(const f_string_static source, f_string_dynamic *destination);
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors from (with error bit): f_utf_is_whitespace().
+ *
+ * @see f_utf_is_whitespace()
*/
#ifndef _di_fl_string_dynamic_compare_trim_
extern f_return_status fl_string_dynamic_compare_trim(const f_string_static string1, const f_string_static string2);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
- *
- * Errors from (with error bit): f_utf_is_graph().
- *
- * @see f_utf_is_graph()
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_mash_
extern f_return_status fl_string_dynamic_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_mash_nulless_
extern f_return_status fl_string_dynamic_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_mish_
extern f_return_status fl_string_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_mish_nulless_
extern f_return_status fl_string_dynamic_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_append_
extern f_return_status fl_string_dynamic_partial_append(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_append_assure_
extern f_return_status fl_string_dynamic_partial_append_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_append_assure_nulless_
extern f_return_status fl_string_dynamic_partial_append_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_append_nulless_
extern f_return_status fl_string_dynamic_partial_append_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors from (with error bit): f_utf_is_whitespace().
+ *
+ * @see f_utf_is_whitespace()
*/
#ifndef _di_fl_string_dynamic_partial_compare_trim_
extern f_return_status fl_string_dynamic_partial_compare_trim(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_mash_
extern f_return_status fl_string_dynamic_partial_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_mash_nulless_
extern f_return_status fl_string_dynamic_partial_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_mish_
extern f_return_status fl_string_dynamic_partial_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_mish_nulless_
extern f_return_status fl_string_dynamic_partial_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_prepend_
extern f_return_status fl_string_dynamic_partial_prepend(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_prepend_assure_
extern f_return_status fl_string_dynamic_partial_prepend_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_prepend_assure_nulless_
extern f_return_status fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_partial_prepend_nulless_
extern f_return_status fl_string_dynamic_partial_prepend_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_prepend_
extern f_return_status fl_string_dynamic_prepend(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_prepend_assure_
extern f_return_status fl_string_dynamic_prepend_assure(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_prepend_assure_nulless_
extern f_return_status fl_string_dynamic_prepend_assure_nulless(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_prepend_nulless_
extern f_return_status fl_string_dynamic_prepend_nulless(const f_string_static source, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_dynamic_rip_
extern f_return_status fl_string_dynamic_rip(const f_string_static source, const f_string_range range, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_seek_line_to_
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors from (with error bit): f_utf_is_whitespace().
+ * Errors from (with error bit): f_utf_is_graph().
*
- * @see f_utf_is_whitespace()
+ * @see f_utf_is_graph()
*/
#ifndef _di_fl_string_dynamic_seek_line_until_non_graph_
extern f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder);
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_mash_
extern f_return_status fl_string_mash(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_mash_nulless_
extern f_return_status fl_string_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_mish_
extern f_return_status fl_string_mish(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_mish_nulless_
extern f_return_status fl_string_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_prepend_
extern f_return_status fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_prepend_assure_
extern f_return_status fl_string_prepend_assure(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_prepend_assure_nulless_
extern f_return_status fl_string_prepend_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_string_prepend_nulless_
extern f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors from (with error bit): f_utf_is_whitespace().
+ *
+ * @see f_utf_is_whitespace()
*/
#ifndef _di_fl_string_rip_
extern f_return_status fl_string_rip(const f_string source, const f_string_length length, f_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors from (with error bit): f_utf_is_whitespace().
+ *
+ * @see f_utf_is_whitespace()
*/
#ifndef _di_fl_string_rip_nulless_
extern f_return_status fl_string_rip_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination);
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_seek_line_to_
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_allocation (with error bit) on memory allocation error.
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_allocation (with error bit) on memory allocation error.
* @return
* F_none on success.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
#if !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_)
f_return_status private_fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
+
if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
f_status status = F_none;
#if !defined(_di_fl_utf_string_append_nulless_) || !defined(_di_fl_utf_string_dynamic_append_nulless_) || !defined(_di_fl_utf_string_mash_nulless_) || !defined(_di_fl_utf_string_dynamic_mash_nulless_)
f_return_status private_fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
+
if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
f_status status = F_none;
#if !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_)
f_return_status private_fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
- if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
+
+ if (destination->used + length > f_utf_string_max_size) {
+ return F_status_set_error(F_string_too_large);
+ }
f_status status = F_none;
#if !defined(_di_fl_utf_string_prepend_nulless_) || !defined(_di_fl_utf_string_dynamic_prepend_nulless_)
f_return_status private_fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
- if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
+
+ if (destination->used + length > f_utf_string_max_size) {
+ return F_status_set_error(F_string_too_large);
+ }
f_status status = F_none;
for (f_utf_string_length i = 0; i <= length; i++) {
if (i == length) {
if (i > first) {
- f_utf_string_length size = i - first;
+ const f_utf_string_length size = i - first;
- if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
+ if (destination->used + size > f_utf_string_max_size) {
+ return F_status_set_error(F_string_too_large);
+ }
- f_utf_string_length total = destination->used + size;
+ const f_utf_string_length total = destination->used + size;
if (total > destination->size) {
f_macro_string_dynamic_resize(status, (*destination), total);
if (source[i] == f_utf_character_eos) {
if (i > 0) {
if (i > first) {
- f_utf_string_length size = i - first;
+ const f_utf_string_length size = i - first;
- if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
+ if (destination->used + size > f_utf_string_max_size) {
+ return F_status_set_error(F_string_too_large);
+ }
- f_utf_string_length total = destination->used + size;
+ const f_utf_string_length total = destination->used + size;
if (total > destination->size) {
f_macro_string_dynamic_resize(status, (*destination), total);
#if !defined(_di_fl_utf_string_rip_) || !defined(_di_fl_utf_string_dynamic_rip_) || !defined(_di_fl_utf_string_rip_nulless_) || !defined(_di_fl_utf_string_dynamic_rip_nulless_)
f_return_status private_fl_utf_string_rip_find_range(const f_utf_string source, f_utf_string_length *start, f_utf_string_length *stop) {
- f_utf_string_length stop_original = *stop;
f_status status = F_none;
status = f_utf_character_is_whitespace(source[*start]);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
status = f_utf_character_is_whitespace(source[*stop]);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
if (*stop == *start) {
status = f_utf_character_is_whitespace(source[*stop]);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
*
* @return
* F_none on success.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_utf_string_append()
* @see fl_utf_string_mash()
*
* @return
* F_none on success.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_utf_string_append_nulless()
* @see fl_utf_string_mash_nulless()
*
* @return
* F_none on success.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_utf_string_prepend()
* @see fl_utf_string_dynamic_prepend()
*
* @return
* F_none on success.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*
* @see fl_utf_string_prepend_nulless()
* @see fl_utf_string_dynamic_prepend_nulless()
* @return
* F_none on success.
* F_data_not on success but only whitespace found.
- * F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
*
* @see fl_utf_string_dynamic_rip()
* @see fl_utf_string_rip()
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
return private_fl_utf_string_append(source, length, destination);
}
#endif // _di_fl_utf_string_append_
-#ifndef _di_fl_utf_string_append_nulless_
- f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
- #ifndef _di_level_1_parameter_checking_
- if (destination == 0) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (length == 0) return F_data_not;
-
- return private_fl_utf_string_append_nulless(source, length, destination);
- }
-#endif // _di_fl_utf_string_append_nulless_
-
#ifndef _di_fl_utf_string_append_assure_
f_return_status fl_utf_string_append_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (destination->used < length) {
return private_fl_utf_string_append(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (destination->used < length) {
return private_fl_utf_string_append_nulless(source, length, destination);
}
#endif // _di_fl_utf_string_append_assure_nulless_
-#ifndef _di_fl_utf_string_compare_
- f_return_status fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) {
+#ifndef _di_fl_utf_string_append_nulless_
+ f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
- if (length1 == 0) return F_status_set_error(F_parameter);
- if (length2 == 0) return F_status_set_error(F_parameter);
+ if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
+ if (length == 0) return F_data_not_eos;
+
+ return private_fl_utf_string_append_nulless(source, length, destination);
+ }
+#endif // _di_fl_utf_string_append_nulless_
+
+#ifndef _di_fl_utf_string_compare_
+ f_return_status fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) {
return private_fl_utf_string_compare(string1, string2, 0, 0, length1, length2);
}
#endif // _di_fl_utf_string_compare_
#ifndef _di_fl_utf_string_compare_trim_
f_return_status fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) {
- #ifndef _di_level_1_parameter_checking_
- if (length1 == 0) return F_status_set_error(F_parameter);
- if (length2 == 0) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
return private_fl_utf_string_compare_trim(string1, string2, 0, 0, length1, length2);
}
#endif // _di_fl_utf_string_compare_trim_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_utf_string_append(source.string, source.used, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_utf_string_append(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_utf_string_append_nulless(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_utf_string_append_nulless(source.string, source.used, destination);
}
#endif // _di_fl_utf_string_dynamic_append_nulless_
+#ifndef _di_fl_utf_string_dynamic_compare_
+ f_return_status fl_utf_string_dynamic_compare(const f_utf_string_static string1, const f_utf_string_static string2) {
+ return private_fl_utf_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used);
+ }
+#endif // _di_fl_utf_string_dynamic_compare_
+
+#ifndef _di_f_utf_string_dynamic_compare_trim_
+ f_return_status f_utf_string_dynamic_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2) {
+ return private_fl_utf_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used);
+ }
+#endif // _di_f_utf_string_dynamic_compare_trim_
+
#ifndef _di_fl_utf_string_dynamic_mash_
f_return_status fl_utf_string_dynamic_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
- f_status status = private_fl_utf_string_append(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ const f_status status = private_fl_utf_string_append(glue, glue_length, destination);
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_append(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
- f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ const f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination);
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_append_nulless(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
- f_status status = private_fl_utf_string_prepend(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ const f_status status = private_fl_utf_string_prepend(glue, glue_length, destination);
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_prepend(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
- f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ const f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination);
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_prepend_nulless(source.string, source.used, destination);
}
#endif // _di_fl_utf_string_dynamic_mish_nulless_
-#ifndef _di_fl_utf_string_dynamic_compare_
- f_return_status fl_utf_string_dynamic_compare(const f_utf_string_static string1, const f_utf_string_static string2) {
- return private_fl_utf_string_compare(string1.string, string2.string, 0, 0, string1.used, string2.used);
- }
-#endif // _di_fl_utf_string_dynamic_compare_
-
-#ifndef _di_f_utf_string_dynamic_compare_trim_
- f_return_status f_utf_string_dynamic_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2) {
- return private_fl_utf_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used);
- }
-#endif // _di_f_utf_string_dynamic_compare_trim_
-
#ifndef _di_fl_utf_string_dynamic_partial_append_
f_return_status fl_utf_string_dynamic_partial_append(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_utf_string_length length = (range.stop - range.start) + 1;
+ const f_utf_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_utf_string_append(source.string + range.start, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_utf_string_length length = (range.stop - range.start) + 1;
+ const f_utf_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_utf_string_append_nulless(source.string + range.start, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_append(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_prepend(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_utf_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_utf_string_length length = (range.stop - range.start) + 1;
+ const f_utf_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_utf_string_prepend(source.string + range.start, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
- f_utf_string_length length = (range.stop - range.start) + 1;
+ const f_utf_string_length length = (range.stop - range.start) + 1;
if (destination->used < length) {
return private_fl_utf_string_prepend_nulless(source.string + range.start, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_utf_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_utf_string_prepend(source.string, source.used, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_utf_string_prepend(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
if (destination->used < source.used) {
return private_fl_utf_string_prepend_nulless(source.string, source.used, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
return private_fl_utf_string_prepend_nulless(source.string, source.used, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (source.used == 0) return F_data_not;
- if (range.start > range.stop) return F_data_not;
+ if (source.used == 0) return F_data_not_eos;
+ if (range.start > range.stop) return F_data_not_stop;
return private_fl_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
range->start++;
- if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
- return F_status_set_error(F_utf);
- }
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) return F_status_set_error(F_utf);
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
f_utf_character seek_to_character = seek_to_this << 24;
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
}
while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_graph(buffer.string[range->start])) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
-
+ if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol;
range->start++;
if (range->start > range->stop) return F_none_stop;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
}
while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
-
+ if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol;
range->start++;
if (range->start > range->stop) return F_none_stop;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
if (buffer.used <= range->stop) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (buffer.used == 0) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (buffer.used == 0) return F_data_not_eos;
+ if (range->start > range->stop) return F_data_not_stop;
f_utf_character seek_to_character = seek_to_this << 24;
if (destination->used > destination->size) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (destination->used > 0 && destination->string[destination->used - 1] == f_utf_character_eos) return F_none;
+ if (destination->used > 0 && destination->string[destination->used - 1] == f_utf_character_eos) {
+ return F_none;
+ }
- if (destination->used + 1 > f_utf_string_max_size) return F_status_set_error(F_string_too_large);
+ if (destination->used + 1 > f_utf_string_length_size) {
+ return F_status_set_error(F_string_too_large);
+ }
const f_utf_string_length total = destination->used + 1;
}
#endif // _di_fl_utf_string_dynamic_terminate_
+#ifndef _di_fl_utf_string_dynamic_terminate_after_
+ f_return_status fl_utf_string_dynamic_terminate_after(f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (destination == 0) return F_status_set_error(F_parameter);
+ if (destination->used > destination->size) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ for (; destination->used > 0; destination->used--) {
+ if (destination->string[destination->used - 1] == 0) continue;
+ break;
+ } // for
+ }
+
+ if (destination->used + 1 > f_utf_string_length_size) {
+ return F_status_set_error(F_string_too_large);
+ }
+
+ const f_utf_string_length total = destination->used + 1;
+
+ if (total > destination->size) {
+ f_status status = F_none;
+
+ f_macro_string_dynamic_resize(status, (*destination), total);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->string[destination->used] = 0;
+ destination->used = total - 1;
+
+ return F_none;
+ }
+#endif // _di_fl_utf_string_dynamic_terminate_after_
+
#ifndef _di_fl_utf_string_mash_
f_return_status fl_utf_string_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_append(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_append(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_append_nulless(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_prepend(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_prepend(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (glue_length > 0 && destination->used > 0) {
f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
return private_fl_utf_string_prepend_nulless(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
return private_fl_utf_string_prepend(source, length, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (destination->used < length) {
return private_fl_utf_string_prepend(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
if (destination->used < length) {
return private_fl_utf_string_prepend_nulless(source, length, destination);
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
return private_fl_utf_string_prepend_nulless(source, length, destination);
}
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
f_utf_string_length begin = 0;
f_utf_string_length end = length - 1;
if (destination == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (length == 0) return F_data_not;
+ if (length == 0) return F_data_not_eos;
f_utf_string_length begin = 0;
f_utf_string_length end = length - 1;
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
f_utf_character seek_to_character = seek_to_this << 24;
- f_status status = F_none;
-
for (; range->start <= range->stop; range->start++) {
if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
}
while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
-
+ if (F_status_is_error(status)) return status;
if (string[range->start] == f_utf_character_eol) return F_none_eol;
range->start++;
if (range->start > range->stop) return F_none_stop;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
f_status status = F_none;
- if (f_macro_utf_character_width_is(string[range->start]) == 1) {
- return F_status_set_error(F_utf);
- }
-
- while (string[range->start] == placeholder || (status = f_utf_character_is_whitespace(string[range->start])) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) return F_status_set_error(F_utf);
+ while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_true) {
+ if (F_status_is_error(status)) return status;
if (string[range->start] == f_utf_character_eol) return F_none_eol;
range->start++;
if (range->start > range->stop) return F_none_stop;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) return F_data_not_stop;
if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
if (range == 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_none_stop;
-
- f_utf_character seek_to_character = seek_to_this << 24;
+ if (range->start > range->stop) return F_data_not_stop;
- f_status status = F_none;
+ const f_utf_character seek_to_character = seek_to_this << 24;
if (f_macro_utf_character_width_is(string[0]) == 1) {
return F_status_set_error(F_utf);
*
* UTF-8 is handled within these functions via padded string characters (f_utf_string).
* Unlike f_string, these f_utf_string base functions force padding of ASCII or UTF-8 characters.
- * An ASCII character is 4-byte and a 4-byte wide UTF-8 character is 4-byte.
+ * With f_utf_string, a 1-byte wide ASCII character is stored as 4 bytes and a 4-byte wide UTF-8 character is stored as 4 bytes.
*
* This simplifies traversing the strings at the cost of size vs f_string.
*
*
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to append.
- * @param stop
- * Inclusive stop point of string to append.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_append_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_append_
extern f_return_status fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_append_
/**
- * Append the source UTF-8 string onto the destination.
+ * Append the source UTF-8 string onto the destination, but only if the string is not already at the end.
*
+ * This ignores NULL characters when comparing both the source and the destination.
* Skips over NULL characters from source when appending.
*
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to append.
- * @param stop
- * Inclusive stop point of string to append.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_append_assure()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
-#ifndef _di_fl_utf_string_append_nulless_
- extern f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
-#endif // _di_fl_utf_string_append_nulless_
+#ifndef _di_fl_utf_string_append_assure_
+ extern f_return_status fl_utf_string_append_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_append_assure_
/**
- * Append the source UTF-8 string onto the destination, but only if the string is not already at the end.
+ * Append the UTF-8 source string onto the destination, but only if the string is not already at the end.
*
* This ignores NULL characters when comparing both the source and the destination.
+ * Skips over NULL characters from source when appending.
*
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to append.
- * @param stop
- * Inclusive stop point of string to append.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_append_assure_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
-#ifndef _di_fl_utf_string_append_assure_
- extern f_return_status fl_utf_string_append_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
-#endif // _di_fl_utf_string_append_assure_
+#ifndef _di_fl_utf_string_append_assure_nulless_
+ extern f_return_status fl_utf_string_append_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_append_assure_nulless_
/**
- * Append the source UTF-8 string onto the destination, but only if the string is not already at the end.
+ * Append the UTF-8 source string onto the destination.
*
- * This ignores NULL characters when comparing both the source and the destination.
* Skips over NULL characters from source when appending.
*
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to append.
- * @param stop
- * Inclusive stop point of string to append.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_append()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
-#ifndef _di_fl_utf_string_append_assure_nulless_
- extern f_return_status fl_utf_string_append_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
-#endif // _di_fl_utf_string_append_assure_nulless_
+#ifndef _di_fl_utf_string_append_nulless_
+ extern f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_append_nulless_
/**
* Compare two UTF-8 strings, similar to strncmp().
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_compare()
- * @see fl_utf_string_dynamic_compare_trim()
- * @see fl_utf_string_dynamic_partial_compare()
- * @see fl_utf_string_dynamic_partial_compare_trim()
*/
#ifndef _di_fl_utf_string_compare_
extern f_return_status fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2);
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
*
- * @see fl_utf_string_dynamic_compare()
- * @see fl_utf_string_dynamic_compare_trim()
- * @see fl_utf_string_dynamic_partial_compare()
- * @see fl_utf_string_dynamic_partial_compare_trim()
+ * Errors from (with error bit): f_utf_character_is_whitespace().
+ *
+ * @see f_utf_character_is_whitespace()
*/
#ifndef _di_fl_utf_string_compare_trim_
extern f_return_status fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2);
#endif // _di_fl_utf_string_compare_trim_
/**
- * Append the source UTF-8 string onto the destination.
+ * Append the UTF-8 source string onto the destination.
*
* @param source
* The source string to append.
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_append_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_append_
extern f_return_status fl_utf_string_dynamic_append(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_append_
/**
- * Append the source UTF-8 string onto the destination, but only if the string is not already at the end.
- *
- * This ignores NULL characters when comparing both the source and the destination.
+ * Append the UTF-8 source string onto the destination.
*
* @param source
* The source string to append.
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_append_assure_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_append_assure_
extern f_return_status fl_utf_string_dynamic_append_assure(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_append_assure_
/**
- * Append the source UTF-8 string onto the destination, but only if the string is not already at the end.
+ * Append the UTF-8 source string onto the destination.
*
- * This ignores NULL characters when comparing both the source and the destination.
* Skips over NULL characters from source when appending.
*
* @param source
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_append_assure()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_append_assure_nulless_
extern f_return_status fl_utf_string_dynamic_append_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_append_assure_nulless_
/**
- * Append the source UTF-8 string onto the destination.
+ * Append the UTF-8 source string onto the destination.
*
* Skips over NULL characters from source when appending.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_append()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_append_nulless_
extern f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination);
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_compare()
- * @see fl_utf_string_compare_trim()
- * @see fl_utf_string_dynamic_partial_compare()
- * @see fl_utf_string_dynamic_partial_compare_trim()
+ * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_dynamic_compare_
extern f_return_status fl_utf_string_dynamic_compare(const f_utf_string_static string1, const f_utf_string_static string2);
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
+ * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
+ *
+ * Errors from (with error bit): f_utf_character_is_whitespace().
*
- * @see fl_utf_string_compare()
- * @see fl_utf_string_compare_trim()
- * @see fl_utf_string_dynamic_partial_compare()
- * @see fl_utf_string_dynamic_partial_compare_trim()
+ * @see f_utf_character_is_whitespace()
*/
#ifndef _di_f_utf_string_dynamic_compare_trim_
extern f_return_status f_utf_string_dynamic_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mash()
- * @see fl_utf_string_dynamic_mash()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_mash_
extern f_return_status fl_utf_string_dynamic_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mash_nulless()
- * @see fl_utf_string_dynamic_mash_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_mash_nulless_
extern f_return_status fl_utf_string_dynamic_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mish()
- * @see fl_utf_string_dynamic_mish()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_mish_
extern f_return_status fl_utf_string_dynamic_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mish_nulless()
- * @see fl_utf_string_dynamic_mish_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_mish_nulless_
extern f_return_status fl_utf_string_dynamic_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_mish_nulless_
/**
- * Append the source UTF-8 string onto the destination, but restricted to the given range.
+ * Append the UTF-8 source string onto the destination, but restricted to the given range.
*
* @param source
* The source string to append.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_append_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_append_
extern f_return_status fl_utf_string_dynamic_partial_append(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_append_
/**
- * Append the source UTF-8 string onto the destination, but restricted to the given range.
+ * Append the UTF-8 source string onto the destination, but only if the string is not already at the end and restricted to the given range
+ *
+ * This ignores NULL characters when comparing both the source and the destination.
*
* @param source
* The source string to append.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_append_assure_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_append_assure_
extern f_return_status fl_utf_string_dynamic_partial_append_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_append_assure_
/**
- * Append the source UTF-8 string onto the destination, but only if the string is not already at the end and restricted to the given range
+ * Append the UTF-8 source string onto the destination, but only if the string is not already at the end and restricted to the given range
*
* This ignores NULL characters when comparing both the source and the destination.
+ *
* Skips over NULL characters from source when appending.
*
* @param source
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_append_assure()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_append_assure_nulless_
extern f_return_status fl_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_append_assure_nulless_
/**
- * Append the source UTF-8 string onto the destination, but only if the string is not already at the end and restricted to the given range
+ * Append the UTF-8 source string onto the destination, but restricted to the given range.
*
- * This ignores NULL characters when comparing both the source and the destination.
* Skips over NULL characters from source when appending.
*
* @param source
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_append()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_append_nulless_
extern f_return_status fl_utf_string_dynamic_partial_append_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_compare()
- * @see fl_utf_string_compare_trim()
- * @see fl_utf_string_dynamic_compare()
- * @see fl_utf_string_dynamic_compare_trim()
*/
#ifndef _di_fl_utf_string_dynamic_partial_compare_
extern f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2);
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
*
- * @see fl_utf_string_compare()
- * @see fl_utf_string_compare_trim()
- * @see fl_utf_string_dynamic_compare()
- * @see fl_utf_string_dynamic_compare_trim()
+ * Errors from (with error bit): f_utf_character_is_whitespace().
+ *
+ * @see f_utf_character_is_whitespace()
*/
#ifndef _di_fl_utf_string_dynamic_partial_compare_trim_
extern f_return_status fl_utf_string_dynamic_partial_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_mash_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_mash_
extern f_return_status fl_utf_string_dynamic_partial_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_mash()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_mash_nulless_
extern f_return_status fl_utf_string_dynamic_partial_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_mish_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_mish_
extern f_return_status fl_utf_string_dynamic_partial_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_mish()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_mish_nulless_
extern f_return_status fl_utf_string_dynamic_partial_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_mish_nulless_
/**
- * Prepend the source string onto the destination, but restricted to the given range.
+ * Prepend the UTF-8 source string onto the destination, but restricted to the given range.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_prepend_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_prepend_
extern f_return_status fl_utf_string_dynamic_partial_prepend(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_prepend_
/**
- * Prepend the source string onto the destination, but restricted to the given range, but only if the string is not already at the beginning.
+ * Prepend the UTF-8 source string onto the destination, but only if the string is not already at the end and restricted to the given range
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_prepend_assure_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_
extern f_return_status fl_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_prepend_assure_
/**
- * Prepend the source string onto the destination, but restricted to the given range, but only if the string is not already at the beginning.
+ * Prepend the UTF-8 source string onto the destination, but only if the string is not already at the end and restricted to the given range
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_prepend_assure()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_
extern f_return_status fl_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_
/**
- * Prepend the source string onto the destination, but restricted to the given range.
+ * Prepend the UTF-8 source string onto the destination, but restricted to the given range.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0 or range is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_partial_prepend()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_partial_prepend_nulless_
extern f_return_status fl_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_prepend_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_prepend_
extern f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_prepend_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the beginning.
+ * Prepend the UTF-8 source string onto the destination, but only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_prepend_assure_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_prepend_assure_
extern f_return_status fl_utf_string_dynamic_prepend_assure(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_prepend_assure_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the beginning.
+ * Prepend the UTF-8 source string onto the destination, but only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_prepend_assure()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_prepend_assure_nulless_
extern f_return_status fl_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_prepend_assure_nulless_
/**
- * Prepend the source string onto the destination.
+ * Prepend the UTF-8 source string onto the destination.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not if source length is 0.
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_prepend()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_prepend_nulless_
extern f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_prepend_nulless_
/**
- * Allocate a new string from the provided range in the buffer.
+ * Allocate a new UTF-8 string from the provided range in the buffer.
*
* Ignores leading and trailing whitespace.
* As a result, resulting size may be smaller than requested range.
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_rip_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_dynamic_rip_
extern f_return_status fl_utf_string_dynamic_rip(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_rip_
/**
- * Allocate a new string from the provided range in the buffer.
+ * Allocate a new UTF-8 string from the provided range in the buffer.
*
* Ignores leading and trailing whitespace.
* As a result, resulting size may be smaller than requested range.
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_dynamic_rip()
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_utf_string_dynamic_rip_nulless_
extern f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination);
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_line_to_char()
- * @see fl_utf_string_seek_line_to_char()
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_to_
extern f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_line_to_
/**
- * Seek the buffer location forward until the 1-byte wide character or EOL is reached.
+ * Seek the buffer location forward until the (1-byte wide) character or EOL is reached.
*
* @param buffer
* The buffer to traverse.
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
- * A single-width non-UTF-8 character.
+ * A single-width character.
*
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_line_to()
- * @see fl_utf_string_seek_line_to()
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_seek_line_to_char_
extern f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this);
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ *
+ * Errors from (with error bit): f_utf_character_is_graph().
*
- * @see fl_utf_string_seek_line_until_graph()
+ * @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_
extern f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder);
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*
- * @see fl_utf_string_seek_line_until_non_graph()
+ * Errors from (with error bit): f_utf_character_is_graph().
+ *
+ * @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_
extern f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder);
#endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_
/**
- * Seek the buffer location forward until the character (1-byte wide) is reached.
+ * Seek the buffer location forward until the UTF-8 character is reached.
*
* @param buffer
* The buffer to traverse.
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_to_char()
- * @see fl_utf_string_seek_to()
- * @see fl_utf_string_seek_to_char()
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_
extern f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_to_
/**
- * Seek the buffer location forward until the UTF-8 character (up to 4-byte wide) is reached.
+ * Seek the buffer location forward until the UTF-8 character (1-byte wide) is reached.
*
* @param buffer
* The buffer to traverse.
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_to()
- * @see fl_utf_string_seek_to()
- * @see fl_utf_string_seek_to_char()
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_char_
extern f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_to_char_
/**
- * Seek the buffer location forward until the UTF-8 character (up to 4-byte wide) is reached.
+ * Seek the buffer location forward until the (4-byte wide) UTF-8 character is reached.
*
* @param buffer
* The buffer to traverse.
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if character is an invalid UTF-8 character.
+ * F_data_not_eos if buffer length is 0.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
- * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
+ * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_to()
- * @see fl_utf_string_seek_to()
- * @see fl_utf_string_seek_to_character()
+ * F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_utf_character_
extern f_return_status fl_utf_string_dynamic_seek_to_utf_character(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this);
*
* @return
* F_none on success.
- * F_parameter (with error bit) if a parameter is invalid.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if string is too large to fit into the buffer.
*/
#ifndef _di_fl_utf_string_dynamic_terminate_
#endif // _di_fl_utf_string_dynamic_terminate_
/**
+ * Guarantee that an end of string (NULL) exists at the end of the UTF-8 string.
+ *
+ * This ensures that the terminating NULL not only exists but is not counted in destination.used.
+ *
+ * This is intended to be used for anything requiring NULL terminated strings whose used length cannot be counted.
+ * This will reallocate more space if necessary.
+ *
+ * If destination size is 0, then it will be reallocated and have the NULL assigned at index 0.
+ *
+ * @param destination
+ * The new string, which will be allocated or reallocated as necessary.
+ *
+ * @return
+ * F_none on success.
+ * F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if string is too large to fit into the buffer.
+ */
+#ifndef _di_fl_utf_string_dynamic_terminate_after_
+ extern f_return_status fl_utf_string_dynamic_terminate_after(f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_dynamic_terminate_after_
+
+/**
* Append the UTF-8 source string onto the destination with the glue in between.
*
* If the destination string is empty, then no glue is appended.
* The number of bytes the glue takes up.
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source and glue are appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mash_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_mash_
extern f_return_status fl_utf_string_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
* The number of bytes the glue takes up.
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source and glue are appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mash()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_mash_nulless_
extern f_return_status fl_utf_string_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
* The number of bytes the glue takes up.
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source and glue are appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mish_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_mish_
extern f_return_status fl_utf_string_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
* The number of bytes the glue takes up.
* @param source
* The source string to append.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source and glue are appended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_mish()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_mish_nulless_
extern f_return_status fl_utf_string_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
*
* @param source
* The source string to prepend.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is prepended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_prepend_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_prepend_
extern f_return_status fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
*
* @param source
* The source string to prepend.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is prepended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_prepend_assure_nulless()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_prepend_assure_
extern f_return_status fl_utf_string_prepend_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
*
* @param source
* The source string to prepend.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is prepended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_prepend_assure()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_prepend_assure_nulless_
extern f_return_status fl_utf_string_prepend_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_prepend_assure_nulless_
/**
- * Prepend the UTF-8 source string onto the destination.
+ * Prepend the UTF-8 source string onto the destination, but only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
+ * This ignores NULL characters when comparing both the source and the destination.
* Skips over NULL characters from source when prepending.
*
* @param source
* The source string to prepend.
- * @param start
- * Inclusive start point of string to prepend.
- * @param stop
- * Inclusive stop point of string to prepend.
+ * @param length
+ * The length of source to append.
* @param destination
* The destination string the source is prepended onto.
*
* @return
* F_none on success.
- * F_data_not if source length is 0 (start > stop).
- * f_string_length_size (with error bit) if the combined string is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
- *
- * @see fl_utf_string_prepend()
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
*/
#ifndef _di_fl_utf_string_prepend_nulless_
extern f_return_status fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
* Allocate a new UTF-8 string from the provided range in the string.
*
* Ignores leading and trailing whitespace.
- * As a result, resulting size may be smaller than requested range.
+ * As a result, resulting size may be smaller than requested length.
*
* @param source
* The string to rip from.
- * @param start
- * An inclusive start location within string.
- * @param stop
- * An inclusive stop location within string.
+ * @param length
+ * The length of source to append.
* @param destination
* The new string, which will be allocated or reallocated as necessary.
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see fl_utf_string_rip_nulless()
+ * Errors from (with error bit): f_utf_character_is_whitespace().
+ *
+ * @see f_utf_character_is_whitespace()
*/
#ifndef _di_fl_utf_string_rip_
extern f_return_status fl_utf_string_rip(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
* Allocate a new UTF-8 string from the provided range in the string.
*
* Ignores leading and trailing whitespace.
- * As a result, resulting size may be smaller than requested range.
+ * As a result, resulting size may be smaller than requested length.
*
* Skips over NULL characters from source when ripping.
*
* @param source
* The string to rip from.
- * @param start
- * An inclusive start location within string.
- * @param stop
- * An inclusive stop location within string.
+ * @param length
+ * The length of source to append.
* @param destination
* The new string, which will be allocated or reallocated as necessary.
*
* @return
* F_none on success.
- * F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_data_not_eos if source length is 0.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see fl_utf_string_append()
+ * Errors from (with error bit): f_utf_character_is_whitespace().
+ *
+ * @see f_utf_character_is_whitespace()
*/
#ifndef _di_fl_utf_string_rip_nulless_
extern f_return_status fl_utf_string_rip_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_rip_nulless_
/**
- * Seek the string location forward until the UTF-8 character or EOL is reached.
+ * Seek the UTF-8 string location forward until the character (1-byte wide) or EOL is reached.
*
* @param string
* The string to traverse.
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
- * A UTF-8 character representing a character to seek to.
+ * A single-width character representing a character to seek to.
*
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
- * F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_seek_line_to_char()
*/
#ifndef _di_fl_utf_string_seek_line_to_
extern f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this);
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
- * A single-width non-UTF-8 character.
+ * A single-width character.
*
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_seek_line_to()
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_seek_line_to_char_
extern f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this);
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
- * F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
*
- * @see fl_utf_string_dynamic_seek_line_until_graph()
+ * Errors from (with error bit): f_utf_character_is_graph().
+ *
+ * @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_seek_line_until_graph_
extern f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder);
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_none_stop on success, but stopped stop location.
+ * F_data_not_stop if range.start > range.stop.
* F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
- * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
- * F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
+ *
+ * Errors from (with error bit): f_utf_character_is_graph().
*
- * @see fl_utf_string_dynamic_seek_line_until_non_graph()
+ * @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_seek_line_until_non_graph_
extern f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder);
*
* @return
* F_none on success.
- * F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_to()
- * @see fl_utf_string_dynamic_seek_to_char()
- * @see fl_utf_string_seek_to_char()
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_seek_to_
extern f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this);
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
- * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
+ * F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * @see fl_utf_string_dynamic_seek_to()
- * @see fl_utf_string_dynamic_seek_to_char()
- * @see fl_utf_string_seek_to()
+ * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_seek_to_character_
extern f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_file_found_not (with error bit) if file does not exist at the program_path.
- * f_string_length_size (with error bit) if the combined string (generated from PATH) is too large.
+ * F_string_too_large (with error bit) if the combined string (generated from PATH) is too large.
*
* @see execvp()
*/
* F_access_denied (with error bit) on access denied for program_path.
* F_loop (with error bit) on loop error while checking the program_path.
* F_buffer_too_large (with error bit) if paths array (generated from PATH) is too large for further addressing.
- * f_string_length_size (with error bit) if the combined string (generated from PATH) is too large.
+ * F_string_too_large (with error bit) if the combined string (generated from PATH) is too large.
*
* @see execvpe()
*/
* F_data_not when there is no buffer, objects or contents to process.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if any combined string is too large when processing values.
+ * F_string_too_large (with error bit) if any combined string is too large when processing values.
*/
#ifndef _di_fll_fss_snatch_
extern f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size);
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_buffer_too_large (with error bit) on maximum buffer limit reached when processing values.
- * f_string_length_size (with error bit) if any combined string is too large when processing values.
+ * F_string_too_large (with error bit) if any combined string is too large when processing values.
*/
#ifndef _di_fll_fss_snatch_apart_
extern f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamics *values[], const f_string_length size);
* F_data_not when there is no buffer, objects or contents to process.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if any combined string is too large when processing values.
+ * F_string_too_large (with error bit) if any combined string is too large when processing values.
*/
#ifndef _di_fll_fss_snatch_together_
extern f_return_status fll_fss_snatch_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size);
* F_data_not when there is no buffer, objects or contents to process.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if any combined string is too large when processing values.
+ * F_string_too_large (with error bit) if any combined string is too large when processing values.
*/
#ifndef _di_fll_fss_snatch_mash_
extern f_return_status fll_fss_snatch_mash(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size, const f_string glue, const f_string_length glue_length);
* F_data_not when there is no buffer, objects or contents to process.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if any combined string is too large when processing values.
+ * F_string_too_large (with error bit) if any combined string is too large when processing values.
*/
#ifndef _di_fll_fss_snatch_mash_apart_
extern f_return_status fll_fss_snatch_mash_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamics *values[], const f_string_length size, const f_string glue, const f_string_length glue_length);
* F_data_not when there is no buffer, objects or contents to process.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * f_string_length_size (with error bit) if any combined string is too large when processing values.
+ * F_string_too_large (with error bit) if any combined string is too large when processing values.
*/
#ifndef _di_fll_fss_snatch_mash_together_
extern f_return_status fll_fss_snatch_mash_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size, const f_string glue, const f_string_length glue_length);
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
* F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
- * f_string_length_size (with error bit) if the combined string is too large.
+ * F_string_too_large (with error bit) if the combined string is too large.
* F_parameter (with error bit) if a parameter is invalid.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.