After further review I realized that the dynamic partial behavior is going to be more common.
The rip functions are also not the same because it removes leading/trailing whitespace, which may be undesirable.
Some of the append_nulless function implementations were missing.
Update comments.
}
#endif // _di_fl_string_dynamic_append_
+#ifndef _di_fl_string_dynamic_append_nulless_
+ f_return_status fl_string_dynamic_append_nulless(const f_string_dynamic source, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_string_append_nulless(source.string, 0, source.used - 1, destination);
+ }
+#endif // _di_fl_string_dynamic_append_nulless_
+
#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_dynamic source, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
}
#endif // _di_fl_string_dynamic_mish_nulless_
+#ifndef _di_fl_string_dynamic_partial_append_
+ f_return_status fl_string_dynamic_partial_append(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_string_append(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_append_
+
+#ifndef _di_fl_string_dynamic_partial_append_nulless_
+ f_return_status fl_string_dynamic_partial_append_nulless(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_string_append_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_append_nulless_
+
#ifndef _di_fl_string_dynamic_partial_compare_
- f_return_status fl_string_dynamic_partial_compare(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location offset1, const f_string_location offset2) {
+ f_return_status fl_string_dynamic_partial_compare(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location range1, const f_string_location range2) {
#ifndef _di_level_1_parameter_checking_
if (string1.used <= 0) return f_status_set_error(f_invalid_parameter);
if (string2.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (offset1.start > offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (offset2.start > offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (range1.start > range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (range2.start > range2.stop) return f_status_set_error(f_invalid_parameter);
- if (string1.used <= offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (string2.used <= offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_string_compare(string1.string, string2.string, offset1.start, offset2.start, offset1.stop + 1, offset2.stop + 1);
+ return private_fl_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_
#ifndef _di_fl_string_dynamic_partial_compare_trim_
- f_return_status fl_string_dynamic_partial_compare_trim(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location offset1, const f_string_location offset2) {
+ f_return_status fl_string_dynamic_partial_compare_trim(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location range1, const f_string_location range2) {
#ifndef _di_level_1_parameter_checking_
if (string1.used <= 0) return f_status_set_error(f_invalid_parameter);
if (string2.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (offset1.start > offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (offset2.start > offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (range1.start > range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (range2.start > range2.stop) return f_status_set_error(f_invalid_parameter);
- if (string1.used <= offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (string2.used <= offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_string_compare_trim(string1.string, string2.string, offset1.start, offset2.start, offset1.stop + 1, offset2.stop + 1);
+ return private_fl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1);
}
#endif // _di_fl_string_dynamic_partial_compare_trim_
+#ifndef _di_fl_string_dynamic_partial_mash_
+ f_return_status fl_string_dynamic_partial_mash(const f_string glue, const f_string_length glue_length, const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_string_append(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_string_append(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_mash_
+
+#ifndef _di_fl_string_dynamic_partial_mash_nulless_
+ f_return_status fl_string_dynamic_partial_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_string_append_nulless(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_string_append_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_mash_nulless_
+
+#ifndef _di_fl_string_dynamic_partial_mish_
+ f_return_status fl_string_partial_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_string_prepend(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_string_prepend(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_mish_
+
+#ifndef _di_fl_string_dynamic_partial_mish_nulless_
+ f_return_status fl_string_dynamic_partial_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_string_prepend_nulless(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_string_prepend_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_mish_nulless_
+
+#ifndef _di_fl_string_dynamic_partial_prepend_
+ f_return_status fl_string_dynamic_partial_prepend(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_string_prepend(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_prepend_
+
+#ifndef _di_fl_string_dynamic_partial_prepend_nulless_
+ f_return_status fl_string_dynamic_partial_prepend_nulless(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_string_prepend_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_string_dynamic_partial_prepend_nulless
+
#ifndef _di_fl_string_dynamic_prepend_
f_return_status fl_string_dynamic_prepend(const f_string_dynamic source, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
}
#endif // _di_fl_string_dynamic_prepend_
+#ifndef _di_fl_string_dynamic_prepend_nulless_
+ f_return_status fl_string_dynamic_prepend_nulless(const f_string_dynamic source, f_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_string_prepend_nulless(source.string, 0, source.used - 1, destination);
+ }
+#endif // _di_fl_string_dynamic_prepend_nulless_
+
#ifndef _di_fl_string_dynamic_rip_
- f_return_status fl_string_dynamic_rip(const f_string_dynamic source, const f_string_location offset, f_string_dynamic *destination) {
+ f_return_status fl_string_dynamic_rip(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
- if (offset.stop < offset.start) return f_status_set_error(f_invalid_parameter);
+ if (range.stop < range.start) return f_status_set_error(f_invalid_parameter);
if (source.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.start) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.start) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
if (destination == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_string_append(source.string, offset.start, offset.stop, destination);
+ return private_fl_string_append(source.string, range.start, range.stop, destination);
}
#endif // _di_fl_string_dynamic_rip_
#ifndef _di_fl_string_dynamic_rip_nulless_
- f_return_status fl_string_dynamic_rip_nulless(const f_string_dynamic source, const f_string_location offset, f_string_dynamic *destination) {
+ f_return_status fl_string_dynamic_rip_nulless(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
- if (offset.stop < offset.start) return f_status_set_error(f_invalid_parameter);
+ if (range.stop < range.start) return f_status_set_error(f_invalid_parameter);
if (source.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.start) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.start) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
if (destination == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_string_append_nulless(source.string, offset.start, offset.stop, destination);
+ return private_fl_string_append_nulless(source.string, range.start, range.stop, destination);
}
#endif // _di_fl_string_dynamic_rip_nulless_
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append()
- * @see fl_string_dynamic_append()
+ * @see fl_string_append_nulless()
*/
#ifndef _di_fl_string_append_
extern f_return_status fl_string_append(const f_string source, const f_string_length start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append_nulless()
- * @see fl_string_dynamic_append_nulless()
+ * @see fl_string_append()
*/
#ifndef _di_fl_string_append_nulless_
extern f_return_status fl_string_append_nulless(const f_string source, const f_string_length start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append()
- * @see fl_string_dynamic_append()
+ * @see fl_string_dynamic_append_nulless()
*/
#ifndef _di_fl_string_dynamic_append_
extern f_return_status fl_string_dynamic_append(const f_string_dynamic source, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append_nulless()
- * @see fl_string_dynamic_append_nulless()
+ * @see fl_string_dynamic_append()
*/
#ifndef _di_fl_string_dynamic_append_nulless_
extern f_return_status fl_string_dynamic_append_nulless(const f_string_dynamic source, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mash()
- * @see fl_string_dynamic_mash()
+ * @see fl_string_dynamic_mash_nulless()
*/
#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_dynamic source, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mash_nulless()
- * @see fl_string_dynamic_mash_nulless()
+ * @see fl_string_dynamic_mash()
*/
#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_dynamic source, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mish()
- * @see fl_string_dynamic_mish()
+ * @see fl_string_dynamic_mish_nulless()
*/
#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_dynamic source, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mish_nulless()
- * @see fl_string_dynamic_mish_nulless()
+ * @see fl_string_dynamic_mish()
*/
#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_dynamic source, f_string_dynamic *destination);
#endif // _di_fl_string_dynamic_mish_nulless_
/**
+ * Append the source string onto the destination, but restricted to the given range.
+ *
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_append_nulless()
+ */
+#ifndef _di_fl_string_dynamic_partial_append_
+ extern f_return_status fl_string_dynamic_partial_append(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_append_
+
+/**
+ * Append the source string onto the destination, but restricted to the given range.
+ *
+ * Skips over NULL characters from source when appending.
+ *
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_append()
+ */
+#ifndef _di_fl_string_dynamic_partial_append_nulless_
+ extern f_return_status fl_string_dynamic_partial_append_nulless(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_append_nulless_
+
+/**
* Compare two strings, similar to strncmp(), but restricted to the given ranges.
*
* This does not stop on NULL.
* String to compare.
* @param string2
* String to compare.
- * @param offset1
+ * @param range1
* A range within the string1 to restrict the comparison to.
- * @param offset2
+ * @param range2
* A range within the string2 to restrict the comparison to.
*
* @return
* @see fl_string_dynamic_compare_trim()
*/
#ifndef _di_fl_string_dynamic_partial_compare_
- extern f_return_status fl_string_dynamic_partial_compare(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location offset1, const f_string_location offset2);
+ extern f_return_status fl_string_dynamic_partial_compare(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location range1, const f_string_location range2);
#endif // _di_fl_string_dynamic_partial_compare_
/**
* String to compare.
* @param string2
* String to compare.
- * @param offset1
+ * @param range1
* A range within the string1 to restrict the comparison to.
- * @param offset2
+ * @param range2
* A range within the string2 to restrict the comparison to.
*
* @return
* @see fl_string_dynamic_compare_trim()
*/
#ifndef _di_fl_string_dynamic_partial_compare_trim_
- extern f_return_status fl_string_dynamic_partial_compare_trim(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location offset1, const f_string_location offset2);
+ extern f_return_status fl_string_dynamic_partial_compare_trim(const f_string_dynamic string1, const f_string_dynamic string2, const f_string_location range1, const f_string_location range2);
#endif // _di_fl_string_dynamic_partial_compare_trim_
/**
+ * Append the source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_mash_nulless()
+ */
+#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_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_mash_
+
+/**
+ * Append the source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * Skips over NULL characters from glue and source when appending.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_mash()
+ */
+#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_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_mash_nulless_
+
+/**
+ * Prepend the source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_mish_nulless()
+ */
+#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_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_mish_
+
+/**
+ * Prepend the source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * Skips over NULL characters from glue and source when appending.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_mish()
+ */
+#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_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_mish_nulless_
+
+/**
+ * Prepend the 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.
+ *
+ * @param source
+ * The source string to prepend.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is prepended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_prepend_nulless()
+ */
+#ifndef _di_fl_string_dynamic_partial_prepend_
+ extern f_return_status fl_string_dynamic_partial_prepend(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_prepend_
+
+/**
+ * Prepend the 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.
+ *
+ * @param source
+ * The source string to prepend.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is prepended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_string_dynamic_partial_prepend()
+ */
+#ifndef _di_fl_string_dynamic_partial_prepend_nulless_
+ extern f_return_status fl_string_dynamic_partial_prepend_nulless(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination);
+#endif // _di_fl_string_dynamic_partial_prepend_nulless_
+
+/**
* Prepend the source string onto the destination.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_prepend()
+ * @see fl_string_dynamic_prepend_nulless()
*/
#ifndef _di_fl_string_dynamic_prepend_
extern f_return_status fl_string_dynamic_prepend(const f_string_dynamic source, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_prepend_nulless()
+ * @see fl_string_dynamic_prepend()
*/
#ifndef _di_fl_string_dynamic_prepend_nulless_
extern f_return_status fl_string_dynamic_prepend_nulless(const f_string_dynamic source, f_string_dynamic *destination);
*
* @param source
* The buffer to rip from.
- * @param offset
+ * @param range
* A range within the buffer representing the string to rip.
* @param destination
* The new string, which will be allocated or reallocated as necessary.
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append()
- * @see fl_string_dynamic_append()
- * @see fl_string_dynamic_rip()
+ * @see fl_string_dynamic_rip_nulless()
*/
#ifndef _di_fl_string_dynamic_rip_
- extern f_return_status fl_string_dynamic_rip(const f_string_dynamic source, const f_string_location offset, f_string_dynamic *destination);
+ extern f_return_status fl_string_dynamic_rip(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination);
#endif // _di_fl_string_dynamic_rip_
/**
*
* @param source
* The string to rip from.
- * @param offset
+ * @param range
* A range within the buffer representing the string to rip.
* @param destination
* The new string, which will be allocated or reallocated as necessary.
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append_nulless()
- * @see fl_string_dynamic_append_nulless()
- * @see fl_string_dynamic_rip_nulless()
+ * @see fl_string_dynamic_rip()
*/
#ifndef _di_fl_string_dynamic_rip_nulless_
- extern f_return_status fl_string_dynamic_rip_nulless(const f_string_dynamic source, const f_string_location offset, f_string_dynamic *destination);
+ extern f_return_status fl_string_dynamic_rip_nulless(const f_string_dynamic source, const f_string_location range, f_string_dynamic *destination);
#endif // _di_fl_string_dynamic_rip_nulless_
/**
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mash()
- * @see fl_string_dynamic_mash()
+ * @see fl_string_mash_nulless()
*/
#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 start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mash_nulless()
- * @see fl_string_dynamic_mash_nulless()
+ * @see fl_string_mash()
*/
#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 start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mish()
- * @see fl_string_dynamic_mish()
+ * @see fl_string_mish_nulless()
*/
#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 start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_mish_nulless()
- * @see fl_string_dynamic_mish_nulless()
+ * @see fl_string_mish()
*/
#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 start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_dynamic_prepend()
+ * @see fl_string_prepend_nulless()
*/
#ifndef _di_fl_string_prepend_
extern f_return_status fl_string_prepend(const f_string source, const f_string_length start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_dynamic_prepend_nulless()
+ * @see fl_string_dynamic_prepend()
*/
#ifndef _di_fl_string_prepend_nulless_
extern f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append()
- * @see fl_string_dynamic_append()
+ * @see fl_string_rip_nulless()
*/
#ifndef _di_fl_string_rip_
extern f_return_status fl_string_rip(const f_string source, const f_string_length start, const f_string_length stop, f_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_string_append_nulless()
- * @see fl_string_dynamic_rip_nulless()
+ * @see fl_string_rip()
*/
#ifndef _di_fl_string_rip_nulless_
extern f_return_status fl_string_rip_nulless(const f_string source, const f_string_length start, const f_string_length stop, f_string_dynamic *destination);
}
#endif // _di_fl_utf_string_dynamic_append_
+#ifndef _di_fl_utf_string_dynamic_append_nulless_
+ f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_dynamic source, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_utf_string_append_nulless(source.string, 0, source.used - 1, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_append_nulless_
+
#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_dynamic source, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
}
#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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_utf_string_append(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_append_
+
+#ifndef _di_fl_utf_string_dynamic_partial_append_nulless_
+ f_return_status fl_utf_string_dynamic_partial_append_nulless(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_utf_string_append_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_append_nulless_
+
#ifndef _di_fl_utf_string_dynamic_partial_compare_
- f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location offset1, const f_utf_string_location offset2) {
+ f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location range1, const f_utf_string_location range2) {
#ifndef _di_level_1_parameter_checking_
if (string1.used <= 0) return f_status_set_error(f_invalid_parameter);
if (string2.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (offset1.start > offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (offset2.start > offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (range1.start > range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (range2.start > range2.stop) return f_status_set_error(f_invalid_parameter);
- if (string1.used <= offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (string2.used <= offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_utf_string_compare(string1.string, string2.string, offset1.start, offset2.start, offset1.stop + 1, offset2.stop + 1);
+ return private_fl_utf_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1);
}
#endif // _di_fl_utf_string_dynamic_partial_compare_
#ifndef _di_fl_utf_string_dynamic_partial_compare_trim_
- f_return_status fl_utf_string_dynamic_partial_comparetrim(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location offset1, const f_utf_string_location offset2) {
+ f_return_status fl_utf_string_dynamic_partial_comparetrim(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location range1, const f_utf_string_location range2) {
#ifndef _di_level_1_parameter_checking_
if (string1.used <= 0) return f_status_set_error(f_invalid_parameter);
if (string2.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (offset1.start > offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (offset2.start > offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (range1.start > range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (range2.start > range2.stop) return f_status_set_error(f_invalid_parameter);
- if (string1.used <= offset1.stop) return f_status_set_error(f_invalid_parameter);
- if (string2.used <= offset2.stop) return f_status_set_error(f_invalid_parameter);
+ if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter);
+ if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_utf_string_compare_trim(string1.string, string2.string, offset1.start, offset2.start, offset1.stop + 1, offset2.stop + 1);
+ return private_fl_utf_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1);
}
#endif // _di_fl_utf_string_dynamic_partial_compare_trim_
+#ifndef _di_fl_utf_string_dynamic_partial_mash_
+ 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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_utf_string_append(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_utf_string_append(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_mash_
+
+#ifndef _di_fl_utf_string_dynamic_partial_mash_nulless_
+ 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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_utf_string_append_nulless(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_utf_string_append_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_mash_nulless_
+
+#ifndef _di_fl_utf_string_dynamic_partial_mish_
+ 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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_utf_string_prepend(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_utf_string_prepend(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_mish_
+
+#ifndef _di_fl_utf_string_dynamic_partial_mish_nulless_
+ 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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ if (destination->used > 0) {
+ f_status status = private_fl_utf_string_prepend_nulless(glue, 0, glue_length - 1, destination);
+
+ if (f_status_is_error(status)) {
+ return status;
+ }
+ }
+
+ return private_fl_utf_string_prepend_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_mish_nulless_
+
+#ifndef _di_fl_utf_string_dynamic_partial_prepend_
+ f_return_status fl_utf_string_dynamic_partial_prepend(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_utf_string_prepend(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_prepend_
+
+#ifndef _di_fl_utf_string_dynamic_partial_prepend_nulless_
+ f_return_status fl_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (range.start > range.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_utf_string_prepend_nulless(source.string, range.start, range.stop, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_partial_prepend_nulless_
+
#ifndef _di_fl_utf_string_dynamic_prepend_
f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_dynamic source, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
}
#endif // _di_fl_utf_string_dynamic_prepend_
+#ifndef _di_fl_utf_string_dynamic_prepend_nulless_
+ f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_dynamic source, f_utf_string_dynamic *destination) {
+ #ifndef _di_level_1_parameter_checking_
+ if (source.used < 1) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ return private_fl_utf_string_prepend_nulless(source.string, 0, source.used - 1, destination);
+ }
+#endif // _di_fl_utf_string_dynamic_prepend_nulless_
+
#ifndef _di_fl_utf_string_dynamic_rip_
- f_return_status fl_utf_string_dynamic_rip(const f_utf_string_dynamic source, const f_utf_string_location offset, f_utf_string_dynamic *destination) {
+ f_return_status fl_utf_string_dynamic_rip(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
- if (offset.stop < offset.start) return f_status_set_error(f_invalid_parameter);
+ if (range.stop < range.start) return f_status_set_error(f_invalid_parameter);
if (source.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.start) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.start) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
if (destination == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_utf_string_append(source.string, offset.start, offset.stop, destination);
+ return private_fl_utf_string_append(source.string, range.start, range.stop, destination);
}
#endif // _di_fl_utf_string_dynamic_rip_
#ifndef _di_fl_utf_string_dynamic_rip_nulless_
- f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_dynamic source, const f_utf_string_location offset, f_utf_string_dynamic *destination) {
+ f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination) {
#ifndef _di_level_1_parameter_checking_
- if (offset.stop < offset.start) return f_status_set_error(f_invalid_parameter);
+ if (range.stop < range.start) return f_status_set_error(f_invalid_parameter);
if (source.used <= 0) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.start) return f_status_set_error(f_invalid_parameter);
- if (source.used <= offset.stop) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.start) return f_status_set_error(f_invalid_parameter);
+ if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter);
if (destination == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- return private_fl_utf_string_append_nulless(source.string, offset.start, offset.stop, destination);
+ return private_fl_utf_string_append_nulless(source.string, range.start, range.stop, destination);
}
#endif // _di_fl_utf_string_dynamic_rip_nulless_
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append()
- * @see fl_utf_string_dynamic_append()
+ * @see fl_utf_string_append_nulless()
*/
#ifndef _di_fl_utf_string_append_
extern f_return_status fl_utf_string_append(const f_utf_string source, const f_utf_string_length start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append_nulless()
- * @see fl_utf_string_dynamic_append_nulless()
+ * @see fl_utf_string_append()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append()
- * @see fl_utf_string_dynamic_append()
+ * @see fl_utf_string_dynamic_append_nulless()
*/
#ifndef _di_fl_utf_string_dynamic_append_
extern f_return_status fl_utf_string_dynamic_append(const f_utf_string_dynamic source, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append_nulless()
- * @see fl_utf_string_dynamic_append_nulless()
+ * @see fl_utf_string_dynamic_append()
*/
#ifndef _di_fl_utf_string_dynamic_append_nulless_
extern f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_dynamic 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.
+ *
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_append_nulless()
+ */
+#ifndef _di_fl_utf_string_dynamic_partial_append_
+ extern f_return_status fl_utf_string_dynamic_partial_append(const f_utf_string_dynamic source, const f_utf_string_location 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.
+ *
+ * Skips over NULL characters from source when appending.
+ *
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_append()
+ */
+#ifndef _di_fl_utf_string_dynamic_partial_append_nulless_
+ extern f_return_status fl_utf_string_dynamic_partial_append_nulless(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_dynamic_partial_append_nulless_
+
+/**
* Compare two UTF-8 strings, similar to strncmp(), but restricted to the given ranges.
*
* This does not stop on NULL.
* String to compare.
* @param string2
* String to compare.
- * @param offset1
+ * @param range1
* A range within the string1 to restrict the comparison to.
- * @param offset2
+ * @param range2
* A range within the string2 to restrict the comparison to.
*
* @return
* @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_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location offset1, const f_utf_string_location offset2);
+ extern f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location range1, const f_utf_string_location range2);
#endif // _di_fl_utf_string_dynamic_partial_compare_
/**
* String to compare.
* @param string2
* String to compare.
- * @param offset1
+ * @param range1
* A range within the string1 to restrict the comparison to.
- * @param offset2
+ * @param range2
* A range within the string2 to restrict the comparison to.
*
* @return
* @see fl_utf_string_dynamic_compare_trim()
*/
#ifndef _di_fl_utf_string_dynamic_partial_compare_trim_
- extern f_return_status fl_utf_string_dynamic_partial_compare_trim(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location offset1, const f_utf_string_location offset2);
+ extern f_return_status fl_utf_string_dynamic_partial_compare_trim(const f_utf_string_dynamic string1, const f_utf_string_dynamic string2, const f_utf_string_location range1, const f_utf_string_location range2);
#endif // _di_fl_utf_string_dynamic_partial_compare_trim_
/**
+ * Append the UTF-8 source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_mash_nulless()
+ */
+#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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_dynamic_partial_mash_
+
+/**
+ * Append the UTF-8 source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * Skips over NULL characters from glue and source when appending.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_mash()
+ */
+#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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_dynamic_partial_mash_nulless_
+
+/**
+ * Prepend the UTF-8 source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_mish_nulless()
+ */
+#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_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_dynamic_partial_mish_
+
+/**
+ * Prepend the UTF-8 source string onto the destination with the glue in between, but restricted to the given range.
+ *
+ * If the destination string is empty, then no glue is appended.
+ *
+ * Skips over NULL characters from glue and source when appending.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param source
+ * The source string to append.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_mish()
+ */
+#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_dynamic source, const f_utf_string_location 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 operations require memory move operations and are therefore likely more expensive than append operations.
+ *
+ * @param source
+ * The source string to prepend.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is prepended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_prepend_nulless()
+ */
+#ifndef _di_fl_utf_string_dynamic_partial_prepend_
+ extern f_return_status fl_utf_string_dynamic_partial_prepend(const f_utf_string_dynamic source, const f_utf_string_location 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.
+ *
+ * Prepend operations require memory move operations and are therefore likely more expensive than append operations.
+ *
+ * @param source
+ * The source string to prepend.
+ * @param range
+ * A range within the source to restrict the copy from.
+ * @param destination
+ * The destination string the source is prepended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ *
+ * @see fl_utf_string_dynamic_partial_prepend()
+ */
+#ifndef _di_fl_utf_string_dynamic_partial_prepend_nulless_
+ extern f_return_status fl_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
+#endif // _di_fl_utf_string_dynamic_partial_prepend_nulless_
+
+/**
* Prepend the source string onto the destination.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_prepend()
+ * @see fl_utf_string_dynamic_prepend_nulless()
*/
#ifndef _di_fl_utf_string_dynamic_prepend_
extern f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_dynamic source, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_prepend_nulless()
+ * @see fl_utf_string_dynamic_prepend()
*/
#ifndef _di_fl_utf_string_dynamic_prepend_nulless_
extern f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_dynamic source, f_utf_string_dynamic *destination);
*
* @param source
* The buffer to rip from.
- * @param offset
+ * @param range
* A range within the buffer representing the string to rip.
* @param destination
* The new string, which will be allocated or reallocated as necessary.
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append()
- * @see fl_utf_string_dynamic_append()
- * @see fl_utf_string_dynamic_rip()
+ * @see fl_utf_string_dynamic_rip_nulless()
*/
#ifndef _di_fl_utf_string_dynamic_rip_
- extern f_return_status fl_utf_string_dynamic_rip(const f_utf_string_dynamic source, const f_utf_string_location offset, f_utf_string_dynamic *destination);
+ extern f_return_status fl_utf_string_dynamic_rip(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_rip_
/**
*
* @param source
* The string to rip from.
- * @param offset
+ * @param range
* A range within the buffer representing the string to rip.
* @param destination
* The new string, which will be allocated or reallocated as necessary.
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append_nulless()
- * @see fl_utf_string_dynamic_append_nulless()
- * @see fl_utf_string_dynamic_rip_nulless()
+ * @see fl_utf_string_dynamic_rip()
*/
#ifndef _di_fl_utf_string_dynamic_rip_nulless_
- extern f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_dynamic source, const f_utf_string_location offset, f_utf_string_dynamic *destination);
+ extern f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_dynamic source, const f_utf_string_location range, f_utf_string_dynamic *destination);
#endif // _di_fl_utf_string_dynamic_rip_nulless_
/**
* f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
* f_invalid_parameter (with error bit) if a parameter is invalid
*
- * @see fl_utf_string_seek_line_untile_graph()
+ * @see fl_utf_string_seek_line_until_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_dynamic buffer, f_utf_string_location *location, const f_utf_character placeholder);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_mash()
- * @see fl_utf_string_dynamic_mash()
+ * @see fl_utf_string_mash_nulless()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_mash_nulless()
- * @see fl_utf_string_dynamic_mash_nulless()
+ * @see fl_utf_string_mash()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_mish()
- * @see fl_utf_string_dynamic_mish()
+ * @see fl_utf_string_mish_nulless()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_mish_nulless()
- * @see fl_utf_string_dynamic_mish_nulless()
+ * @see fl_utf_string_mish()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_dynamic_prepend()
+ * @see fl_utf_string_prepend_nulless()
*/
#ifndef _di_fl_utf_string_prepend_
extern f_return_status fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_dynamic_prepend_nulless()
+ * @see fl_utf_string_prepend()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append()
- * @see fl_utf_string_dynamic_append()
+ * @see fl_utf_string_rip_nulless()
*/
#ifndef _di_fl_utf_string_rip_
extern f_return_status fl_utf_string_rip(const f_utf_string source, const f_utf_string_length start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_error_allocation (with error bit) on memory allocation error.
* f_error_reallocation (with error bit) on memory reallocation error.
*
- * @see fl_utf_string_append_nulless()
- * @see fl_utf_string_dynamic_rip_nulless()
+ * @see fl_utf_string_append()
*/
#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 start, const f_utf_string_length stop, f_utf_string_dynamic *destination);
* f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
* f_invalid_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()
*/
#ifndef _di_fl_utf_string_seek_line_to_
* f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
* f_invalid_parameter (with error bit) if a parameter is invalid.
*
- * @see fl_utf_string_dynamic_seek_line_to()
* @see fl_utf_string_seek_line_to()
*/
#ifndef _di_fl_utf_string_seek_line_to_char_