From: Kevin Day Date: Fri, 10 Jul 2020 04:45:32 +0000 (-0500) Subject: Update: the fss snatch and similar functions should also optionally get the index. X-Git-Tag: 0.5.0~95 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=4e6a77478467c509b9580d66c8f764ad26dc5fdc;p=fll Update: the fss snatch and similar functions should also optionally get the index. The index will be the index where the match was found. The objects and contents will have the same index. --- diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index d5bb4f8..1818413 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -46,10 +46,11 @@ extern "C" { #endif // _di_fll_fss_identify_file_ #ifndef _di_fll_fss_snatch_ - f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamic *values[]) { + f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamic *values[], f_array_length *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -84,6 +85,10 @@ extern "C" { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], values[j]); if (F_status_is_error(status)) return status; + + if (indexs) { + *indexs[j] = i; + } } // for } // for @@ -92,10 +97,11 @@ extern "C" { #endif // _di_fll_fss_snatch_ #ifndef _di_fll_fss_snatch_apart_ - f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamics *values[]) { + f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamics *values[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -129,8 +135,12 @@ extern "C" { } f_macro_string_dynamics_resize(status, (*value), (values[j]->used + content->used)); - if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), (indexs[j]->used + content->used)); + if (F_status_is_error(status)) return status; + } } for (k = 0; k < contents.array[i].used; k++) { @@ -138,6 +148,11 @@ extern "C" { if (F_status_is_error(status)) return status; values[j]->used++; + + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } } // for } // for } // for @@ -147,10 +162,11 @@ extern "C" { #endif // _di_fll_fss_snatch_apart_ #ifndef _di_fll_fss_snatch_map_ - f_return_status fll_fss_snatch_map(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_maps *values[]) { + f_return_status fll_fss_snatch_map(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_maps *values[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -222,6 +238,11 @@ extern "C" { f_macro_string_dynamic_delete_simple(name); return status; } + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + if (F_status_is_error(status)) return status; + } } else { f_macro_string_maps_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); @@ -229,6 +250,11 @@ extern "C" { f_macro_string_dynamic_delete_simple(name); return status; } + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + if (F_status_is_error(status)) return status; + } } } @@ -248,6 +274,11 @@ extern "C" { values[j]->used++; + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } + f_macro_string_dynamic_clear(name); } // for } // for @@ -258,10 +289,11 @@ extern "C" { #endif // _di_fll_fss_snatch_map_ #ifndef _di_fll_fss_snatch_map_apart_ - f_return_status fll_fss_snatch_map_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, f_string_map_multis *values[]) { + f_return_status fll_fss_snatch_map_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, f_string_map_multis *values[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -296,10 +328,20 @@ extern "C" { f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + if (F_status_is_error(status)) return status; + } } else { f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + if (F_status_is_error(status)) return status; + } } } @@ -310,6 +352,11 @@ extern "C" { values[j]->used++; + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } + if (contents.array[i].used > 1) { if (map_multi->value.used + contents.array[i].used - 1 > map_multi->value.size) { if (map_multi->value.used + contents.array[i].used - 1 > f_array_length_size) return F_status_set_error(F_buffer_too_large); @@ -333,10 +380,11 @@ extern "C" { #endif // _di_fll_fss_snatch_map_apart_ #ifndef _di_fll_fss_snatch_map_mash_ - f_return_status fll_fss_snatch_map_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_maps *values[]) { + f_return_status fll_fss_snatch_map_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_maps *values[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -371,10 +419,20 @@ extern "C" { f_macro_string_maps_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + if (F_status_is_error(status)) 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)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + if (F_status_is_error(status)) return status; + } } } @@ -385,6 +443,11 @@ extern "C" { values[j]->used++; + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } + if (contents.array[i].used > 1) { for (k = 1; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map->value); @@ -399,10 +462,11 @@ extern "C" { #endif // _di_fll_fss_snatch_map_mash_ #ifndef _di_fll_fss_snatch_map_mash_apart_ - 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[]) { + 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[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -471,10 +535,20 @@ extern "C" { f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + if (F_status_is_error(status)) return status; + } } else { f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + if (F_status_is_error(status)) return status; + } } } @@ -485,6 +559,11 @@ extern "C" { values[j]->used++; + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } + f_macro_string_dynamic_clear(name); if (contents.array[i].used == 1) continue; @@ -514,10 +593,11 @@ extern "C" { #endif // _di_fll_fss_snatch_map_mash_apart_ #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[]) { + 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[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -590,6 +670,11 @@ extern "C" { f_macro_string_dynamic_delete_simple(name); return status; } + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + if (F_status_is_error(status)) return status; + } } else { f_macro_string_maps_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); @@ -597,6 +682,11 @@ extern "C" { f_macro_string_dynamic_delete_simple(name); return status; } + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + if (F_status_is_error(status)) return status; + } } } @@ -608,6 +698,11 @@ extern "C" { values[j]->used++; + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } + f_macro_string_dynamic_clear(name); } @@ -627,10 +722,11 @@ extern "C" { #endif // _di_fll_fss_snatch_map_together_ #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[]) { + 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[], f_array_length *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -665,6 +761,10 @@ extern "C" { 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 + + if (indexs) { + *indexs[j] = i; + } } // for } // for @@ -673,10 +773,11 @@ extern "C" { #endif // _di_fll_fss_snatch_mash_ #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[]) { + 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[], f_array_lengths *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -707,10 +808,20 @@ extern "C" { f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[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; + + if (indexs) { + f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + if (F_status_is_error(status)) return status; + } } } @@ -720,6 +831,11 @@ extern "C" { } // for values[j]->used++; + + if (indexs) { + indexs[j]->array[indexs[j]->used] = i; + indexs[j]->used++; + } } // for } // for @@ -728,10 +844,11 @@ extern "C" { #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, const f_string glue, const f_string_length glue_length, 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[], f_array_length *indexs[]) { #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 (values == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ if (buffer.used == 0) return F_data_not; @@ -758,6 +875,10 @@ extern "C" { 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 + + if (indexs) { + *indexs[j] = i; + } } // for } // for diff --git a/level_2/fll_fss/c/fss.h b/level_2/fll_fss/c/fss.h index 6ee9ce9..9b0fc1a 100644 --- a/level_2/fll_fss/c/fss.h +++ b/level_2/fll_fss/c/fss.h @@ -102,6 +102,9 @@ extern "C" { * The total size of the names, lengths, and values arrays. * @param values * An array of values where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -115,7 +118,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_ - extern f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamic *values[]); + extern f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamic *values[], f_array_length *indexs[]); #endif // _di_fll_fss_snatch_ /** @@ -145,6 +148,9 @@ extern "C" { * The total size of the names, lengths, and values arrays. * @param values * An array of values where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -158,7 +164,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_apart_ - extern f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamics *values[]); + extern f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamics *values[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_apart_ /** @@ -190,6 +196,9 @@ extern "C" { * The total size of the names, lengths, and values arrays. * @param values * An array of map arrays where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -203,7 +212,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_map_ - extern f_return_status fll_fss_snatch_map(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_maps *values[]); + extern f_return_status fll_fss_snatch_map(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_maps *values[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_map_ /** @@ -237,6 +246,9 @@ extern "C" { * The total size of the names, lengths, and values arrays. * @param values * An array of multi map arrays where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -250,7 +262,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_map_apart_ - extern f_return_status fll_fss_snatch_map_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, f_string_map_multis *values[]); + extern f_return_status fll_fss_snatch_map_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, f_string_map_multis *values[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_map_apart_ /** @@ -287,6 +299,9 @@ extern "C" { * The length of the glue string * @param values * An array of multi map value arrays where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -297,7 +312,7 @@ extern "C" { * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_map_mash_ - extern f_return_status fll_fss_snatch_map_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_maps *values[]); + extern f_return_status fll_fss_snatch_map_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_maps *values[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_map_mash_ /** @@ -335,6 +350,9 @@ extern "C" { * The length of the glue string * @param values * An array of multi map value arrays where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -348,7 +366,7 @@ extern "C" { * @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[]); + 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[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_map_mash_apart__ /** @@ -385,6 +403,9 @@ extern "C" { * The length of the glue string * @param values * An array of map arrays where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -398,7 +419,7 @@ extern "C" { * @see fl_string_dynamic_partial_mash_nulless() */ #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[]); + 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[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_map_together_ /** @@ -432,6 +453,9 @@ extern "C" { * The length of the glue string. * @param values * An array of values where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -442,7 +466,7 @@ extern "C" { * Errors from (with error bit): 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[]); + 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[], f_array_length *indexs[]); #endif // _di_fll_fss_snatch_mash_ /** @@ -477,6 +501,9 @@ extern "C" { * The length of the glue string * @param values * An array of values where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -490,7 +517,7 @@ extern "C" { * @see 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[]); + 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[], f_array_lengths *indexs[]); #endif // _di_fll_fss_snatch_mash_apart_ /** @@ -518,6 +545,9 @@ extern "C" { * The total size of the names, lengths, and values arrays. * @param values * An array of values where "snatched" content is stored. + * @param indexs + * An array representing the index within the objects where the match was made. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -531,7 +561,7 @@ extern "C" { * @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, const f_string glue, const f_string_length glue_length, 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[], f_array_length *indexs[]); #endif // _di_fll_fss_snatch_together_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 372ad9c..566e357 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -1454,7 +1454,7 @@ extern "C" { f_string function = "fll_fss_snatch_apart"; - *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, fake_build_setting_total, settings_value); + *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, fake_build_setting_total, settings_value, 0); if (*status == F_none) { f_string_dynamic settings_mode_name_dynamic[fake_build_setting_total]; @@ -1518,7 +1518,7 @@ extern "C" { } // for if (*status == F_none) { - *status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, setting_mode_lengths, fake_build_setting_total, settings_value); + *status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, setting_mode_lengths, fake_build_setting_total, settings_value, 0); if (F_status_is_error(*status)) { function = "fll_fss_snatch_apart"; diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 1580347..fc16497 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -205,7 +205,7 @@ extern "C" { &data_make->setting_make.parameter, }; - *status = fll_fss_snatch_map_mash_apart(data_make->buffer, settings.objects, settings.contents, settings_name, settings_length, 2, " ", 1, settings_value); + *status = fll_fss_snatch_map_mash_apart(data_make->buffer, settings.objects, settings.contents, settings_name, settings_length, 2, " ", 1, settings_value, 0); if (F_status_is_error(*status)) { fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fll_fss_snatch_map_mash_apart", F_true);