From: Kevin Day Date: Wed, 18 Nov 2020 00:59:35 +0000 (-0600) Subject: Cleanup: parameters should be objects_quoted instead of quoted_objects as well as... X-Git-Tag: 0.5.2~69 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=2771dd54c78a807b508ab357aec32acc89fae9d6;p=fll Cleanup: parameters should be objects_quoted instead of quoted_objects as well as for contents_quoted. Also update the documentation for these to be more clear on how these parameters are populated. --- diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index fb94645..e046410 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_basic_read_ - f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *quoted_objects, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) { + f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) { #ifndef _di_level_2_parameter_checking_ if (!buffer) return F_status_set_error(F_parameter); if (!range) return F_status_set_error(F_parameter); @@ -30,15 +30,15 @@ extern "C" { f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; - if (quoted_objects) { - f_macro_fss_quotes_t_resize(status2, (*quoted_objects), quoted_objects->used + f_fss_default_allocation_step); + if (objects_quoted) { + f_macro_fss_quotes_t_resize(status2, (*objects_quoted), objects_quoted->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } } do { - if (quoted_objects) { - quoted_object = "ed_objects->array[quoted_objects->used]; + if (objects_quoted) { + quoted_object = &objects_quoted->array[objects_quoted->used]; } status = fl_fss_basic_object_read(buffer, range, &objects->array[objects->used], quoted_object, objects_delimits); @@ -51,8 +51,8 @@ extern "C" { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { objects->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } if (contents->array[contents->used].used == contents->array[contents->used].size) { @@ -106,8 +106,8 @@ extern "C" { objects->used++; contents->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } return status; @@ -131,8 +131,8 @@ extern "C" { objects->used++; contents->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } } @@ -146,8 +146,8 @@ extern "C" { objects->used++; contents->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } } while (range->start < f_string_length_t_size); diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index 72cf40a..15eb113 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -40,8 +40,8 @@ extern "C" { * This will be populated with all valid objects found. * @param contents * This will be populated with all valid contents found. - * @param quoted_objects - * An array of all objects discovered with quotes and the quote discovered. + * @param objects_quoted + * An array mapped to each object in objects representing the quote discovered, if any. * Set the pointer address to 0 to disable. * @param objects_delimits * An array of delimits for objects detected during processing. @@ -68,7 +68,7 @@ extern "C" { * Errors (with error bit) from: fl_fss_basic_object_read(). */ #ifndef _di_fll_fss_basic_read_ - extern f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *quoted_objects, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits); + extern f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits); #endif // _di_fll_fss_basic_read_ /** diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 45d1969..40081ee 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_extended_read_ - f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *quoted_objects, f_fss_quotess_t *quoted_contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) { + f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_quotess_t *contents_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) { #ifndef _di_level_2_parameter_checking_ if (!buffer) return F_status_set_error(F_parameter); if (!range) return F_status_set_error(F_parameter); @@ -31,20 +31,20 @@ extern "C" { f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; - if (quoted_objects) { - f_macro_fss_quotes_t_resize(status2, (*quoted_objects), quoted_objects->used + f_fss_default_allocation_step); + if (objects_quoted) { + f_macro_fss_quotes_t_resize(status2, (*objects_quoted), objects_quoted->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } - if (quoted_contents) { - f_macro_fss_quotess_t_resize(status2, (*quoted_contents), quoted_contents->used + f_fss_default_allocation_step); + if (contents_quoted) { + f_macro_fss_quotess_t_resize(status2, (*contents_quoted), contents_quoted->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } } do { - if (quoted_objects) { - quoted_object = "ed_objects->array[quoted_objects->used]; + if (objects_quoted) { + quoted_object = &objects_quoted->array[objects_quoted->used]; } status = fl_fss_extended_object_read(buffer, range, &objects->array[objects->used], quoted_object, objects_delimits); @@ -57,8 +57,8 @@ extern "C" { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { objects->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } if (contents->array[contents->used].used == contents->array[contents->used].size) { @@ -68,8 +68,8 @@ extern "C" { contents->used++; - if (quoted_contents) { - quoted_contents->used++; + if (contents_quoted) { + contents_quoted->used++; } return FL_fss_found_object_content_not; @@ -94,8 +94,8 @@ extern "C" { if (status == FL_fss_found_object) { found_data = F_true; - if (quoted_contents) { - quoted_content = "ed_contents->array[quoted_contents->used]; + if (contents_quoted) { + quoted_content = &contents_quoted->array[contents_quoted->used]; } status = fl_fss_extended_content_read(buffer, range, &contents->array[contents->used], quoted_content, contents_delimits ? contents_delimits : objects_delimits); @@ -125,13 +125,13 @@ extern "C" { objects->used++; contents->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } - if (quoted_contents) { - quoted_contents->array[quoted_contents->used].used++; - quoted_contents->used++; + if (contents_quoted) { + contents_quoted->array[contents_quoted->used].used++; + contents_quoted->used++; } return status; @@ -155,12 +155,12 @@ extern "C" { objects->used++; contents->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } - if (quoted_contents) { - quoted_contents->used++; + if (contents_quoted) { + contents_quoted->used++; } } @@ -178,12 +178,12 @@ extern "C" { objects->used++; contents->used++; - if (quoted_objects) { - quoted_objects->used++; + if (objects_quoted) { + objects_quoted->used++; } - if (quoted_contents) { - quoted_contents->used++; + if (contents_quoted) { + contents_quoted->used++; } } while (range->start < f_string_length_t_size); diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index ec94c37..d35d7a3 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -38,11 +38,11 @@ extern "C" { * This will be populated with all valid objects found. * @param contents * This will be populated with all valid contents found. - * @param quoted_objects - * An array of all objects discovered with quotes and the quote discovered. + * @param objects_quoted + * An array mapped to each object in objects representing the quote discovered, if any. * Set the pointer address to 0 to disable. - * @param quoted_contents - * An array of all contents discovered with quotes and the quote discovered. + * @param contents_quoted + * An array mapped to each content in contents representing the quote discovered, if any. * Set the pointer address to 0 to disable. * @param objects_delimits * An array of delimits for objects detected during processing. @@ -69,7 +69,7 @@ extern "C" { * Errors (with error bit) from: fl_fss_extended_object_read(). */ #ifndef _di_fll_fss_extended_read_ - extern f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *quoted_objects, f_fss_quotess_t *quoted_contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits); + extern f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_quotess_t *contents_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits); #endif // _di_fll_fss_extended_read_ /**