]> Kevux Git Server - fll/commitdiff
Cleanup: parameters should be objects_quoted instead of quoted_objects as well as...
authorKevin Day <thekevinday@gmail.com>
Wed, 18 Nov 2020 00:59:35 +0000 (18:59 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 18 Nov 2020 00:59:35 +0000 (18:59 -0600)
Also update the documentation for these to be more clear on how these parameters are populated.

level_2/fll_fss/c/fss_basic.c
level_2/fll_fss/c/fss_basic.h
level_2/fll_fss/c/fss_extended.c
level_2/fll_fss/c/fss_extended.h

index fb946454e8b9222f028b2c7d4a52b14f76d5e80f..e046410eecfae6c043a4a9cab92d3012031f502b 100644 (file)
@@ -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 = &quoted_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);
 
index 72cf40a5bdcf9e52722e01d2638750ba48d5aed3..15eb1139889f94bc662358aa0af413936e7b5800 100644 (file)
@@ -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_
 
 /**
index 45d1969dd383d816f3b29ffae5b46f897a7e826f..40081ee2497bc2406db8dd1edfabe36c557f2eed 100644 (file)
@@ -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 = &quoted_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 = &quoted_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);
 
index ec94c37447472df70966ad9d48ec19f0c95b69d9..d35d7a3f19d2df9c45587ea0fa0903ffd36b8412 100644 (file)
@@ -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_
 
 /**