Add line counting functions.
Remove unnecessary checks against negative values for unsigned numbers.
(They are theoretically necessary in that if the type was overwritten to a signed type, but for now just ignore that case.)
Finish adding or updating the *_together functions.
Review and update the documentation.
extern "C" {
#endif
+#ifndef _di_f_fss_count_lines_
+ f_return_status f_fss_count_lines(const f_string_static buffer, const f_string_length before, f_string_length *line) {
+ #ifndef _di_level_0_parameter_checking_
+ if (buffer.used <= 0) return F_status_set_error(F_parameter);
+ if (before >= buffer.used) return F_status_set_error(F_parameter);
+ if (line == 0) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ f_string_length i = before;
+
+ for (; i > 0; i--) {
+ if (buffer.string[i] == f_string_eol[0]) {
+ (*line)++;
+ }
+ } // for
+
+ if (buffer.string[0] == f_string_eol[0]) {
+ (*line)++;
+ }
+
+ return F_none;
+ }
+#endif // _di_f_fss_count_lines_
+
+#ifndef _di_f_fss_count_lines_range_
+ f_return_status f_fss_count_lines_range(const f_string_static buffer, const f_string_range range, const f_string_length before, f_string_length *line) {
+ #ifndef _di_level_0_parameter_checking_
+ if (buffer.used <= 0) return F_status_set_error(F_parameter);
+ if (range.start > range.stop) return F_status_set_error(F_parameter);
+ if (range.start >= buffer.used) return F_status_set_error(F_parameter);
+ if (before >= buffer.used) return F_status_set_error(F_parameter);
+ if (before > range.stop) return F_status_set_error(F_parameter);
+ if (line == 0) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ f_string_length i = before;
+
+ for (; i > range.start; i--) {
+ if (buffer.string[i] == f_string_eol[0]) {
+ (*line)++;
+ }
+ } // for
+
+ if (buffer.string[range.start] == f_string_eol[0]) {
+ (*line)++;
+ }
+
+ return F_none;
+ }
+#endif // _di_f_fss_count_lines_range_
+
#ifndef _di_f_fss_decrement_buffer_
- f_return_status f_fss_decrement_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) {
+ f_return_status f_fss_decrement_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step) {
#ifndef _di_level_0_parameter_checking_
if (buffer.used <= 0) return F_status_set_error(F_parameter);
- if (location->start < 0) return F_status_set_error(F_parameter);
- if (location->stop < location->start) return F_status_set_error(F_parameter);
- if (location->start >= buffer.used) return F_status_set_error(F_parameter);
+ if (range->stop < range->start) return F_status_set_error(F_parameter);
+ if (range->start >= buffer.used) return F_status_set_error(F_parameter);
if (step < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (location->start < 1) return F_none_eos;
+ if (range->start < 1) return F_none_eos;
f_string_length i = 0;
unsigned short width = 0;
do {
- width = f_macro_utf_byte_width(buffer.string[location->start - 1]);
+ width = f_macro_utf_byte_width(buffer.string[range->start - 1]);
- if (width > location->start) {
+ if (width > range->start) {
if (width > 1) {
return F_status_set_error(F_incomplete_utf_eos);
}
}
i++;
- location->start -= width;
+ range->start -= width;
} while (i < step);
return F_none;
#endif // _di_f_fss_decrement_buffer_
#ifndef _di_f_fss_increment_buffer_
- f_return_status f_fss_increment_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) {
+ f_return_status f_fss_increment_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step) {
#ifndef _di_level_0_parameter_checking_
if (buffer.used <= 0) return F_status_set_error(F_parameter);
- if (location->start < 0) return F_status_set_error(F_parameter);
- if (location->stop < location->start) return F_status_set_error(F_parameter);
- if (location->start >= buffer.used) return F_status_set_error(F_parameter);
+ if (range->stop < range->start) return F_status_set_error(F_parameter);
+ if (range->start >= buffer.used) return F_status_set_error(F_parameter);
if (step < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
unsigned short width = 0;
do {
- width = f_macro_utf_byte_width(buffer.string[location->start]);
+ width = f_macro_utf_byte_width(buffer.string[range->start]);
- if (location->start + width > location->stop) {
+ if (range->start + width > range->stop) {
if (width > 1) {
return F_status_set_error(F_incomplete_utf_stop);
}
- location->start += width;
+ range->start += width;
return F_none_stop;
}
- else if (location->start + width >= buffer.used) {
+ else if (range->start + width >= buffer.used) {
if (width > 1) {
return F_status_set_error(F_incomplete_utf_eos);
}
- location->start += width;
+ range->start += width;
return F_none_eos;
}
i++;
- location->start += width;
+ range->start += width;
} while (i < step);
return F_none;
#ifndef _di_level_0_parameter_checking_
if (buffer.used <= 0) return F_status_set_error(F_parameter);
if (range == 0) return F_status_set_error(F_parameter);
- if (range->start < 0) return F_status_set_error(F_parameter);
if (range->stop < range->start) return F_status_set_error(F_parameter);
if (range->start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#ifndef _di_level_0_parameter_checking_
if (buffer.used <= 0) return F_status_set_error(F_parameter);
if (range == 0) return F_status_set_error(F_parameter);
- if (range->start < 0) return F_status_set_error(F_parameter);
if (range->stop < range->start) return F_status_set_error(F_parameter);
if (range->start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif
/**
+ * Count the number of new lines from the buffer before the given location.
+ *
+ * Use this to calculate where a given range exists in relation to a line.
+ *
+ * This does not initialize line, instead it only performs addition to line.
+ *
+ * @param buffer
+ * The string to process.
+ * @param before
+ * The position in the buffer where to start counting before.
+ * @param line
+ * The total lines found leading up to but not including before.
+ *
+ * @return
+ * F_none on success.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_f_fss_count_lines_
+ extern f_return_status f_fss_count_lines(const f_string_static buffer, const f_string_length before, f_string_length *line);
+#endif // _di_f_fss_count_lines_
+
+/**
+ * Count the number of new lines from the given range in the buffer before the given location.
+ *
+ * Use this to calculate where a given range exists in relation to a line.
+ *
+ * This does not initialize line, instead it only performs addition to line.
+ *
+ * @param buffer
+ * The string to process.
+ * @param range
+ * The range within the buffer to process.
+ * @param before
+ * The position in the buffer where to start counting before.
+ * @param line
+ * The total lines found leading up to but not including before.
+ *
+ * @return
+ * F_none on success.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_f_fss_count_lines_range_
+ extern f_return_status f_fss_count_lines_range(const f_string_static buffer, const f_string_range range, const f_string_length before, f_string_length *line);
+#endif // _di_f_fss_count_lines_range_
+
+/**
* Continue to the previous character, based on step and character width.
*
* The start position must be at the start of a valid UTF-8 block.
if (source.used == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
const f_status status = private_fl_string_append(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (source.used == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
const f_status status = private_fl_string_append_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (source.used == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
const f_status status = private_fl_string_prepend(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (source.used == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
const f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
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) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_append(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
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) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_append_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
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) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_prepend(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
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) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
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] == 0) return F_none;
+ if (destination->used && destination->string[destination->used - 1] == 0) return F_none;
if (destination->used + 1 > f_string_length_size) return F_status_set_error(F_string_too_large);
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->used) {
+ for (; destination->used; destination->used--) {
if (destination->string[destination->used - 1] == 0) continue;
break;
} // for
if (length == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_append(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (length == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_append_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (length == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_prepend(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (length == 0) return F_data_not_eos;
- if (glue_length > 0 && destination->used > 0) {
+ if (glue_length && destination->used) {
f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
}
#endif // _di_fll_fss_snatch_map_mash_apart_
-#ifndef _di_fll_fss_snatch_mash_
- 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]) {
+#ifndef _di_fll_fss_snatch_map_together_
+ f_return_status fll_fss_snatch_map_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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_maps *values[]) {
#ifndef _di_level_2_parameter_checking_
if (size == 0) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (contents.used == 0) return F_data_not;
f_status status = F_none;
- f_string_length length_object = 0;
+ f_string_length length_name = 0;
+ f_string_dynamic name = f_string_dynamic_initialize;
f_array_length i = 0;
f_array_length j = 0;
f_array_length k = 0;
- bool matched[size];
+ bool matched = F_false;
- memset(&matched, 0, sizeof(bool) * size);
+ f_string_map *map = 0;
for (; i < objects.used; i++) {
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
+ if (!contents.array[i].used) continue;
- for (j = 0; j < size; j++) {
- if (matched[j]) continue;
+ length_name = (objects.array[i].stop - objects.array[i].start) + 1;
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ for (j = 0; j < size; j++) {
+ status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_name, lengths[j]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
- matched[j] = F_true;
+ status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
+ if (F_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(name);
+ return status;
+ }
- for (k = 0; k < contents.array[i].used; k++) {
- status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]);
- if (F_status_is_error(status)) return status;
+ matched = F_false;
+ length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
+
+ for (k = 0; k < values[j]->used; k++) {
+ status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
+
+ if (F_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(name);
+ return status;
+ }
+
+ if (status == F_equal_to) {
+ matched = F_true;
+
+ f_macro_string_dynamic_delete_simple(name);
+ break;
+ }
} // for
+
+ if (matched) {
+ name.used = 0;
+
+ map = &values[j]->array[k];
+ }
+ else {
+ if (values[j]->used + 1 > values[j]->size) {
+ if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) {
+ if (values[j]->used + 1 > f_array_length_size) {
+ f_macro_string_dynamic_delete_simple(name);
+ return F_status_set_error(F_buffer_too_large);
+ }
+
+ f_macro_string_maps_resize(status, (*values[j]), values[j]->used + 1);
+ if (F_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(name);
+ return status;
+ }
+ }
+ else {
+ f_macro_string_maps_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step);
+ if (F_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(name);
+ return status;
+ }
+ }
+ }
+
+ map = &values[j]->array[values[j]->used];
+
+ map->name.string = name.string;
+ map->name.used = name.used;
+ map->name.size = name.size;
+
+ values[j]->used++;
+
+ f_macro_string_dynamic_clear(name);
+ }
+
+ if (contents.array[i].used > 1) {
+ status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[1], &map->value);
+ if (F_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(name);
+ return status;
+ }
+ }
} // for
} // for
+ f_macro_string_dynamic_delete_simple(name);
return F_none;
}
-#endif // _di_fll_fss_snatch_mash_
+#endif // _di_fll_fss_snatch_map_together_
-#ifndef _di_fll_fss_snatch_mash_apart_
- 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamics *values[]) {
+#ifndef _di_fll_fss_snatch_mash_
+ 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]) {
#ifndef _di_level_2_parameter_checking_
if (size == 0) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
f_array_length j = 0;
f_array_length k = 0;
+ bool matched[size];
+
+ memset(&matched, 0, sizeof(bool) * size);
+
for (; i < objects.used; i++) {
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+ if (matched[j]) continue;
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
- if (values[j]->used + 1 > values[j]->size) {
- if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) {
- if (values[j]->used + 1 > f_array_length_size) {
- return F_status_set_error(F_buffer_too_large);
- }
-
- f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + 1);
- if (F_status_is_error(status)) return status;
- }
- else {
- f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step);
- if (F_status_is_error(status)) return status;
- }
- }
+ matched[j] = F_true;
for (k = 0; k < contents.array[i].used; k++) {
- status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]);
+ status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]);
if (F_status_is_error(status)) return status;
} // for
-
- values[j]->used++;
} // for
} // for
return F_none;
}
-#endif // _di_fll_fss_snatch_mash_apart_
+#endif // _di_fll_fss_snatch_mash_
-#ifndef _di_fll_fss_snatch_mash_together_
- 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]) {
+#ifndef _di_fll_fss_snatch_mash_apart_
+ 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamics *values[]) {
#ifndef _di_level_2_parameter_checking_
if (size == 0) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
+ if (values[j]->used + 1 > values[j]->size) {
+ if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) {
+ if (values[j]->used + 1 > f_array_length_size) {
+ return F_status_set_error(F_buffer_too_large);
+ }
+
+ f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + 1);
+ if (F_status_is_error(status)) return status;
+ }
+ else {
+ f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step);
+ if (F_status_is_error(status)) return status;
+ }
+ }
+
for (k = 0; k < contents.array[i].used; k++) {
- status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]);
+ status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]);
if (F_status_is_error(status)) return status;
} // for
+
+ values[j]->used++;
} // for
} // for
return F_none;
}
-#endif // _di_fll_fss_snatch_mash_together_
+#endif // _di_fll_fss_snatch_mash_apart_
#ifndef _di_fll_fss_snatch_together_
- 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[], const f_string_length size, f_string_dynamic *values[]) {
+ 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]) {
#ifndef _di_level_2_parameter_checking_
if (size == 0) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (status == F_equal_to_not) continue;
for (k = 0; k < contents.array[i].used; k++) {
- status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], values[j]);
+ status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]);
if (F_status_is_error(status)) return status;
} // for
} // for
* Errors from (with error bit): fl_string_dynamic_partial_append_nulless().
*
* @see fl_string_compare_trim()
- * @see fl_string_dynamic_partial_append_nulless()
+ * @see fl_string_dynamic_partial_mash_nulless()
*/
#ifndef _di_fll_fss_snatch_map_mash_apart_
extern f_return_status fll_fss_snatch_map_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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_map_multis *values[]);
-#endif // _di_fll_fss_snatch_map_mash_apart_
+#endif // _di_fll_fss_snatch_map_mash_apart__
/**
- * Perform simple search through all objects against the given set, saving all values when matched.
+ * Perform simple search through all objects against the given set, saving all values to a map when matched.
*
- * Only the first match for each distinct object is snatched.
- * All content for each object is snatched.
+ * All matches for each distinct object and map name is snatched.
+ * All content map values for each distinct object and map name is snatched.
*
- * Multiple contents for a single object are appended using the provided glue.
+ * The first content is considered the map name, all other content are considered a map value.
+ * Multiple contents, after the first, for each distinct object and map names are appended to a single map value string using the provided glue (map names are therefore distinct).
+ *
+ * This will ignore any object that has no map name.
*
* This will trim the object names when comparing (removing leading/trailing whitespace).
* This will strip NULL characters when copying.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param glue_length
- * The length of the glue string.
+ * The length of the glue string
* @param values
- * An array of values where "snatched" content is stored.
+ * An array of map arrays where "snatched" content is stored.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors from (with error bit): fl_string_compare_trim().
- * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless().
+ * Errors from (with error bit): fl_string_dynamic_partial_append_nulless().
+ *
+ * @see fl_string_compare_trim()
+ * @see fl_string_dynamic_partial_mash_nulless()
*/
-#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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]);
-#endif // _di_fll_fss_snatch_mash_
+#ifndef _di_fll_fss_snatch_map_together_
+ extern f_return_status fll_fss_snatch_map_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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_maps *values[]);
+#endif // _di_fll_fss_snatch_map_together_
/**
* Perform simple search through all objects against the given set, saving all values when matched.
*
- * All matches for each object is snatched.
+ * Only the first match for each distinct object is snatched.
* All content for each object is snatched.
*
* Multiple contents for a single object are appended using the provided glue.
- * Content for multiple identical objects are added in separate strings from other objects.
*
* This will trim the object names when comparing (removing leading/trailing whitespace).
* This will strip NULL characters when copying.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param glue_length
- * The length of the glue string
+ * The length of the glue string.
* @param values
* An array of values where "snatched" content is stored.
*
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors from (with error bit): fl_string_compare_trim().
- * Errors from (with error bit): fl_string_dynamic_partial_append_nulless().
- *
- * @see fl_string_compare_trim()
- * @see fl_string_dynamic_partial_append_nulless()
+ * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless().
*/
-#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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamics *values[]);
-#endif // _di_fll_fss_snatch_mash_apart_
+#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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]);
+#endif // _di_fll_fss_snatch_mash_
/**
* Perform simple search through all objects against the given set, saving all values when matched.
*
* All matches for each object is snatched.
+ * All content for each object is snatched.
+ *
* Multiple contents for a single object are appended using the provided glue.
- * Content for multiple identical objects are appended using the provided glue.
+ * Content for multiple identical objects are added in separate strings from other objects.
*
* This will trim the object names when comparing (removing leading/trailing whitespace).
* This will strip NULL characters when copying.
*
* This performs only a simple search algorithm that should be acceptable for small sets where performance is generally not a concern.
*
- * @fixme redesign to match all based on content column, mash each value by glue for each column, and finally mash each column into the final dynamic value.
- *
* @param buffer
* The buffer to read from.
* @param objects
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param glue_length
- * The length of the glue string.
+ * The length of the glue string
* @param values
* An array of values where "snatched" content is stored.
*
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors from (with error bit): fl_string_compare_trim().
- * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless().
+ * Errors from (with error bit): fl_string_dynamic_partial_append_nulless().
+ *
+ * @see fl_string_compare_trim()
+ * @see fl_string_dynamic_partial_mash_nulless()
*/
-#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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]);
-#endif // _di_fll_fss_snatch_mash_together_
+#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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamics *values[]);
+#endif // _di_fll_fss_snatch_mash_apart_
/**
* Perform simple search through all objects against the given set, saving all values when matched.
*
* All matches for each object is snatched.
- * Multiple contents for a single object are appended.
- * Content for multiple identical objects are appended.
+ * Multiple contents for all objects are appended using the provided glue.
*
* This will trim the object names when comparing (removing leading/trailing whitespace).
* This will strip NULL characters when copying.
*
* This performs only a simple search algorithm that should be acceptable for small sets where performance is generally not a concern.
*
- * @fixme redesign to match all based on content column, mash each value by glue for each column, storing them as separate content string.
- *
* @param buffer
* The buffer to read from.
* @param objects
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors from (with error bit): fl_string_compare_trim().
- * Errors from (with error bit): fl_string_dynamic_partial_append_nulless().
+ * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless().
*
* @see fl_string_compare_trim()
* @see fl_string_dynamic_partial_append_nulless()
*/
#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[], const f_string_length size, f_string_dynamic *values[]);
+ 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[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[]);
#endif // _di_fll_fss_snatch_together_
#ifdef __cplusplus