#ifndef _di_fl_string_dynamic_compare_
f_status_t fl_string_dynamic_compare(const f_string_static_t string1, const f_string_static_t 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_partial_compare_
f_status_t fl_string_dynamic_partial_compare(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2) {
- #ifndef _di_level_1_parameter_checking_
- if (string1.used <= range1.stop) return F_status_set_error(F_parameter);
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used || range1.start > range1.stop) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1);
+ return private_fl_string_compare(string1.string, string2.string, range1.start, range2.start, string1.used <= range1.stop ? string1.used : range1.stop + 1, string2.used <= range2.stop ? string2.used : range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_
#ifndef _di_fl_string_dynamic_partial_compare_dynamic_
f_status_t fl_string_dynamic_partial_compare_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare(string1.string, string2.string, 0, range2.start, string1.used, range2.stop + 1);
+ return private_fl_string_compare(string1.string, string2.string, 0, range2.start, string1.used, string2.used <= range2.stop ? string2.used : range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_dynamic_
#ifndef _di_fl_string_dynamic_partial_compare_string_
f_status_t fl_string_dynamic_partial_compare_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1, const f_string_range_t range2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!length1) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
- return private_fl_string_compare(string1, string2.string, 0, range2.start, length1, range2.stop + 1);
+ return private_fl_string_compare(string1, string2.string, 0, range2.start, length1, string2.used < range2.stop ? string2.used : range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_string_
#ifndef _di_fl_string_dynamic_partial_compare_except_
f_status_t fl_string_dynamic_partial_compare_except(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
- #ifndef _di_level_1_parameter_checking_
- if (string1.used <= range1.stop) return F_status_set_error(F_parameter);
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used || range1.start > range1.stop) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare_except(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1, except1, except2);
+ return private_fl_string_compare_except(string1.string, string2.string, range1.start, range2.start, string1.used < range1.stop ? string1.used : range1.stop + 1, string2.used <= range2.stop ? string2.used : range2.stop + 1, except1, except2);
}
#endif // _di_fl_string_dynamic_partial_compare_except_
#ifndef _di_fl_string_dynamic_partial_compare_except_dynamic_
f_status_t fl_string_dynamic_partial_compare_except_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare_except(string1.string, string2.string, 0, range2.start, string1.used, range2.stop + 1, except1, except2);
+ return private_fl_string_compare_except(string1.string, string2.string, 0, range2.start, string1.used, string2.used <= range2.stop ? string2.used : range2.stop + 1, except1, except2);
}
#endif // _di_fl_string_dynamic_partial_compare_except_dynamic_
#ifndef _di_fl_string_dynamic_partial_compare_except_string_
f_status_t fl_string_dynamic_partial_compare_except_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1, const f_string_range_t range2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!length1) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
- return private_fl_string_compare_except(string1, string2.string, 0, range2.start, length1, range2.stop + 1, except1, except2);
+ return private_fl_string_compare_except(string1, string2.string, 0, range2.start, length1, string2.used <= range2.stop ? string2.used : range2.stop + 1, except1, except2);
}
#endif // _di_fl_string_dynamic_partial_compare_except_string_
#ifndef _di_fl_string_dynamic_partial_compare_except_trim_
f_status_t fl_string_dynamic_partial_compare_except_trim(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
- #ifndef _di_level_1_parameter_checking_
- if (string1.used <= range1.stop) return F_status_set_error(F_parameter);
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used || range1.start > range1.stop) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare_except_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1, except1, except2);
+ return private_fl_string_compare_except_trim(string1.string, string2.string, range1.start, range2.start, string1.used <= range1.stop ? string1.used : range1.stop + 1, string2.used <= range2.stop ? string2.used : range2.stop + 1, except1, except2);
}
#endif // _di_fl_string_dynamic_partial_compare_except_trim_
#ifndef _di_fl_string_dynamic_partial_compare_except_trim_dynamic_
f_status_t fl_string_dynamic_partial_compare_except_trim_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare_except_trim(string1.string, string2.string, 0, range2.start, string1.used, range2.stop + 1, except1, except2);
+ return private_fl_string_compare_except_trim(string1.string, string2.string, 0, range2.start, string1.used, string2.used <= range2.stop ? string2.used : range2.stop + 1, except1, except2);
}
#endif // _di_fl_string_dynamic_partial_compare_except_trim_dynamic_
#ifndef _di_fl_string_dynamic_partial_compare_except_trim_string_
f_status_t fl_string_dynamic_partial_compare_except_trim_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1, const f_string_range_t range2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!length1) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
- return private_fl_string_compare_except_trim(string1, string2.string, 0, range2.start, length1, range2.stop + 1, except1, except2);
+ return private_fl_string_compare_except_trim(string1, string2.string, 0, range2.start, length1, string2.used <= range2.stop ? string2.used : range2.stop + 1, except1, except2);
}
#endif // _di_fl_string_dynamic_partial_compare_except_trim_string_
#ifndef _di_fl_string_dynamic_partial_compare_trim_
f_status_t fl_string_dynamic_partial_compare_trim(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range1, const f_string_range_t range2) {
- #ifndef _di_level_1_parameter_checking_
- if (string1.used <= range1.stop) return F_status_set_error(F_parameter);
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used || range1.start > range1.stop) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1);
+ return private_fl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, string1.used <= range1.stop ? string1.used : range1.stop + 1, string2.used <= range2.stop ? string2.used : range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_trim_
#ifndef _di_fl_string_dynamic_partial_compare_trim_dynamic_
f_status_t fl_string_dynamic_partial_compare_trim_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!string1.used) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
-
- return private_fl_string_compare_trim(string1.string, string2.string, 0, range2.start, string1.used, range2.stop + 1);
+ return private_fl_string_compare_trim(string1.string, string2.string, 0, range2.start, string1.used, string2.used <= range2.stop ? string2.used : range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_trim_dynamic_
#ifndef _di_fl_string_dynamic_partial_compare_trim_string_
f_status_t fl_string_dynamic_partial_compare_trim_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1, const f_string_range_t range2) {
- #ifndef _di_level_1_parameter_checking_
- if (string2.used <= range2.stop) return F_status_set_error(F_parameter);
- #endif // _di_level_1_parameter_checking_
-
- if (!length1) {
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to;
- }
-
- return F_equal_to_not;
- }
-
- if (!string2.used || range2.start > range2.stop) {
- return F_equal_to_not;
- }
- return private_fl_string_compare_trim(string1, string2.string, 0, range2.start, length1, range2.stop + 1);
+ return private_fl_string_compare_trim(string1, string2.string, 0, range2.start, length1, string2.used <= range2.stop ? string2.used : range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_trim_string_
#ifndef _di_fl_string_dynamic_partial_rip_
f_status_t fl_string_dynamic_partial_rip(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_1_parameter_checking_
- if (source.used <= range.start) return F_status_set_error(F_parameter);
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
#ifndef _di_fl_string_dynamic_partial_rip_nulless_
f_status_t fl_string_dynamic_partial_rip_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_1_parameter_checking_
- if (source.used <= range.start) return F_status_set_error(F_parameter);
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_