This adds some test files that I did a git add on but forgot to do the git commit with.
Update many of the unit tests and fix any mistakes discovered.
build_sources_library status_string.c
build_sources_library string.c
build_sources_library private-string.c string/common.c
-build_sources_library string/private-dynamics.c
-build_sources_library string/private-maps.c string/private-mapss.c
-build_sources_library string/private-map_multis.c string/private-map_multiss.c
-build_sources_library string/private-quantitys.c string/private-quantityss.c
-build_sources_library string/private-ranges.c string/private-rangess.c
-build_sources_library string/private-triples.c string/private-tripless.c
build_sources_library string/dynamic.c string/dynamics.c string/dynamicss.c
build_sources_library string/map.c string/maps.c string/mapss.c
build_sources_library string/map_multi.c string/map_multis.c string/map_multiss.c
build_sources_library utf/static.c utf/statics.c utf/staticss.c
build_sources_library utf/string.c utf/triple.c utf/triples.c utf/tripless.c
build_sources_library utf/private-dynamic.c utf/private-dynamics.c utf/private-dynamicss.c
-build_sources_library utf/private-maps.c utf/private-mapss.c
build_sources_library utf/private-map_multis.c utf/private-map_multiss.c
+build_sources_library utf/private-maps.c utf/private-mapss.c
build_sources_library utf/private-string.c
build_sources_library utf/private-triples.c utf/private-tripless.c
build_sources_library level_0/status_string.c
build_sources_library level_0/string.c
build_sources_library level_0/private-string.c level_0/string/common.c
-build_sources_library level_0/string/private-dynamics.c
-build_sources_library level_0/string/private-maps.c level_0/string/private-mapss.c
-build_sources_library level_0/string/private-map_multis.c level_0/string/private-map_multiss.c
-build_sources_library level_0/string/private-quantitys.c level_0/string/private-quantityss.c
-build_sources_library level_0/string/private-ranges.c level_0/string/private-rangess.c
-build_sources_library level_0/string/private-triples.c level_0/string/private-tripless.c
build_sources_library level_0/string/dynamic.c level_0/string/dynamics.c level_0/string/dynamicss.c
build_sources_library level_0/string/map.c level_0/string/maps.c level_0/string/mapss.c
build_sources_library level_0/string/map_multi.c level_0/string/map_multis.c level_0/string/map_multiss.c
build_sources_program fll/level_0/pipe.c
build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_0/print/common.c fll/level_0/print/to.c fll/level_0/print/private-to.c
build_sources_program fll/level_0/signal.c
-build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/dynamic.c fll/level_0/string/map.c fll/level_0/string/map_multi.c fll/level_0/string/private-map.c fll/level_0/string/private-map_multi.c fll/level_0/string/private-quantity.c fll/level_0/string/private-range.c fll/level_0/string/private-triple.c fll/level_0/string/quantity.c fll/level_0/string/range.c fll/level_0/string/static.c fll/level_0/string/triple.c
+build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/dynamic.c fll/level_0/string/map.c fll/level_0/string/map_multi.cfll/level_0/string/quantity.c fll/level_0/string/range.c fll/level_0/string/static.c fll/level_0/string/triple.c
build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c
build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c
build_sources_program fll/level_0/utf/common.c fll/level_0/utf/convert.c fll/level_0/utf/dynamic.c fll/level_0/utf/is.c fll/level_0/utf/is_character.c fll/level_0/utf/map.c fll/level_0/utf/map_multi.c fll/level_0/utf/static.c fll/level_0/utf/string.c fll/level_0/utf/triple.c fll/level_0/utf/private-dynamic.c fll/level_0/utf/private-map.c fll/level_0/utf/private-map_multi.c fll/level_0/utf/private-triple.c fll/level_0/utf/private-string.c
//#define _di_f_string_empty_s_
//#define _di_f_string_eol_s_
//#define _di_f_string_format_s_
-#define _di_f_string_map_multis_adjust_
#define _di_f_string_map_multis_append_
#define _di_f_string_map_multis_append_all_
-#define _di_f_string_map_multis_decimate_by_
-#define _di_f_string_map_multis_decrease_by_
-//#define _di_f_string_map_multis_increase_
-#define _di_f_string_map_multis_increase_by_
-//#define _di_f_string_map_multis_resize_
-#define _di_f_string_map_multiss_adjust_
+//#define _di_f_string_map_multis_delete_callback_
+#define _di_f_string_map_multis_destroy_callback_
#define _di_f_string_map_multiss_append_
#define _di_f_string_map_multiss_append_all_
-#define _di_f_string_map_multiss_decimate_by_
-#define _di_f_string_map_multiss_decrease_by_
-#define _di_f_string_map_multiss_increase_
-#define _di_f_string_map_multiss_increase_by_
-#define _di_f_string_map_multiss_resize_
+#define _di_f_string_map_multiss_delete_callback_
+#define _di_f_string_map_multiss_destroy_callback_
#define _di_f_string_map_multiss_t_
//#define _di_f_string_map_multis_t_
//#define _di_f_string_map_multi_t_
-#define _di_f_string_maps_adjust_
//#define _di_f_string_maps_append_
#define _di_f_string_maps_append_all_
-#define _di_f_string_maps_decimate_by_
-#define _di_f_string_maps_decrease_by_
-//#define _di_f_string_maps_increase_
-//#define _di_f_string_maps_increase_by_
-//#define _di_f_string_maps_resize_
-#define _di_f_string_mapss_adjust_
+//#define _di_f_string_maps_delete_callback_
+#define _di_f_string_maps_destroy_callback_
#define _di_f_string_mapss_append_
#define _di_f_string_mapss_append_all_
-#define _di_f_string_mapss_decimate_by_
-#define _di_f_string_mapss_decrease_by_
-#define _di_f_string_mapss_increase_
-#define _di_f_string_mapss_increase_by_
-#define _di_f_string_mapss_resize_
+#define _di_f_string_mapss_delete_callback_
+#define _di_f_string_mapss_destroy_callback_
#define _di_f_string_mapss_t_
//#define _di_f_string_maps_t_
//#define _di_f_string_map_t_
#define _di_f_string_prepend_assure_
#define _di_f_string_prepend_assure_nulless_
#define _di_f_string_prepend_nulless_
-#define _di_f_string_quantitys_adjust_
#define _di_f_string_quantitys_append_
#define _di_f_string_quantitys_append_all_
-#define _di_f_string_quantitys_decimate_by_
-#define _di_f_string_quantitys_decrease_by_
-#define _di_f_string_quantitys_increase_
-#define _di_f_string_quantitys_increase_by_
-#define _di_f_string_quantitys_resize_
-#define _di_f_string_quantityss_adjust_
#define _di_f_string_quantityss_append_
#define _di_f_string_quantityss_append_all_
-#define _di_f_string_quantityss_decimate_by_
-#define _di_f_string_quantityss_decrease_by_
-#define _di_f_string_quantityss_increase_
-#define _di_f_string_quantityss_increase_by_
-#define _di_f_string_quantityss_resize_
+#define _di_f_string_quantityss_delete_callback_
+#define _di_f_string_quantityss_destroy_callback_
#define _di_f_string_quantityss_t_
#define _di_f_string_quantitys_t_
#define _di_f_string_quantity_t_
#define _di_f_string_range_empty_c_
-#define _di_f_string_ranges_adjust_
#define _di_f_string_ranges_append_
#define _di_f_string_ranges_append_all_
-#define _di_f_string_ranges_decimate_by_
-#define _di_f_string_ranges_decrease_by_
-//#define _di_f_string_ranges_increase_
-#define _di_f_string_ranges_increase_by_
-//#define _di_f_string_ranges_resize_
-#define _di_f_string_rangess_adjust_
#define _di_f_string_rangess_append_
#define _di_f_string_rangess_append_all_
-#define _di_f_string_rangess_decimate_by_
-#define _di_f_string_rangess_decrease_by_
-//#define _di_f_string_rangess_increase_
-#define _di_f_string_rangess_increase_by_
-//#define _di_f_string_rangess_resize_
+//#define _di_f_string_rangess_delete_callback_
+#define _di_f_string_rangess_destroy_callback_
//#define _di_f_string_rangess_t_
//#define _di_f_string_ranges_t_
//#define _di_f_string_range_t_
//#define _di_f_string_statics_t_
//#define _di_f_string_static_t_
//#define _di_f_string_t_
-#define _di_f_string_triples_adjust_
#define _di_f_string_triples_append_
#define _di_f_string_triples_append_all_
-#define _di_f_string_triples_decimate_by_
-#define _di_f_string_triples_decrease_by_
-#define _di_f_string_triples_increase_
-#define _di_f_string_triples_increase_by_
-#define _di_f_string_triples_resize_
+#define _di_f_string_triples_delete_callback_
+#define _di_f_string_triples_destroy_callback_
#define _di_f_string_tripless_adjust_
#define _di_f_string_tripless_append_
#define _di_f_string_tripless_append_all_
-#define _di_f_string_tripless_decimate_by_
-#define _di_f_string_tripless_decrease_by_
-#define _di_f_string_tripless_increase_
-#define _di_f_string_tripless_increase_by_
-#define _di_f_string_tripless_resize_
+#define _di_f_string_tripless_delete_callback_
+#define _di_f_string_tripless_destroy_callback_
#define _di_f_string_tripless_t_
#define _di_f_string_triples_t_
#define _di_f_string_triple_t_
build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_0/print/common.c fll/level_0/print/to.c fll/level_0/print/private-to.c
build_sources_program fll/level_0/rip.c fll/level_0/rip/utf.c fll/level_0/private-rip.c fll/level_0/rip/private-utf.c
build_sources_program fll/level_0/signal.c
-build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c
+build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c
build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c fll/level_0/string/dynamicss.c fll/level_0/string/map.c fll/level_0/string/maps.c fll/level_0/string/mapss.c fll/level_0/string/map_multi.c fll/level_0/string/map_multis.c fll/level_0/string/map_multiss.c fll/level_0/string/quantity.c fll/level_0/string/quantitys.c fll/level_0/string/quantityss.c fll/level_0/string/range.c fll/level_0/string/ranges.c fll/level_0/string/rangess.c fll/level_0/string/static.c fll/level_0/string/statics.c fll/level_0/string/staticss.c fll/level_0/string/triple.c fll/level_0/string/triples.c fll/level_0/string/tripless.c
build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c
build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c
build_sources_program fll/level_0/pipe.c
build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_0/print/common.c fll/level_0/print/to.c fll/level_0/print/private-to.c
build_sources_program fll/level_0/signal.c
-build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/dynamic.c fll/level_0/string/map.c fll/level_0/string/map_multi.c fll/level_0/string/private-map.c fll/level_0/string/private-map_multi.c fll/level_0/string/private-quantity.c fll/level_0/string/private-range.c fll/level_0/string/private-triple.c fll/level_0/string/quantity.c fll/level_0/string/range.c fll/level_0/string/static.c fll/level_0/string/triple.c
+build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/dynamic.c fll/level_0/string/map.c fll/level_0/string/map_multi.c fll/level_0/string/quantity.c fll/level_0/string/range.c fll/level_0/string/static.c fll/level_0/string/triple.c
build_sources_program fll/level_0/thread.c fll/level_0/private-thread.c fll/level_0/thread/attribute.c fll/level_0/thread/barrier.c fll/level_0/thread/barrier_attribute.c fll/level_0/thread/condition.c fll/level_0/thread/condition_attribute.c fll/level_0/thread/id.c fll/level_0/thread/key.c fll/level_0/thread/lock.c fll/level_0/thread/lock_attribute.c fll/level_0/thread/mutex.c fll/level_0/thread/mutex_attribute.c fll/level_0/thread/once.c fll/level_0/thread/semaphore.c fll/level_0/thread/set.c fll/level_0/thread/spin.c
build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c
build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c
build_sources_program fll/level_0/pipe.c
build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_0/print/common.c fll/level_0/print/to.c fll/level_0/print/private-to.c
build_sources_program fll/level_0/signal.c
-build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c
+build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c
build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c fll/level_0/string/dynamicss.c fll/level_0/string/map.c fll/level_0/string/maps.c fll/level_0/string/mapss.c fll/level_0/string/map_multi.c fll/level_0/string/map_multis.c fll/level_0/string/map_multiss.c fll/level_0/string/quantity.c fll/level_0/string/quantitys.c fll/level_0/string/quantityss.c fll/level_0/string/range.c fll/level_0/string/ranges.c fll/level_0/string/rangess.c fll/level_0/string/static.c fll/level_0/string/statics.c fll/level_0/string/staticss.c fll/level_0/string/triple.c fll/level_0/string/triples.c fll/level_0/string/tripless.c
build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c
build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c
if (!total) return F_data_not;
{
- const f_status_t status = f_string_maps_increase_by(total, environment);
+ const f_status_t status = f_memory_array_increase_by(total, sizeof(f_string_map_t), (void **) &environment->array, &environment->used, &environment->size);
if (F_status_is_error(status)) return status;
}
* F_okay on success.
* F_data_not if the arguments.envp pointer is NULL or there are no environment variables in arguments.envp.
*
- * Errors (with error bit) from: f_string_maps_increase_by().
+ * Errors (with error bit) from: f_memory_array_increase_by().
*
- * @see f_string_maps_increase_by()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_console_environment_process_
extern f_status_t f_console_environment_process(const f_console_arguments_t arguments, f_string_maps_t * const environment);
assert_int_equal(status, F_data_not);
}
- f_string_maps_resize(0, &maps);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &maps.array, &maps.used, &maps.size, &f_string_maps_delete_callback);
} // for
}
} // for
}
- f_string_maps_resize(0, &maps);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &maps.array, &maps.used, &maps.size, &f_string_maps_delete_callback);
}
#ifdef __cplusplus
assert_string_equal(environment.array[0].value.string, value.string);
}
- f_string_maps_resize(0, &environment);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &environment.array, &environment.used, &environment.size, &f_string_maps_delete_callback);
}
#ifdef __cplusplus
const f_status_t status = f_file_read(file, &buffer);
// Ensure string ends in NULL so that assert_string_equal() can be used.
- f_string_dynamic_increase_by(1, &buffer);
+ f_memory_array_increase_by(1, sizeof(f_char_t), (void **) &buffer.string, &buffer.used, &buffer.size);
buffer.string[buffer.used] = 0;
assert_int_equal(status, F_okay_eof);
const f_status_t status = f_file_read_block(file, &buffer);
// Ensure string ends in NULL so that assert_string_equal() can be used.
- f_string_dynamic_increase_by(1, &buffer);
+ f_memory_array_increase_by(1, sizeof(f_char_t), (void **) &buffer.string, &buffer.used, &buffer.size);
buffer.string[buffer.used] = 0;
assert_int_equal(status, F_okay);
const f_status_t status = f_file_read_until(file, 6, &buffer);
// Ensure string ends in NULL so that assert_string_equal() can be used.
- f_string_dynamic_increase_by(1, &buffer);
+ f_memory_array_increase_by(1, sizeof(f_char_t), (void **) &buffer.string, &buffer.used, &buffer.size);
buffer.string[buffer.used] = 0;
assert_int_equal(status, F_okay_stop);
const f_status_t status = f_file_read_until(file, 6, &buffer);
// Ensure string ends in NULL so that assert_string_equal() can be used.
- f_string_dynamic_increase_by(1, &buffer);
+ f_memory_array_increase_by(1, sizeof(f_char_t), (void **) &buffer.string, &buffer.used, &buffer.size);
buffer.string[buffer.used] = 0;
assert_int_equal(status, F_okay_eof);
if (!item) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return f_string_ranges_resize(0, &item->content);
+ return f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &item->content.array, &item->content.used, &item->content.size);
}
#endif // _di_f_fss_item_delete_
if (!item) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return f_string_ranges_adjust(0, &item->content);
+ return f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &item->content.array, &item->content.used, &item->content.size);
}
#endif // _di_f_fss_item_destroy_
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_resize(0, &array[i].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].content.array, &array[i].content.used, &array[i].content.size);
if (F_status_is_error(status)) return status;
} // for
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_adjust(0, &array[i].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].content.array, &array[i].content.used, &array[i].content.size);
if (F_status_is_error(status)) return status;
} // for
}
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_resize(0, &array[i].array[j].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].content.array, &array[i].array[j].content.used, &array[i].array[j].content.size);
if (F_status_is_error(status)) return status;
} // for
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_adjust(0, &array[i].array[j].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].content.array, &array[i].array[j].content.used, &array[i].array[j].content.size);
if (F_status_is_error(status)) return status;
} // for
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_string_ranges_resize()
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_item_delete_
extern f_status_t f_fss_item_delete(f_fss_item_t * const item);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
*
- * @see f_string_ranges_adjust()
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fss_item_destroy_
extern f_status_t f_fss_item_destroy(f_fss_item_t * const item);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_string_ranges_resize()
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_items_delete_callback_
extern f_status_t f_fss_items_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
*
- * @see f_string_ranges_adjust()
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fss_items_destroy_callback_
extern f_status_t f_fss_items_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_string_ranges_resize()
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_itemss_delete_callback_
extern f_status_t f_fss_itemss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
*
- * @see f_string_ranges_adjust()
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fss_itemss_destroy_callback_
extern f_status_t f_fss_itemss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_resize(0, &named->objects);
+ f_status_t status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &named->objects.array, &named->objects.used, &named->objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &named->contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &named->contents.array, &named->contents.used, &named->contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_resize(0, sizeof(uint8_t), (void **) &named->quotess.array, &named->quotess.used, &named->quotess.size, &f_uint8ss_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &named->quotess.array, &named->quotess.used, &named->quotess.size, &f_uint8ss_delete_callback);
if (F_status_is_error(status)) return status;
}
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_adjust(0, &named->objects);
+ f_status_t status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &named->objects.array, &named->objects.used, &named->objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &named->contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &named->contents.array, &named->contents.used, &named->contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_adjust(0, sizeof(uint8_t), (void **) &named->quotess.array, &named->quotess.used, &named->quotess.size, &f_uint8ss_destroy_callback);
+ status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &named->quotess.array, &named->quotess.used, &named->quotess.size, &f_uint8ss_destroy_callback);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_resize(0, &array[i].objects);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].objects.array, &array[i].objects.used, &array[i].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &array[i].contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &array[i].contents.array, &array[i].contents.used, &array[i].contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_resize(0, sizeof(uint8_t), (void **) &array[i].quotess.array, &array[i].quotess.used, &array[i].quotess.size, &f_uint8ss_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &array[i].quotess.array, &array[i].quotess.used, &array[i].quotess.size, &f_uint8ss_delete_callback);
if (F_status_is_error(status)) return status;
} // for
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_adjust(0, &array[i].objects);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].objects.array, &array[i].objects.used, &array[i].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &array[i].contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &array[i].contents.array, &array[i].contents.used, &array[i].contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_adjust(0, sizeof(uint8_t), (void **) &array[i].quotess.array, &array[i].quotess.used, &array[i].quotess.size, &f_uint8ss_destroy_callback);
+ status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &array[i].quotess.array, &array[i].quotess.used, &array[i].quotess.size, &f_uint8ss_destroy_callback);
if (F_status_is_error(status)) return status;
} // for
}
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_resize(0, &array[i].array[j].objects);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].objects.array, &array[i].array[j].objects.used, &array[i].array[j].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &array[i].array[j].contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &array[i].array[j].contents.array, &array[i].array[j].contents.used, &array[i].array[j].contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_resize(0, sizeof(uint8_t), (void **) &array[i].array[j].quotess.array, &array[i].array[j].quotess.used, &array[i].array[j].quotess.size, &f_uint8ss_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &array[i].array[j].quotess.array, &array[i].array[j].quotess.used, &array[i].array[j].quotess.size, &f_uint8ss_delete_callback);
if (F_status_is_error(status)) return status;
} // for
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_adjust(0, &array[i].array[j].objects);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].objects.array, &array[i].array[j].objects.used, &array[i].array[j].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &array[i].array[j].contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &array[i].array[j].contents.array, &array[i].array[j].contents.used, &array[i].array[j].contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_adjust(0, sizeof(uint8_t), (void **) &array[i].array[j].quotess.array, &array[i].array[j].quotess.used, &array[i].array[j].quotess.size, &f_uint8ss_destroy_callback);
+ status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &array[i].array[j].quotess.array, &array[i].array[j].quotess.used, &array[i].array[j].quotess.size, &f_uint8ss_destroy_callback);
if (F_status_is_error(status)) return status;
} // for
#define f_fss_named_t_initialize { f_string_range_t_initialize, f_string_ranges_t_initialize, f_string_rangess_t_initialize, f_uint8ss_t_initialize }
#define macro_f_fss_named_t_initialize_1(name, objects, contents, quotess) macro_f_number_unsigneds_t_initialize_1(name, objects, contents, quotess)
+ #define macro_f_fss_named_t_initialize_2(name) macro_f_number_unsigneds_t_initialize_1(name, f_string_ranges_t_initialize, f_string_rangess_t_initialize, f_uint8ss_t_initialize)
#define macro_f_fss_named_t_clear(named) \
macro_f_string_range_t_clear(named.name) \
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_memory_arrays_resize().
*
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
+ * @see f_memory_array_resize()
* @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_named_delete_
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
* Errors (with error bit) from: f_memory_arrays_adjust().
*
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
+ * @see f_memory_array_adjust()
* @see f_memory_arrays_adjust()
*/
#ifndef _di_f_fss_named_destroy_
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_memory_arrays_resize().
*
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
+ * @see f_memory_arrays_resize()
* @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_nameds_delete_callback_
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
* Errors (with error bit) from: f_memory_arrays_adjust().
*
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
+ * @see f_memory_array_adjust()
* @see f_memory_arrays_adjust()
*/
#ifndef _di_f_fss_nameds_destroy_callback_
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_memory_arrays_resize().
*
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
+ * @see f_memory_array_resize()
* @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_namedss_delete_callback_
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
* Errors (with error bit) from: f_memory_arrays_adjust().
*
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
+ * @see f_memory_array_adjust()
* @see f_memory_arrays_adjust()
*/
#ifndef _di_f_fss_namedss_destroy_callback_
for (j = 0; j < nest->depth[i].size; ++j) {
- status = f_string_ranges_resize(0, &nest->depth[i].array[j].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &nest->depth[i].array[j].content.array, &nest->depth[i].array[j].content.used, &nest->depth[i].array[j].content.size);
if (F_status_is_error(status)) return status;
} // for
for (j = 0; j < nest->depth[i].size; ++j) {
- status = f_string_ranges_adjust(0, &nest->depth[i].array[j].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &nest->depth[i].array[j].content.array, &nest->depth[i].array[j].content.used, &nest->depth[i].array[j].content.size);
if (F_status_is_error(status)) return status;
} // for
for (k = 0; k < array[i].depth[j].size; ++k) {
- status = f_string_ranges_resize(0, &array[i].depth[j].array[k].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].depth[j].array[k].content.array, &array[i].depth[j].array[k].content.used, &array[i].depth[j].array[k].content.size);
if (F_status_is_error(status)) return status;
} // for
for (k = 0; k < array[i].depth[j].size; ++k) {
- status = f_string_ranges_adjust(0, &array[i].depth[j].array[k].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].depth[j].array[k].content.array, &array[i].depth[j].array[k].content.used, &array[i].depth[j].array[k].content.size);
if (F_status_is_error(status)) return status;
} // for
for (l = 0; l < array[i].array[j].depth[k].size; ++l) {
- status = f_string_ranges_resize(0, &array[i].array[j].depth[k].array[l].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].depth[k].array[l].content.array, &array[i].array[j].depth[k].array[l].content.used, &array[i].array[j].depth[k].array[l].content.size);
if (F_status_is_error(status)) return status;
} // for
for (l = 0; l < array[i].array[j].depth[k].size; ++l) {
- status = f_string_ranges_adjust(0, &array[i].array[j].depth[k].array[l].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].depth[k].array[l].content.array, &array[i].array[j].depth[k].array[l].content.used, &array[i].array[j].depth[k].array[l].content.size);
if (F_status_is_error(status)) return status;
} // for
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_string_ranges_resize()
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_nest_delete_
extern f_status_t f_fss_nest_delete(f_fss_nest_t * const nest);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
*
- * @see f_memory_array_resize()
- * @see f_string_ranges_resize()
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fss_nest_destroy_
extern f_status_t f_fss_nest_destroy(f_fss_nest_t * const nest);
+++ /dev/null
-#include "../fss.h"
-#include "private-item.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
- f_status_t private_f_fss_items_adjust(const f_number_unsigned_t length, f_fss_items_t * const items) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < items->size; ++i) {
-
- status = f_string_ranges_adjust(0, &items->array[i].content);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
- }
-#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
-
-#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
- f_status_t private_f_fss_items_resize(const f_number_unsigned_t length, f_fss_items_t * const items) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < items->size; ++i) {
-
- status = f_string_ranges_resize(0, &items->array[i].content);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
- }
-#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: FSS
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_fss_item_h
-#define _PRIVATE_F_fss_item_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param items
- * The items to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_string_dynamic_adjust().
- *
- * @see f_memory_array_adjust()
- * @see f_string_dynamic_adjust()
- *
- * @see f_fss_items_adjust()
- * @see f_fss_items_decimate_by()
- * @see f_fss_nest_adjust()
- * @see f_fss_nest_decimate_by()
- */
-#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
- extern f_status_t private_f_fss_items_adjust(const f_number_unsigned_t length, f_fss_items_t * const items) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param items
- * The items to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- *
- * @see f_memory_array_resize()
- *
- * @see f_fss_items_decrease_by()
- * @see f_fss_items_resize()
- * @see f_fss_nest_decrease_by()
- * @see f_fss_nest_resize()
- */
-#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
- extern f_status_t private_f_fss_items_resize(const f_number_unsigned_t length, f_fss_items_t * const items) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_fss_item_h
+++ /dev/null
-#include "../fss.h"
-#include "private-named.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
- f_status_t private_f_fss_named_adjust(const f_number_unsigned_t length, f_fss_named_t * const named) {
-
- f_status_t status = f_string_ranges_adjust(length, &named->objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_adjust(length, &named->contents);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_arrays_adjust(length, sizeof(f_uint8s_t), (void **) &named->quotess.array, &named->quotess.used, &named->quotess.size, &f_uint8s_delete_callback);
- if (F_status_is_error(status)) return status;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
- f_status_t private_f_fss_named_resize(const f_number_unsigned_t length, f_fss_named_t * const named) {
-
- f_status_t status = f_string_ranges_resize(length, &named->objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_resize(length, &named->contents);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_arrays_resize(length, sizeof(f_uint8s_t), (void **) &named->quotess.array, &named->quotess.used, &named->quotess.size, &f_uint8s_delete_callback);
- if (F_status_is_error(status)) return status;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
-
-#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
- f_status_t private_f_fss_nameds_adjust(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < nameds->size; ++i) {
-
- status = private_f_fss_named_adjust(0, &nameds->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_named_t), (void **) &nameds->array, &nameds->used, &nameds->size);
- }
-#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
- f_status_t private_f_fss_nameds_resize(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < nameds->size; ++i) {
-
- status = private_f_fss_named_resize(0, &nameds->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_named_t), (void **) &nameds->array, &nameds->used, &nameds->size);
- }
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: FSS
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_fss_named_h
-#define _PRIVATE_F_fss_named_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param named
- * The named to adjust.
- *
- * @return
- * F_okay on success.
- *
- * Errors (with error bit) from: f_memory_arrays_adjust().
- * Errors (with error bit) from: macro_f_string_ranges_t_adjust().
- * Errors (with error bit) from: macro_f_string_rangess_t_adjust().
- *
- * @see f_memory_arrays_adjust()
- * @see macro_f_string_ranges_t_adjust()
- * @see macro_f_string_rangess_t_adjust()
- *
- * @see f_fss_nameds_adjust()
- * @see f_fss_nameds_decimate_by()
- */
-#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
- extern f_status_t private_f_fss_named_adjust(const f_number_unsigned_t length, f_fss_named_t * const named) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param named
- * The named to resize.
- *
- * @return
- * F_okay on success.
- *
- * Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
- *
- * @see f_memory_arrays_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
- *
- * @see f_fss_nameds_decrease_by()
- * @see f_fss_nameds_resize()
- */
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
- extern f_status_t private_f_fss_named_resize(const f_number_unsigned_t length, f_fss_named_t * const named) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param nameds
- * The nameds to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
- *
- * @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
- *
- * @see f_fss_nameds_adjust()
- * @see f_fss_nameds_decimate_by()
- */
-#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
- extern f_status_t private_f_fss_nameds_adjust(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param nameds
- * The nameds to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
- *
- * @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
- *
- * @see f_fss_nameds_decrease_by()
- * @see f_fss_nameds_increase()
- * @see f_fss_nameds_increase_by()
- * @see f_fss_nameds_resize()
- */
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
- extern f_status_t private_f_fss_nameds_resize(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_fss_named_h
+++ /dev/null
-#include "../fss.h"
-#include "private-item.h"
-#include "private-nest.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
- f_status_t private_f_fss_nest_adjust(const f_number_unsigned_t length, f_fss_nest_t * const nest) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < nest->size; ++i) {
-
- status = private_f_fss_items_adjust(0, &nest->depth[i]);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_items_t), (void **) &nest->depth, &nest->used, &nest->size);
- }
-#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
-
-#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
- f_status_t private_f_fss_nest_resize(const f_number_unsigned_t length, f_fss_nest_t * const nest) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < nest->size; ++i) {
-
- status = private_f_fss_items_resize(0, &nest->depth[i]);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_items_t), (void **) &nest->depth, &nest->used, &nest->size);
- }
-#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
-
-#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
- f_status_t private_f_fss_nests_adjust(const f_number_unsigned_t length, f_fss_nests_t *nests) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < nests->size; ++i) {
-
- status = private_f_fss_nest_adjust(0, &nests->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_nest_t), (void **) &nests->array, &nests->used, &nests->size);
- }
-#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
-
-#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
- f_status_t private_f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < nests->size; ++i) {
-
- status = private_f_fss_nest_resize(0, &nests->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_nest_t), (void **) &nests->array, &nests->used, &nests->size);
- }
-#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: FSS
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_fss_nest_h
-#define _PRIVATE_F_fss_nest_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param nest
- * The nest to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_string_dynamic_adjust().
- *
- * @see f_memory_array_adjust()
- * @see f_string_dynamic_adjust()
- *
- * @see f_fss_nests_adjust()
- * @see f_fss_nests_decimate_by()
- */
-#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
- extern f_status_t private_f_fss_nest_adjust(const f_number_unsigned_t length, f_fss_nest_t * const nest) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param nest
- * The nest to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- *
- * @see f_memory_array_resize()
- *
- * @see f_fss_nests_decrease_by()
- * @see f_fss_nests_resize()
- */
-#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
- extern f_status_t private_f_fss_nest_resize(const f_number_unsigned_t length, f_fss_nest_t * const nest) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param nests
- * The nests to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_string_dynamic_adjust().
- *
- * @see f_memory_array_adjust()
- * @see f_string_dynamic_adjust()
- *
- * @see f_fss_nests_adjust()
- * @see f_fss_nests_decimate_by()
- */
-#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
- extern f_status_t private_f_fss_nests_adjust(const f_number_unsigned_t length, f_fss_nests_t * const nests) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param nests
- * The nests to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- *
- * @see f_memory_array_resize()
- *
- * @see f_fss_nests_decrease_by()
- * @see f_fss_nests_increase()
- * @see f_fss_nests_increase_by()
- * @see f_fss_nests_resize()
- */
-#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
- extern f_status_t private_f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_fss_nest_h
+++ /dev/null
-#include "../fss.h"
-#include "private-set.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
- f_status_t private_f_fss_set_adjust(const f_number_unsigned_t length, f_fss_set_t * const set) {
-
- f_status_t status = f_string_ranges_adjust(length, &set->objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_adjust(length, &set->contents);
- if (F_status_is_error(status)) return status;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
-
-#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
- f_status_t private_f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t *set) {
-
- f_status_t status = f_string_ranges_resize(length, &set->objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_resize(length, &set->contents);
- if (F_status_is_error(status)) return status;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
-
-#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
- f_status_t private_f_fss_sets_adjust(const f_number_unsigned_t length, f_fss_sets_t * const sets) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < sets->size; ++i) {
-
- status = f_string_ranges_adjust(0, &sets->array[i].objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_adjust(0, &sets->array[i].contents);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_set_t), (void **) &sets->array, &sets->used, &sets->size);
- }
-#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
-
-#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
- f_status_t private_f_fss_sets_resize(const f_number_unsigned_t length, f_fss_sets_t * const sets) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < sets->size; ++i) {
-
- status = f_string_ranges_resize(0, &sets->array[i].objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_resize(0, &sets->array[i].contents);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_set_t), (void **) &sets->array, &sets->used, &sets->size);
- }
-#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: FSS
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_fss_set_h
-#define _PRIVATE_F_fss_set_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param set
- * The set to adjust.
- *
- * @return
- * F_okay on success.
- *
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
- *
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
- *
- * @see f_fss_set_adjust()
- * @see f_fss_set_decimate_by()
- */
-#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
- extern f_status_t private_f_fss_set_adjust(const f_number_unsigned_t length, f_fss_set_t * const set) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param set
- * The set to resize.
- *
- * @return
- * F_okay on success.
- *
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
- *
- * @see f_string_ranges_resize
- * @see f_string_rangess_resize()()
- *
- * @see f_fss_set_decrease_by()
- * @see f_fss_set_increase()
- * @see f_fss_set_increase_by()
- * @see f_fss_set_resize()
- */
-#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
- extern f_status_t private_f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t * const set) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param sets
- * The sets to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
- *
- * @see f_memory_array_adjust()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
- *
- * @see f_fss_sets_adjust()
- * @see f_fss_sets_decimate_by()
- */
-#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
- extern f_status_t private_f_fss_sets_adjust(const f_number_unsigned_t length, f_fss_sets_t * const sets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param sets
- * The sets to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
- *
- * @see f_memory_array_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
- *
- * @see f_fss_sets_decrease_by()
- * @see f_fss_sets_resize()
- */
-#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
- extern f_status_t private_f_fss_sets_resize(const f_number_unsigned_t length, f_fss_sets_t * const sets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_fss_set_h
+++ /dev/null
-#include "../fss.h"
-#include "private-set_quote.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
- f_status_t private_f_fss_set_quote_adjust(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) {
-
- f_status_t status = f_string_ranges_adjust(length, &set_quote->objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_adjust(length, &set_quote->contents);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_adjust(length, sizeof(uint8_t), (void **) &set_quote->objects_quote.array, &set_quote->objects_quote.used, &set_quote->objects_quote.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_arrays_adjust(length, sizeof(f_uint8s_t), (void **) &set_quote->contents_quote.array, &set_quote->contents_quote.used, &set_quote->contents_quote.size, &f_uint8s_delete_callback);
- if (F_status_is_error(status)) return status;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
-
-#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
- f_status_t private_f_fss_set_quote_resize(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) {
-
- f_status_t status = f_string_ranges_resize(length, &set_quote->objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_resize(length, &set_quote->contents);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_resize(length, sizeof(uint8_t), (void **) &set_quote->objects_quote.array, &set_quote->objects_quote.used, &set_quote->objects_quote.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_arrays_resize(length, sizeof(f_uint8s_t), (void **) &set_quote->contents_quote.array, &set_quote->contents_quote.used, &set_quote->contents_quote.size, &f_uint8s_delete_callback);
- if (F_status_is_error(status)) return status;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
-
-#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
- f_status_t private_f_fss_set_quotes_adjust(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < set_quotes->size; ++i) {
-
- status = f_string_ranges_adjust(0, &set_quotes->array[i].objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_adjust(0, &set_quotes->array[i].contents);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_adjust(0, sizeof(uint8_t), (void **) &set_quotes->array[i].objects_quote.array, &set_quotes->array[i].objects_quote.used, &set_quotes->array[i].objects_quote.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &set_quotes->array[i].contents_quote.array, &set_quotes->array[i].contents_quote.used, &set_quotes->array[i].contents_quote.size, &f_uint8s_delete_callback);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_set_quote_t), (void **) &set_quotes->array, &set_quotes->used, &set_quotes->size);
- }
-#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
-
-#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
- f_status_t private_f_fss_set_quotes_resize(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < set_quotes->size; ++i) {
-
- status = f_string_ranges_resize(0, &set_quotes->array[i].objects);
- if (F_status_is_error(status)) return status;
-
- status = f_string_rangess_resize(0, &set_quotes->array[i].contents);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_resize(0, sizeof(uint8_t), (void **) &set_quotes->array[i].objects_quote.array, &set_quotes->array[i].objects_quote.used, &set_quotes->array[i].objects_quote.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &set_quotes->array[i].contents_quote.array, &set_quotes->array[i].contents_quote.used, &set_quotes->array[i].contents_quote.size, &f_uint8s_delete_callback);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_set_quote_t), (void **) &set_quotes->array, &set_quotes->used, &set_quotes->size);
- }
-#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: FSS
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_fss_set_quote_h
-#define _PRIVATE_F_fss_set_quote_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param set_quote
- * The set_quote to adjust.
- *
- * @return
- * F_okay on success.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
- *
- * @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
- *
- * @see f_fss_set_quote_adjust()
- * @see f_fss_set_quote_decimate_by()
- */
-#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
- extern f_status_t private_f_fss_set_quote_adjust(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param set_quote
- * The set_quote to resize.
- *
- * @return
- * F_okay on success.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
- *
- * @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
- *
- * @see f_fss_set_quote_decrease_by()
- * @see f_fss_set_quote_resize()
- */
-#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
- extern f_status_t private_f_fss_set_quote_resize(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param set_quotes
- * The set_quotes to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_memory_arrays_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
- *
- * @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
- *
- * @see f_fss_set_quotes_decrease_by()
- * @see f_fss_set_quotes_adjust()
- * @see f_memory_adjust()
- */
-#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
- extern f_status_t private_f_fss_set_quotes_adjust(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param set_quotes
- * The set_quotes to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_memory_arrays_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
- *
- * @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
- *
- * @see f_fss_set_quotes_decrease_by()
- * @see f_fss_set_quotes_increase()
- * @see f_fss_set_quotes_increase_by()
- * @see f_fss_set_quotes_resize()
- * @see f_memory_resize()
- */
-#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
- extern f_status_t private_f_fss_set_quotes_resize(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_fss_set_quote_h
+++ /dev/null
-#include "../fss.h"
-#include "private-simple_packet.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_rangess_append_)
- extern f_status_t private_f_fss_simple_packet_ranges_append(const f_fss_simple_packet_range_t source, f_fss_simple_packet_ranges_t *destination) {
-
- const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_fss_simple_packet_range_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
-
- destination->array[destination->used++] = source;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_rangess_append_)
-
-#if !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_ranges_append_all_) || !defined(_di_f_fss_simple_packet_rangess_append_all_)
- extern f_status_t private_f_fss_simple_packet_ranges_append_all(const f_fss_simple_packet_ranges_t source, f_fss_simple_packet_ranges_t *destination) {
-
- {
- const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fss_simple_packet_range_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- destination->array[destination->used++] = source.array[i];
- } // for
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_ranges_append_all_) || !defined(_di_f_fss_simple_packet_rangess_append_all_)
-
-#if !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
- f_status_t private_f_fss_simple_packet_rangess_adjust(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
-
- status = f_memory_array_adjust(0, sizeof(f_fss_simple_packet_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_simple_packet_ranges_t), (void **) &rangess->array, &rangess->used, &rangess->size);
- }
-#endif // !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
-
-#if !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
- f_status_t private_f_fss_simple_packet_rangess_resize(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_fss_simple_packet_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_simple_packet_ranges_t), (void **) &rangess->array, &rangess->used, &rangess->size);
- }
-#endif // !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
-
-#if !defined(_di_f_fss_simple_packets_adjust_) || !defined(_di_f_fss_simple_packets_decimate_by_)
- f_status_t private_f_fss_simple_packets_adjust(const f_number_unsigned_t length, f_fss_simple_packets_t *packets) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < packets->size; ++i) {
-
- status = f_string_dynamic_adjust(0, &packets->array[i].payload);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_simple_packet_t), (void **) &packets->array, &packets->used, &packets->size);
- }
-#endif // !defined(_di_f_fss_simple_packets_adjust_) || !defined(_di_f_fss_simple_packets_decimate_by_)
-
-#if !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packetss_append_)
- extern f_status_t private_f_fss_simple_packets_append(const f_fss_simple_packet_t source, f_fss_simple_packets_t *destination) {
-
- const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_fss_simple_packet_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
-
- destination->array[destination->used++] = source;
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packetss_append_)
-
-#if !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packets_append_all_) || !defined(_di_f_fss_simple_packetss_append_all_)
- extern f_status_t private_f_fss_simple_packets_append_all(const f_fss_simple_packets_t source, f_fss_simple_packets_t *destination) {
-
- {
- const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fss_simple_packet_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- destination->array[destination->used++] = source.array[i];
- } // for
-
- return F_okay;
- }
-#endif // !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packets_append_all_) || !defined(_di_f_fss_simple_packetss_append_all_)
-
-#if !defined(_di_f_fss_simple_packets_decrease_by_) || !defined(_di_f_fss_simple_packets_resize_)
- f_status_t private_f_fss_simple_packets_resize(const f_number_unsigned_t length, f_fss_simple_packets_t *packets) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < packets->size; ++i) {
-
- status = f_memory_array(0, sizeof(f_char_t), (void **) &packets->array[i].payload.string, &packets->array[i].payload.used, &packets->array[i].payload.size);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_simple_packet_t), (void **) &packets->array, &packets->used, &packets->size);
- }
-#endif // !defined(_di_f_fss_simple_packets_decrease_by_) || !defined(_di_f_fss_simple_packets_resize_)
-
-#if !defined(_di_f_fss_simple_packetss_adjust_) || !defined(_di_f_fss_simple_packetss_decimate_by_)
- f_status_t private_f_fss_simple_packetss_adjust(const f_number_unsigned_t length, f_fss_simple_packetss_t *packetss) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < packetss->size; ++i) {
-
- status = f_memory_array_adjust(0, sizeof(f_fss_simple_packet_t), (void **) &packetss->array[i].array, &packetss->array[i].used, &packetss->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_fss_simple_packets_t), (void **) &packetss->array, &packetss->used, &packetss->size);
- }
-#endif // !defined(_di_f_fss_simple_packetss_adjust_) || !defined(_di_f_fss_simple_packetss_decimate_by_)
-
-#if !defined(_di_f_fss_simple_packetss_decrease_by_) || !defined(_di_f_fss_simple_packetss_resize_)
- f_status_t private_f_fss_simple_packetss_resize(const f_number_unsigned_t length, f_fss_simple_packetss_t *packetss) {
-
- {
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < packetss->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_fss_simple_packet_t), (void **) &packetss->array[i].array, &packetss->array[i].used, &packetss->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_fss_simple_packets_t), (void **) &packetss->array, &packetss->used, &packetss->size);
- }
-#endif // !defined(_di_f_fss_simple_packetss_decrease_by_) || !defined(_di_f_fss_simple_packetss_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: FSS
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_fss_simple_packet_h
-#define _PRIVATE_F_fss_simple_packet_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for appending the range array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source range to append.
- * @param destination
- * The destination lengths the source is appended onto.
- *
- * @return
- * Success from f_memory_array_increase().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_increase().
- *
- * @see f_memory_array_increase()
- *
- * @see f_fss_simple_packet_ranges_append()
- * @see f_fss_simple_packet_rangess_append()
- */
-#if !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_rangess_append_)
- extern f_status_t private_f_fss_simple_packet_ranges_append(const f_fss_simple_packet_range_t source, f_fss_simple_packet_ranges_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_rangess_append_)
-
-/**
- * Private implementation for appending the range array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source ranges to append.
- * @param destination
- * The destination lengths the source is appended onto.
- *
- * @return
- * Success from f_memory_array_increase_by().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_increase_by().
- *
- * @see f_memory_array_increase_by()
- *
- * @see f_fss_simple_packet_ranges_append_all()
- * @see f_fss_simple_packet_rangess_append()
- * @see f_fss_simple_packet_rangess_append_all()
- */
-#if !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_ranges_append_all_) || !defined(_di_f_fss_simple_packet_rangess_append_all_)
- extern f_status_t private_f_fss_simple_packet_ranges_append_all(const f_fss_simple_packet_ranges_t source, f_fss_simple_packet_ranges_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_ranges_append_all_) || !defined(_di_f_fss_simple_packet_rangess_append_all_)
-
-/**
- * Private implementation for resizing the rangess array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param rangess
- * The rangess array to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- *
- * @see f_memory_array_adjust()
- *
- * @see f_fss_simple_packet_rangess_decrease_by()
- * @see f_fss_simple_packet_rangess_adjust()
- */
-#if !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
- extern f_status_t private_f_fss_simple_packet_rangess_adjust(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
-
-/**
- * Private implementation for resizing the rangess array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param rangess
- * The rangess array to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- *
- * @see f_memory_array_resize()
- *
- * @see f_fss_simple_packet_rangess_decrease_by()
- * @see f_fss_simple_packet_rangess_resize()
- */
-#if !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
- extern f_status_t private_f_fss_simple_packet_rangess_resize(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
-
-/**
- * Private implementation for resizing the simple packet array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param packets
- * The simple packet array to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- *
- * @see f_memory_array_adjust()
- *
- * @see f_fss_simple_packets_decrease_by()
- * @see f_fss_simple_packets_adjust()
- */
-#if !defined(_di_f_fss_simple_packets_adjust_) || !defined(_di_f_fss_simple_packets_decimate_by_)
- extern f_status_t private_f_fss_simple_packets_adjust(const f_number_unsigned_t length, f_fss_simple_packets_t *packets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packets_adjust_) || !defined(_di_f_fss_simple_packets_decimate_by_)
-
-/**
- * Private implementation for appending the simple packet array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source simple packet to append.
- * @param destination
- * The destination lengths the source is appended onto.
- *
- * @return
- * Success from f_memory_array_increase().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_increase().
- *
- * @see f_memory_array_increase()
- *
- * @see f_fss_simple_packets_append()
- * @see f_fss_simple_packetss_append()
- */
-#if !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packetss_append_)
- extern f_status_t private_f_fss_simple_packets_append(const f_fss_simple_packet_t source, f_fss_simple_packets_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packetss_append_)
-
-/**
- * Private implementation for appending the simple packet array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source simple packets to append.
- * @param destination
- * The destination lengths the source is appended onto.
- *
- * @return
- * Success from f_memory_array_increase_by().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_increase_by().
- *
- * @see f_memory_array_increase_by()
- *
- * @see f_fss_simple_packets_append_all()
- * @see f_fss_simple_packetss_append()
- * @see f_fss_simple_packetss_append_all()
- */
-#if !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packets_append_all_) || !defined(_di_f_fss_simple_packetss_append_all_)
- extern f_status_t private_f_fss_simple_packets_append_all(const f_fss_simple_packets_t source, f_fss_simple_packets_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packets_append_) || !defined(_di_f_fss_simple_packets_append_all_) || !defined(_di_f_fss_simple_packetss_append_all_)
-
-/**
- * Private implementation for resizing the simple packet array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param packets
- * The simple packet array to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- *
- * @see f_memory_array_resize()
- *
- * @see f_fss_simple_packets_decrease_by()
- * @see f_fss_simple_packets_resize()
- */
-#if !defined(_di_f_fss_simple_packets_decrease_by_) || !defined(_di_f_fss_simple_packets_resize_)
- extern f_status_t private_f_fss_simple_packets_resize(const f_number_unsigned_t length, f_fss_simple_packets_t *packets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packets_decrease_by_) || !defined(_di_f_fss_simple_packets_resize_)
-
-/**
- * Private implementation for resizing the simple packets array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param packetss
- * The simple packets array to adjust.
- *
- * @return
- * Success from f_memory_array_adjust().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_adjust().
- *
- * @see f_memory_array_adjust()
- *
- * @see f_fss_simple_packetss_decrease_by()
- * @see f_fss_simple_packetss_adjust()
- */
-#if !defined(_di_f_fss_simple_packetss_adjust_) || !defined(_di_f_fss_simple_packetss_decimate_by_)
- extern f_status_t private_f_fss_simple_packetss_adjust(const f_number_unsigned_t length, f_fss_simple_packetss_t *packetss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packetss_adjust_) || !defined(_di_f_fss_simple_packetss_decimate_by_)
-
-/**
- * Private implementation for resizing the simple packets array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param packetss
- * The simple packets array to resize.
- *
- * @return
- * Success from f_memory_array_resize().
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_array_resize().
- *
- * @see f_memory_array_resize()
- *
- * @see f_fss_simple_packetss_decrease_by()
- * @see f_fss_simple_packetss_resize()
- */
-#if !defined(_di_f_fss_simple_packetss_decrease_by_) || !defined(_di_f_fss_simple_packetss_resize_)
- extern f_status_t private_f_fss_simple_packetss_resize(const f_number_unsigned_t length, f_fss_simple_packetss_t *packetss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packetss_decrease_by_) || !defined(_di_f_fss_simple_packetss_resize_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_fss_simple_packet_h
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_resize(0, &set->objects);
+ f_status_t status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &set->objects.array, &set->objects.used, &set->objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &set->contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &set->contents.array, &set->contents.used, &set->contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
}
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_adjust(0, &set->objects);
+ f_status_t status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &set->objects.array, &set->objects.used, &set->objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &set->contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &set->contents.array, &set->contents.used, &set->contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_resize(0, &array[i].objects);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].objects.array, &array[i].objects.used, &array[i].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &array[i].contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &array[i].contents.array, &array[i].contents.used, &array[i].contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
} // for
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_adjust(0, &array[i].objects);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].objects.array, &array[i].objects.used, &array[i].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &array[i].contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &array[i].contents.array, &array[i].contents.used, &array[i].contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
} // for
}
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_resize(0, &array[i].array[j].objects);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].objects.array, &array[i].array[j].objects.used, &array[i].array[j].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &array[i].array[j].contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &array[i].array[j].contents.array, &array[i].array[j].contents.used, &array[i].array[j].contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
} // for
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_adjust(0, &array[i].array[j].objects);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].objects.array, &array[i].array[j].objects.used, &array[i].array[j].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &array[i].array[j].contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &array[i].array[j].contents.array, &array[i].array[j].contents.used, &array[i].array[j].contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
} // for
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_memory_arrays_resize().
*
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_set_delete_
extern f_status_t f_fss_set_delete(f_fss_set_t * const set);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_memory_arrays_adjust().
*
- * @see f_string_ranges_adjust
- * @see f_string_rangess_adjust()()
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
*/
#ifndef _di_f_fss_set_destroy_
extern f_status_t f_fss_set_destroy(f_fss_set_t * const set);
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_memory_arrays_resize().
*
* @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_sets_delete_callback_
extern f_status_t f_fss_sets_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_memory_arrays_resize().
*
- * @see f_memory_array_adjust()
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_sets_destroy_callback_
extern f_status_t f_fss_sets_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_memory_arrays_resize().
*
* @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_setss_delete_callback_
extern f_status_t f_fss_setss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_memory_arrays_resize().
*
- * @see f_memory_array_adjust()
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_setss_destroy_callback_
extern f_status_t f_fss_setss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_resize(0, &set_quote->objects);
+ f_status_t status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &set_quote->objects.array, &set_quote->objects.used, &set_quote->objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &set_quote->contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &set_quote->contents.array, &set_quote->contents.used, &set_quote->contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
status = f_memory_array_resize(0, sizeof(uint8_t), (void **) &set_quote->objects_quote.array, &set_quote->objects_quote.used, &set_quote->objects_quote.size);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_resize(0, sizeof(uint8_t), (void **) &set_quote->contents_quote.array, &set_quote->contents_quote.used, &set_quote->contents_quote.size, &f_uint8ss_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &set_quote->contents_quote.array, &set_quote->contents_quote.used, &set_quote->contents_quote.size, &f_uint8ss_delete_callback);
if (F_status_is_error(status)) return status;
}
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_adjust(0, &set_quote->objects);
+ f_status_t status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &set_quote->objects.array, &set_quote->objects.used, &set_quote->objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &set_quote->contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &set_quote->contents.array, &set_quote->contents.used, &set_quote->contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
status = f_memory_array_adjust(0, sizeof(uint8_t), (void **) &set_quote->objects_quote.array, &set_quote->objects_quote.used, &set_quote->objects_quote.size);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_adjust(0, sizeof(uint8_t), (void **) &set_quote->contents_quote.array, &set_quote->contents_quote.used, &set_quote->contents_quote.size, &f_uint8ss_destroy_callback);
+ status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &set_quote->contents_quote.array, &set_quote->contents_quote.used, &set_quote->contents_quote.size, &f_uint8ss_destroy_callback);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_resize(0, &array[i].objects);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].objects.array, &array[i].objects.used, &array[i].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &array[i].contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &array[i].contents.array, &array[i].contents.used, &array[i].contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
status = f_memory_array_resize(0, sizeof(uint8_t), (void **) &array[i].objects_quote.array, &array[i].objects_quote.used, &array[i].objects_quote.size);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_resize(0, sizeof(uint8_t), (void **) &array[i].contents_quote.array, &array[i].contents_quote.used, &array[i].contents_quote.size, &f_uint8ss_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &array[i].contents_quote.array, &array[i].contents_quote.used, &array[i].contents_quote.size, &f_uint8ss_delete_callback);
if (F_status_is_error(status)) return status;
} // for
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_adjust(0, &array[i].objects);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].objects.array, &array[i].objects.used, &array[i].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &array[i].contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &array[i].contents.array, &array[i].contents.used, &array[i].contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
status = f_memory_array_adjust(0, sizeof(uint8_t), (void **) &array[i].objects_quote.array, &array[i].objects_quote.used, &array[i].objects_quote.size);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_adjust(0, sizeof(uint8_t), (void **) &array[i].contents_quote.array, &array[i].contents_quote.used, &array[i].contents_quote.size, &f_uint8ss_destroy_callback);
+ status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &array[i].contents_quote.array, &array[i].contents_quote.used, &array[i].contents_quote.size, &f_uint8ss_destroy_callback);
if (F_status_is_error(status)) return status;
} // for
}
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_resize(0, &array[i].array[j].objects);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].objects.array, &array[i].array[j].objects.used, &array[i].array[j].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &array[i].array[j].contents);
+ status = f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &array[i].array[j].contents.array, &array[i].array[j].contents.used, &array[i].array[j].contents.size, &f_string_rangess_delete_callback);
if (F_status_is_error(status)) return status;
status = f_memory_array_resize(0, sizeof(uint8_t), (void **) &array[i].array[j].objects_quote.array, &array[i].array[j].objects_quote.used, &array[i].array[j].objects_quote.size);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_resize(0, sizeof(uint8_t), (void **) &array[i].array[j].contents_quote.array, &array[i].array[j].contents_quote.used, &array[i].array[j].contents_quote.size, &f_uint8ss_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_uint8s_t), (void **) &array[i].array[j].contents_quote.array, &array[i].array[j].contents_quote.used, &array[i].array[j].contents_quote.size, &f_uint8ss_delete_callback);
if (F_status_is_error(status)) return status;
} // for
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_adjust(0, &array[i].array[j].objects);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].objects.array, &array[i].array[j].objects.used, &array[i].array[j].objects.size);
if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &array[i].array[j].contents);
+ status = f_memory_arrays_adjust(0, sizeof(f_string_ranges_t), (void **) &array[i].array[j].contents.array, &array[i].array[j].contents.used, &array[i].array[j].contents.size, &f_string_rangess_destroy_callback);
if (F_status_is_error(status)) return status;
status = f_memory_array_adjust(0, sizeof(uint8_t), (void **) &array[i].array[j].objects_quote.array, &array[i].array[j].objects_quote.used, &array[i].array[j].objects_quote.size);
if (F_status_is_error(status)) return status;
- status = f_memory_arrays_adjust(0, sizeof(uint8_t), (void **) &array[i].array[j].contents_quote.array, &array[i].array[j].contents_quote.used, &array[i].array[j].contents_quote.size, &f_uint8ss_destroy_callback);
+ status = f_memory_arrays_adjust(0, sizeof(f_uint8s_t), (void **) &array[i].array[j].contents_quote.array, &array[i].array[j].contents_quote.used, &array[i].array[j].contents_quote.size, &f_uint8ss_destroy_callback);
if (F_status_is_error(status)) return status;
} // for
if (array[i].size) {
- status = f_memory_array_resize(0, sizeof(f_fss_set_quote_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ status = f_memory_array_adjust(0, sizeof(f_fss_set_quote_t), (void **) &array[i].array, &array[i].used, &array[i].size);
if (F_status_is_error(status)) return status;
}
} // for
*
* Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
*
* @see f_memory_array_resize()
* @see f_memory_arrays_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
*/
#ifndef _di_f_fss_set_quote_delete_
extern f_status_t f_fss_set_quote_delete(f_fss_set_quote_t * const set_quote);
*
* Errors (with error bit) from: f_memory_array_adjust().
* Errors (with error bit) from: f_memory_arrays_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
*
* @see f_memory_array_adjust()
* @see f_memory_arrays_adjust()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
*/
#ifndef _di_f_fss_set_quote_destroy_
extern f_status_t f_fss_set_quote_destroy(f_fss_set_quote_t * const set_quote);
*
* Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
*
* @see f_memory_array_resize()
* @see f_memory_arrays_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
*/
#ifndef _di_f_fss_set_quotes_delete_callback_
extern f_status_t f_fss_set_quotes_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* Errors (with error bit) from: f_memory_array_adjust().
* Errors (with error bit) from: f_memory_arrays_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
*
* @see f_memory_array_adjust()
* @see f_memory_arrays_adjust()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
*/
#ifndef _di_f_fss_set_quotes_destroy_callback_
extern f_status_t f_fss_set_quotes_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_memory_arrays_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- * Errors (with error bit) from: f_string_rangess_resize().
*
* @see f_memory_array_resize()
* @see f_memory_arrays_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
*/
#ifndef _di_f_fss_set_quotess_delete_callback_
extern f_status_t f_fss_set_quotess_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
*
* Errors (with error bit) from: f_memory_array_adjust().
* Errors (with error bit) from: f_memory_arrays_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- * Errors (with error bit) from: f_string_rangess_adjust().
*
* @see f_memory_array_adjust()
* @see f_memory_arrays_adjust()
- * @see f_string_ranges_adjust()
- * @see f_string_rangess_adjust()
*/
#ifndef _di_f_fss_set_quotess_destroy_callback_
extern f_status_t f_fss_set_quotess_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
#endif
#ifndef _di_f_fss_simple_packet_delete_
- f_status_t f_fss_simple_packet_delete(f_fss_simple_packet_t * const packet) {
+ f_status_t f_fss_simple_packet_delete(f_fss_simple_packet_t * const simple_packet) {
#ifndef _di_level_0_parameter_checking_
- if (!packet) return F_status_set_error(F_parameter);
+ if (!simple_packet) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return f_memory_array_resize(0, sizeof(f_char_t), (void **) &packet->payload.string, &packet->payload.used, &packet->payload.size);
+ {
+ const f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &simple_packet->payload.string, &simple_packet->payload.used, &simple_packet->payload.size);
+ if (F_status_is_error(status)) return status;
+ }
+
+ return F_okay;
}
#endif // _di_f_fss_simple_packet_delete_
#ifndef _di_f_fss_simple_packet_destroy_
- f_status_t f_fss_simple_packet_destroy(f_fss_simple_packet_t * const packet) {
+ f_status_t f_fss_simple_packet_destroy(f_fss_simple_packet_t * const simple_packet) {
#ifndef _di_level_0_parameter_checking_
- if (!packet) return F_status_set_error(F_parameter);
+ if (!simple_packet) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return f_memory_array_adjust(0, sizeof(f_char_t), (void **) &packet->payload.string, &packet->payload.used, &packet->payload.size);
+ {
+ const f_status_t status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &simple_packet->payload.string, &simple_packet->payload.used, &simple_packet->payload.size);
+ if (F_status_is_error(status)) return status;
+ }
+
+ return F_okay;
}
#endif // _di_f_fss_simple_packet_destroy_
#endif // _di_f_fss_simple_packet_rangess_t_
/**
- * Delete a simple packet.
+ * Delete a FSS-000F (Simple Packet).
*
- * @param packet
- * The simple packet to delete.
+ * @param simple_packet
+ * The FSS-000F (Simple Packet) to delete.
*
* @return
* F_okay on success.
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_memory_arrays_resize().
*
* @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_f_fss_simple_packet_delete_
- extern f_status_t f_fss_simple_packet_delete(f_fss_simple_packet_t * const packet);
+ extern f_status_t f_fss_simple_packet_delete(f_fss_simple_packet_t * const simple_packet);
#endif // _di_f_fss_simple_packet_delete_
/**
- * Destroy a simple packet.
+ * Destroy a FSS-000F (Simple Packet).
*
- * @param packet
- * The simple packet to destroy.
+ * @param simple_packet
+ * The FSS-000F (Simple Packet) to destroy.
*
* @return
* F_okay on success.
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_memory_arrays_adjust().
*
* @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
*/
#ifndef _di_f_fss_simple_packet_destroy_
- extern f_status_t f_fss_simple_packet_destroy(f_fss_simple_packet_t * const packet);
+ extern f_status_t f_fss_simple_packet_destroy(f_fss_simple_packet_t * const simple_packet);
#endif // _di_f_fss_simple_packet_destroy_
/**
build_libraries -lc
build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf
-build_sources_library fss.c fss/common.c fss/item.c fss/named.c fss/nest.c fss/quote.c fss/set.c fss/set_quote.c fss/simple_packet.c ../../tests/unit/c/mock-fss.c
+build_sources_library fss.c fss/common.c fss/item.c fss/named.c fss/nest.c fss/quote.c fss/set.c fss/set_quote.c fss/simple_packet.c
+build_sources_library ../../tests/unit/c/mock-fss.c
build_sources_headers fss.h fss/common.h fss/item.h fss/named.h fss/nest.h fss/quote.h fss/set.h fss/set_quote.h fss/simple_packet.h
flags -Wl,--wrap=f_memory_array_resize
flags -Wl,--wrap=f_memory_arrays_adjust
flags -Wl,--wrap=f_memory_arrays_resize
-flags -Wl,--wrap=f_string_ranges_adjust
-flags -Wl,--wrap=f_string_ranges_resize
-flags -Wl,--wrap=f_string_rangess_adjust
-flags -Wl,--wrap=f_string_rangess_resize
build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf -lf_fss
build_sources_program test-fss-apply_delimit.c test-fss-apply_delimit_range.c test-fss-count_lines.c test-fss-count_lines_range.c test-fss-fail_utf.c test-fss-fail_utf_to_false.c test-fss-is_combining.c test-fss-is_graph.c test-fss-is_space.c test-fss-is_zero_width.c test-fss-seek_to_eol.c test-fss-skip_past_delimit.c test-fss-skip_past_space.c
-
-build_sources_program test-fss-items_destroy_callback.c test-fss-items_delete_callback.c test-fss-itemss_destroy_callback.c test-fss-itemss_delete_callback.c
-build_sources_program test-fss-nameds_destroy_callback.c test-fss-nameds_delete_callback.c test-fss-namedss_destroy_callback.c test-fss-namedss_delete_callback.c
-build_sources_program test-fss-nests_destroy_callback.c test-fss-nests_delete_callback.c test-fss-nestss_destroy_callback.c test-fss-nestss_delete_callback.c
-build_sources_program test-fss-sets_destroy_callback.c test-fss-sets_delete_callback.c test-fss-setss_destroy_callback.c test-fss-setss_delete_callback.c
-build_sources_program test-fss-set_quotes_destroy_callback.c test-fss-set_quotes_delete_callback.c test-fss-set_quotess_destroy_callback.c test-fss-set_quotess_delete_callback.c
-build_sources_program test-fss-simple_packets_destroy_callback.c test-fss-simple_packets_delete_callback.c test-fss-simple_packetss_destroy_callback.c test-fss-simple_packetss_delete_callback.c
+build_sources_program test-fss-item_delete.c test-fss-item_destroy.c
+build_sources_program test-fss-items_delete_callback.c test-fss-items_destroy_callback.c test-fss-itemss_delete_callback.c test-fss-itemss_destroy_callback.c
+build_sources_program test-fss-named_delete.c test-fss-named_destroy.c
+build_sources_program test-fss-nameds_delete_callback.c test-fss-nameds_destroy_callback.c test-fss-namedss_delete_callback.c test-fss-namedss_destroy_callback.c
+build_sources_program test-fss-nest_delete.c test-fss-nest_destroy.c
+build_sources_program test-fss-nests_delete_callback.c test-fss-nests_destroy_callback.c test-fss-nestss_delete_callback.c test-fss-nestss_destroy_callback.c
+build_sources_program test-fss-set_delete.c test-fss-set_destroy.c
+build_sources_program test-fss-sets_delete_callback.c test-fss-sets_destroy_callback.c test-fss-setss_delete_callback.c test-fss-setss_destroy_callback.c
+build_sources_program test-fss-set_quote_delete.c test-fss-set_quote_destroy.c
+build_sources_program test-fss-set_quotes_delete_callback.c test-fss-set_quotes_destroy_callback.c test-fss-set_quotess_delete_callback.c test-fss-set_quotess_destroy_callback.c
+build_sources_program test-fss-simple_packet_delete.c test-fss-simple_packet_destroy.c
+build_sources_program test-fss-simple_packets_delete_callback.c test-fss-simple_packets_destroy_callback.c test-fss-simple_packetss_delete_callback.c test-fss-simple_packetss_destroy_callback.c
build_sources_program test-fss.c
return mock_type(f_status_t);
}
-f_status_t __wrap_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
-
- if (mock_unwrap) {
- return __real_f_string_ranges_adjust(length, structure);
- }
-
- if (!structure) return F_status_set_error(F_parameter_not);
-
- const bool failure = mock_type(bool);
-
- if (failure) return mock_type(f_status_t);
-
- structure->size = length;
-
- return mock_type(f_status_t);
-}
-
-f_status_t __wrap_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
-
- if (mock_unwrap) {
- return __real_f_string_ranges_resize(length, structure);
- }
-
- if (!structure) return F_status_set_error(F_parameter_not);
-
- const bool failure = mock_type(bool);
-
- if (failure) return mock_type(f_status_t);
-
- structure->size = length;
-
- return mock_type(f_status_t);
-}
-
-f_status_t __wrap_f_string_rangess_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
-
- if (mock_unwrap) {
- return __real_f_string_rangess_adjust(length, structure);
- }
-
- if (!structure) return F_status_set_error(F_parameter_not);
-
- const bool failure = mock_type(bool);
-
- if (failure) return mock_type(f_status_t);
-
- structure->size = length;
-
- return mock_type(f_status_t);
-}
-
-f_status_t __wrap_f_string_rangess_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
-
- if (mock_unwrap) {
- return __real_f_string_rangess_resize(length, structure);
- }
-
- if (!structure) return F_status_set_error(F_parameter_not);
-
- const bool failure = mock_type(bool);
-
- if (failure) return mock_type(f_status_t);
-
- structure->size = length;
-
- return mock_type(f_status_t);
-}
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t __real_f_memory_arrays_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size, f_status_t (*callback)(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array));
extern f_status_t __real_f_memory_arrays_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size, f_status_t (*callback)(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array));
-extern f_status_t __real_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __real_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __real_f_string_rangess_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __real_f_string_rangess_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-
extern f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
extern f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
extern f_status_t __wrap_f_memory_arrays_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size, f_status_t (*callback)(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array));
extern f_status_t __wrap_f_memory_arrays_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size, f_status_t (*callback)(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array));
-extern f_status_t __wrap_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __wrap_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __wrap_f_string_rangess_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __wrap_f_string_rangess_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-
//extern long __wrap_sysconf(int name);
#ifdef __cplusplus
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-item_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_item_delete__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_item_t data = f_fss_item_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_item_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_item_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_item_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_item_delete__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_item_t data = f_fss_item_t_initialize;
+
+ {
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.content.array, &data.content.used, &data.content.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_item_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.content.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__item_delete
+#define _TEST__F_fss__item_delete
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_item_delete()
+ */
+extern void test__f_fss_item_delete__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_item_delete()
+ */
+extern void test__f_fss_item_delete__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_item_delete()
+ */
+extern void test__f_fss_item_delete__works(void **state);
+
+#endif // _TEST__F_fss__item_delete
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-item_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_item_destroy__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_item_t data = f_fss_item_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_item_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_item_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_item_destroy(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_item_destroy__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_item_t data = f_fss_item_t_initialize;
+
+ {
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.content.array, &data.content.used, &data.content.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_item_destroy(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.content.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__item_destroy
+#define _TEST__F_fss__item_destroy
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_item_destroy()
+ */
+extern void test__f_fss_item_destroy__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_item_destroy()
+ */
+extern void test__f_fss_item_destroy__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_item_destroy()
+ */
+extern void test__f_fss_item_destroy__works(void **state);
+
+#endif // _TEST__F_fss__item_destroy
f_fss_items_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_items_delete_callback(0, 1, (void *) datas_array);
void test__f_fss_items_delete_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_item_t data = f_fss_item_t_initialize;
- f_fss_item_t data_array[] = { data };
- f_fss_items_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_items_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_items_t datas = f_fss_items_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_item_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].content.array, &datas.array[0].content.used, &datas.array[0].content.size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_fss_items_delete_callback(0, length, (void *) datas_array);
+ {
+ const f_status_t status = f_fss_items_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].content.size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_items_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_items_destroy_callback(0, 1, (void *) datas_array);
void test__f_fss_items_destroy_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_item_t data = f_fss_item_t_initialize;
- f_fss_item_t data_array[] = { data };
- f_fss_items_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_items_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_items_t datas = f_fss_items_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_item_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].content.array, &datas.array[0].content.used, &datas.array[0].content.size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_fss_items_destroy_callback(0, length, (void *) datas_array);
+ {
+ const f_status_t status = f_fss_items_destroy_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].content.size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_items_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_itemss_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
void test__f_fss_itemss_delete_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].content);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].content.array, &datass.array[0].array[0].content.used, &datass.array[0].array[0].content.size);
assert_int_equal(status, F_okay);
}
f_fss_items_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_itemss_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
void test__f_fss_itemss_destroy_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
f_fss_itemss_t datass = f_fss_itemss_t_initialize;
{
- f_status_t status = f_memory_array_adjust(length, sizeof(f_fss_items_t), (void **) &datass.array, &datass.used, &datass.size);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_items_t), (void **) &datass.array, &datass.used, &datass.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_item_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].content);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].content.array, &datass.array[0].array[0].content.used, &datass.array[0].array[0].content.size);
assert_int_equal(status, F_okay);
}
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-named_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_named_delete__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_named_t data = f_fss_named_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_named_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_named_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
+
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_named_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_named_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_named_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_named_delete__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_named_t data = f_fss_named_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.objects.array, &data.objects.used, &data.objects.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &data.contents.array, &data.contents.used, &data.contents.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.contents.array[0].array, &data.contents.array[0].used, &data.contents.array[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &data.quotess.array, &data.quotess.used, &data.quotess.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &data.quotess.array[0].array, &data.quotess.array[0].used, &data.quotess.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_named_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.objects.size, 0);
+ assert_int_equal(data.contents.size, 0);
+ assert_int_equal(data.quotess.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__named_delete
+#define _TEST__F_fss__named_delete
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_named_delete()
+ */
+extern void test__f_fss_named_delete__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_named_delete()
+ */
+extern void test__f_fss_named_delete__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_named_delete()
+ */
+extern void test__f_fss_named_delete__works(void **state);
+
+#endif // _TEST__F_fss__named_delete
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-named_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_named_destroy__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_named_t data = f_fss_named_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_named_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_named_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
+
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_named_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_named_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_named_destroy(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_named_destroy__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_named_t data = f_fss_named_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.objects.array, &data.objects.used, &data.objects.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &data.contents.array, &data.contents.used, &data.contents.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.contents.array[0].array, &data.contents.array[0].used, &data.contents.array[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &data.quotess.array, &data.quotess.used, &data.quotess.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &data.quotess.array[0].array, &data.quotess.array[0].used, &data.quotess.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_named_destroy(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.objects.size, 0);
+ assert_int_equal(data.contents.size, 0);
+ assert_int_equal(data.quotess.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__named_destroy
+#define _TEST__F_fss__named_destroy
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_named_destroy()
+ */
+extern void test__f_fss_named_destroy__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_named_destroy()
+ */
+extern void test__f_fss_named_destroy__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_named_destroy()
+ */
+extern void test__f_fss_named_destroy__works(void **state);
+
+#endif // _TEST__F_fss__named_destroy
f_fss_nameds_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, true);
- will_return(__wrap_f_string_rangess_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
will_return(__wrap_f_memory_arrays_resize, true);
will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
void test__f_fss_nameds_delete_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_named_t data = f_fss_named_t_initialize;
- f_fss_named_t data_array[] = { data };
- f_fss_nameds_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_nameds_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_nameds_t datas = f_fss_nameds_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_named_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].objects.array, &datas.array[0].objects.used, &datas.array[0].objects.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datas.array[0].contents.array, &datas.array[0].contents.used, &datas.array[0].contents.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_arrays_resize, false);
- will_return(__wrap_f_memory_arrays_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].contents.array[0].array, &datas.array[0].contents.array[0].used, &datas.array[0].contents.array[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datas.array[0].quotess.array, &datas.array[0].quotess.used, &datas.array[0].quotess.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datas.array[0].quotess.array[0].array, &datas.array[0].quotess.array[0].used, &datas.array[0].quotess.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_fss_nameds_delete_callback(0, length, (void *) datas_array);
+ {
+ const f_status_t status = f_fss_nameds_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].objects.size, 0);
+ assert_int_equal(datas.array[0].contents.size, 0);
+ assert_int_equal(datas.array[0].quotess.size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_nameds_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, true);
- will_return(__wrap_f_string_rangess_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
will_return(__wrap_f_memory_arrays_adjust, true);
will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
void test__f_fss_nameds_destroy_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_named_t data = f_fss_named_t_initialize;
- f_fss_named_t data_array[] = { data };
- f_fss_nameds_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_nameds_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_nameds_t datas = f_fss_nameds_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_named_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].objects.array, &datas.array[0].objects.used, &datas.array[0].objects.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datas.array[0].contents.array, &datas.array[0].contents.used, &datas.array[0].contents.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_arrays_adjust, false);
- will_return(__wrap_f_memory_arrays_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].contents.array[0].array, &datas.array[0].contents.array[0].used, &datas.array[0].contents.array[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datas.array[0].quotess.array, &datas.array[0].quotess.used, &datas.array[0].quotess.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datas.array[0].quotess.array[0].array, &datas.array[0].quotess.array[0].used, &datas.array[0].quotess.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_fss_nameds_destroy_callback(0, length, (void *) datas_array);
+ {
+ const f_status_t status = f_fss_nameds_destroy_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].objects.size, 0);
+ assert_int_equal(datas.array[0].contents.size, 0);
+ assert_int_equal(datas.array[0].quotess.size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_nameds_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_namedss_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, true);
- will_return(__wrap_f_string_rangess_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_namedss_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
will_return(__wrap_f_memory_arrays_resize, true);
will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
void test__f_fss_namedss_delete_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
status = f_memory_array_resize(1, sizeof(f_fss_named_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].objects);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].objects.array, &datass.array[0].array[0].objects.used, &datass.array[0].array[0].objects.size);
assert_int_equal(status, F_okay);
- status = f_string_rangess_resize(1, &datass.array[0].array[0].contents);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datass.array[0].array[0].contents.array, &datass.array[0].array[0].contents.used, &datass.array[0].array[0].contents.size);
assert_int_equal(status, F_okay);
- status = f_memory_arrays_resize(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].quotess.array, &datass.array[0].array[0].quotess.used, &datass.array[0].array[0].quotess.size, &f_uint8ss_delete_callback);
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].quotess.array, &datass.array[0].array[0].quotess.used, &datass.array[0].array[0].quotess.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datass.array[0].array[0].quotess.array[0].array, &datass.array[0].array[0].quotess.array[0].used, &datass.array[0].array[0].quotess.array[0].size);
f_fss_nameds_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_namedss_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, true);
- will_return(__wrap_f_string_rangess_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_namedss_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
will_return(__wrap_f_memory_arrays_adjust, true);
will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
void test__f_fss_namedss_destroy_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
f_fss_namedss_t datass = f_fss_namedss_t_initialize;
{
- f_status_t status = f_memory_array_adjust(length, sizeof(f_fss_nameds_t), (void **) &datass.array, &datass.used, &datass.size);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_nameds_t), (void **) &datass.array, &datass.used, &datass.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_named_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_named_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].objects);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].objects.array, &datass.array[0].array[0].objects.used, &datass.array[0].array[0].objects.size);
assert_int_equal(status, F_okay);
- status = f_string_rangess_adjust(1, &datass.array[0].array[0].contents);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datass.array[0].array[0].contents.array, &datass.array[0].array[0].contents.used, &datass.array[0].array[0].contents.size);
assert_int_equal(status, F_okay);
- status = f_memory_arrays_adjust(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].quotess.array, &datass.array[0].array[0].quotess.used, &datass.array[0].array[0].quotess.size, &f_uint8ss_delete_callback);
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].quotess.array, &datass.array[0].array[0].quotess.used, &datass.array[0].array[0].quotess.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(uint8_t), (void **) &datass.array[0].array[0].quotess.array[0].array, &datass.array[0].array[0].quotess.array[0].used, &datass.array[0].array[0].quotess.array[0].size);
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datass.array[0].array[0].quotess.array[0].array, &datass.array[0].array[0].quotess.array[0].used, &datass.array[0].array[0].quotess.array[0].size);
assert_int_equal(status, F_okay);
}
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-nest_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_nest_delete__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_item_t item = f_fss_item_t_initialize;
+ f_fss_item_t item_array[] = { item };
+ f_fss_items_t items = { .array = item_array, .used = 0, .size = 1 };
+ f_fss_items_t items_array[] = { items };
+ f_fss_nest_t data = { .depth = items_array, .used = 0, .size = 1 };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_nest_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_nest_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_nest_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_nest_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_nest_delete__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_nest_t data = f_fss_nest_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_items_t), (void **) &data.depth, &data.used, &data.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &data.depth[0].array, &data.depth[0].used, &data.depth[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.depth[0].array[0].content.array, &data.depth[0].array[0].content.used, &data.depth[0].array[0].content.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_nest_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__nest_delete
+#define _TEST__F_fss__nest_delete
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_nest_delete()
+ */
+extern void test__f_fss_nest_delete__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_nest_delete()
+ */
+extern void test__f_fss_nest_delete__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_nest_delete()
+ */
+extern void test__f_fss_nest_delete__works(void **state);
+
+#endif // _TEST__F_fss__nest_delete
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-nest_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_nest_destroy__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_item_t item = f_fss_item_t_initialize;
+ f_fss_item_t item_array[] = { item };
+ f_fss_items_t items = { .array = item_array, .used = 0, .size = 1 };
+ f_fss_items_t items_array[] = { items };
+ f_fss_nest_t data = { .depth = items_array, .used = 0, .size = 1 };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_nest_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_nest_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_nest_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_nest_destroy(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_nest_destroy__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_nest_t data = f_fss_nest_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_items_t), (void **) &data.depth, &data.used, &data.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &data.depth[0].array, &data.depth[0].used, &data.depth[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.depth[0].array[0].content.array, &data.depth[0].array[0].content.used, &data.depth[0].array[0].content.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_nest_destroy(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__nest_destroy
+#define _TEST__F_fss__nest_destroy
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_nest_destroy()
+ */
+extern void test__f_fss_nest_destroy__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_nest_destroy()
+ */
+extern void test__f_fss_nest_destroy__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_nest_destroy()
+ */
+extern void test__f_fss_nest_destroy__works(void **state);
+
+#endif // _TEST__F_fss__nest_destroy
f_fss_nest_t data_array[] = { data };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_nests_delete_callback(0, 1, (void *) data_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
void test__f_fss_nests_delete_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_item_t item = f_fss_item_t_initialize;
- f_fss_item_t item_array[] = { item };
- f_fss_items_t items = { .array = item_array, .used = 1, .size = 1 };
- f_fss_items_t items_array[] = { items };
- f_fss_nest_t data = { .depth = items_array, .used = 1, .size = 1 };
- f_fss_nest_t data_array[] = { data };
const f_number_unsigned_t length = 1;
+ f_fss_nests_t datas = f_fss_nests_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_nest_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_resize, false);
- will_return(__wrap_f_memory_array_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_fss_items_t), (void **) &datas.array[0].depth, &datas.array[0].used, &datas.array[0].size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_resize, false);
- will_return(__wrap_f_memory_array_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &datas.array[0].depth[0].array, &datas.array[0].depth[0].used, &datas.array[0].depth[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].depth[0].array[0].content.array, &datas.array[0].depth[0].array[0].content.used, &datas.array[0].depth[0].array[0].content.size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_fss_nests_delete_callback(0, length, (void *) data_array);
+ {
+ const f_status_t status = f_fss_nests_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_nest_t data_array[] = { data };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_nests_destroy_callback(0, 1, (void *) data_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
void test__f_fss_nests_destroy_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_item_t item = f_fss_item_t_initialize;
- f_fss_item_t item_array[] = { item };
- f_fss_items_t items = { .array = item_array, .used = 1, .size = 1 };
- f_fss_items_t items_array[] = { items };
- f_fss_nest_t data = { .depth = items_array, .used = 1, .size = 1 };
- f_fss_nest_t data_array[] = { data };
const f_number_unsigned_t length = 1;
+ f_fss_nests_t datas = f_fss_nests_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_nest_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_adjust, false);
- will_return(__wrap_f_memory_array_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_fss_items_t), (void **) &datas.array[0].depth, &datas.array[0].used, &datas.array[0].size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_adjust, false);
- will_return(__wrap_f_memory_array_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &datas.array[0].depth[0].array, &datas.array[0].depth[0].used, &datas.array[0].depth[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].depth[0].array[0].content.array, &datas.array[0].depth[0].array[0].content.used, &datas.array[0].depth[0].array[0].content.size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_fss_nests_destroy_callback(0, length, (void *) data_array);
+ {
+ const f_status_t status = f_fss_nests_destroy_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_nests_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_nestss_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
void test__f_fss_nestss_delete_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &datass.array[0].array[0].depth[0].array, &datass.array[0].array[0].depth[0].used, &datass.array[0].array[0].depth[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].depth[0].array[0].content);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].depth[0].array[0].content.array, &datass.array[0].array[0].depth[0].array[0].content.used, &datass.array[0].array[0].depth[0].array[0].content.size);
assert_int_equal(status, F_okay);
}
f_fss_nests_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_nestss_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
void test__f_fss_nestss_destroy_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
f_fss_nestss_t datass = f_fss_nestss_t_initialize;
{
- f_status_t status = f_memory_array_adjust(length, sizeof(f_fss_nests_t), (void **) &datass.array, &datass.used, &datass.size);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_nests_t), (void **) &datass.array, &datass.used, &datass.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_nest_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_nest_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_items_t), (void **) &datass.array[0].array[0].depth, &datass.array[0].array[0].used, &datass.array[0].array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_items_t), (void **) &datass.array[0].array[0].depth, &datass.array[0].array[0].used, &datass.array[0].array[0].size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_item_t), (void **) &datass.array[0].array[0].depth[0].array, &datass.array[0].array[0].depth[0].used, &datass.array[0].array[0].depth[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_item_t), (void **) &datass.array[0].array[0].depth[0].array, &datass.array[0].array[0].depth[0].used, &datass.array[0].array[0].depth[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].depth[0].array[0].content);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].depth[0].array[0].content.array, &datass.array[0].array[0].depth[0].array[0].content.used, &datass.array[0].array[0].depth[0].array[0].content.size);
assert_int_equal(status, F_okay);
}
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-set_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_set_delete__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_set_t data = f_fss_set_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_set_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_set_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_set_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_set_delete__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_set_t data = f_fss_set_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.objects.array, &data.objects.used, &data.objects.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &data.contents.array, &data.contents.used, &data.contents.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.contents.array[0].array, &data.contents.array[0].used, &data.contents.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_set_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.objects.size, 0);
+ assert_int_equal(data.contents.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__set_delete
+#define _TEST__F_fss__set_delete
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_set_delete()
+ */
+extern void test__f_fss_set_delete__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_set_delete()
+ */
+extern void test__f_fss_set_delete__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_set_delete()
+ */
+extern void test__f_fss_set_delete__works(void **state);
+
+#endif // _TEST__F_fss__set_delete
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-set_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_set_destroy__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_set_t data = f_fss_set_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_set_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_set_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_set_destroy(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_set_destroy__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_set_t data = f_fss_set_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.objects.array, &data.objects.used, &data.objects.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &data.contents.array, &data.contents.used, &data.contents.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.contents.array[0].array, &data.contents.array[0].used, &data.contents.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_set_destroy(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.objects.size, 0);
+ assert_int_equal(data.contents.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__set_destroy
+#define _TEST__F_fss__set_destroy
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_set_destroy()
+ */
+extern void test__f_fss_set_destroy__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_set_destroy()
+ */
+extern void test__f_fss_set_destroy__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_set_destroy()
+ */
+extern void test__f_fss_set_destroy__works(void **state);
+
+#endif // _TEST__F_fss__set_destroy
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-set_quote_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_set_quote_delete__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_set_quote_t data = f_fss_set_quote_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_set_quote_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_set_quote_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_set_quote_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_set_quote_delete__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_set_quote_t data = f_fss_set_quote_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.objects.array, &data.objects.used, &data.objects.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &data.contents.array, &data.contents.used, &data.contents.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.contents.array[0].array, &data.contents.array[0].used, &data.contents.array[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &data.objects_quote.array, &data.objects_quote.used, &data.objects_quote.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &data.contents_quote.array, &data.contents_quote.used, &data.contents_quote.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &data.contents_quote.array[0].array, &data.contents_quote.array[0].used, &data.contents_quote.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_set_quote_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.objects.size, 0);
+ assert_int_equal(data.contents.size, 0);
+ assert_int_equal(data.objects_quote.size, 0);
+ assert_int_equal(data.contents_quote.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__set_quote_delete
+#define _TEST__F_fss__set_quote_delete
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_set_quote_delete()
+ */
+extern void test__f_fss_set_quote_delete__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_set_quote_delete()
+ */
+extern void test__f_fss_set_quote_delete__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_set_quote_delete()
+ */
+extern void test__f_fss_set_quote_delete__works(void **state);
+
+#endif // _TEST__F_fss__set_quote_delete
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-set_quote_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_set_quote_destroy__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_set_quote_t data = f_fss_set_quote_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_set_quote_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_set_quote_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_set_quote_destroy(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_set_quote_destroy__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_set_quote_t data = f_fss_set_quote_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &data.objects.array, &data.objects.used, &data.objects.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &data.contents.array, &data.contents.used, &data.contents.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &data.contents.array[0].array, &data.contents.array[0].used, &data.contents.array[0].size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &data.objects_quote.array, &data.objects_quote.used, &data.objects_quote.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &data.contents_quote.array, &data.contents_quote.used, &data.contents_quote.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &data.contents_quote.array[0].array, &data.contents_quote.array[0].used, &data.contents_quote.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_set_quote_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.objects.size, 0);
+ assert_int_equal(data.contents.size, 0);
+ assert_int_equal(data.objects_quote.size, 0);
+ assert_int_equal(data.contents_quote.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__set_quote_destroy
+#define _TEST__F_fss__set_quote_destroy
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_set_quote_destroy()
+ */
+extern void test__f_fss_set_quote_destroy__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_set_quote_destroy()
+ */
+extern void test__f_fss_set_quote_destroy__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_set_quote_destroy()
+ */
+extern void test__f_fss_set_quote_destroy__works(void **state);
+
+#endif // _TEST__F_fss__set_quote_destroy
f_fss_set_quotes_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, true);
- will_return(__wrap_f_string_rangess_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
void test__f_fss_set_quotes_delete_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_set_quote_t data = f_fss_set_quote_t_initialize;
- f_fss_set_quote_t data_array[] = { data };
- f_fss_set_quotes_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_set_quotes_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_set_quotes_t datas = f_fss_set_quotes_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_set_quote_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].objects.array, &datas.array[0].objects.used, &datas.array[0].objects.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_resize, false);
- will_return(__wrap_f_memory_array_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datas.array[0].contents.array, &datas.array[0].contents.used, &datas.array[0].contents.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_arrays_resize, false);
- will_return(__wrap_f_memory_arrays_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].contents.array[0].array, &datas.array[0].contents.array[0].used, &datas.array[0].contents.array[0].size);
+ assert_int_equal(status, F_okay);
- const f_status_t status = f_fss_set_quotes_delete_callback(0, length, (void *) datas_array);
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datas.array[0].objects_quote.array, &datas.array[0].objects_quote.used, &datas.array[0].objects_quote.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datas.array[0].contents_quote.array, &datas.array[0].contents_quote.used, &datas.array[0].contents_quote.size);
+ assert_int_equal(status, F_okay);
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datas.array[0].contents_quote.array[0].array, &datas.array[0].contents_quote.array[0].used, &datas.array[0].contents_quote.array[0].size);
assert_int_equal(status, F_okay);
}
+
+ {
+ const f_status_t status = f_fss_set_quotes_delete_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].objects.size, 0);
+ assert_int_equal(datas.array[0].contents.size, 0);
+ assert_int_equal(datas.array[0].objects_quote.size, 0);
+ assert_int_equal(datas.array[0].contents_quote.size, 0);
+ }
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_set_quotes_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, true);
- will_return(__wrap_f_string_rangess_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
void test__f_fss_set_quotes_destroy_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_set_quote_t data = f_fss_set_quote_t_initialize;
- f_fss_set_quote_t data_array[] = { data };
- f_fss_set_quotes_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_set_quotes_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_set_quotes_t datas = f_fss_set_quotes_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_set_quote_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].objects.array, &datas.array[0].objects.used, &datas.array[0].objects.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_adjust, false);
- will_return(__wrap_f_memory_array_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datas.array[0].contents.array, &datas.array[0].contents.used, &datas.array[0].contents.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_arrays_adjust, false);
- will_return(__wrap_f_memory_arrays_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].contents.array[0].array, &datas.array[0].contents.array[0].used, &datas.array[0].contents.array[0].size);
+ assert_int_equal(status, F_okay);
- const f_status_t status = f_fss_set_quotes_destroy_callback(0, length, (void *) datas_array);
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datas.array[0].objects_quote.array, &datas.array[0].objects_quote.used, &datas.array[0].objects_quote.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datas.array[0].contents_quote.array, &datas.array[0].contents_quote.used, &datas.array[0].contents_quote.size);
+ assert_int_equal(status, F_okay);
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datas.array[0].contents_quote.array[0].array, &datas.array[0].contents_quote.array[0].used, &datas.array[0].contents_quote.array[0].size);
assert_int_equal(status, F_okay);
}
+
+ {
+ const f_status_t status = f_fss_set_quotes_destroy_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].objects.size, 0);
+ assert_int_equal(datas.array[0].contents.size, 0);
+ assert_int_equal(datas.array[0].objects_quote.size, 0);
+ assert_int_equal(datas.array[0].contents_quote.size, 0);
+ }
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_set_quotes_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotess_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, true);
- will_return(__wrap_f_string_rangess_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotess_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ will_return(__wrap_f_memory_arrays_resize, false);
+ will_return(__wrap_f_memory_arrays_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
void test__f_fss_set_quotess_delete_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
status = f_memory_array_resize(1, sizeof(f_fss_set_quote_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].objects);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].objects.array, &datass.array[0].array[0].objects.used, &datass.array[0].array[0].objects.size);
assert_int_equal(status, F_okay);
- status = f_string_rangess_resize(1, &datass.array[0].array[0].contents);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].contents.array, &datass.array[0].array[0].contents.used, &datass.array[0].array[0].contents.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datass.array[0].array[0].objects_quote.array, &datass.array[0].array[0].objects_quote.used, &datass.array[0].array[0].objects_quote.size);
assert_int_equal(status, F_okay);
- status = f_memory_arrays_adjust(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].contents_quote.array, &datass.array[0].array[0].contents_quote.used, &datass.array[0].array[0].contents_quote.size, &f_uint8ss_destroy_callback);
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].contents_quote.array, &datass.array[0].array[0].contents_quote.used, &datass.array[0].array[0].contents_quote.size);
assert_int_equal(status, F_okay);
}
f_fss_set_quotes_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotess_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, true);
- will_return(__wrap_f_string_rangess_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_set_quotess_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ will_return(__wrap_f_memory_arrays_adjust, false);
+ will_return(__wrap_f_memory_arrays_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
void test__f_fss_set_quotess_destroy_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
f_fss_set_quotess_t datass = f_fss_set_quotess_t_initialize;
{
- f_status_t status = f_memory_array_adjust(length, sizeof(f_fss_set_quotes_t), (void **) &datass.array, &datass.used, &datass.size);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_set_quotes_t), (void **) &datass.array, &datass.used, &datass.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_set_quote_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_set_quote_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].objects);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].objects.array, &datass.array[0].array[0].objects.used, &datass.array[0].array[0].objects.size);
assert_int_equal(status, F_okay);
- status = f_string_rangess_adjust(1, &datass.array[0].array[0].contents);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datass.array[0].array[0].contents.array, &datass.array[0].array[0].contents.used, &datass.array[0].array[0].contents.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(uint8_t), (void **) &datass.array[0].array[0].objects_quote.array, &datass.array[0].array[0].objects_quote.used, &datass.array[0].array[0].objects_quote.size);
+ status = f_memory_array_resize(1, sizeof(uint8_t), (void **) &datass.array[0].array[0].objects_quote.array, &datass.array[0].array[0].objects_quote.used, &datass.array[0].array[0].objects_quote.size);
assert_int_equal(status, F_okay);
- status = f_memory_arrays_adjust(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].contents_quote.array, &datass.array[0].array[0].contents_quote.used, &datass.array[0].array[0].contents_quote.size, &f_uint8ss_destroy_callback);
+ status = f_memory_array_resize(1, sizeof(f_uint8s_t), (void **) &datass.array[0].array[0].contents_quote.array, &datass.array[0].array[0].contents_quote.used, &datass.array[0].array[0].contents_quote.size);
assert_int_equal(status, F_okay);
}
f_fss_sets_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_sets_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, true);
- will_return(__wrap_f_string_rangess_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_sets_delete_callback(0, 1, (void *) datas_array);
void test__f_fss_sets_delete_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_set_t data = f_fss_set_t_initialize;
- f_fss_set_t data_array[] = { data };
- f_fss_sets_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_sets_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_sets_t datas = f_fss_sets_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_set_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_rangess_resize, false);
- will_return(__wrap_f_string_rangess_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].objects.array, &datas.array[0].objects.used, &datas.array[0].objects.size);
+ assert_int_equal(status, F_okay);
- const f_status_t status = f_fss_sets_delete_callback(0, length, (void *) datas_array);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datas.array[0].contents.array, &datas.array[0].contents.used, &datas.array[0].contents.size);
+ assert_int_equal(status, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].contents.array[0].array, &datas.array[0].contents.array[0].used, &datas.array[0].contents.array[0].size);
assert_int_equal(status, F_okay);
}
+
+ {
+ const f_status_t status = f_fss_sets_delete_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].objects.size, 0);
+ assert_int_equal(datas.array[0].contents.size, 0);
+ }
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_sets_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_sets_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, true);
- will_return(__wrap_f_string_rangess_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_sets_destroy_callback(0, 1, (void *) datas_array);
void test__f_fss_sets_destroy_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_fss_set_t data = f_fss_set_t_initialize;
- f_fss_set_t data_array[] = { data };
- f_fss_sets_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_fss_sets_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_fss_sets_t datas = f_fss_sets_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_set_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_rangess_adjust, false);
- will_return(__wrap_f_string_rangess_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].objects.array, &datas.array[0].objects.used, &datas.array[0].objects.size);
+ assert_int_equal(status, F_okay);
- const f_status_t status = f_fss_sets_destroy_callback(0, length, (void *) datas_array);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datas.array[0].contents.array, &datas.array[0].contents.used, &datas.array[0].contents.size);
+ assert_int_equal(status, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].contents.array[0].array, &datas.array[0].contents.array[0].used, &datas.array[0].contents.array[0].size);
assert_int_equal(status, F_okay);
}
+
+ {
+ const f_status_t status = f_fss_sets_destroy_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].objects.size, 0);
+ assert_int_equal(datas.array[0].contents.size, 0);
+ }
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_fss_sets_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_setss_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_rangess_resize, true);
- will_return(__wrap_f_string_rangess_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_resize, true);
+ will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure));
const f_status_t status = f_fss_setss_delete_callback(0, 1, (void *) datas_array);
status = f_memory_array_resize(1, sizeof(f_fss_set_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].objects);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].objects.array, &datass.array[0].array[0].objects.used, &datass.array[0].array[0].objects.size);
assert_int_equal(status, F_okay);
- status = f_string_rangess_resize(1, &datass.array[0].array[0].contents);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datass.array[0].array[0].contents.array, &datass.array[0].array[0].contents.used, &datass.array[0].array[0].contents.size);
assert_int_equal(status, F_okay);
}
f_fss_sets_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_setss_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_rangess_adjust, true);
- will_return(__wrap_f_string_rangess_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_arrays_adjust, true);
+ will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure));
const f_status_t status = f_fss_setss_destroy_callback(0, 1, (void *) datas_array);
void test__f_fss_setss_destroy_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
f_fss_setss_t datass = f_fss_setss_t_initialize;
{
- f_status_t status = f_memory_array_adjust(length, sizeof(f_fss_sets_t), (void **) &datass.array, &datass.used, &datass.size);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_fss_sets_t), (void **) &datass.array, &datass.used, &datass.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_fss_set_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_fss_set_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].objects);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].objects.array, &datass.array[0].array[0].objects.used, &datass.array[0].array[0].objects.size);
assert_int_equal(status, F_okay);
- status = f_string_rangess_adjust(1, &datass.array[0].array[0].contents);
+ status = f_memory_array_resize(1, sizeof(f_string_ranges_t), (void **) &datass.array[0].array[0].contents.array, &datass.array[0].array[0].contents.used, &datass.array[0].array[0].contents.size);
assert_int_equal(status, F_okay);
}
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-simple_packet_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_simple_packet_delete__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_simple_packet_t data = f_fss_simple_packet_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_simple_packet_delete(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_simple_packet_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_simple_packet_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_simple_packet_delete__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_simple_packet_t data = f_fss_simple_packet_t_initialize;
+
+ {
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_char_t), (void **) &data.payload, &data.payload.used, &data.payload.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_simple_packet_delete(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.payload.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__simple_packet_delete
+#define _TEST__F_fss__simple_packet_delete
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_simple_packet_delete()
+ */
+extern void test__f_fss_simple_packet_delete__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_simple_packet_delete()
+ */
+extern void test__f_fss_simple_packet_delete__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_simple_packet_delete()
+ */
+extern void test__f_fss_simple_packet_delete__works(void **state);
+
+#endif // _TEST__F_fss__simple_packet_delete
--- /dev/null
+#include "test-fss.h"
+#include "test-fss-simple_packet_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_fss_simple_packet_destroy__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_fss_simple_packet_t data = f_fss_simple_packet_t_initialize;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_fss_simple_packet_destroy(&data);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_fss_simple_packet_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_fss_simple_packet_destroy(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_fss_simple_packet_destroy__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_fss_simple_packet_t data = f_fss_simple_packet_t_initialize;
+
+ {
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_char_t), (void **) &data.payload, &data.payload.used, &data.payload.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_fss_simple_packet_destroy(&data);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(data.payload.size, 0);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: FSS
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_fss__simple_packet_destroy
+#define _TEST__F_fss__simple_packet_destroy
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_fss_simple_packet_destroy()
+ */
+extern void test__f_fss_simple_packet_destroy__fails(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_fss_simple_packet_destroy()
+ */
+extern void test__f_fss_simple_packet_destroy__parameter_checking(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_fss_simple_packet_destroy()
+ */
+extern void test__f_fss_simple_packet_destroy__works(void **state);
+
+#endif // _TEST__F_fss__simple_packet_destroy
cmocka_unit_test(test__f_fss_fail_utf__works_for_no_error),
cmocka_unit_test(test__f_fss_fail_utf_to_false__works_for_no_error),
+ cmocka_unit_test(test__f_fss_item_delete__fails),
+ cmocka_unit_test(test__f_fss_item_destroy__fails),
cmocka_unit_test(test__f_fss_items_delete_callback__fails),
cmocka_unit_test(test__f_fss_items_destroy_callback__fails),
cmocka_unit_test(test__f_fss_itemss_delete_callback__fails),
cmocka_unit_test(test__f_fss_itemss_destroy_callback__fails),
+ cmocka_unit_test(test__f_fss_item_delete__works),
+ cmocka_unit_test(test__f_fss_item_destroy__works),
cmocka_unit_test(test__f_fss_items_delete_callback__works),
cmocka_unit_test(test__f_fss_items_destroy_callback__works),
cmocka_unit_test(test__f_fss_itemss_delete_callback__works),
cmocka_unit_test(test__f_fss_itemss_destroy_callback__works),
+ cmocka_unit_test(test__f_fss_named_delete__fails),
+ cmocka_unit_test(test__f_fss_named_destroy__fails),
cmocka_unit_test(test__f_fss_nameds_delete_callback__fails),
cmocka_unit_test(test__f_fss_nameds_destroy_callback__fails),
cmocka_unit_test(test__f_fss_namedss_delete_callback__fails),
cmocka_unit_test(test__f_fss_namedss_destroy_callback__fails),
+ cmocka_unit_test(test__f_fss_named_delete__works),
+ cmocka_unit_test(test__f_fss_named_destroy__works),
cmocka_unit_test(test__f_fss_nameds_delete_callback__works),
cmocka_unit_test(test__f_fss_nameds_destroy_callback__works),
cmocka_unit_test(test__f_fss_namedss_delete_callback__works),
cmocka_unit_test(test__f_fss_namedss_destroy_callback__works),
+ cmocka_unit_test(test__f_fss_nest_delete__fails),
+ cmocka_unit_test(test__f_fss_nest_destroy__fails),
cmocka_unit_test(test__f_fss_nests_delete_callback__fails),
cmocka_unit_test(test__f_fss_nests_destroy_callback__fails),
cmocka_unit_test(test__f_fss_nestss_delete_callback__fails),
cmocka_unit_test(test__f_fss_nestss_destroy_callback__fails),
+ cmocka_unit_test(test__f_fss_nest_delete__works),
+ cmocka_unit_test(test__f_fss_nest_destroy__works),
cmocka_unit_test(test__f_fss_nests_delete_callback__works),
cmocka_unit_test(test__f_fss_nests_destroy_callback__works),
cmocka_unit_test(test__f_fss_nestss_delete_callback__works),
cmocka_unit_test(test__f_fss_nestss_destroy_callback__works),
- cmocka_unit_test(test__f_fss_set_quotes_delete_callback__fails),
- cmocka_unit_test(test__f_fss_set_quotes_destroy_callback__fails),
- cmocka_unit_test(test__f_fss_set_quotess_delete_callback__fails),
- cmocka_unit_test(test__f_fss_set_quotess_destroy_callback__fails),
-
- cmocka_unit_test(test__f_fss_set_quotes_delete_callback__works),
- cmocka_unit_test(test__f_fss_set_quotes_destroy_callback__works),
- cmocka_unit_test(test__f_fss_set_quotess_delete_callback__works),
- cmocka_unit_test(test__f_fss_set_quotess_destroy_callback__works),
-
+ cmocka_unit_test(test__f_fss_set_delete__fails),
+ cmocka_unit_test(test__f_fss_set_destroy__fails),
cmocka_unit_test(test__f_fss_sets_delete_callback__fails),
cmocka_unit_test(test__f_fss_sets_destroy_callback__fails),
cmocka_unit_test(test__f_fss_setss_delete_callback__fails),
cmocka_unit_test(test__f_fss_setss_destroy_callback__fails),
+ cmocka_unit_test(test__f_fss_set_delete__works),
+ cmocka_unit_test(test__f_fss_set_destroy__works),
cmocka_unit_test(test__f_fss_sets_delete_callback__works),
cmocka_unit_test(test__f_fss_sets_destroy_callback__works),
cmocka_unit_test(test__f_fss_setss_delete_callback__works),
cmocka_unit_test(test__f_fss_setss_destroy_callback__works),
+ cmocka_unit_test(test__f_fss_set_quote_delete__fails),
+ cmocka_unit_test(test__f_fss_set_quote_destroy__fails),
+ cmocka_unit_test(test__f_fss_set_quotes_delete_callback__fails),
+ cmocka_unit_test(test__f_fss_set_quotes_destroy_callback__fails),
+ cmocka_unit_test(test__f_fss_set_quotess_delete_callback__fails),
+ cmocka_unit_test(test__f_fss_set_quotess_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_fss_set_quote_delete__works),
+ cmocka_unit_test(test__f_fss_set_quote_destroy__works),
+ cmocka_unit_test(test__f_fss_set_quotes_delete_callback__works),
+ cmocka_unit_test(test__f_fss_set_quotes_destroy_callback__works),
+ cmocka_unit_test(test__f_fss_set_quotess_delete_callback__works),
+ cmocka_unit_test(test__f_fss_set_quotess_destroy_callback__works),
+
+ cmocka_unit_test(test__f_fss_simple_packet_delete__fails),
+ cmocka_unit_test(test__f_fss_simple_packet_destroy__fails),
cmocka_unit_test(test__f_fss_simple_packets_delete_callback__fails),
cmocka_unit_test(test__f_fss_simple_packets_destroy_callback__fails),
cmocka_unit_test(test__f_fss_simple_packetss_delete_callback__fails),
cmocka_unit_test(test__f_fss_simple_packetss_destroy_callback__fails),
+ cmocka_unit_test(test__f_fss_simple_packet_delete__works),
+ cmocka_unit_test(test__f_fss_simple_packet_destroy__works),
cmocka_unit_test(test__f_fss_simple_packets_delete_callback__works),
cmocka_unit_test(test__f_fss_simple_packets_destroy_callback__works),
cmocka_unit_test(test__f_fss_simple_packetss_delete_callback__works),
cmocka_unit_test(test__f_fss_skip_past_delimit__parameter_checking),
cmocka_unit_test(test__f_fss_skip_past_space__parameter_checking),
+ cmocka_unit_test(test__f_fss_item_delete__parameter_checking),
+ cmocka_unit_test(test__f_fss_item_destroy__parameter_checking),
+
+ cmocka_unit_test(test__f_fss_named_delete__parameter_checking),
+ cmocka_unit_test(test__f_fss_named_destroy__parameter_checking),
+
+ cmocka_unit_test(test__f_fss_named_delete__parameter_checking),
+ cmocka_unit_test(test__f_fss_named_destroy__parameter_checking),
+
+ cmocka_unit_test(test__f_fss_set_delete__parameter_checking),
+ cmocka_unit_test(test__f_fss_set_destroy__parameter_checking),
+
+ cmocka_unit_test(test__f_fss_set_quote_delete__parameter_checking),
+ cmocka_unit_test(test__f_fss_set_quote_destroy__parameter_checking),
+
+ cmocka_unit_test(test__f_fss_simple_packet_delete__parameter_checking),
+ cmocka_unit_test(test__f_fss_simple_packet_destroy__parameter_checking),
+
// f_fss_items_delete_callback() doesn't use parameter checking.
// f_fss_items_destroy_callback() doesn't use parameter checking.
// f_fss_itemss_delete_callback() doesn't use parameter checking.
// f_fss_nests_destroy_callback() doesn't use parameter checking.
// f_fss_nestss_delete_callback() doesn't use parameter checking.
// f_fss_nestss_destroy_callback() doesn't use parameter checking.
- // f_fss_set_quotes_delete_callback() doesn't use parameter checking.
- // f_fss_set_quotes_destroy_callback() doesn't use parameter checking.
- // f_fss_set_quotess_delete_callback() doesn't use parameter checking.
- // f_fss_set_quotess_destroy_callback() doesn't use parameter checking.
// f_fss_sets_delete_callback() doesn't use parameter checking.
// f_fss_sets_destroy_callback() doesn't use parameter checking.
// f_fss_setss_delete_callback() doesn't use parameter checking.
// f_fss_setss_destroy_callback() doesn't use parameter checking.
+ // f_fss_set_quotes_delete_callback() doesn't use parameter checking.
+ // f_fss_set_quotes_destroy_callback() doesn't use parameter checking.
+ // f_fss_set_quotess_delete_callback() doesn't use parameter checking.
+ // f_fss_set_quotess_destroy_callback() doesn't use parameter checking.
// f_fss_simple_packets_delete_callback() doesn't use parameter checking.
// f_fss_simple_packets_destroy_callback() doesn't use parameter checking.
// f_fss_simple_packetss_delete_callback() doesn't use parameter checking.
#include "test-fss-is_graph.h"
#include "test-fss-is_space.h"
#include "test-fss-is_zero_width.h"
-#include "test-fss-items_destroy_callback.h"
+#include "test-fss-item_delete.h"
+#include "test-fss-item_destroy.h"
#include "test-fss-items_delete_callback.h"
-#include "test-fss-itemss_destroy_callback.h"
+#include "test-fss-items_destroy_callback.h"
#include "test-fss-itemss_delete_callback.h"
-#include "test-fss-nameds_destroy_callback.h"
+#include "test-fss-itemss_destroy_callback.h"
+#include "test-fss-named_delete.h"
+#include "test-fss-named_destroy.h"
#include "test-fss-nameds_delete_callback.h"
-#include "test-fss-namedss_destroy_callback.h"
+#include "test-fss-nameds_destroy_callback.h"
#include "test-fss-namedss_delete_callback.h"
-#include "test-fss-nests_destroy_callback.h"
+#include "test-fss-namedss_destroy_callback.h"
+#include "test-fss-nest_delete.h"
+#include "test-fss-nest_destroy.h"
#include "test-fss-nests_delete_callback.h"
-#include "test-fss-nestss_destroy_callback.h"
+#include "test-fss-nests_destroy_callback.h"
#include "test-fss-nestss_delete_callback.h"
+#include "test-fss-nestss_destroy_callback.h"
#include "test-fss-seek_to_eol.h"
-#include "test-fss-set_quotes_destroy_callback.h"
-#include "test-fss-set_quotes_delete_callback.h"
-#include "test-fss-set_quotess_destroy_callback.h"
-#include "test-fss-set_quotess_delete_callback.h"
-#include "test-fss-sets_destroy_callback.h"
+#include "test-fss-set_delete.h"
+#include "test-fss-set_destroy.h"
#include "test-fss-sets_delete_callback.h"
-#include "test-fss-setss_destroy_callback.h"
+#include "test-fss-sets_destroy_callback.h"
#include "test-fss-setss_delete_callback.h"
-#include "test-fss-simple_packets_destroy_callback.h"
+#include "test-fss-setss_destroy_callback.h"
+#include "test-fss-set_quote_delete.h"
+#include "test-fss-set_quote_destroy.h"
+#include "test-fss-set_quotes_delete_callback.h"
+#include "test-fss-set_quotes_destroy_callback.h"
+#include "test-fss-set_quotess_delete_callback.h"
+#include "test-fss-set_quotess_destroy_callback.h"
+#include "test-fss-simple_packet_delete.h"
+#include "test-fss-simple_packet_destroy.h"
#include "test-fss-simple_packets_delete_callback.h"
-#include "test-fss-simple_packetss_destroy_callback.h"
+#include "test-fss-simple_packets_destroy_callback.h"
#include "test-fss-simple_packetss_delete_callback.h"
+#include "test-fss-simple_packetss_destroy_callback.h"
#include "test-fss-skip_past_delimit.h"
#include "test-fss-skip_past_space.h"
}
if (buffer->string[range->start] == quote) {
- state->status = f_string_ranges_increase(state->step_small, &data->variable);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &data->variable.array, &data->variable.used, &data->variable.size);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, &data->vocabulary);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &data->vocabulary.array, &data->vocabulary.used, &data->vocabulary.size);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, &data->content);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &data->content.array, &data->content.used, &data->content.size);
if (F_status_is_error(state->status)) break;
data->variable.array[data->variable.used].start = found_vocabulary.start;
// Valid content's ending quote is not delimited, save and return.
if (content_slash_total % 2 == 0) {
- state->status = f_string_ranges_increase(state->step_small, &data->variable);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &data->variable.array, &data->variable.used, &data->variable.size);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, &data->vocabulary);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &data->vocabulary.array, &data->vocabulary.used, &data->vocabulary.size);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, &data->content);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &data->content.array, &data->content.used, &data->content.size);
if (F_status_is_error(state->status)) break;
data->variable.array[data->variable.used].start = found_vocabulary.start;
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_resize(0, &data->content);
+ f_status_t status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &data->content.array, &data->content.used, &data->content.size);
if (F_status_is_error(status)) return status;
status = f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &data->delimits.array, &data->delimits.used, &data->delimits.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_resize(0, &data->variable);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &data->variable.array, &data->variable.used, &data->variable.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_resize(0, &data->vocabulary);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &data->vocabulary.array, &data->vocabulary.used, &data->vocabulary.size);
if (F_status_is_error(status)) return status;
}
#endif // _di_level_0_parameter_checking_
{
- f_status_t status = f_string_ranges_adjust(0, &data->content);
+ f_status_t status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &data->content.array, &data->content.used, &data->content.size);
if (F_status_is_error(status)) return status;
status = f_memory_array_adjust(0, sizeof(f_number_unsigned_t), (void **) &data->delimits.array, &data->delimits.used, &data->delimits.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_adjust(0, &data->variable);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &data->variable.array, &data->variable.used, &data->variable.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_adjust(0, &data->vocabulary);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &data->vocabulary.array, &data->vocabulary.used, &data->vocabulary.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_resize(0, &array[i].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].content.array, &array[i].content.used, &array[i].content.size);
if (F_status_is_error(status)) return status;
status = f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &array[i].delimits.array, &array[i].delimits.used, &array[i].delimits.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_resize(0, &array[i].variable);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].variable.array, &array[i].variable.used, &array[i].variable.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_resize(0, &array[i].vocabulary);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].vocabulary.array, &array[i].vocabulary.used, &array[i].vocabulary.size);
if (F_status_is_error(status)) return status;
} // for
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- status = f_string_ranges_adjust(0, &array[i].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].content.array, &array[i].content.used, &array[i].content.size);
if (F_status_is_error(status)) return status;
status = f_memory_array_adjust(0, sizeof(f_number_unsigned_t), (void **) &array[i].delimits.array, &array[i].delimits.used, &array[i].delimits.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_adjust(0, &array[i].variable);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].variable.array, &array[i].variable.used, &array[i].variable.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_adjust(0, &array[i].vocabulary);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].vocabulary.array, &array[i].vocabulary.used, &array[i].vocabulary.size);
if (F_status_is_error(status)) return status;
} // for
}
if (!source.used) return F_data_not;
- f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_iki_datas_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_iki_datas_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
- status = private_f_iki_datas_append_all(source, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+ status = private_f_iki_datas_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_iki_datas_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_iki_datas_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- destination->array[destination->used].used = 0;
+ destination->array[destination->used].used = 0;
- if (source.array[i].used) {
- status = private_f_iki_datas_append_all(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ if (source.array[i].used) {
+ status = private_f_iki_datas_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
return F_okay;
}
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_resize(0, &array[i].array[j].content);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].content.array, &array[i].array[j].content.used, &array[i].array[j].content.size);
if (F_status_is_error(status)) return status;
status = f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &array[i].array[j].delimits.array, &array[i].array[j].delimits.used, &array[i].array[j].delimits.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_resize(0, &array[i].array[j].variable);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].variable.array, &array[i].array[j].variable.used, &array[i].array[j].variable.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_resize(0, &array[i].array[j].vocabulary);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array[j].vocabulary.array, &array[i].array[j].vocabulary.used, &array[i].array[j].vocabulary.size);
if (F_status_is_error(status)) return status;
} // for
for (j = 0; j < array[i].size; ++j) {
- status = f_string_ranges_adjust(0, &array[i].array[j].content);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].content.array, &array[i].array[j].content.used, &array[i].array[j].content.size);
if (F_status_is_error(status)) return status;
status = f_memory_array_adjust(0, sizeof(f_number_unsigned_t), (void **) &array[i].array[j].delimits.array, &array[i].array[j].delimits.used, &array[i].array[j].delimits.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_adjust(0, &array[i].array[j].variable);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].variable.array, &array[i].array[j].variable.used, &array[i].array[j].variable.size);
if (F_status_is_error(status)) return status;
- status = f_string_ranges_adjust(0, &array[i].array[j].vocabulary);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array[j].vocabulary.array, &array[i].array[j].vocabulary.used, &array[i].array[j].vocabulary.size);
if (F_status_is_error(status)) return status;
} // for
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
*
* @see f_memory_array_resize()
- * @see f_string_ranges_resize()
*/
#ifndef _di_f_iki_data_delete_
extern f_status_t f_iki_data_delete(f_iki_data_t * const data);
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
*
* @see f_memory_array_adjust()
- * @see f_string_ranges_adjust()
*/
#ifndef _di_f_iki_data_destroy_
extern f_status_t f_iki_data_destroy(f_iki_data_t * const data);
*
* Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
*
* @see f_memory_array_increase()
* @see f_memory_array_resize()
- * @see f_string_ranges_resize()
*/
#ifndef _di_f_iki_datass_append_
extern f_status_t f_iki_datass_append(const f_iki_datas_t source, f_iki_datass_t * const destination);
*
* Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
*
* @see f_memory_array_increase_by()
* @see f_memory_array_resize()
- * @see f_string_ranges_resize()
*/
#ifndef _di_f_iki_datass_append_all_
extern f_status_t f_iki_datass_append_all(const f_iki_datass_t source, f_iki_datass_t * const destination);
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*/
#ifndef _di_f_iki_datass_delete_callback_
extern f_status_t f_iki_datass_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*/
#ifndef _di_f_iki_datass_destroy_callback_
extern f_status_t f_iki_datass_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
# Inject mocks.
flags -Wl,--wrap=f_memory_array_adjust
flags -Wl,--wrap=f_memory_array_resize
-flags -Wl,--wrap=f_string_ranges_adjust
-flags -Wl,--wrap=f_string_ranges_resize
return mock_type(f_status_t);
}
-f_status_t __wrap_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
-
- if (mock_unwrap) {
- return __real_f_string_ranges_adjust(length, structure);
- }
-
- if (!structure) return F_status_set_error(F_parameter_not);
-
- const bool failure = mock_type(bool);
-
- if (failure) return mock_type(f_status_t);
-
- structure->size = length;
-
- return mock_type(f_status_t);
-}
-
-f_status_t __wrap_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
-
- if (mock_unwrap) {
- return __real_f_string_ranges_resize(length, structure);
- }
-
- if (!structure) return F_status_set_error(F_parameter_not);
-
- const bool failure = mock_type(bool);
-
- if (failure) return mock_type(f_status_t);
-
- structure->size = length;
-
- return mock_type(f_status_t);
-}
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t __real_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
extern f_status_t __real_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-extern f_status_t __real_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __real_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-
extern f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
extern f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-extern f_status_t __wrap_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-extern f_status_t __wrap_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-
#ifdef __cplusplus
} // extern "C"
#endif
{
f_number_unsigned_t i = 1;
- f_status_t status = f_string_ranges_resize(length, &source.content);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.content.array, &source.content.used, &source.content.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.content.size, length);
assert_int_equal(status, F_okay);
assert_int_equal(source.delimits.size, length);
- status = f_string_ranges_resize(length, &source.variable);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.variable.array, &source.variable.used, &source.variable.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.variable.size, length);
- status = f_string_ranges_resize(length, &source.vocabulary);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.vocabulary.array, &source.vocabulary.used, &source.vocabulary.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.vocabulary.size, length);
for (; j < 2; ++j) {
- status = f_string_ranges_resize(length, &source.array[j].content);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[j].content.array, &source.array[j].content.used, &source.array[j].content.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].content.size, length);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].delimits.size, length);
- status = f_string_ranges_resize(length, &source.array[j].variable);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[j].variable.array, &source.array[j].variable.used, &source.array[j].variable.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].variable.size, length);
- status = f_string_ranges_resize(length, &source.array[j].vocabulary);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[j].vocabulary.array, &source.array[j].vocabulary.used, &source.array[j].vocabulary.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].vocabulary.size, length);
f_iki_datas_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array);
void test__f_iki_datas_delete_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_string_ranges_t content = f_string_ranges_t_initialize;
- f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize;
- f_string_ranges_t variable = f_string_ranges_t_initialize;
- f_string_ranges_t vocabulary = f_string_ranges_t_initialize;
- f_iki_data_t data = { .content = content, .delimits = delimits, .variable = variable, .vocabulary = vocabulary };
- f_iki_data_t data_array[] = { data };
- f_iki_datas_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_iki_datas_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_iki_datas_t datas = f_iki_datas_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ f_status_t status = f_memory_array_resize(1, sizeof(f_iki_data_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_resize, false);
- will_return(__wrap_f_memory_array_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].content.array, &datas.array[0].content.used, &datas.array[0].content.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_number_unsigned_t), (void **) &datas.array[0].delimits.array, &datas.array[0].delimits.used, &datas.array[0].delimits.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].variable.array, &datas.array[0].variable.used, &datas.array[0].variable.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].vocabulary.array, &datas.array[0].vocabulary.used, &datas.array[0].vocabulary.size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_iki_datas_delete_callback(0, length, (void *) datas_array);
+ {
+ const f_status_t status = f_iki_datas_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].content.size, 0);
+ assert_int_equal(datas.array[0].delimits.size, 0);
+ assert_int_equal(datas.array[0].variable.size, 0);
+ assert_int_equal(datas.array[0].vocabulary.size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
f_iki_datas_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array);
void test__f_iki_datas_destroy_callback__works(void **state) {
mock_unwrap = 0;
- mock_unwrap_f_memory = 0;
+ mock_unwrap_f_memory = 1;
- f_string_ranges_t content = f_string_ranges_t_initialize;
- f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize;
- f_string_ranges_t variable = f_string_ranges_t_initialize;
- f_string_ranges_t vocabulary = f_string_ranges_t_initialize;
- f_iki_data_t data = { .content = content, .delimits = delimits, .variable = variable, .vocabulary = vocabulary };
- f_iki_data_t data_array[] = { data };
- f_iki_datas_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_iki_datas_t datas_array[] = { datas };
const f_number_unsigned_t length = 1;
+ f_iki_datas_t datas = f_iki_datas_t_initialize;
+
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ f_status_t status = f_memory_array_resize(1, sizeof(f_iki_data_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_memory_array_adjust, false);
- will_return(__wrap_f_memory_array_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].content.array, &datas.array[0].content.used, &datas.array[0].content.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_number_unsigned_t), (void **) &datas.array[0].delimits.array, &datas.array[0].delimits.used, &datas.array[0].delimits.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].variable.array, &datas.array[0].variable.used, &datas.array[0].variable.size);
+ assert_int_equal(status, F_okay);
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datas.array[0].vocabulary.array, &datas.array[0].vocabulary.used, &datas.array[0].vocabulary.size);
+ assert_int_equal(status, F_okay);
+ }
- const f_status_t status = f_iki_datas_destroy_callback(0, length, (void *) datas_array);
+ {
+ const f_status_t status = f_iki_datas_destroy_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
+ assert_int_equal(datas.array[0].content.size, 0);
+ assert_int_equal(datas.array[0].delimits.size, 0);
+ assert_int_equal(datas.array[0].variable.size, 0);
+ assert_int_equal(datas.array[0].vocabulary.size, 0);
}
+
+ free((void *) datas.array);
}
#ifdef __cplusplus
for (f_number_unsigned_t j = 0; j < length_outer; ++j) {
- status = f_string_ranges_resize(length, &source.array[j].content);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[j].content.array, &source.array[j].content.used, &source.array[j].content.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].content.size, length);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].delimits.size, length);
- status = f_string_ranges_resize(length, &source.array[j].variable);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[j].variable.array, &source.array[j].variable.used, &source.array[j].variable.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].variable.size, length);
- status = f_string_ranges_resize(length, &source.array[j].vocabulary);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[j].vocabulary.array, &source.array[j].vocabulary.used, &source.array[j].vocabulary.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[j].vocabulary.size, length);
for (j = 0; j < length_inner; ++j) {
- status = f_string_ranges_resize(length, &source.array[source.used].array[j].content);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[source.used].array[j].content.array, &source.array[source.used].array[j].content.used, &source.array[source.used].array[j].content.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[source.used].array[j].content.size, length);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[source.used].array[j].delimits.size, length);
- status = f_string_ranges_resize(length, &source.array[source.used].array[j].variable);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[source.used].array[j].variable.array, &source.array[source.used].array[j].variable.used, &source.array[source.used].array[j].variable.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[source.used].array[j].variable.size, length);
- status = f_string_ranges_resize(length, &source.array[source.used].array[j].vocabulary);
+ status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array[source.used].array[j].vocabulary.array, &source.array[source.used].array[j].vocabulary.used, &source.array[source.used].array[j].vocabulary.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[source.used].array[j].vocabulary.size, length);
f_iki_datas_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_iki_datass_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_iki_datass_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, true);
- will_return(__wrap_f_string_ranges_resize, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
const f_status_t status = f_iki_datass_delete_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, false);
will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
- will_return(__wrap_f_string_ranges_resize, false);
- will_return(__wrap_f_string_ranges_resize, F_okay);
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
will_return(__wrap_f_memory_array_resize, true);
will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
void test__f_iki_datass_delete_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
status = f_memory_array_resize(1, sizeof(f_iki_data_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].content);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].content.array, &datass.array[0].array[0].content.used, &datass.array[0].array[0].content.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_number_unsigned_t), (void **) &datass.array[0].array[0].delimits.array, &datass.array[0].array[0].delimits.used, &datass.array[0].array[0].delimits.size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].variable);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].variable.array, &datass.array[0].array[0].variable.used, &datass.array[0].array[0].variable.size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_resize(1, &datass.array[0].array[0].vocabulary);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].vocabulary.array, &datass.array[0].array[0].vocabulary.used, &datass.array[0].array[0].vocabulary.size);
assert_int_equal(status, F_okay);
}
f_iki_datas_t datas_array[] = { datas };
{
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_iki_datass_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_iki_datass_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, true);
- will_return(__wrap_f_string_ranges_adjust, F_status_set_error(F_failure));
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
const f_status_t status = f_iki_datass_destroy_callback(0, 1, (void *) datas_array);
}
{
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, false);
will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
- will_return(__wrap_f_string_ranges_adjust, false);
- will_return(__wrap_f_string_ranges_adjust, F_okay);
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
will_return(__wrap_f_memory_array_adjust, true);
will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
void test__f_iki_datass_destroy_callback__works(void **state) {
- mock_unwrap = 1;
+ mock_unwrap = 0;
mock_unwrap_f_memory = 1;
const f_number_unsigned_t length = 1;
f_iki_datass_t datass = f_iki_datass_t_initialize;
{
- f_status_t status = f_memory_array_adjust(length, sizeof(f_iki_datas_t), (void **) &datass.array, &datass.used, &datass.size);
+ f_status_t status = f_memory_array_resize(length, sizeof(f_iki_datas_t), (void **) &datass.array, &datass.used, &datass.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_iki_data_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ status = f_memory_array_resize(1, sizeof(f_iki_data_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].content);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].content.array, &datass.array[0].array[0].content.used, &datass.array[0].array[0].content.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_adjust(1, sizeof(f_number_unsigned_t), (void **) &datass.array[0].array[0].delimits.array, &datass.array[0].array[0].delimits.used, &datass.array[0].array[0].delimits.size);
+ status = f_memory_array_resize(1, sizeof(f_number_unsigned_t), (void **) &datass.array[0].array[0].delimits.array, &datass.array[0].array[0].delimits.used, &datass.array[0].array[0].delimits.size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].variable);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].variable.array, &datass.array[0].array[0].variable.used, &datass.array[0].array[0].variable.size);
assert_int_equal(status, F_okay);
- status = f_string_ranges_adjust(1, &datass.array[0].array[0].vocabulary);
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array[0].vocabulary.array, &datass.array[0].array[0].vocabulary.used, &datass.array[0].array[0].vocabulary.size);
assert_int_equal(status, F_okay);
}
cmocka_unit_test(test__f_limit_process__fails),
cmocka_unit_test(test__f_limit_process__works),
- cmocka_unit_test(test__f_limit_setss_destroy_callback__fails),
cmocka_unit_test(test__f_limit_setss_delete_callback__fails),
+ cmocka_unit_test(test__f_limit_setss_destroy_callback__fails),
cmocka_unit_test(test__f_limit_setss_delete_callback__works),
cmocka_unit_test(test__f_limit_setss_destroy_callback__works),
- cmocka_unit_test(test__f_limit_valuess_destroy_callback__fails),
cmocka_unit_test(test__f_limit_valuess_delete_callback__fails),
+ cmocka_unit_test(test__f_limit_valuess_destroy_callback__fails),
cmocka_unit_test(test__f_limit_valuess_delete_callback__works),
cmocka_unit_test(test__f_limit_valuess_destroy_callback__works),
#ifndef _di_level_0_parameter_checking_
cmocka_unit_test(test__f_limit_process__parameter_checking),
- // f_limit_setss_destroy_callback() doesn't use parameter checking.
// f_limit_setss_delete_callback() doesn't use parameter checking.
+ // f_limit_setss_destroy_callback() doesn't use parameter checking.
- // f_limit_valuess_destroy_callback() doesn't use parameter checking.
// f_limit_valuess_delete_callback() doesn't use parameter checking.
+ // f_limit_valuess_destroy_callback() doesn't use parameter checking.
#endif // _di_level_0_parameter_checking_
};
cmocka_unit_test(test__f_path_change_at__fails),
cmocka_unit_test(test__f_path_change_at__works),
- // test__f_path_directory_cleanup__fails test isn't needed yet as f_string_dynamic_increase_by() aren't tested at this time.
cmocka_unit_test(test__f_path_directory_cleanup__works),
cmocka_unit_test(test__f_path_is__returns_false),
if (i + width > source.used) {
total = i - start;
- status = f_string_ranges_increase(F_memory_default_allocation_small_d, ranges);
+ status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
if (F_status_is_error(status)) return status;
if (total) {
if (source.string[i] == f_serialize_to_simple_splitter_s.string[0]) {
total = i - start;
- status = f_string_ranges_increase(F_memory_default_allocation_small_d, ranges);
+ status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
if (F_status_is_error(status)) return status;
if (total) {
// Handle case when splitter as at the end of the string, creating a new empty string.
if (start == source.used) {
- status = f_string_ranges_increase(F_memory_default_allocation_small_d, ranges);
+ status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
if (F_status_is_error(status)) return status;
ranges->array[ranges->used].start = 1;
if (start < source.used) {
total = source.used - start;
- status = f_string_ranges_increase(F_memory_default_allocation_small_d, ranges);
+ status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
if (F_status_is_error(status)) return status;
if (total) {
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_string_ranges_increase()
+ * Errors (with error bit) from: f_memory_array_increase()
*
- * @see f_string_ranges_increase()
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_serialize_from_simple_range_
extern f_status_t f_serialize_from_simple_range(const f_string_static_t source, f_string_ranges_t * const ranges);
assert_int_equal(status, F_data_not);
}
- f_string_ranges_resize(0, &ranges);
+ free((void *) ranges.array);
}
void test__f_serialize_from_simple_range__works(void **state) {
} // for
}
- f_string_ranges_resize(0, &ranges);
+ free((void *) ranges.array);
}
#ifdef __cplusplus
if (destination->used >= F_string_t_size_d) return F_status_set_error(F_string_too_large);
- f_status_t status = F_okay;
- f_number_unsigned_t i = 0;
- f_number_unsigned_t size = 0;
+ {
+ f_status_t status = F_okay;
+ f_number_unsigned_t i = 0;
+ f_number_unsigned_t size = 0;
- // Count all of the NULLs and subtract them from the total size.
- for (; i < length; ++i) {
- if (source[i]) ++size;
- } // for
+ // Count all of the NULLs and subtract them from the total size.
+ for (; i < length; ++i) {
+ if (source[i]) ++size;
+ } // for
- if (size + 1 > F_string_t_size_d) return F_status_set_error(F_string_too_large);
+ if (size + 1 > F_string_t_size_d) return F_status_set_error(F_string_too_large);
- status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
+ status = f_memory_array_increase_by(size + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
- f_number_unsigned_t first = 0;
+ f_number_unsigned_t first = 0;
- for (i = 0, size = 0; i < length; ++i) {
+ for (i = 0, size = 0; i < length; ++i) {
- if (source[i]) continue;
+ if (source[i]) continue;
- if (i && i > first) {
- size = i - first;
+ if (i && i > first) {
+ size = i - first;
- memcpy(destination->string + destination->used, source + first, sizeof(f_char_t) * size);
- destination->used += size;
- }
+ memcpy(destination->string + destination->used, source + first, sizeof(f_char_t) * size);
+ destination->used += size;
+ }
- while (i + 1 < length && !source[i + 1]) {
- ++i;
- } // while
+ while (i + 1 < length && !source[i + 1]) {
+ ++i;
+ } // while
- first = i + 1;
- } // for
+ first = i + 1;
+ } // for
- if (i > first) {
- size = i - first;
+ if (i > first) {
+ size = i - first;
- memcpy(destination->string + destination->used, source + first, sizeof(f_char_t) * size);
- destination->used += size;
+ memcpy(destination->string + destination->used, source + first, sizeof(f_char_t) * size);
+ destination->used += size;
+ }
}
destination->string[destination->used] = 0;
#include "../string.h"
#include "../private-string.h"
-#include "private-dynamics.h"
#ifdef __cplusplus
extern "C" {
if (!source.used) return F_data_not;
- return private_f_string_dynamics_append(source, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.used) {
+ status = private_f_string_append(source.string, source.used, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ }
+
+ ++destination->used;
+
+ return F_okay;
}
#endif // _di_f_string_dynamics_append_
if (!source.used) return F_data_not;
- return private_f_string_dynamics_append_all(source, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+
+ return F_okay;
}
#endif // _di_f_string_dynamics_append_all_
#include "../string.h"
#include "../private-string.h"
-#include "private-dynamics.h"
#ifdef __cplusplus
extern "C" {
f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamics_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- destination->array[destination->used].used = 0;
+ f_string_dynamics_t * const destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
if (source.used) {
- status = private_f_string_dynamics_append_all(source, &destination->array[destination->used]);
+ status = f_memory_array_increase_by(source.used, sizeof(f_string_dynamic_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t j = 0; j < source.used; ++j, ++destination_inner->used) {
+
+ destination_inner->array[destination_inner->used].used = 0;
+
+ if (source.array[j].used) {
+ status = private_f_string_append(source.array[j].string, source.array[j].used, &destination_inner->array[destination_inner->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
}
destination->array[destination->used].used = 0;
if (source.array[i].used) {
- status = private_f_string_dynamics_append_all(source.array[i], &destination->array[destination->used]);
+ status = f_memory_array_increase_by(source.array[i].used, sizeof(f_string_dynamic_t), (void **) &destination->array[destination->used].array, &destination->array[destination->used].used, &destination->array[destination->used].size);
if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t j = 0; j < source.array[i].used; ++j, ++destination->array[destination->used].used) {
+
+ destination->array[destination->used].array[destination->array[destination->used].used].used = 0;
+
+ if (source.array[i].array[j].used) {
+ status = private_f_string_append(source.array[i].array[j].string, source.array[i].array[j].used, &destination->array[destination->used].array[destination->array[destination->used].used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
} // for
}
#include "../string.h"
#include "../private-string.h"
-#include "private-dynamics.h"
-#include "private-map_multis.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_map_multis_adjust_
- f_status_t f_string_map_multis_adjust(const f_number_unsigned_t length, f_string_map_multis_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_map_multis_adjust(length, structure);
- }
-#endif // _di_f_string_map_multis_adjust_
-
#ifndef _di_f_string_map_multis_append_
f_status_t f_string_map_multis_append(const f_string_map_multi_t source, f_string_map_multis_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_map_multis_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_map_multi_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].name.used = 0;
- destination->array[destination->used].value.used = 0;
+ f_string_map_multi_t * const destination_inner = &destination->array[destination->used];
- if (source.name.used) {
- status = private_f_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
- if (F_status_is_error(status)) return status;
- }
+ destination_inner->name.used = 0;
+ destination_inner->value.used = 0;
- if (source.value.used) {
- status = private_f_string_dynamics_append_all(source.value, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
+ if (source.name.used) {
+ status = private_f_string_append(source.name.string, source.name.used, &destination_inner->name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.value.used) {
+ status = f_memory_array_increase_by(source.value.used, sizeof(f_string_dynamic_t), (void **) &destination_inner->value.array, &destination_inner->value.used, &destination_inner->value.size);
+ if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t j = 0; j < source.value.used; ++j, ++destination_inner->value.used) {
+
+ destination_inner->value.array[destination_inner->value.used].used = 0;
+
+ if (source.value.array[j].used) {
+ status = private_f_string_append(source.value.array[j].string, source.value.array[j].used, &destination_inner->value.array[destination_inner->value.used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- return private_f_string_map_multis_append_all(source, destination);
- }
-#endif // _di_f_string_map_multis_append_all_
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_map_multi_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
-#ifndef _di_f_string_map_multis_decimate_by_
- f_status_t f_string_map_multis_decimate_by(const f_number_unsigned_t amount, f_string_map_multis_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ f_string_map_multi_t * destination_inner = 0;
+ f_number_unsigned_t j = 0;
- if (!amount) return F_data_not;
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- return private_f_string_map_multis_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_map_multis_decimate_by_
+ destination_inner = &destination->array[destination->used];
+ destination_inner->name.used = 0;
+ destination_inner->value.used = 0;
-#ifndef _di_f_string_map_multis_decrease_by_
- f_status_t f_string_map_multis_decrease_by(const f_number_unsigned_t amount, f_string_map_multis_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (source.array[i].name.used) {
+ status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination_inner->name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].value.used) {
+ status = f_memory_array_increase_by(source.array[i].value.used, sizeof(f_string_dynamic_t), (void **) &destination_inner->value.array, &destination_inner->value.used, &destination_inner->value.size);
+ if (F_status_is_error(status)) return status;
+
+ for (j = 0; j < source.array[i].value.used; ++j, ++destination_inner->value.used) {
- if (!amount) return F_data_not;
+ destination_inner->value.array[destination_inner->value.used].used = 0;
- return private_f_string_map_multis_resize((structure->size > amount) ? structure->size - amount : 0, structure);
+ if (source.array[i].value.array[j].used) {
+ status = private_f_string_append(source.array[i].value.array[j].string, source.array[i].value.array[j].used, &destination_inner->value.array[destination_inner->value.used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+ } // for
+ }
+
+ return F_okay;
}
-#endif // _di_f_string_map_multis_decrease_by_
+#endif // _di_f_string_map_multis_append_all_
-#ifndef _di_f_string_map_multis_increase_
- f_status_t f_string_map_multis_increase(const f_number_unsigned_t step, f_string_map_multis_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_map_multis_delete_callback_
+ f_status_t f_string_map_multis_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+ {
+ f_string_map_multi_t * const array = (f_string_map_multi_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- length = F_number_t_size_unsigned_d;
- }
+ if (array[i].name.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (array[i].value.size) {
+ for (j = 0; j < array[i].value.size; ++j) {
- return private_f_string_map_multis_resize(length, structure);
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].value.array[j].string, &array[i].value.array[j].used, &array[i].value.array[j].size);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_array_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].value.array, &array[i].value.used, &array[i].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_map_multis_increase_
+#endif // _di_f_string_map_multis_delete_callback_
-#ifndef _di_f_string_map_multis_increase_by_
- f_status_t f_string_map_multis_increase_by(const f_number_unsigned_t amount, f_string_map_multis_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_map_multis_destroy_callback_
+ f_status_t f_string_map_multis_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_map_multi_t * const array = (f_string_map_multi_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
- const f_number_unsigned_t length = structure->used + amount;
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (array[i].name.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_map_multis_resize(length, structure);
- }
- }
+ if (array[i].value.size) {
+ for (j = 0; j < array[i].value.size; ++j) {
- return F_data_not;
- }
-#endif // _di_f_string_map_multis_increase_by_
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].value.array[j].string, &array[i].value.array[j].used, &array[i].value.array[j].size);
+ if (F_status_is_error(status)) return status;
+ } // for
-#ifndef _di_f_string_map_multis_resize_
- f_status_t f_string_map_multis_resize(const f_number_unsigned_t length, f_string_map_multis_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ status = f_memory_array_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].value.array, &array[i].value.used, &array[i].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
- return private_f_string_map_multis_resize(length, structure);
+ return F_okay;
}
-#endif // _di_f_string_map_multis_resize_
+#endif // _di_f_string_map_multis_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_map_multis_t_
/**
- * Resize the map_multis array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The map_multis array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multis_adjust_
- extern f_status_t f_string_map_multis_adjust(const f_number_unsigned_t length, f_string_map_multis_t * const structure);
-#endif // _di_f_string_map_multis_adjust_
-
-/**
* Append a single source map_multi onto the destination.
*
* @param source
#endif // _di_f_string_map_multis_append_all_
/**
- * Resize the map_multis array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_string_map_multis_t structure.
*
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The map_multis array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multis_decimate_by_
- extern f_status_t f_string_map_multis_decimate_by(const f_number_unsigned_t amount, f_string_map_multis_t * const structure);
-#endif // _di_f_string_map_multis_decimate_by_
-
-/**
- * Resize the map_multis array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The map_multis array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multis_decrease_by_
- extern f_status_t f_string_map_multis_decrease_by(const f_number_unsigned_t amount, f_string_map_multis_t * const structure);
-#endif // _di_f_string_map_multis_decrease_by_
-
-/**
- * Increase the size of the map_multis array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The map_multis array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_map_multis_increase_
- extern f_status_t f_string_map_multis_increase(const f_number_unsigned_t step, f_string_map_multis_t * const structure);
-#endif // _di_f_string_map_multis_increase_
+#ifndef _di_f_string_map_multis_delete_callback_
+ extern f_status_t f_string_map_multis_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_map_multis_delete_callback_
/**
- * Resize the map_multis array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_string_map_multis_t structure.
*
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The map_multis array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multis_increase_by_
- extern f_status_t f_string_map_multis_increase_by(const f_number_unsigned_t amount, f_string_map_multis_t * const structure);
-#endif // _di_f_string_map_multis_increase_by_
-
-/**
- * Resize the map_multis array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The map_multis array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_map_multis_resize_
- extern f_status_t f_string_map_multis_resize(const f_number_unsigned_t length, f_string_map_multis_t * const structure);
-#endif // _di_f_string_map_multis_resize_
+#ifndef _di_f_string_map_multis_destroy_callback_
+ extern f_status_t f_string_map_multis_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_map_multis_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#include "../string.h"
#include "../private-string.h"
-#include "private-dynamics.h"
-#include "private-map_multis.h"
-#include "private-map_multiss.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_map_multiss_adjust_
- f_status_t f_string_map_multiss_adjust(const f_number_unsigned_t length, f_string_map_multiss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_map_multiss_adjust(length, structure);
- }
-#endif // _di_f_string_map_multiss_adjust_
-
#ifndef _di_f_string_map_multiss_append_
f_status_t f_string_map_multiss_append(const f_string_map_multis_t source, f_string_map_multiss_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_map_multiss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_map_multis_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].used = 0;
+ f_string_map_multis_t * const destination_inner = &destination->array[destination->used];
- if (source.used) {
- status = private_f_string_map_multis_append_all(source, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+ destination_inner->used = 0;
+
+ if (source.used) {
+ status = f_memory_array_increase_by(source.used, sizeof(f_string_map_multi_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
+
+ f_string_map_multi_t * destination_inner_deep = 0;
+ f_number_unsigned_t j = 0;
+
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) {
+
+ destination_inner->array[destination_inner->used].name.used = 0;
+ destination_inner->array[destination_inner->used].value.used = 0;
+
+ if (source.array[i].name.used) {
+ status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination_inner->array[destination_inner->used].name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].value.used) {
+ destination_inner_deep = &destination_inner->array[destination_inner->used];
+
+ status = f_memory_array_increase_by(source.array[i].value.used, sizeof(f_string_dynamic_t), (void **) &destination_inner_deep->value.array, &destination_inner_deep->value.used, &destination_inner_deep->value.size);
+ if (F_status_is_error(status)) return status;
+
+ for (j = 0; j < source.array[i].value.used; ++j, ++destination_inner_deep->value.used) {
+
+ destination_inner_deep->value.array[destination_inner_deep->value.used].used = 0;
+
+ if (source.array[i].value.array[j].used) {
+ status = private_f_string_append(source.array[i].value.array[j].string, source.array[i].value.array[j].used, &destination_inner_deep->value.array[destination_inner_deep->value.used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+ } // for
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_map_multiss_resize(destination->used + source.used, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_map_multis_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+ f_number_unsigned_t j = 0;
+ f_number_unsigned_t k = 0;
+ f_string_map_multis_t * destination_inner = 0;
+ f_string_map_multi_t * destination_inner_deep = 0;
- destination->array[destination->used].used = 0;
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- if (source.array[i].used) {
- status = private_f_string_map_multis_append_all(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- return F_okay;
- }
-#endif // _di_f_string_map_multiss_append_all_
+ if (source.array[i].used) {
+ status = f_memory_array_increase_by(source.array[i].used, sizeof(f_string_map_multi_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
-#ifndef _di_f_string_map_multiss_decimate_by_
- f_status_t f_string_map_multiss_decimate_by(const f_number_unsigned_t amount, f_string_map_multiss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) {
- if (!amount) return F_data_not;
+ destination_inner_deep = &destination_inner->array[destination_inner->used];
- return private_f_string_map_multiss_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_map_multiss_decimate_by_
+ destination_inner_deep->name.used = 0;
+ destination_inner_deep->value.used = 0;
-#ifndef _di_f_string_map_multiss_decrease_by_
- f_status_t f_string_map_multiss_decrease_by(const f_number_unsigned_t amount, f_string_map_multiss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (source.array[i].array[j].name.used) {
+ status = private_f_string_append(source.array[i].array[j].name.string, source.array[i].array[j].name.used, &destination_inner_deep->name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].array[j].value.used) {
+ status = f_memory_array_increase_by(source.array[i].array[j].value.used, sizeof(f_string_dynamic_t), (void **) &destination_inner_deep->value.array, &destination_inner_deep->value.used, &destination_inner_deep->value.size);
+ if (F_status_is_error(status)) return status;
+
+ for (k = 0; k < source.array[i].array[j].value.used; ++k, ++destination_inner_deep->value.used) {
+
+ destination_inner_deep->value.array[destination_inner_deep->value.used].used = 0;
- if (!amount) return F_data_not;
+ if (source.array[i].array[j].value.array[k].used) {
+ status = private_f_string_append(source.array[i].array[j].value.array[k].string, source.array[i].array[j].value.array[k].used, &destination_inner_deep->value.array[destination_inner_deep->value.used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+ } // for
+ }
+ } // for
+ }
- return private_f_string_map_multiss_resize((structure->size > amount) ? structure->size - amount : 0, structure);
+ return F_okay;
}
-#endif // _di_f_string_map_multiss_decrease_by_
+#endif // _di_f_string_map_multiss_append_all_
-#ifndef _di_f_string_map_multiss_increase_
- f_status_t f_string_map_multiss_increase(const f_number_unsigned_t step, f_string_map_multiss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_map_multiss_delete_callback_
+ f_status_t f_string_map_multiss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+ {
+ f_string_map_multis_t * const array = (f_string_map_multis_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
+ f_number_unsigned_t k = 0;
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- length = F_number_t_size_unsigned_d;
- }
+ if (array[i].size) {
+ if (array[i].array[j].name.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (array[i].array[j].value.size) {
+ for (k = 0; k < array[i].array[j].value.size; ++k) {
- return private_f_string_map_multiss_resize(length, structure);
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].value.array[k].string, &array[i].array[j].value.array[k].used, &array[i].array[j].value.array[k].size);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_array_resize(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].value.array, &array[i].array[j].value.used, &array[i].array[j].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = f_memory_array_resize(0, sizeof(f_string_map_multi_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_map_multiss_increase_
+#endif // _di_f_string_map_multiss_delete_callback_
-#ifndef _di_f_string_map_multiss_increase_by_
- f_status_t f_string_map_multiss_increase_by(const f_number_unsigned_t amount, f_string_map_multiss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_map_multiss_destroy_callback_
+ f_status_t f_string_map_multiss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_map_multis_t * const array = (f_string_map_multis_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
+ f_number_unsigned_t k = 0;
- const f_number_unsigned_t length = structure->used + amount;
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (array[i].size) {
+ if (array[i].array[j].name.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_map_multiss_resize(length, structure);
- }
- }
+ if (array[i].array[j].value.size) {
+ for (k = 0; k < array[i].array[j].value.size; ++k) {
- return F_data_not;
- }
-#endif // _di_f_string_map_multiss_increase_by_
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].value.array[k].string, &array[i].array[j].value.array[k].used, &array[i].array[j].value.array[k].size);
+ if (F_status_is_error(status)) return status;
+ } // for
-#ifndef _di_f_string_map_multiss_resize_
- f_status_t f_string_map_multiss_resize(const f_number_unsigned_t length, f_string_map_multiss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ status = f_memory_array_adjust(0, sizeof(f_string_dynamic_t), (void **) &array[i].array[j].value.array, &array[i].array[j].value.used, &array[i].array[j].value.size);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_map_multiss_resize(length, structure);
+ status = f_memory_array_adjust(0, sizeof(f_string_map_multi_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+
+ return F_okay;
}
-#endif // _di_f_string_map_multiss_resize_
+#endif // _di_f_string_map_multiss_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_map_multiss_t_
/**
- * Resize the map_multiss array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The map_multiss array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multiss_adjust_
- extern f_status_t f_string_map_multiss_adjust(const f_number_unsigned_t length, f_string_map_multiss_t * const structure);
-#endif // _di_f_string_map_multiss_adjust_
-
-/**
* Append a single source map_multis onto the destination.
*
* @param source
#endif // _di_f_string_map_multiss_append_all_
/**
- * Resize the map_multiss array to a smaller size.
+ * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_map_multiss_t structure.
*
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The map_multiss array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multiss_decimate_by_
- extern f_status_t f_string_map_multiss_decimate_by(const f_number_unsigned_t amount, f_string_map_multiss_t * const structure);
-#endif // _di_f_string_map_multiss_decimate_by_
-
-/**
- * Resize the map_multiss array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The map_multiss array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multiss_decrease_by_
- extern f_status_t f_string_map_multiss_decrease_by(const f_number_unsigned_t amount, f_string_map_multiss_t * const structure);
-#endif // _di_f_string_map_multiss_decrease_by_
-
-/**
- * Increase the size of the map_multiss array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The map_multiss array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_map_multiss_increase_
- extern f_status_t f_string_map_multiss_increase(const f_number_unsigned_t step, f_string_map_multiss_t * const structure);
-#endif // _di_f_string_map_multiss_increase_
+#ifndef _di_f_string_map_multiss_delete_callback_
+ extern f_status_t f_string_map_multiss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_map_multiss_delete_callback_
/**
- * Resize the map_multiss array to a larger size.
+ * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_map_multiss_t structure.
*
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The map_multiss array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_map_multiss_increase_by_
- extern f_status_t f_string_map_multiss_increase_by(const f_number_unsigned_t amount, f_string_map_multiss_t * const structure);
-#endif // _di_f_string_map_multiss_increase_by_
-
-/**
- * Resize the map_multiss array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The map_multiss array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_map_multiss_resize_
- extern f_status_t f_string_map_multiss_resize(const f_number_unsigned_t length, f_string_map_multiss_t * const structure);
-#endif // _di_f_string_map_multiss_resize_
+#ifndef _di_f_string_map_multiss_destroy_callback_
+ extern f_status_t f_string_map_multiss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_map_multiss_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#include "../string.h"
#include "../private-string.h"
-#include "private-maps.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_maps_adjust_
- f_status_t f_string_maps_adjust(const f_number_unsigned_t length, f_string_maps_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_maps_adjust(length, structure);
- }
-#endif // _di_f_string_maps_adjust_
-
#ifndef _di_f_string_maps_append_
f_status_t f_string_maps_append(const f_string_map_t source, f_string_maps_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_maps_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_map_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].name.used = 0;
- destination->array[destination->used].value.used = 0;
+ destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].value.used = 0;
- if (source.name.used) {
- status = private_f_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
- if (F_status_is_error(status)) return status;
- }
+ if (source.name.used) {
+ status = private_f_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.value.used) {
- status = private_f_string_append(source.value.string, source.value.used, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
+ if (source.value.used) {
+ status = private_f_string_append(source.value.string, source.value.used, &destination->array[destination->used].value);
+ if (F_status_is_error(status)) return status;
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- return private_f_string_maps_append_all(source, destination);
- }
-#endif // _di_f_string_maps_append_all_
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_map_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
-#ifndef _di_f_string_maps_decimate_by_
- f_status_t f_string_maps_decimate_by(const f_number_unsigned_t amount, f_string_maps_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- if (!amount) return F_data_not;
+ destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].value.used = 0;
- return private_f_string_maps_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_maps_decimate_by_
+ if (source.array[i].name.used) {
+ status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
+ if (F_status_is_error(status)) return status;
+ }
-#ifndef _di_f_string_maps_decrease_by_
- f_status_t f_string_maps_decrease_by(const f_number_unsigned_t amount, f_string_maps_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) return F_data_not;
+ if (source.array[i].value.used) {
+ status = private_f_string_append(source.array[i].value.string, source.array[i].value.used, &destination->array[destination->used].value);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
- return private_f_string_maps_resize((structure->size > amount) ? structure->size - amount : 0, structure);
+ return F_okay;
}
-#endif // _di_f_string_maps_decrease_by_
+#endif // _di_f_string_maps_append_all_
-#ifndef _di_f_string_maps_increase_
- f_status_t f_string_maps_increase(const f_number_unsigned_t step, f_string_maps_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_maps_delete_callback_
+ f_status_t f_string_maps_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+ {
+ f_string_map_t * const array = (f_string_map_t *) void_array;
+ f_status_t status = F_okay;
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- length = F_number_t_size_unsigned_d;
- }
+ if (array[i].name.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_maps_resize(length, structure);
+ if (array[i].value.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].value.string, &array[i].value.used, &array[i].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_maps_increase_
+#endif // _di_f_string_maps_delete_callback_
-#ifndef _di_f_string_maps_increase_by_
- f_status_t f_string_maps_increase_by(const f_number_unsigned_t amount, f_string_maps_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_maps_destroy_callback_
+ f_status_t f_string_maps_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_map_t * const array = (f_string_map_t *) void_array;
+ f_status_t status = F_okay;
- const f_number_unsigned_t length = structure->used + amount;
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (array[i].name.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_maps_resize(length, structure);
- }
+ if (array[i].value.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].value.string, &array[i].value.used, &array[i].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
- }
-#endif // _di_f_string_maps_increase_by_
-
-#ifndef _di_f_string_maps_resize_
- f_status_t f_string_maps_resize(const f_number_unsigned_t length, f_string_maps_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_maps_resize(length, structure);
+ return F_okay;
}
-#endif // _di_f_string_maps_resize_
+#endif // _di_f_string_maps_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_maps_t_
/**
- * Resize the string maps array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string maps array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_maps_adjust_
- extern f_status_t f_string_maps_adjust(const f_number_unsigned_t length, f_string_maps_t * const structure);
-#endif // _di_f_string_maps_adjust_
-
-/**
* Append a single source map onto the destination.
*
* @param source
#endif // _di_f_string_maps_append_all_
/**
- * Resize the string maps array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_string_maps_t structure.
*
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string maps array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_maps_decimate_by_
- extern f_status_t f_string_maps_decimate_by(const f_number_unsigned_t amount, f_string_maps_t * const structure);
-#endif // _di_f_string_maps_decimate_by_
-
-/**
- * Resize the string maps array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string maps array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_maps_decrease_by_
- extern f_status_t f_string_maps_decrease_by(const f_number_unsigned_t amount, f_string_maps_t * const structure);
-#endif // _di_f_string_maps_decrease_by_
-
-/**
- * Increase the size of the string maps array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string maps array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_maps_increase_
- extern f_status_t f_string_maps_increase(const f_number_unsigned_t step, f_string_maps_t * const structure);
-#endif // _di_f_string_maps_increase_
+#ifndef _di_f_string_maps_delete_callback_
+ extern f_status_t f_string_maps_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_maps_delete_callback_
/**
- * Resize the string maps array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_string_maps_t structure.
*
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string maps array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_maps_increase_by_
- extern f_status_t f_string_maps_increase_by(const f_number_unsigned_t amount, f_string_maps_t * const structure);
-#endif // _di_f_string_maps_increase_by_
-
-/**
- * Resize the string maps array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string maps array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_maps_resize_
- extern f_status_t f_string_maps_resize(const f_number_unsigned_t length, f_string_maps_t * const structure);
-#endif // _di_f_string_maps_resize_
+#ifndef _di_f_string_maps_destroy_callback_
+ extern f_status_t f_string_maps_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_maps_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#include "../string.h"
#include "../private-string.h"
-#include "private-maps.h"
-#include "private-mapss.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_mapss_adjust_
- f_status_t f_string_mapss_adjust(const f_number_unsigned_t length, f_string_mapss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_mapss_adjust(length, structure);
- }
-#endif // _di_f_string_mapss_adjust_
-
#ifndef _di_f_string_mapss_append_
f_status_t f_string_mapss_append(const f_string_maps_t source, f_string_mapss_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_mapss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_maps_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].used = 0;
+ f_string_maps_t * const destination_inner = &destination->array[destination->used];
- if (source.used) {
- status = private_f_string_maps_append_all(source, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+ destination_inner->used = 0;
+
+ if (source.used) {
+ status = f_memory_array_increase_by(source.used, sizeof(f_string_map_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) {
+
+ destination_inner->array[destination_inner->used].name.used = 0;
+ destination_inner->array[destination_inner->used].value.used = 0;
+
+ if (source.array[i].name.used) {
+ status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination_inner->array[destination_inner->used].name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].value.used) {
+ status = private_f_string_append(source.array[i].value.string, source.array[i].value.used, &destination_inner->array[destination_inner->used].value);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_mapss_resize(destination->used + source.used, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_maps_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+ f_number_unsigned_t j = 0;
+ f_string_maps_t * destination_inner = 0;
- destination->array[destination->used].used = 0;
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- if (source.array[i].used) {
- status = private_f_string_maps_append_all(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_okay;
- }
-#endif // _di_f_string_mapss_append_all_
+ destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
-#ifndef _di_f_string_mapss_decimate_by_
- f_status_t f_string_mapss_decimate_by(const f_number_unsigned_t amount, f_string_mapss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (source.array[i].used) {
+ status = f_memory_array_increase_by(source.array[i].used, sizeof(f_string_map_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
- if (!amount) return F_data_not;
+ for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) {
- return private_f_string_mapss_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_mapss_decimate_by_
+ destination_inner->array[destination_inner->used].name.used = 0;
+ destination_inner->array[destination_inner->used].value.used = 0;
-#ifndef _di_f_string_mapss_decrease_by_
- f_status_t f_string_mapss_decrease_by(const f_number_unsigned_t amount, f_string_mapss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (source.array[i].array[j].name.used) {
+ status = private_f_string_append(source.array[i].array[j].name.string, source.array[i].array[j].name.used, &destination_inner->array[destination_inner->used].name);
+ if (F_status_is_error(status)) return status;
+ }
- if (!amount) return F_data_not;
+ if (source.array[i].array[j].value.used) {
+ status = private_f_string_append(source.array[i].array[j].value.string, source.array[i].array[j].value.used, &destination_inner->array[destination_inner->used].value);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+ } // for
+ }
- return private_f_string_mapss_resize((structure->size > amount) ? structure->size - amount : 0, structure);
+ return F_okay;
}
-#endif // _di_f_string_mapss_decrease_by_
+#endif // _di_f_string_mapss_append_all_
-#ifndef _di_f_string_mapss_increase_
- f_status_t f_string_mapss_increase(const f_number_unsigned_t step, f_string_mapss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_mapss_delete_callback_
+ f_status_t f_string_mapss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+ {
+ f_string_maps_t * const array = (f_string_maps_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- length = F_number_t_size_unsigned_d;
- }
+ if (array[i].size) {
+ for (j = 0; j < array[i].size; ++j) {
+
+ if (array[i].array[j].name.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_mapss_resize(length, structure);
+ if (array[i].array[j].value.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].value.string, &array[i].array[j].value.used, &array[i].array[j].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_mapss_increase_
+#endif // _di_f_string_mapss_delete_callback_
-#ifndef _di_f_string_mapss_increase_by_
- f_status_t f_string_mapss_increase_by(const f_number_unsigned_t amount, f_string_mapss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_mapss_destroy_callback_
+ f_status_t f_string_mapss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_maps_t * const array = (f_string_maps_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
- const f_number_unsigned_t length = structure->used + amount;
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (array[i].size) {
+ for (j = 0; j < array[i].size; ++j) {
- return private_f_string_mapss_resize(length, structure);
- }
- }
+ if (array[i].array[j].name.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (F_status_is_error(status)) return status;
+ }
- return F_data_not;
- }
-#endif // _di_f_string_mapss_increase_by_
+ if (array[i].array[j].value.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].value.string, &array[i].array[j].value.used, &array[i].array[j].value.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
-#ifndef _di_f_string_mapss_resize_
- f_status_t f_string_mapss_resize(const f_number_unsigned_t length, f_string_mapss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
- return private_f_string_mapss_resize(length, structure);
+ return F_okay;
}
-#endif // _di_f_string_mapss_resize_
+#endif // _di_f_string_mapss_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_mapss_t_
/**
- * Resize the string mapss array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string mapss array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_mapss_adjust_
- extern f_status_t f_string_mapss_adjust(const f_number_unsigned_t length, f_string_mapss_t * const structure);
-#endif // _di_f_string_mapss_adjust_
-
-/**
* Append a single source maps onto the destination.
*
* @param source
#endif // _di_f_string_mapss_append_all_
/**
- * Resize the string mapss array to a smaller size.
+ * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_mapss_t structure.
*
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string mapss array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_mapss_decimate_by_
- extern f_status_t f_string_mapss_decimate_by(const f_number_unsigned_t amount, f_string_mapss_t * const structure);
-#endif // _di_f_string_mapss_decimate_by_
-
-/**
- * Resize the string mapss array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string mapss array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_mapss_decrease_by_
- extern f_status_t f_string_mapss_decrease_by(const f_number_unsigned_t amount, f_string_mapss_t * const structure);
-#endif // _di_f_string_mapss_decrease_by_
-
-/**
- * Increase the size of the string mapss array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string mapss array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size) (or step is 0).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_mapss_increase_
- extern f_status_t f_string_mapss_increase(const f_number_unsigned_t step, f_string_mapss_t * const structure);
-#endif // _di_f_string_mapss_increase_
+#ifndef _di_f_string_mapss_delete_callback_
+ extern f_status_t f_string_mapss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_mapss_delete_callback_
/**
- * Resize the string mapss array to a larger size.
+ * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_mapss_t structure.
*
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string mapss array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_mapss_increase_by_
- extern f_status_t f_string_mapss_increase_by(const f_number_unsigned_t amount, f_string_mapss_t * const structure);
-#endif // _di_f_string_mapss_increase_by_
-
-/**
- * Resize the string mapss array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string mapss array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_mapss_resize_
- extern f_status_t f_string_mapss_resize(const f_number_unsigned_t length, f_string_mapss_t * const structure);
-#endif // _di_f_string_mapss_resize_
+#ifndef _di_f_string_mapss_destroy_callback_
+ extern f_status_t f_string_mapss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_mapss_destroy_callback_
#ifdef __cplusplus
} // extern "C"
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-dynamics.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
- f_status_t private_f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination) {
-
- {
- f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
-
- destination->array[destination->used].used = 0;
-
- if (source.used) {
- status = private_f_string_append(source.string, source.used, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- }
-
- ++destination->used;
-
- return F_okay;
- }
-#endif // !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
-
-#if !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
- f_status_t private_f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination) {
-
- {
- f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
-
- destination->array[destination->used].used = 0;
-
- if (source.array[i].used) {
- status = private_f_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
- }
-
- return F_okay;
- }
-#endif // !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_dynamics_h
-#define _PRIVATE_F_string_dynamics_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source string to append.
- * @param destination
- * The destination dynamics the source is appended onto.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_dynamics_append()
- * @see f_string_map_multis_append()
- * @see f_string_map_multis_append_all()
- */
-#if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
- extern f_status_t private_f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source strings to append.
- * @param destination
- * The destination dynamics the source is appended onto.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_dynamics_append_all()
- * @see f_string_map_multis_append()
- * @see f_string_map_multis_append_all()
- */
-#if !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
- extern f_status_t private_f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_dynamics_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-dynamics.h"
-#include "private-map_multis.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
- f_status_t private_f_string_map_multis_adjust(const f_number_unsigned_t length, f_string_map_multis_t * const structure) {
-
- {
- f_status_t status = F_okay;
- f_number_unsigned_t j = 0;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size);
- if (F_status_is_error(status)) return status;
-
- for (j = 0; j < structure->array[i].value.size; ++j) {
-
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].value.array[j].string, &structure->array[i].value.array[j].used, &structure->array[i].value.array[j].size);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_arrays_adjust(0, sizeof(f_string_dynamic_t), (void **) &structure->array[i].value.array, &structure->array[i].value.used, &structure->array[i].value.size, &f_string_dynamics_destroy_callback);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_adjust(length, sizeof(f_string_map_multi_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
-
-#if !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
- f_status_t private_f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t * const destination) {
-
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_map_multis_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
-
- destination->array[destination->used].name.used = 0;
- destination->array[destination->used].value.used = 0;
-
- if (source.array[i].name.used) {
- status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
- if (F_status_is_error(status)) return status;
- }
-
- if (source.array[i].value.used) {
- status = private_f_string_dynamics_append_all(source.array[i].value, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_okay;
- }
-#endif // !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
-
-#if !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
- f_status_t private_f_string_map_multis_resize(const f_number_unsigned_t length, f_string_map_multis_t * const structure) {
-
- {
- f_status_t status = F_okay;
- f_number_unsigned_t j = 0;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size);
- if (F_status_is_error(status)) return status;
-
- for (j = 0; j < structure->array[i].value.size; ++j) {
-
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].value.array[j].string, &structure->array[i].value.array[j].used, &structure->array[i].value.array[j].size);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &structure->array[i].value.array, &structure->array[i].value.used, &structure->array[i].value.size, &f_string_dynamics_delete_callback);
- if (F_status_is_error(status)) return status;
- } // for
- }
-
- return f_memory_array_resize(length, sizeof(f_string_map_multi_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_map_multis_h
-#define _PRIVATE_F_string_map_multis_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param map_multis
- * The map_multis to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- *
- * @see f_string_map_multis_adjust()
- */
-#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
- extern f_status_t private_f_string_map_multis_adjust(const f_number_unsigned_t length, f_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source destination to append.
- * @param destination
- * The destination map_multis the source is appended onto.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_map_multis_append_all()
- * @see f_string_map_multiss_append()
- * @see f_string_map_multiss_append_all()
- */
-#if !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
- extern f_status_t private_f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param map_multis
- * The map_multis to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_map_multis_append()
- * @see f_string_map_multis_append_all()
- * @see f_string_map_multis_decrease_by()
- * @see f_string_map_multis_increase()
- * @see f_string_map_multis_increase_by()
- * @see f_string_map_multis_resize()
- * @see f_string_map_multiss_append()
- * @see f_string_map_multiss_append_all()
- * @see f_string_map_multiss_decrease_by()
- * @see f_string_map_multiss_increase()
- * @see f_string_map_multiss_increase_by()
- */
-#if !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
- extern f_status_t private_f_string_map_multis_resize(const f_number_unsigned_t length, f_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_map_multis_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-dynamics.h"
-#include "private-map_multis.h"
-#include "private-map_multiss.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
- f_status_t private_f_string_map_multiss_adjust(const f_number_unsigned_t length, f_string_map_multiss_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = private_f_string_map_multis_adjust(0, &structure->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_map_multis_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
-
-#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
- f_status_t private_f_string_map_multiss_resize(const f_number_unsigned_t length, f_string_map_multiss_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = private_f_string_map_multis_resize(0, &structure->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_map_multis_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_map_multiss_h
-#define _PRIVATE_F_string_map_multiss_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The map_multiss to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- *
- * @see f_string_map_multiss_adjust()
- */
-#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
- extern f_status_t private_f_string_map_multiss_adjust(const f_number_unsigned_t length, f_string_map_multiss_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The map_multiss to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_map_multiss_decrease_by()
- * @see f_string_map_multiss_increase()
- * @see f_string_map_multiss_increase_by()
- */
-#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
- extern f_status_t private_f_string_map_multiss_resize(const f_number_unsigned_t length, f_string_map_multiss_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_map_multiss_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-maps.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
- f_status_t private_f_string_maps_adjust(const f_number_unsigned_t length, f_string_maps_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &structure->array[i].value.string, &structure->array[i].value.used, &structure->array[i].value.size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_map_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
-
-#if !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
- f_status_t private_f_string_maps_append_all(const f_string_maps_t source, f_string_maps_t * const destination) {
-
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_maps_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
-
- destination->array[destination->used].name.used = 0;
- destination->array[destination->used].value.used = 0;
-
- if (source.array[i].name.used) {
- status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
- if (F_status_is_error(status)) return status;
- }
-
- if (source.array[i].value.used) {
- status = private_f_string_append(source.array[i].value.string, source.array[i].value.used, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_okay;
- }
-#endif // !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
-
-#if !defined(_di_f_string_maps_append_) || !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_resize_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
- f_status_t private_f_string_maps_resize(const f_number_unsigned_t length, f_string_maps_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &structure->array[i].value.string, &structure->array[i].value.used, &structure->array[i].value.size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_map_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_maps_append_) || !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_resize_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_maps_h
-#define _PRIVATE_F_string_maps_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The maps to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- *
- * @see f_string_maps_adjust()
- */
-#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
- extern f_status_t private_f_string_maps_adjust(const f_number_unsigned_t length, f_string_maps_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source destination to append.
- * @param destination
- * The destination maps the source is appended onto.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_maps_append_all()
- * @see f_string_mapss_append()
- * @see f_string_mapss_append_all()
- */
-#if !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
- extern f_status_t private_f_string_maps_append_all(const f_string_maps_t source, f_string_maps_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The maps to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_maps_append()
- * @see f_string_maps_append_all()
- * @see f_string_maps_decrease_by()
- * @see f_string_maps_increase()
- * @see f_string_maps_increase_by()
- * @see f_string_maps_resize()
- * @see f_string_mapss_append()
- * @see f_string_mapss_append_all()
- * @see f_string_mapss_decrease_by()
- * @see f_string_mapss_increase()
- * @see f_string_mapss_increase_by()
- */
-#if !defined(_di_f_string_maps_append_) || !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_resize_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
- extern f_status_t private_f_string_maps_resize(const f_number_unsigned_t length, f_string_maps_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_maps_append_) || !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_resize_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_maps_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-maps.h"
-#include "private-mapss.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
- f_status_t private_f_string_mapss_adjust(const f_number_unsigned_t length, f_string_mapss_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = private_f_string_maps_adjust(0, &structure->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_maps_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
-
-#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
- f_status_t private_f_string_mapss_resize(const f_number_unsigned_t length, f_string_mapss_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = private_f_string_maps_resize(0, &structure->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_maps_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_mapss_h
-#define _PRIVATE_F_string_mapss_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The structure to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- *
- * @see f_string_mapss_adjust()
- */
-#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
- extern f_status_t private_f_string_mapss_adjust(const f_number_unsigned_t length, f_string_mapss_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The structure to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_mapss_decrease_by()
- * @see f_string_mapss_increase()
- * @see f_string_mapss_increase_by()
- */
-#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
- extern f_status_t private_f_string_mapss_resize(const f_number_unsigned_t length, f_string_mapss_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_mapss_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-quantitys.h"
-#include "private-quantityss.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
- f_status_t private_f_string_quantityss_adjust(const f_number_unsigned_t length, f_string_quantityss_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_adjust(length, sizeof(f_string_quantitys_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_quantitys_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
-
-#if !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_)
- f_status_t private_f_string_quantityss_resize(const f_number_unsigned_t length, f_string_quantityss_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_string_quantity_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_quantitys_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_quantityss_h
-#define _PRIVATE_F_string_quantityss_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The structure to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- *
- * @see f_string_quantityss_adjust()
- */
-#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
- extern f_status_t private_f_string_quantityss_adjust(const f_number_unsigned_t length, f_string_quantityss_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The structure to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- *
- * @see f_string_quantityss_decrease_by()
- * @see f_string_quantityss_increase()
- * @see f_string_quantityss_increase_by()
- */
-#if !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_)
- extern f_status_t private_f_string_quantityss_resize(const f_number_unsigned_t length, f_string_quantityss_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_quantityss_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-ranges.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
- f_status_t private_f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination) {
-
- if (destination->used + source.used > destination->size) {
- const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_range_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i) {
-
- destination->array[destination->used].start = source.array[i].start;
- destination->array[destination->used++].stop = source.array[i].stop;
- } // for
-
- return F_okay;
- }
-#endif // !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_ranges_h
-#define _PRIVATE_F_string_ranges_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source ranges to append.
- * @param destination
- * The destination ranges the source is appended onto.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_ranges_append_all()
- * @see f_string_rangess_append()
- * @see f_string_rangess_append_all()
- */
-#if !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
- extern f_status_t private_f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_ranges_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-ranges.h"
-#include "private-rangess.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
- f_status_t private_f_string_rangess_adjust(const f_number_unsigned_t length, f_string_rangess_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_ranges_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
-
-#if !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
- f_status_t private_f_string_rangess_resize(const f_number_unsigned_t length, f_string_rangess_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_ranges_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_rangess_h
-#define _PRIVATE_F_string_rangess_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The structure to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_rangess_adjust()
- */
-#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
- extern f_status_t private_f_string_rangess_adjust(const f_number_unsigned_t length, f_string_rangess_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The structure to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_rangess_append()
- * @see f_string_rangess_append_all()
- * @see f_string_rangess_decrease_by()
- * @see f_string_rangess_increase()
- * @see f_string_rangess_increase_by()
- */
-#if !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
- extern f_status_t private_f_string_rangess_resize(const f_number_unsigned_t length, f_string_rangess_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_rangess_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-triples.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- f_status_t private_f_string_triples_adjust(const f_number_unsigned_t length, f_string_triples_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &structure->array[i].a.string, &structure->array[i].a.used, &structure->array[i].a.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &structure->array[i].b.string, &structure->array[i].b.used, &structure->array[i].b.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &structure->array[i].c.string, &structure->array[i].c.used, &structure->array[i].c.size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_triple_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-#if !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
- f_status_t private_f_string_triples_append_all(const f_string_triples_t source, f_string_triples_t * const destination) {
-
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_triples_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
-
- destination->array[destination->used].a.used = 0;
- destination->array[destination->used].b.used = 0;
- destination->array[destination->used].c.used = 0;
-
- if (source.array[i].a.used) {
- status = private_f_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a);
- if (F_status_is_error(status)) return status;
- }
-
- if (source.array[i].b.used) {
- status = private_f_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b);
- if (F_status_is_error(status)) return status;
- }
-
- if (source.array[i].c.used) {
- status = private_f_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_okay;
- }
-#endif // !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
-
-#if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_)
- f_status_t private_f_string_triples_resize(const f_number_unsigned_t length, f_string_triples_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &structure->array[i].a.string, &structure->array[i].a.used, &structure->array[i].a.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &structure->array[i].b.string, &structure->array[i].b.used, &structure->array[i].b.size);
- if (F_status_is_error(status)) return status;
-
- status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &structure->array[i].c.string, &structure->array[i].c.used, &structure->array[i].c.size);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_triple_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_triple_h
-#define _PRIVATE_F_string_triple_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The triples to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_triples_adjust()
- */
-#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- extern f_status_t private_f_string_triples_adjust(const f_number_unsigned_t length, f_string_triples_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source destination to append.
- * @param destination
- * The destination triples the source is appended onto.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_triples_append_all()
- * @see f_string_tripless_append()
- * @see f_string_tripless_append_all()
- */
-#if !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
- extern f_status_t private_f_string_triples_append_all(const f_string_triples_t source, f_string_triples_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The triples to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_triples_decrease_by()
- * @see f_string_triples_increase()
- * @see f_string_triples_increase_by()
- */
-#if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_)
- extern f_status_t private_f_string_triples_resize(const f_number_unsigned_t length, f_string_triples_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The tripless to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_tripless_adjust()
- */
-#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
- extern f_status_t private_f_string_tripless_adjust(const f_number_unsigned_t length, f_string_tripless_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The tripless to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_tripless_decrease_by()
- * @see f_string_tripless_increase()
- * @see f_string_tripless_increase_by()
- */
-#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
- extern f_status_t private_f_string_tripless_resize(const f_number_unsigned_t length, f_string_tripless_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_triple_h
+++ /dev/null
-#include "../string.h"
-#include "../private-string.h"
-#include "private-triples.h"
-#include "private-tripless.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
- f_status_t private_f_string_tripless_adjust(const f_number_unsigned_t length, f_string_tripless_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = private_f_string_triples_adjust(0, &structure->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_adjust(length, sizeof(f_string_triples_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
-
-#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
- f_status_t private_f_string_tripless_resize(const f_number_unsigned_t length, f_string_tripless_t * const structure) {
-
- f_status_t status = F_okay;
-
- for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
- status = private_f_string_triples_resize(0, &structure->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return f_memory_array_resize(length, sizeof(f_string_triples_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: String
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_string_tripless_h
-#define _PRIVATE_F_string_tripless_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The tripless to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_tripless_adjust()
- */
-#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
- extern f_status_t private_f_string_tripless_adjust(const f_number_unsigned_t length, f_string_tripless_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The tripless to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_tripless_decrease_by()
- * @see f_string_tripless_increase()
- * @see f_string_tripless_increase_by()
- */
-#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
- extern f_status_t private_f_string_tripless_resize(const f_number_unsigned_t length, f_string_tripless_t * const structure) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_string_tripless_h
#include "../string.h"
#include "../private-string.h"
-#include "private-quantitys.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_quantitys_adjust_
- f_status_t f_string_quantitys_adjust(const f_number_unsigned_t length, f_string_quantitys_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_adjust(length, sizeof(f_string_quantity_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_quantitys_adjust_
-
#ifndef _di_f_string_quantitys_append_
f_status_t f_string_quantitys_append(const f_string_quantity_t source, f_string_quantitys_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (destination->used + 1 > destination->size) {
+ {
const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_quantity_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
if (!source.used) return F_data_not;
- return private_f_string_quantitys_append_all(source, destination);
- }
-#endif // _di_f_string_quantitys_append_all_
-
-#ifndef _di_f_string_quantitys_decimate_by_
- f_status_t f_string_quantitys_decimate_by(const f_number_unsigned_t amount, f_string_quantitys_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_decimate_by(amount, sizeof(f_string_quantity_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_quantitys_decimate_by_
-
-#ifndef _di_f_string_quantitys_decrease_by_
- f_status_t f_string_quantitys_decrease_by(const f_number_unsigned_t amount, f_string_quantitys_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
-
- return f_memory_array_decrease_by(amount, sizeof(f_string_quantity_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_quantitys_decrease_by_
-
-#ifndef _di_f_string_quantitys_increase_
- f_status_t f_string_quantitys_increase(const f_number_unsigned_t step, f_string_quantitys_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_increase(step, sizeof(f_string_quantity_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_quantitys_increase_
-
-#ifndef _di_f_string_quantitys_increase_by_
- f_status_t f_string_quantitys_increase_by(const f_number_unsigned_t amount, f_string_quantitys_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_quantity_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
+ }
- return f_memory_array_increase_by(amount, sizeof(f_string_quantity_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_quantitys_increase_by_
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
-#ifndef _di_f_string_quantitys_resize_
- f_status_t f_string_quantitys_resize(const f_number_unsigned_t length, f_string_quantitys_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ destination->array[destination->used].start = source.array[i].start;
+ destination->array[destination->used].total = source.array[i].total;
+ } // for
- return f_memory_array_resize(length, sizeof(f_string_quantity_t), (void **) &structure->array, &structure->used, &structure->size);
+ return F_okay;
}
-#endif // _di_f_string_quantitys_resize_
+#endif // _di_f_string_quantitys_append_all_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_quantitys_t_
/**
- * Resize the string quantitys array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string quantitys array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantitys_adjust_
- extern f_status_t f_string_quantitys_adjust(const f_number_unsigned_t length, f_string_quantitys_t * const structure);
-#endif // _di_f_string_quantitys_adjust_
-
-/**
* Append the single source quantity onto the destination.
*
* @param source
extern f_status_t f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination);
#endif // _di_f_string_quantitys_append_all_
-/**
- * Resize the string quantitys array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string quantitys array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantitys_decimate_by_
- extern f_status_t f_string_quantitys_decimate_by(const f_number_unsigned_t amount, f_string_quantitys_t * const structure);
-#endif // _di_f_string_quantitys_decimate_by_
-
-/**
- * Resize the string quantitys array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string quantitys array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantitys_decrease_by_
- extern f_status_t f_string_quantitys_decrease_by(const f_number_unsigned_t amount, f_string_quantitys_t * const structure);
-#endif // _di_f_string_quantitys_decrease_by_
-
-/**
- * Increase the size of the string quantitys array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string quantitys array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantitys_increase_
- extern f_status_t f_string_quantitys_increase(const f_number_unsigned_t step, f_string_quantitys_t * const structure);
-#endif // _di_f_string_quantitys_increase_
-
-/**
- * Resize the string quantitys array to a larger size.
- *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string quantitys array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantitys_increase_by_
- extern f_status_t f_string_quantitys_increase_by(const f_number_unsigned_t amount, f_string_quantitys_t * const structure);
-#endif // _di_f_string_quantitys_increase_by_
-
-/**
- * Resize the string quantitys array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string quantitys array to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantitys_resize_
- extern f_status_t f_string_quantitys_resize(const f_number_unsigned_t length, f_string_quantitys_t * const structure);
-#endif // _di_f_string_quantitys_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include "../string.h"
#include "../private-string.h"
-#include "private-quantitys.h"
-#include "private-quantityss.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_quantityss_adjust_
- f_status_t f_string_quantityss_adjust(const f_number_unsigned_t length, f_string_quantityss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_quantityss_adjust(length, structure);
- }
-#endif // _di_f_string_quantityss_adjust_
-
#ifndef _di_f_string_quantityss_append_
f_status_t f_string_quantityss_append(const f_string_quantitys_t source, f_string_quantityss_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_quantityss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_quantitys_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].used = 0;
+ f_string_quantitys_t * const destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- if (source.used) {
- status = private_f_string_quantitys_append_all(source, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+ if (source.used) {
+ status = f_memory_array_increase_by(source.used, sizeof(f_string_quantity_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) {
+
+ destination_inner->array[destination_inner->used].start = source.array[i].start;
+ destination_inner->array[destination_inner->used].total = source.array[i].total;
+ } // for
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_quantityss_resize(destination->used + source.used, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_quantitys_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
-
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- destination->array[destination->used].used = 0;
-
- if (source.array[i].used) {
- status = private_f_string_quantitys_append_all(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ f_string_quantitys_t * destination_inner = 0;
+ f_number_unsigned_t j = 0;
- return F_okay;
- }
-#endif // _di_f_string_quantityss_append_all_
-
-#ifndef _di_f_string_quantityss_decimate_by_
- f_status_t f_string_quantityss_decimate_by(const f_number_unsigned_t amount, f_string_quantityss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- if (!amount) return F_data_not;
+ destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- return private_f_string_quantityss_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_quantityss_decimate_by_
+ if (source.array[i].used) {
+ status = f_memory_array_increase_by(source.array[i].used, sizeof(f_string_quantity_t), (void **) &destination->array[destination->used].array, &destination->array[destination->used].used, &destination->array[destination->used].size);
+ if (F_status_is_error(status)) return status;
-#ifndef _di_f_string_quantityss_decrease_by_
- f_status_t f_string_quantityss_decrease_by(const f_number_unsigned_t amount, f_string_quantityss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) {
- if (!amount) return F_data_not;
+ destination_inner->array[destination_inner->used].start = source.array[i].array[j].start;
+ destination_inner->array[destination_inner->used].total = source.array[i].array[j].total;
+ } // for
+ }
+ } // for
+ }
- return private_f_string_quantityss_resize((structure->size > amount) ? structure->size - amount : 0, structure);
+ return F_okay;
}
-#endif // _di_f_string_quantityss_decrease_by_
-
-#ifndef _di_f_string_quantityss_increase_
- f_status_t f_string_quantityss_increase(const f_number_unsigned_t step, f_string_quantityss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#endif // _di_f_string_quantityss_append_all_
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+#ifndef _di_f_string_quantityss_delete_callback_
+ f_status_t f_string_quantityss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_quantitys_t * const array = (f_string_quantitys_t *) void_array;
+ f_status_t status = F_okay;
- length = F_number_t_size_unsigned_d;
- }
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- return private_f_string_quantityss_resize(length, structure);
+ if (array[i].size) {
+ status = f_memory_array_resize(0, sizeof(f_string_quantity_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_quantityss_increase_
+#endif // _di_f_string_quantityss_delete_callback_
-#ifndef _di_f_string_quantityss_increase_by_
- f_status_t f_string_quantityss_increase_by(const f_number_unsigned_t amount, f_string_quantityss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#ifndef _di_f_string_quantityss_destroy_callback_
+ f_status_t f_string_quantityss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- const f_number_unsigned_t length = structure->used + amount;
+ {
+ f_string_quantitys_t * const array = (f_string_quantitys_t *) void_array;
+ f_status_t status = F_okay;
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- return private_f_string_quantityss_resize(length, structure);
- }
+ if (array[i].size) {
+ status = f_memory_array_adjust(0, sizeof(f_string_quantity_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
- }
-#endif // _di_f_string_quantityss_increase_by_
-
-#ifndef _di_f_string_quantityss_resize_
- f_status_t f_string_quantityss_resize(const f_number_unsigned_t length, f_string_quantityss_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_quantityss_resize(length, structure);
+ return F_okay;
}
-#endif // _di_f_string_quantityss_resize_
-
+#endif // _di_f_string_quantityss_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_string_quantityss_t_
/**
- * Resize the string quantityss array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string quantityss array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantityss_adjust_
- extern f_status_t f_string_quantityss_adjust(const f_number_unsigned_t length, f_string_quantityss_t * const structure);
-#endif // _di_f_string_quantityss_adjust_
-
-/**
* Append the single source quantitys onto the destination.
*
* @param source
#endif // _di_f_string_quantityss_append_all_
/**
- * Resize the string quantityss array to a smaller size.
+ * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_quantityss_t structure.
*
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string quantityss array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantityss_decimate_by_
- extern f_status_t f_string_quantityss_decimate_by(const f_number_unsigned_t amount, f_string_quantityss_t * const structure);
-#endif // _di_f_string_quantityss_decimate_by_
-
-/**
- * Resize the string quantityss array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string quantityss array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantityss_decrease_by_
- extern f_status_t f_string_quantityss_decrease_by(const f_number_unsigned_t amount, f_string_quantityss_t * const structure);
-#endif // _di_f_string_quantityss_decrease_by_
-
-/**
- * Increase the size of the string quantityss array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string quantityss array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_quantityss_increase_
- extern f_status_t f_string_quantityss_increase(const f_number_unsigned_t step, f_string_quantityss_t * const structure);
-#endif // _di_f_string_quantityss_increase_
+#ifndef _di_f_string_quantityss_delete_callback_
+ extern f_status_t f_string_quantityss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_quantityss_delete_callback_
/**
- * Resize the string quantityss array to a larger size.
+ * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_quantityss_t structure.
*
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string quantityss array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_quantityss_increase_by_
- extern f_status_t f_string_quantityss_increase_by(const f_number_unsigned_t amount, f_string_quantityss_t * const structure);
-#endif // _di_f_string_quantityss_increase_by_
-
-/**
- * Resize the string quantityss array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string quantityss array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_quantityss_resize_
- extern f_status_t f_string_quantityss_resize(const f_number_unsigned_t length, f_string_quantityss_t * const structure);
-#endif // _di_f_string_quantityss_resize_
+#ifndef _di_f_string_quantityss_destroy_callback_
+ extern f_status_t f_string_quantityss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_quantityss_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#include "../string.h"
#include "../private-string.h"
-#include "private-ranges.h"
#ifdef __cplusplus
extern "C" {
#include "../string.h"
#include "../private-string.h"
-#include "private-ranges.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_ranges_adjust_
- f_status_t f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_adjust(length, sizeof(f_string_range_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_ranges_adjust_
-
#ifndef _di_f_string_ranges_append_
f_status_t f_string_ranges_append(const f_string_range_t source, f_string_ranges_t * const destination) {
#ifndef _di_level_0_parameter_checking_
}
#endif // _di_f_string_ranges_append_all_
-#ifndef _di_f_string_ranges_decimate_by_
- f_status_t f_string_ranges_decimate_by(const f_number_unsigned_t amount, f_string_ranges_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) return F_data_not;
-
- return f_memory_array_decimate_by(amount, sizeof(f_string_range_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_ranges_decimate_by_
-
-#ifndef _di_f_string_ranges_decrease_by_
- f_status_t f_string_ranges_decrease_by(const f_number_unsigned_t amount, f_string_ranges_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_decrease_by(amount, sizeof(f_string_range_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_ranges_decrease_by_
-
-#ifndef _di_f_string_ranges_increase_
- f_status_t f_string_ranges_increase(const f_number_unsigned_t step, f_string_ranges_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_increase(step, sizeof(f_string_range_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_ranges_increase_
-
-#ifndef _di_f_string_ranges_increase_by_
- f_status_t f_string_ranges_increase_by(const f_number_unsigned_t amount, f_string_ranges_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_increase_by(amount, sizeof(f_string_range_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_ranges_increase_by_
-
-#ifndef _di_f_string_ranges_resize_
- f_status_t f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &structure->array, &structure->used, &structure->size);
- }
-#endif // _di_f_string_ranges_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_string_ranges_t_
/**
- * Resize the string ranges array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string ranges array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_string_ranges_adjust_
- extern f_status_t f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-#endif // _di_f_string_ranges_adjust_
-
-/**
* Append the single source range onto the destination.
*
* @param source
extern f_status_t f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination);
#endif // _di_f_string_ranges_append_all_
-/**
- * Resize the string ranges array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string ranges array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_ranges_decimate_by_
- extern f_status_t f_string_ranges_decimate_by(const f_number_unsigned_t amount, f_string_ranges_t * const structure);
-#endif // _di_f_string_ranges_decimate_by_
-
-/**
- * Resize the string ranges array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string ranges array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_ranges_decrease_by_
- extern f_status_t f_string_ranges_decrease_by(const f_number_unsigned_t amount, f_string_ranges_t * const structure);
-#endif // _di_f_string_ranges_decrease_by_
-
-/**
- * Increase the size of the string ranges array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string ranges array to resize.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * @return
- * F_okay on success.
- * F_array_too_large (with error bit) if the new array length is too large.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_ranges_increase_
- extern f_status_t f_string_ranges_increase(const f_number_unsigned_t step, f_string_ranges_t * const structure);
-#endif // _di_f_string_ranges_increase_
-
-/**
- * Resize the string ranges array to a larger size.
- *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string ranges array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_ranges_increase_by_
- extern f_status_t f_string_ranges_increase_by(const f_number_unsigned_t amount, f_string_ranges_t * const structure);
-#endif // _di_f_string_ranges_increase_by_
-
-/**
- * Resize the string ranges array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string ranges array to adjust.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_ranges_resize_
- extern f_status_t f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const structure);
-#endif // _di_f_string_ranges_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include "../string.h"
#include "../private-string.h"
-#include "private-ranges.h"
-#include "private-rangess.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_rangess_adjust_
- f_status_t f_string_rangess_adjust(const f_number_unsigned_t length, f_string_rangess_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_rangess_adjust(length, structure);
- }
-#endif // _di_f_string_rangess_adjust_
-
#ifndef _di_f_string_rangess_append_
f_status_t f_string_rangess_append(const f_string_ranges_t source, f_string_rangess_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_rangess_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_ranges_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].used = 0;
+ f_string_ranges_t * const destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- if (source.used) {
- status = private_f_string_ranges_append_all(source, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+ if (source.used) {
+ status = f_memory_array_increase_by(source.used, sizeof(f_string_range_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) {
+
+ destination_inner->array[destination_inner->used].start = source.array[i].start;
+ destination_inner->array[destination_inner->used].stop = source.array[i].stop;
+ } // for
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_rangess_resize(destination->used + source.used, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_ranges_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+ f_string_ranges_t * destination_inner = 0;
+ f_number_unsigned_t j = 0;
- destination->array[destination->used].used = 0;
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- if (source.array[i].used) {
- status = private_f_string_ranges_append_all(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- return F_okay;
- }
-#endif // _di_f_string_rangess_append_all_
+ if (source.array[i].used) {
+ status = f_memory_array_increase_by(source.array[i].used, sizeof(f_string_range_t), (void **) &destination->array[destination->used].array, &destination->array[destination->used].used, &destination->array[destination->used].size);
+ if (F_status_is_error(status)) return status;
-#ifndef _di_f_string_rangess_decimate_by_
- f_status_t f_string_rangess_decimate_by(const f_number_unsigned_t amount, f_string_rangess_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) {
- if (!amount) return F_data_not;
-
- return private_f_string_rangess_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_rangess_decimate_by_
-
-#ifndef _di_f_string_rangess_decrease_by_
- f_status_t f_string_rangess_decrease_by(const f_number_unsigned_t amount, f_string_rangess_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) return F_data_not;
+ destination_inner->array[destination_inner->used].start = source.array[i].array[j].start;
+ destination_inner->array[destination_inner->used].stop = source.array[i].array[j].stop;
+ } // for
+ }
+ } // for
+ }
- return private_f_string_rangess_resize((structure->size > amount) ? structure->size - amount : 0, structure);
+ return F_okay;
}
-#endif // _di_f_string_rangess_decrease_by_
-
-#ifndef _di_f_string_rangess_increase_
- f_status_t f_string_rangess_increase(const f_number_unsigned_t step, f_string_rangess_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#endif // _di_f_string_rangess_append_all_
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+#ifndef _di_f_string_rangess_delete_callback_
+ f_status_t f_string_rangess_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_ranges_t * const array = (f_string_ranges_t *) void_array;
+ f_status_t status = F_okay;
- length = F_number_t_size_unsigned_d;
- }
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- return private_f_string_rangess_resize(length, structure);
+ if (array[i].size) {
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_rangess_increase_
-
-#ifndef _di_f_string_rangess_increase_by_
- f_status_t f_string_rangess_increase_by(const f_number_unsigned_t amount, f_string_rangess_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#endif // _di_f_string_rangess_delete_callback_
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#ifndef _di_f_string_rangess_destroy_callback_
+ f_status_t f_string_rangess_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- const f_number_unsigned_t length = structure->used + amount;
+ {
+ f_string_ranges_t * const array = (f_string_ranges_t *) void_array;
+ f_status_t status = F_okay;
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- return private_f_string_rangess_resize(length, structure);
- }
+ if (array[i].size) {
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
- }
-#endif // _di_f_string_rangess_increase_by_
-
-#ifndef _di_f_string_rangess_resize_
- f_status_t f_string_rangess_resize(const f_number_unsigned_t length, f_string_rangess_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_rangess_resize(length, structure);
+ return F_okay;
}
-#endif // _di_f_string_rangess_resize_
+#endif // _di_f_string_rangess_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_rangess_t_
/**
- * Resize the string rangess array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string rangess array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_rangess_adjust_
- extern f_status_t f_string_rangess_adjust(const f_number_unsigned_t length, f_string_rangess_t * const structure);
-#endif // _di_f_string_rangess_adjust_
-
-/**
* Append the single source ranges onto the destination.
*
* @param source
#endif // _di_f_string_rangess_append_all_
/**
- * Resize the string rangess array to a smaller size.
+ * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_rangess_t structure.
*
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string rangess array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_rangess_decimate_by_
- extern f_status_t f_string_rangess_decimate_by(const f_number_unsigned_t amount, f_string_rangess_t * const structure);
-#endif // _di_f_string_rangess_decimate_by_
-
-/**
- * Resize the string rangess array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string rangess array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_rangess_decrease_by_
- extern f_status_t f_string_rangess_decrease_by(const f_number_unsigned_t amount, f_string_rangess_t * const structure);
-#endif // _di_f_string_rangess_decrease_by_
-
-/**
- * Increase the size of the string rangess array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string rangess array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_rangess_increase_
- extern f_status_t f_string_rangess_increase(const f_number_unsigned_t step, f_string_rangess_t * const structure);
-#endif // _di_f_string_rangess_increase_
+#ifndef _di_f_string_rangess_delete_callback_
+ extern f_status_t f_string_rangess_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_rangess_delete_callback_
/**
- * Resize the string rangess array to a larger size.
+ * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_rangess_t structure.
*
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string rangess array to resize.
+ * This does not do parameter checking.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_rangess_increase_by_
- extern f_status_t f_string_rangess_increase_by(const f_number_unsigned_t amount, f_string_rangess_t * const structure);
-#endif // _di_f_string_rangess_increase_by_
-
-/**
- * Resize the string rangess array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string rangess array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_rangess_resize_
- extern f_status_t f_string_rangess_resize(const f_number_unsigned_t length, f_string_rangess_t * const structure);
-#endif // _di_f_string_rangess_resize_
+#ifndef _di_f_string_rangess_destroy_callback_
+ extern f_status_t f_string_rangess_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_rangess_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#include "../string.h"
#include "../private-string.h"
-#include "private-triples.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_triples_adjust_
- f_status_t f_string_triples_adjust(const f_number_unsigned_t length, f_string_triples_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_triples_adjust(length, structure);
- }
-#endif // _di_f_string_triples_adjust_
-
#ifndef _di_f_string_triples_append_
f_status_t f_string_triples_append(const f_string_triple_t source, f_string_triples_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_triples_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_triple_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].a.used = 0;
- destination->array[destination->used].b.used = 0;
- destination->array[destination->used].c.used = 0;
+ destination->array[destination->used].a.used = 0;
+ destination->array[destination->used].b.used = 0;
+ destination->array[destination->used].c.used = 0;
- if (source.a.used) {
- status = private_f_string_append(source.a.string, source.a.used, &destination->array[destination->used].a);
- if (F_status_is_error(status)) return status;
- }
+ if (source.a.used) {
+ status = private_f_string_append(source.a.string, source.a.used, &destination->array[destination->used].a);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.b.used) {
- status = private_f_string_append(source.b.string, source.b.used, &destination->array[destination->used].b);
- if (F_status_is_error(status)) return status;
- }
+ if (source.b.used) {
+ status = private_f_string_append(source.b.string, source.b.used, &destination->array[destination->used].b);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.c.used) {
- status = private_f_string_append(source.c.string, source.c.used, &destination->array[destination->used].c);
- if (F_status_is_error(status)) return status;
+ if (source.c.used) {
+ status = private_f_string_append(source.c.string, source.c.used, &destination->array[destination->used].c);
+ if (F_status_is_error(status)) return status;
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_triples_resize(destination->used + source.used, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_triple_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- destination->array[destination->used].a.used = 0;
- destination->array[destination->used].b.used = 0;
- destination->array[destination->used].c.used = 0;
+ destination->array[destination->used].a.used = 0;
+ destination->array[destination->used].b.used = 0;
+ destination->array[destination->used].c.used = 0;
- if (source.array[i].a.used) {
- status = private_f_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a);
- if (F_status_is_error(status)) return status;
- }
+ if (source.array[i].a.used) {
+ status = private_f_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.array[i].b.used) {
- status = private_f_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b);
- if (F_status_is_error(status)) return status;
- }
+ if (source.array[i].b.used) {
+ status = private_f_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.array[i].c.used) {
- status = private_f_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ if (source.array[i].c.used) {
+ status = private_f_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
return F_okay;
}
#endif // _di_f_string_triples_append_all_
-#ifndef _di_f_string_triples_decimate_by_
- f_status_t f_string_triples_decimate_by(const f_number_unsigned_t amount, f_string_triples_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_triples_delete_callback_
+ f_status_t f_string_triples_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (!amount) return F_data_not;
+ {
+ f_string_triple_t * const array = (f_string_triple_t *) void_array;
+ f_status_t status = F_okay;
- return private_f_string_triples_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_triples_decimate_by_
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
-#ifndef _di_f_string_triples_decrease_by_
- f_status_t f_string_triples_decrease_by(const f_number_unsigned_t amount, f_string_triples_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) return F_data_not;
-
- return private_f_string_triples_resize((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_triples_decrease_by_
-
-#ifndef _di_f_string_triples_increase_
- f_status_t f_string_triples_increase(const f_number_unsigned_t step, f_string_triples_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (array[i].a.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].a.string, &array[i].a.used, &array[i].a.size);
+ if (F_status_is_error(status)) return status;
+ }
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + F_memory_default_allocation_small_d;
+ if (array[i].b.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].b.string, &array[i].b.used, &array[i].b.size);
+ if (F_status_is_error(status)) return status;
+ }
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- length = F_number_t_size_unsigned_d;
- }
-
- return private_f_string_triples_resize(length, structure);
+ if (array[i].c.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].c.string, &array[i].c.used, &array[i].c.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_triples_increase_
-
-#ifndef _di_f_string_triples_increase_by_
- f_status_t f_string_triples_increase_by(const f_number_unsigned_t amount, f_string_triples_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#endif // _di_f_string_triples_delete_callback_
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#ifndef _di_f_string_triples_destroy_callback_
+ f_status_t f_string_triples_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- const f_number_unsigned_t length = structure->used + amount;
+ {
+ f_string_triple_t * const array = (f_string_triple_t *) void_array;
+ f_status_t status = F_okay;
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- return private_f_string_triples_resize(length, structure);
- }
- }
+ if (array[i].a.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].a.string, &array[i].a.used, &array[i].a.size);
+ if (F_status_is_error(status)) return status;
+ }
- return F_data_not;
- }
-#endif // _di_f_string_triples_increase_by_
+ if (array[i].b.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].b.string, &array[i].b.used, &array[i].b.size);
+ if (F_status_is_error(status)) return status;
+ }
-#ifndef _di_f_string_triples_resize_
- f_status_t f_string_triples_resize(const f_number_unsigned_t length, f_string_triples_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (array[i].c.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].c.string, &array[i].c.used, &array[i].c.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
- return private_f_string_triples_resize(length, structure);
+ return F_okay;
}
-#endif // _di_f_string_triples_resize_
+#endif // _di_f_string_triples_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_triples_t_
/**
- * Resize the string triples array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string triples array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_string_triples_adjust_
- extern f_status_t f_string_triples_adjust(const f_number_unsigned_t length, f_string_triples_t * const structure);
-#endif // _di_f_string_triples_adjust_
-
-/**
* Append the single source triples onto the destination.
*
* @param source
#endif // _di_f_string_triples_append_all_
/**
- * Resize the string triples array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string triples array to resize.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_string_triples_t structure.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * F_parameter (with error bit) if a parameter is invalid.
+ * This does not do parameter checking.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_triples_decimate_by_
- extern f_status_t f_string_triples_decimate_by(const f_number_unsigned_t amount, f_string_triples_t * const structure);
-#endif // _di_f_string_triples_decimate_by_
-
-/**
- * Resize the string triples array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string triples array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_triples_decrease_by_
- extern f_status_t f_string_triples_decrease_by(const f_number_unsigned_t amount, f_string_triples_t * const structure);
-#endif // _di_f_string_triples_decrease_by_
-
-/**
- * Increase the size of the string triples array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string triples array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_triples_increase_
- extern f_status_t f_string_triples_increase(const f_number_unsigned_t step, f_string_triples_t * const structure);
-#endif // _di_f_string_triples_increase_
+#ifndef _di_f_string_triples_delete_callback_
+ extern f_status_t f_string_triples_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_triples_delete_callback_
/**
- * Resize the string triples array to a larger size.
- *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_string_triples_t structure.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string triples array to resize.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ * This does not do parameter checking.
*
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_triples_increase_by_
- extern f_status_t f_string_triples_increase_by(const f_number_unsigned_t amount, f_string_triples_t * const structure);
-#endif // _di_f_string_triples_increase_by_
-
-/**
- * Resize the string triples array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string triples array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_triples_resize_
- extern f_status_t f_string_triples_resize(const f_number_unsigned_t length, f_string_triples_t * const structure);
-#endif // _di_f_string_triples_resize_
+#ifndef _di_f_string_triples_destroy_callback_
+ extern f_status_t f_string_triples_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_triples_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#include "../string.h"
#include "../private-string.h"
-#include "private-triples.h"
-#include "private-tripless.h"
#ifdef __cplusplus
extern "C" {
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_tripless_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_ranges_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- destination->array[destination->used].used = 0;
+ f_string_triples_t * const destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- if (source.used) {
- status = private_f_string_triples_append_all(source, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+ if (source.used) {
+ status = f_memory_array_increase_by(source.used, sizeof(f_string_triple_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
+
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) {
+
+ destination_inner->array[destination_inner->used].a.used = 0;
+ destination_inner->array[destination_inner->used].b.used = 0;
+ destination_inner->array[destination_inner->used].c.used = 0;
+
+ if (source.array[i].a.used) {
+ status = private_f_string_append(source.array[i].a.string, source.array[i].a.used, &destination_inner->array[destination_inner->used].a);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].b.used) {
+ status = private_f_string_append(source.array[i].b.string, source.array[i].b.used, &destination_inner->array[destination_inner->used].b);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].c.used) {
+ status = private_f_string_append(source.array[i].c.string, source.array[i].c.used, &destination_inner->array[destination_inner->used].c);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
}
++destination->used;
if (!source.used) return F_data_not;
- f_status_t status = F_okay;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_string_tripless_resize(destination->used + source.used, destination);
+ {
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_triples_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- }
- for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
+ f_string_triples_t * destination_inner = 0;
+ f_number_unsigned_t j = 0;
- destination->array[destination->used].used = 0;
+ for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- if (source.array[i].used) {
- status = private_f_string_triples_append_all(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ destination_inner = &destination->array[destination->used];
+ destination_inner->used = 0;
- return F_okay;
- }
-#endif // _di_f_string_tripless_append_all_
+ if (source.array[i].used) {
+ status = f_memory_array_increase_by(source.array[i].used, sizeof(f_string_triple_t), (void **) &destination_inner->array, &destination_inner->used, &destination_inner->size);
+ if (F_status_is_error(status)) return status;
-#ifndef _di_f_string_tripless_adjust_
- f_status_t f_string_tripless_adjust(const f_number_unsigned_t length, f_string_tripless_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) {
- return private_f_string_tripless_adjust(length, structure);
- }
-#endif // _di_f_string_tripless_adjust_
+ destination_inner->array[destination_inner->used].a.used = 0;
+ destination_inner->array[destination_inner->used].b.used = 0;
+ destination_inner->array[destination_inner->used].c.used = 0;
-#ifndef _di_f_string_tripless_decimate_by_
- f_status_t f_string_tripless_decimate_by(const f_number_unsigned_t amount, f_string_tripless_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (source.array[i].array[j].a.used) {
+ status = private_f_string_append(source.array[i].array[j].a.string, source.array[i].array[j].a.used, &destination_inner->array[destination_inner->used].a);
+ if (F_status_is_error(status)) return status;
+ }
- if (!amount) return F_data_not;
+ if (source.array[i].array[j].b.used) {
+ status = private_f_string_append(source.array[i].array[j].b.string, source.array[i].array[j].b.used, &destination_inner->array[destination_inner->used].b);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_string_tripless_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
+ if (source.array[i].array[j].c.used) {
+ status = private_f_string_append(source.array[i].array[j].c.string, source.array[i].array[j].c.used, &destination_inner->array[destination_inner->used].c);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+ } // for
+ }
+
+ return F_okay;
}
-#endif // _di_f_string_tripless_decimate_by_
+#endif // _di_f_string_tripless_append_all_
-#ifndef _di_f_string_tripless_decrease_by_
- f_status_t f_string_tripless_decrease_by(const f_number_unsigned_t amount, f_string_tripless_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_tripless_delete_callback_
+ f_status_t f_string_tripless_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (!amount) return F_data_not;
+ {
+ f_string_triples_t * const array = (f_string_triples_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
- return private_f_string_tripless_resize((structure->size > amount) ? structure->size - amount : 0, structure);
- }
-#endif // _di_f_string_tripless_decrease_by_
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
-#ifndef _di_f_string_tripless_increase_
- f_status_t f_string_tripless_increase(const f_number_unsigned_t step, f_string_tripless_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (array[i].size) {
+ for (j = 0; j < array[i].size; ++j) {
- if (step && structure->used + 1 > structure->size) {
- f_number_unsigned_t length = structure->used + step;
+ if (array[i].array[j].a.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].a.string, &array[i].array[j].a.used, &array[i].array[j].a.size);
+ if (F_status_is_error(status)) return status;
+ }
- if (length > F_number_t_size_unsigned_d) {
- if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (array[i].array[j].b.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].b.string, &array[i].array[j].b.used, &array[i].array[j].b.size);
+ if (F_status_is_error(status)) return status;
+ }
- length = F_number_t_size_unsigned_d;
- }
+ if (array[i].array[j].c.size) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].c.string, &array[i].array[j].c.used, &array[i].array[j].c.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
- return private_f_string_tripless_resize(length, structure);
+ status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
}
- return F_data_not;
+ return F_okay;
}
-#endif // _di_f_string_tripless_increase_
+#endif // _di_f_string_tripless_delete_callback_
-#ifndef _di_f_string_tripless_increase_by_
- f_status_t f_string_tripless_increase_by(const f_number_unsigned_t amount, f_string_tripless_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_string_tripless_destroy_callback_
+ f_status_t f_string_tripless_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
- if (amount) {
- if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ {
+ f_string_triples_t * const array = (f_string_triples_t *) void_array;
+ f_status_t status = F_okay;
+ f_number_unsigned_t j = 0;
- const f_number_unsigned_t length = structure->used + amount;
+ for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (length > structure->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (array[i].size) {
+ for (j = 0; j < array[i].size; ++j) {
- return private_f_string_tripless_resize(length, structure);
- }
- }
+ if (array[i].array[j].a.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].a.string, &array[i].array[j].a.used, &array[i].array[j].a.size);
+ if (F_status_is_error(status)) return status;
+ }
- return F_data_not;
- }
-#endif // _di_f_string_tripless_increase_by_
+ if (array[i].array[j].b.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].b.string, &array[i].array[j].b.used, &array[i].array[j].b.size);
+ if (F_status_is_error(status)) return status;
+ }
-#ifndef _di_f_string_tripless_resize_
- f_status_t f_string_tripless_resize(const f_number_unsigned_t length, f_string_tripless_t * const structure) {
- #ifndef _di_level_0_parameter_checking_
- if (!structure) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+ if (array[i].array[j].c.size) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].c.string, &array[i].array[j].c.used, &array[i].array[j].c.size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
- return private_f_string_tripless_resize(length, structure);
+ status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+ }
+
+ return F_okay;
}
-#endif // _di_f_string_tripless_resize_
+#endif // _di_f_string_tripless_destroy_callback_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_string_tripless_t_
/**
- * Resize the string tripless array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string tripless array to resize.
- *
- * @return
- * F_okay on success.
- *
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_string_tripless_adjust_
- extern f_status_t f_string_tripless_adjust(const f_number_unsigned_t length, f_string_tripless_t * const structure);
-#endif // _di_f_string_tripless_adjust_
-
-/**
* Append the single source triples onto the destination.
*
* @param source
#endif // _di_f_string_tripless_append_all_
/**
- * Resize the string tripless array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param structure
- * The string tripless array to resize.
+ * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_tripless_t structure.
*
- * @return
- * F_okay on success.
- * F_data_not if amount is 0.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * F_parameter (with error bit) if a parameter is invalid.
+ * This does not do parameter checking.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_tripless_decimate_by_
- extern f_status_t f_string_tripless_decimate_by(const f_number_unsigned_t amount, f_string_tripless_t * const structure);
-#endif // _di_f_string_tripless_decimate_by_
-
-/**
- * Resize the string tripless array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param structure
- * The string tripless array to resize.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_tripless_decrease_by_
- extern f_status_t f_string_tripless_decrease_by(const f_number_unsigned_t amount, f_string_tripless_t * const structure);
-#endif // _di_f_string_tripless_decrease_by_
-
-/**
- * Increase the size of the string tripless array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * Errors (with error bit) from: f_memory_array_resize().
*
- * @param step
- * The allocation step to use.
- * Must be greater than 0.
- * @param structure
- * The string tripless array to resize.
- *
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
+ * @see f_memory_array_resize()
*/
-#ifndef _di_f_string_tripless_increase_
- extern f_status_t f_string_tripless_increase(const f_number_unsigned_t step, f_string_tripless_t * const structure);
-#endif // _di_f_string_tripless_increase_
+#ifndef _di_f_string_tripless_delete_callback_
+ extern f_status_t f_string_tripless_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_tripless_delete_callback_
/**
- * Resize the string tripless array to a larger size.
- *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_tripless_t structure.
*
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param structure
- * The string tripless array to resize.
+ * This is only called when shrinking the array and generally should perform deallocations.
*
- * @return
- * F_okay on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ * This does not do parameter checking.
*
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_string_tripless_increase_by_
- extern f_status_t f_string_tripless_increase_by(const f_number_unsigned_t amount, f_string_tripless_t * const structure);
-#endif // _di_f_string_tripless_increase_by_
-
-/**
- * Resize the string tripless array.
- *
- * @param length
- * The new size to use.
- * @param structure
- * The string tripless array to adjust.
+ * @param start
+ * The inclusive start position in the array to start deleting.
+ * @param stop
+ * The exclusive stop position in the array to stop deleting.
+ * @param array
+ * The array structure to delete all values of.
+ * Must not be NULL.
*
* @return
* F_okay on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
-#ifndef _di_f_string_tripless_resize_
- extern f_status_t f_string_tripless_resize(const f_number_unsigned_t length, f_string_tripless_t * const structure);
-#endif // _di_f_string_tripless_resize_
+#ifndef _di_f_string_tripless_destroy_callback_
+ extern f_status_t f_string_tripless_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_string_tripless_destroy_callback_
#ifdef __cplusplus
} // extern "C"
build_sources_library string.c
build_sources_library private-string.c string/common.c
-build_sources_library string/private-dynamics.c
-build_sources_library string/private-maps.c string/private-mapss.c
-build_sources_library string/private-map_multis.c string/private-map_multiss.c
-build_sources_library string/private-quantitys.c string/private-quantityss.c
-build_sources_library string/private-ranges.c string/private-rangess.c
-build_sources_library string/private-triples.c string/private-tripless.c
build_sources_library string/dynamic.c string/dynamics.c string/dynamicss.c
build_sources_library string/map.c string/maps.c string/mapss.c
build_sources_library string/map_multi.c string/map_multis.c string/map_multiss.c
--- /dev/null
+# fss-0001
+
+build_name f_string
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual clang test coverage
+modes_default individual test
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc
+build_libraries-individual -lf_memory
+
+build_sources_library string.c
+build_sources_library private-string.c string/common.c
+build_sources_library string/dynamic.c string/dynamics.c string/dynamicss.c
+build_sources_library string/map.c string/maps.c string/mapss.c
+build_sources_library string/map_multi.c string/map_multis.c string/map_multiss.c
+build_sources_library string/quantity.c string/quantitys.c string/quantityss.c
+build_sources_library string/range.c string/ranges.c string/rangess.c
+build_sources_library string/static.c string/statics.c string/staticss.c
+build_sources_library string/triple.c string/triples.c string/tripless.c
+build_sources_library ../../tests/unit/c/mock-string.c
+
+build_sources_headers string.h string/common.h
+build_sources_headers string/dynamic.h string/dynamics.h string/dynamicss.h
+build_sources_headers string/map.h string/maps.h string/mapss.h
+build_sources_headers string/map_multi.h string/map_multis.h string/map_multiss.h
+build_sources_headers string/quantity.h string/quantitys.h string/quantityss.h
+build_sources_headers string/range.h string/ranges.h string/rangess.h
+build_sources_headers string/static.h string/statics.h string/staticss.h
+build_sources_headers string/triple.h string/triples.h string/tripless.h
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers fll/level_0
+path_library_script script
+path_library_shared shared
+path_library_static static
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH
+
+flags -O0 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
+flags-clang -Wno-logical-op-parentheses
+flags-test -fstack-protector -Wall
+flags-coverage --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+
+# Inject mocks.
+flags -Wl,--wrap=f_memory_array_adjust
+flags -Wl,--wrap=f_memory_array_resize
build_sources_program test-string-dynamic_seek_line.c test-string-dynamic_seek_line_to.c test-string-dynamic_seek_to.c
build_sources_program test-string-dynamic_terminate.c test-string-dynamic_terminate_after.c
build_sources_program test-string-dynamics_append.c test-string-dynamics_append_all.c test-string-dynamicss_append.c test-string-dynamicss_append_all.c
-build_sources_program test-string-map_multis_adjust.c test-string-map_multis_append.c test-string-map_multis_append_all.c test-string-map_multis_decimate_by.c test-string-map_multis_decrease_by.c test-string-map_multis_increase.c test-string-map_multis_increase_by.c test-string-map_multis_resize.c test-string-map_multiss_adjust.c test-string-map_multiss_append.c test-string-map_multiss_append_all.c test-string-map_multiss_decimate_by.c test-string-map_multiss_decrease_by.c test-string-map_multiss_increase.c test-string-map_multiss_increase_by.c test-string-map_multiss_resize.c
-build_sources_program test-string-maps_adjust.c test-string-maps_append.c test-string-maps_append_all.c test-string-maps_decimate_by.c test-string-maps_decrease_by.c test-string-maps_increase.c test-string-maps_increase_by.c test-string-maps_resize.c test-string-mapss_adjust.c test-string-mapss_append.c test-string-mapss_append_all.c test-string-mapss_decimate_by.c test-string-mapss_decrease_by.c test-string-mapss_increase.c test-string-mapss_increase_by.c test-string-mapss_resize.c
+build_sources_program test-string-dynamicss_delete_callback.c test-string-dynamicss_destroy_callback.c
+build_sources_program test-string-map_multis_append.c test-string-map_multis_append_all.c test-string-map_multiss_append.c test-string-map_multiss_append_all.c
+build_sources_program test-string-map_multis_delete_callback.c test-string-map_multis_destroy_callback.c
+build_sources_program test-string-map_multiss_delete_callback.c test-string-map_multiss_destroy_callback.c
+build_sources_program test-string-maps_append.c test-string-maps_append_all.c test-string-mapss_append.c test-string-mapss_append_all.c
+build_sources_program test-string-maps_delete_callback.c test-string-maps_destroy_callback.c
+build_sources_program test-string-mapss_delete_callback.c test-string-mapss_destroy_callback.c
build_sources_program test-string-mash.c test-string-mash_nulless.c
build_sources_program test-string-mish.c test-string-mish_nulless.c
build_sources_program test-string-prepend.c test-string-prepend_assure.c test-string-prepend_assure_nulless.c test-string-prepend_nulless.c
-build_sources_program test-string-quantitys_adjust.c test-string-quantitys_append.c test-string-quantitys_append_all.c test-string-quantitys_decimate_by.c test-string-quantitys_decrease_by.c test-string-quantitys_increase.c test-string-quantitys_increase_by.c test-string-quantitys_resize.c test-string-quantityss_adjust.c test-string-quantityss_append.c test-string-quantityss_append_all.c test-string-quantityss_decimate_by.c test-string-quantityss_decrease_by.c test-string-quantityss_increase.c test-string-quantityss_increase_by.c test-string-quantityss_resize.c
-build_sources_program test-string-ranges_adjust.c test-string-ranges_append.c test-string-ranges_append_all.c test-string-ranges_decimate_by.c test-string-ranges_decrease_by.c test-string-ranges_increase.c test-string-ranges_increase_by.c test-string-ranges_resize.c test-string-rangess_adjust.c test-string-rangess_append.c test-string-rangess_append_all.c test-string-rangess_decimate_by.c test-string-rangess_decrease_by.c test-string-rangess_increase.c test-string-rangess_increase_by.c test-string-rangess_resize.c
+build_sources_program test-string-quantitys_append.c test-string-quantitys_append_all.c test-string-quantityss_append.c test-string-quantityss_append_all.c
+build_sources_program test-string-quantityss_delete_callback.c test-string-quantityss_destroy_callback.c
+build_sources_program test-string-ranges_append.c test-string-ranges_append_all.c test-string-rangess_append.c test-string-rangess_append_all.c
+build_sources_program test-string-rangess_delete_callback.c test-string-rangess_destroy_callback.c
build_sources_program test-string-seek_line.c test-string-seek_line_to.c test-string-seek_to.c
-build_sources_program test-string-triples_adjust.c test-string-triples_append.c test-string-triples_append_all.c test-string-triples_decimate_by.c test-string-triples_decrease_by.c test-string-triples_increase.c test-string-triples_increase_by.c test-string-triples_resize.c test-string-tripless_adjust.c test-string-tripless_append.c test-string-tripless_append_all.c test-string-tripless_decimate_by.c test-string-tripless_decrease_by.c test-string-tripless_increase.c test-string-tripless_increase_by.c test-string-tripless_resize.c
+build_sources_program test-string-triples_append.c test-string-triples_append_all.c test-string-tripless_append.c test-string-tripless_append_all.c
+build_sources_program test-string-triples_delete_callback.c test-string-triples_destroy_callback.c
+build_sources_program test-string-tripless_delete_callback.c test-string-tripless_destroy_callback.c
build_sources_program test-string.c
build_script no
#define CMOCKA_XML_FILE ./out.xml
main:
- build settings individual test
+ build settings-mocks individual test
build settings-tests individual test
operate build_path
--- /dev/null
+#include "mock-string.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int mock_unwrap = 0;
+int mock_unwrap_f_memory = 1;
+
+f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
+
+ if (mock_unwrap_f_memory) {
+ return __real_f_memory_array_adjust(length, width, array, used, size);
+ }
+
+ if (!array || !used || !size) return F_status_set_error(F_parameter_not);
+
+ const bool failure = mock_type(bool);
+
+ if (failure) return mock_type(f_status_t);
+
+ *size = length;
+
+ return mock_type(f_status_t);
+}
+
+f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
+
+ if (mock_unwrap_f_memory) {
+ return __real_f_memory_array_resize(length, width, array, used, size);
+ }
+
+ if (!array || !used || !size) return F_status_set_error(F_parameter_not);
+
+ const bool failure = mock_type(bool);
+
+ if (failure) return mock_type(f_status_t);
+
+ *size = length;
+
+ return mock_type(f_status_t);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the string project.
+ */
+#ifndef _MOCK__string_h
+#define _MOCK__string_h
+
+// Libc includes.
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <stdint.h>
+
+// cmocka includes.
+#include <cmocka.h>
+
+// FLL-0 includes.
+#include <fll/level_0/string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const static int mock_errno_generic = 32767;
+
+extern int mock_unwrap;
+extern int mock_unwrap_f_memory;
+
+extern f_status_t __real_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
+extern f_status_t __real_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
+
+extern f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
+extern f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _MOCK__string_h
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ f_string_dynamic_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_dynamics_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_dynamics_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_dynamics_t datas = f_string_dynamics_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_dynamic_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_dynamics_delete_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__dynamics_delete_callback
+#define _TEST__F_string__dynamics_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_dynamics_delete_callback()
+ */
+extern void test__f_string_dynamics_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_delete_callback()
+ */
+extern void test__f_string_dynamics_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__dynamics_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ f_string_dynamic_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_dynamics_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_dynamics_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_dynamics_t datas = f_string_dynamics_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_dynamic_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_dynamics_destroy_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__dynamicss_destroy_callback
+#define _TEST__F_string__dynamicss_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_dynamicss_destroy_callback()
+ */
+extern void test__f_string_dynamicss_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_destroy_callback()
+ */
+extern void test__f_string_dynamicss_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__dynamicss_destroy_callback
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ f_string_dynamic_t data_array[] = { data };
+ f_string_dynamics_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_dynamics_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_dynamicss_delete_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_dynamicss_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_dynamicss_t datass = f_string_dynamicss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_dynamics_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_dynamic_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_dynamicss_delete_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__dynamicss_delete_callback
+#define _TEST__F_string__dynamicss_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_dynamicss_delete_callback()
+ */
+extern void test__f_string_dynamicss_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_delete_callback()
+ */
+extern void test__f_string_dynamicss_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__dynamicss_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ f_string_dynamic_t data_array[] = { data };
+ f_string_dynamics_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_dynamics_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_dynamicss_destroy_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_dynamicss_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_dynamicss_t datass = f_string_dynamicss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_adjust(length, sizeof(f_string_dynamics_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_adjust(1, sizeof(f_string_dynamic_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_dynamicss_destroy_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__dynamicss_destroy_callback
+#define _TEST__F_string__dynamicss_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_dynamicss_destroy_callback()
+ */
+extern void test__f_string_dynamicss_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_destroy_callback()
+ */
+extern void test__f_string_dynamicss_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__dynamicss_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multis_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multis_adjust__works(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multis_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string__string_map_multis_adjust
-#define _TEST__F_string__string_map_multis_adjust
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multis_adjust()
- */
-extern void test__f_string_map_multis_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multis_adjust()
- */
-extern void test__f_string_map_multis_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string__string_map_multis_adjust
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
const f_string_statics_t test_value = macro_f_string_statics_t_initialize_1(test_value_array, 0, length_values);
{
- f_status_t status = f_string_map_multis_resize(length_inner, &source);
+ f_status_t status = f_memory_arrays_resize(length_inner, sizeof(f_string_map_multi_t), (void **) &source.array, &source.used, &source.size, &f_string_map_multis_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.size, length_inner);
f_string_map_multis_t destination = f_string_map_multis_t_initialize;
{
- const f_status_t status = f_string_map_multis_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_map_multi_t), (void **) &source.array, &source.used, &source.size, &f_string_map_multis_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multis_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multis_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_map_multis_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_map_multis_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_map_multis_decimate_by_h
-#define _TEST__F_map_multis_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multis_decimate_by()
- */
-extern void test__f_string_map_multis_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multis_decimate_by()
- */
-extern void test__f_string_map_multis_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_map_multis_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multis_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multis_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_map_multis_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_map_multis_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multis_decrease_by_h
-#define _TEST__F_string_map_multis_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multis_decrease_by()
- */
-extern void test__f_string_map_multis_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multis_decrease_by()
- */
-extern void test__f_string_map_multis_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multis_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 };
+ f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 };
+ f_string_dynamic_t value_array[] = { value };
+ f_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 };
+ f_string_map_multi_t data = { .name = name, .value = values };
+ f_string_map_multi_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multis_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].name.size = 1;
+ data_array[0].value.size = 1;
+ data_array[0].value.array[0].size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multis_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].name.size = 1;
+ data_array[0].value.size = 1;
+ data_array[0].value.array[0].size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multis_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_map_multis_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_map_multis_t datas = f_string_map_multis_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.array[0].string, &datas.array[0].value.array[0].used, &datas.array[0].value.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_map_multis_delete_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].value.array[0].string);
+ free((void *) datas.array[0].value.array);
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__map_multis_delete_callback
+#define _TEST__F_string__map_multis_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_map_multis_delete_callback()
+ */
+extern void test__f_string_map_multis_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_delete_callback()
+ */
+extern void test__f_string_map_multis_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__map_multis_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 };
+ f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 };
+ f_string_dynamic_t value_array[] = { value };
+ f_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 };
+ f_string_map_multi_t data = { .name = name, .value = values };
+ f_string_map_multi_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multis_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].name.size = 1;
+ data_array[0].value.size = 1;
+ data_array[0].value.array[0].size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multis_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].name.size = 1;
+ data_array[0].value.size = 1;
+ data_array[0].value.array[0].size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multis_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_map_multis_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_map_multis_t datas = f_string_map_multis_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.array[0].string, &datas.array[0].value.array[0].used, &datas.array[0].value.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_map_multis_destroy_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].value.array[0].string);
+ free((void *) datas.array[0].value.array);
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__map_multis_destroy_callback
+#define _TEST__F_string__map_multis_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_map_multis_destroy_callback()
+ */
+extern void test__f_string_map_multis_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_destroy_callback()
+ */
+extern void test__f_string_map_multis_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__map_multis_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multis_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multis_increase__works(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_map_multis_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multis_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_map_multis_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multis_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multis_increase_h
-#define _TEST__F_string_map_multis_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multis_increase()
- */
-extern void test__f_string_map_multis_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_map_multis_increase()
- */
-extern void test__f_string_map_multis_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multis_increase()
- */
-extern void test__f_string_map_multis_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multis_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multis_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multis_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_map_multis_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multis_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multis_increase_by_h
-#define _TEST__F_string_map_multis_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multis_increase_by()
- */
-extern void test__f_string_map_multis_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multis_increase_by()
- */
-extern void test__f_string_map_multis_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multis_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multis_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multis_resize__works(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multis_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multis_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multis_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multis_resize_h
-#define _TEST__F_string_map_multis_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multis_resize()
- */
-extern void test__f_string_map_multis_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multis_resize()
- */
-extern void test__f_string_map_multis_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multis_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multiss_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multiss_adjust__works(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multiss_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multiss_adjust_h
-#define _TEST__F_string_map_multiss_adjust_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multiss_adjust()
- */
-extern void test__f_string_map_multiss_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multiss_adjust()
- */
-extern void test__f_string_map_multiss_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multiss_adjust_h
};
{
- f_status_t status = f_string_map_multis_resize(length_inner, &source);
+ f_status_t status = f_memory_arrays_resize(length_inner, sizeof(f_string_map_multi_t), (void **) &source.array, &source.used, &source.size, &f_string_map_multis_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.size, length_inner);
f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
{
- const f_status_t status = f_string_map_multis_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_map_multi_t), (void **) &source.array, &source.used, &source.size, &f_string_map_multis_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
};
{
- f_status_t status = f_string_map_multiss_resize(length_outer, &source);
+ f_status_t status = f_memory_arrays_resize(length_outer, sizeof(f_string_map_multis_t), (void **) &source.array, &source.used, &source.size, &f_string_map_multiss_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
for (; source.used < length_outer; ++source.used) {
- status = f_string_map_multis_resize(length_inner, &source.array[source.used]);
+ status = f_memory_arrays_resize(length_inner, sizeof(f_string_map_multi_t), (void **) &source.array[source.used].array, &source.array[source.used].used, &source.array[source.used].size, &f_string_map_multis_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[source.used].used, 0);
f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
{
- const f_status_t status = f_string_map_multiss_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_map_multis_t), (void **) &source.array, &source.used, &source.size, &f_string_map_multiss_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multiss_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multiss_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_map_multiss_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_map_multiss_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multiss_decimate_by_h
-#define _TEST__F_string_map_multiss_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multiss_decimate_by()
- */
-extern void test__f_string_map_multiss_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multiss_decimate_by()
- */
-extern void test__f_string_map_multiss_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multiss_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multiss_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multiss_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_map_multiss_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_map_multiss_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multiss_decrease_by_h
-#define _TEST__F_string_map_multiss_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multiss_decrease_by()
- */
-extern void test__f_string_map_multiss_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multiss_decrease_by()
- */
-extern void test__f_string_map_multiss_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multiss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_map_multi_t data = f_string_map_multi_t_initialize;
+ f_string_map_multi_t data_array[] = { data };
+ f_string_map_multis_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_map_multis_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multiss_delete_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_map_multiss_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_map_multiss_t datass = f_string_map_multiss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_multis_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_map_multi_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_map_multiss_delete_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__map_multiss_delete_callback
+#define _TEST__F_string__map_multiss_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_map_multiss_delete_callback()
+ */
+extern void test__f_string_map_multiss_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_delete_callback()
+ */
+extern void test__f_string_map_multiss_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__map_multiss_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_map_multi_t data = f_string_map_multi_t_initialize;
+ f_string_map_multi_t data_array[] = { data };
+ f_string_map_multis_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_map_multis_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_map_multiss_destroy_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_map_multiss_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_map_multiss_t datass = f_string_map_multiss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_adjust(length, sizeof(f_string_map_multis_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_adjust(1, sizeof(f_string_map_multi_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_map_multiss_destroy_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__map_multiss_destroy_callback
+#define _TEST__F_string__map_multiss_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_map_multiss_destroy_callback()
+ */
+extern void test__f_string_map_multiss_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_destroy_callback()
+ */
+extern void test__f_string_map_multiss_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__map_multiss_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multiss_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multiss_increase__works(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_map_multiss_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multiss_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_map_multiss_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multiss_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multiss_increase_h
-#define _TEST__F_string_map_multiss_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multiss_increase()
- */
-extern void test__f_string_map_multiss_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_map_multiss_increase()
- */
-extern void test__f_string_map_multiss_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multiss_increase()
- */
-extern void test__f_string_map_multiss_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multiss_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multiss_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multiss_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_map_multiss_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multiss_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multis_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multiss_increase_by_h
-#define _TEST__F_string_map_multiss_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multiss_increase_by()
- */
-extern void test__f_string_map_multiss_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multiss_increase_by()
- */
-extern void test__f_string_map_multiss_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multiss_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-map_multiss_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_map_multiss_resize__works(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_map_multiss_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
-
- {
- const f_status_t status = f_string_map_multiss_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_map_multiss_resize_h
-#define _TEST__F_string_map_multiss_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_map_multiss_resize()
- */
-extern void test__f_string_map_multiss_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_map_multiss_resize()
- */
-extern void test__f_string_map_multiss_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_map_multiss_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-maps_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_maps_adjust__works(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_maps_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string__string_maps_adjust
-#define _TEST__F_string__string_maps_adjust
-
-/**
- * Test that the function works.
- *
- * @see f_string_maps_adjust()
- */
-extern void test__f_string_maps_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_maps_adjust()
- */
-extern void test__f_string_maps_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string__string_maps_adjust
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
const f_string_static_t test_value = macro_f_string_static_t_initialize_1("test_value", 0, 10);
{
- f_status_t status = f_string_maps_resize(length_inner, &source);
+ f_status_t status = f_memory_arrays_resize(length_inner, sizeof(f_string_map_t), (void **) &source.array, &source.used, &source.size, &f_string_maps_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.size, length_inner);
f_string_maps_t destination = f_string_maps_t_initialize;
{
- const f_status_t status = f_string_maps_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_map_t), (void **) &source.array, &source.used, &source.size, &f_string_maps_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-maps_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_maps_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_maps_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_maps_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_maps_decimate_by_h
-#define _TEST__F_maps_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_maps_decimate_by()
- */
-extern void test__f_string_maps_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_maps_decimate_by()
- */
-extern void test__f_string_maps_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_maps_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-maps_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_maps_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_maps_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_maps_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_maps_decrease_by_h
-#define _TEST__F_string_maps_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_maps_decrease_by()
- */
-extern void test__f_string_maps_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_maps_decrease_by()
- */
-extern void test__f_string_maps_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_maps_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 };
+ f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 };
+ f_string_map_t data = { .name = name, .value = value };
+ f_string_map_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_maps_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].name.size = 1;
+ data_array[0].value.size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_maps_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_maps_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_maps_t datas = f_string_maps_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_maps_delete_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].value.string);
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__map_delete_callback
+#define _TEST__F_string__map_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_maps_delete_callback()
+ */
+extern void test__f_string_maps_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_delete_callback()
+ */
+extern void test__f_string_maps_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__map_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 };
+ f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 };
+ f_string_map_t data = { .name = name, .value = value };
+ f_string_map_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_maps_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].name.size = 1;
+ data_array[0].value.size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_maps_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_maps_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_maps_t datas = f_string_maps_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_maps_destroy_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].value.string);
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__map_destroy_callback
+#define _TEST__F_string__map_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_maps_destroy_callback()
+ */
+extern void test__f_string_maps_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_destroy_callback()
+ */
+extern void test__f_string_maps_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__map_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-maps_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_maps_increase__works(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_maps_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_maps_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_maps_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_maps_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_maps_increase_h
-#define _TEST__F_string_maps_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_maps_increase()
- */
-extern void test__f_string_maps_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_maps_increase()
- */
-extern void test__f_string_maps_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_maps_increase()
- */
-extern void test__f_string_maps_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_maps_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-maps_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_maps_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_maps_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_maps_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_maps_increase_by_h
-#define _TEST__F_string_maps_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_maps_increase_by()
- */
-extern void test__f_string_maps_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_maps_increase_by()
- */
-extern void test__f_string_maps_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_maps_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-maps_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_maps_resize__works(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_maps_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_maps_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_maps_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_maps_resize_h
-#define _TEST__F_string_maps_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_maps_resize()
- */
-extern void test__f_string_maps_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_maps_resize()
- */
-extern void test__f_string_maps_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_maps_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-mapss_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_mapss_adjust__works(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_mapss_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_mapss_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_mapss_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_mapss_adjust_h
-#define _TEST__F_string_mapss_adjust_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_mapss_adjust()
- */
-extern void test__f_string_mapss_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_mapss_adjust()
- */
-extern void test__f_string_mapss_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string_mapss_adjust_h
};
{
- f_status_t status = f_string_maps_resize(length_inner, &source);
+ f_status_t status = f_memory_arrays_resize(length_inner, sizeof(f_string_map_t), (void **) &source.array, &source.used, &source.size, &f_string_maps_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.size, length_inner);
f_string_mapss_t destination = f_string_mapss_t_initialize;
{
- const f_status_t status = f_string_maps_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_map_t), (void **) &source.array, &source.used, &source.size, &f_string_maps_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
};
{
- f_status_t status = f_string_mapss_resize(length_outer, &source);
+ f_status_t status = f_memory_arrays_resize(length_outer, sizeof(f_string_maps_t), (void **) &source.array, &source.used, &source.size, &f_string_mapss_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
for (; source.used < length_outer; ++source.used) {
- status = f_string_maps_resize(length_inner, &source.array[source.used]);
+ status = f_memory_arrays_resize(length_inner, sizeof(f_string_map_t), (void **) &source.array[source.used].array, &source.array[source.used].used, &source.array[source.used].size, &f_string_maps_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.array[source.used].used, 0);
f_string_mapss_t destination = f_string_mapss_t_initialize;
{
- const f_status_t status = f_string_mapss_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_maps_t), (void **) &source.array, &source.used, &source.size, &f_string_mapss_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-mapss_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_mapss_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_mapss_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_mapss_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_mapss_decimate_by_h
-#define _TEST__F_string_mapss_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_mapss_decimate_by()
- */
-extern void test__f_string_mapss_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_mapss_decimate_by()
- */
-extern void test__f_string_mapss_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_mapss_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-mapss_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_mapss_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_mapss_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_mapss_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_mapss_decrease_by_h
-#define _TEST__F_string_mapss_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_mapss_decrease_by()
- */
-extern void test__f_string_mapss_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_mapss_decrease_by()
- */
-extern void test__f_string_mapss_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_mapss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_map_t data = f_string_map_t_initialize;
+ f_string_map_t data_array[] = { data };
+ f_string_maps_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_maps_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_mapss_delete_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_mapss_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_mapss_t datass = f_string_mapss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_maps_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_map_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_mapss_delete_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__mapss_delete_callback
+#define _TEST__F_string__mapss_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_mapss_delete_callback()
+ */
+extern void test__f_string_mapss_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_delete_callback()
+ */
+extern void test__f_string_mapss_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__mapss_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_map_t data = f_string_map_t_initialize;
+ f_string_map_t data_array[] = { data };
+ f_string_maps_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_maps_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_mapss_destroy_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_mapss_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_mapss_t datass = f_string_mapss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_adjust(length, sizeof(f_string_maps_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_adjust(1, sizeof(f_string_map_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_mapss_destroy_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__mapss_destroy_callback
+#define _TEST__F_string__mapss_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_mapss_destroy_callback()
+ */
+extern void test__f_string_mapss_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_destroy_callback()
+ */
+extern void test__f_string_mapss_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__mapss_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-mapss_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_mapss_increase__works(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_mapss_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_mapss_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_mapss_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_mapss_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_mapss_increase_h
-#define _TEST__F_string_mapss_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_mapss_increase()
- */
-extern void test__f_string_mapss_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_mapss_increase()
- */
-extern void test__f_string_mapss_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_mapss_increase()
- */
-extern void test__f_string_mapss_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_mapss_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-mapss_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_mapss_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_mapss_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_mapss_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_maps_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_mapss_increase_by_h
-#define _TEST__F_string_mapss_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_mapss_increase_by()
- */
-extern void test__f_string_mapss_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_mapss_increase_by()
- */
-extern void test__f_string_mapss_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_mapss_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-mapss_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_mapss_resize__works(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_mapss_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_mapss_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_mapss_t data = f_string_mapss_t_initialize;
-
- {
- const f_status_t status = f_string_mapss_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_mapss_resize_h
-#define _TEST__F_string_mapss_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_mapss_resize()
- */
-extern void test__f_string_mapss_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_mapss_resize()
- */
-extern void test__f_string_mapss_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_mapss_resize_h
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantitys_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantitys_adjust__works(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantitys_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string__string_quantitys_adjust
-#define _TEST__F_string__string_quantitys_adjust
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantitys_adjust()
- */
-extern void test__f_string_quantitys_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantitys_adjust()
- */
-extern void test__f_string_quantitys_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string__string_quantitys_adjust
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
f_string_quantitys_t destination = f_string_quantitys_t_initialize;
{
- const f_status_t status = f_string_quantitys_resize(length, &source);
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_string_quantity_t), (void **) &source.array, &source.used, &source.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantitys_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantitys_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_quantitys_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_quantitys_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_quantitys_decimate_by_h
-#define _TEST__F_quantitys_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantitys_decimate_by()
- */
-extern void test__f_string_quantitys_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantitys_decimate_by()
- */
-extern void test__f_string_quantitys_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_quantitys_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantitys_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantitys_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_quantitys_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_quantitys_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantitys_decrease_by_h
-#define _TEST__F_string_quantitys_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantitys_decrease_by()
- */
-extern void test__f_string_quantitys_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantitys_decrease_by()
- */
-extern void test__f_string_quantitys_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantitys_decrease_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantitys_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantitys_increase__works(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_quantitys_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantitys_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_quantitys_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantitys_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantitys_increase_h
-#define _TEST__F_string_quantitys_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantitys_increase()
- */
-extern void test__f_string_quantitys_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_quantitys_increase()
- */
-extern void test__f_string_quantitys_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantitys_increase()
- */
-extern void test__f_string_quantitys_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantitys_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantitys_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantitys_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_quantitys_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantitys_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantitys_increase_by_h
-#define _TEST__F_string_quantitys_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantitys_increase_by()
- */
-extern void test__f_string_quantitys_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantitys_increase_by()
- */
-extern void test__f_string_quantitys_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantitys_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantitys_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantitys_resize__works(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantitys_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantitys_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantitys_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantitys_resize_h
-#define _TEST__F_string_quantitys_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantitys_resize()
- */
-extern void test__f_string_quantitys_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantitys_resize()
- */
-extern void test__f_string_quantitys_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantitys_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantityss_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantityss_adjust__works(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantityss_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantityss_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantityss_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantityss_adjust_h
-#define _TEST__F_string_quantityss_adjust_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantityss_adjust()
- */
-extern void test__f_string_quantityss_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantityss_adjust()
- */
-extern void test__f_string_quantityss_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantityss_adjust_h
f_string_quantityss_t destination = f_string_quantityss_t_initialize;
{
- const f_status_t status = f_string_quantitys_resize(length, &source);
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_string_quantity_t), (void **) &source.array, &source.used, &source.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
f_string_quantityss_t destination = f_string_quantityss_t_initialize;
{
- const f_status_t status = f_string_quantityss_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_quantitys_t), (void **) &source.array, &source.used, &source.size, &f_string_quantityss_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantityss_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantityss_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_quantityss_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_quantityss_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantityss_decimate_by_h
-#define _TEST__F_string_quantityss_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantityss_decimate_by()
- */
-extern void test__f_string_quantityss_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantityss_decimate_by()
- */
-extern void test__f_string_quantityss_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantityss_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantityss_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantityss_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_quantityss_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_quantityss_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantityss_decrease_by_h
-#define _TEST__F_string_quantityss_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantityss_decrease_by()
- */
-extern void test__f_string_quantityss_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantityss_decrease_by()
- */
-extern void test__f_string_quantityss_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantityss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_quantity_t data = f_string_quantity_t_initialize;
+ f_string_quantity_t data_array[] = { data };
+ f_string_quantitys_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_quantitys_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_quantityss_delete_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_quantityss_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_quantityss_t datass = f_string_quantityss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_quantitys_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_quantity_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_quantityss_delete_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__quantityss_delete_callback
+#define _TEST__F_string__quantityss_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_quantityss_delete_callback()
+ */
+extern void test__f_string_quantityss_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_delete_callback()
+ */
+extern void test__f_string_quantityss_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__quantityss_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_quantity_t data = f_string_quantity_t_initialize;
+ f_string_quantity_t data_array[] = { data };
+ f_string_quantitys_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_quantitys_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_quantityss_destroy_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_quantityss_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_quantityss_t datass = f_string_quantityss_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_adjust(length, sizeof(f_string_quantitys_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_adjust(1, sizeof(f_string_quantity_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_quantityss_destroy_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__quantityss_destroy_callback
+#define _TEST__F_string__quantityss_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_quantityss_destroy_callback()
+ */
+extern void test__f_string_quantityss_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_destroy_callback()
+ */
+extern void test__f_string_quantityss_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__quantityss_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantityss_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantityss_increase__works(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_quantityss_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantityss_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_quantityss_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantityss_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantityss_increase_h
-#define _TEST__F_string_quantityss_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantityss_increase()
- */
-extern void test__f_string_quantityss_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_quantityss_increase()
- */
-extern void test__f_string_quantityss_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantityss_increase()
- */
-extern void test__f_string_quantityss_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantityss_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantityss_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantityss_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_quantityss_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantityss_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantitys_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantityss_increase_by_h
-#define _TEST__F_string_quantityss_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantityss_increase_by()
- */
-extern void test__f_string_quantityss_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantityss_increase_by()
- */
-extern void test__f_string_quantityss_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantityss_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-quantityss_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_quantityss_resize__works(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantityss_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_quantityss_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_quantityss_t data = f_string_quantityss_t_initialize;
-
- {
- const f_status_t status = f_string_quantityss_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_quantityss_resize_h
-#define _TEST__F_string_quantityss_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_quantityss_resize()
- */
-extern void test__f_string_quantityss_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_quantityss_resize()
- */
-extern void test__f_string_quantityss_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_quantityss_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-ranges_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_ranges_adjust__works(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_ranges_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string__string_ranges_adjust
-#define _TEST__F_string__string_ranges_adjust
-
-/**
- * Test that the function works.
- *
- * @see f_string_ranges_adjust()
- */
-extern void test__f_string_ranges_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_ranges_adjust()
- */
-extern void test__f_string_ranges_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string__string_ranges_adjust
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
f_string_ranges_t destination = f_string_ranges_t_initialize;
{
- const f_status_t status = f_string_ranges_resize(length, &source);
+ const f_status_t status = f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &source.array, &source.used, &source.size);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-ranges_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_ranges_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_ranges_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_ranges_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_ranges_decimate_by_h
-#define _TEST__F_ranges_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_ranges_decimate_by()
- */
-extern void test__f_string_ranges_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_ranges_decimate_by()
- */
-extern void test__f_string_ranges_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_ranges_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-ranges_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_ranges_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_ranges_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_ranges_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_ranges_decrease_by_h
-#define _TEST__F_string_ranges_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_ranges_decrease_by()
- */
-extern void test__f_string_ranges_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_ranges_decrease_by()
- */
-extern void test__f_string_ranges_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_ranges_decrease_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-ranges_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_ranges_increase__works(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_ranges_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_ranges_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_ranges_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_ranges_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_ranges_increase_h
-#define _TEST__F_string_ranges_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_ranges_increase()
- */
-extern void test__f_string_ranges_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_ranges_increase()
- */
-extern void test__f_string_ranges_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_ranges_increase()
- */
-extern void test__f_string_ranges_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_ranges_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-ranges_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_ranges_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_ranges_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_ranges_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_ranges_increase_by_h
-#define _TEST__F_string_ranges_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_ranges_increase_by()
- */
-extern void test__f_string_ranges_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_ranges_increase_by()
- */
-extern void test__f_string_ranges_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_ranges_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-ranges_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_ranges_resize__works(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_ranges_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_ranges_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_ranges_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_ranges_resize_h
-#define _TEST__F_string_ranges_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_ranges_resize()
- */
-extern void test__f_string_ranges_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_ranges_resize()
- */
-extern void test__f_string_ranges_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_ranges_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-rangess_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_rangess_adjust__works(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_rangess_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_rangess_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_rangess_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_rangess_adjust_h
-#define _TEST__F_string_rangess_adjust_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_rangess_adjust()
- */
-extern void test__f_string_rangess_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_rangess_adjust()
- */
-extern void test__f_string_rangess_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string_rangess_adjust_h
f_string_rangess_t destination = f_string_rangess_t_initialize;
{
- const f_status_t status = f_string_ranges_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_ranges_t), (void **) &source.array, &source.used, &source.size, &f_string_rangess_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
f_string_rangess_t destination = f_string_rangess_t_initialize;
{
- const f_status_t status = f_string_rangess_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_ranges_t), (void **) &source.array, &source.used, &source.size, &f_string_rangess_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-rangess_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_rangess_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_rangess_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_rangess_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_rangess_decimate_by_h
-#define _TEST__F_string_rangess_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_rangess_decimate_by()
- */
-extern void test__f_string_rangess_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_rangess_decimate_by()
- */
-extern void test__f_string_rangess_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_rangess_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-rangess_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_rangess_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_rangess_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_rangess_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_rangess_decrease_by_h
-#define _TEST__F_string_rangess_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_rangess_decrease_by()
- */
-extern void test__f_string_rangess_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_rangess_decrease_by()
- */
-extern void test__f_string_rangess_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_rangess_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_range_t data = f_string_range_t_initialize;
+ f_string_range_t data_array[] = { data };
+ f_string_ranges_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_ranges_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_rangess_delete_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_rangess_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_rangess_t datass = f_string_rangess_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_ranges_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_rangess_delete_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__rangess_delete_callback
+#define _TEST__F_string__rangess_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_rangess_delete_callback()
+ */
+extern void test__f_string_rangess_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_delete_callback()
+ */
+extern void test__f_string_rangess_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__rangess_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_range_t data = f_string_range_t_initialize;
+ f_string_range_t data_array[] = { data };
+ f_string_ranges_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_ranges_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_rangess_destroy_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_rangess_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_rangess_t datass = f_string_rangess_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_adjust(length, sizeof(f_string_ranges_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_adjust(1, sizeof(f_string_range_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_rangess_destroy_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__rangess_destroy_callback
+#define _TEST__F_string__rangess_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_rangess_destroy_callback()
+ */
+extern void test__f_string_rangess_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_destroy_callback()
+ */
+extern void test__f_string_rangess_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__rangess_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-rangess_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_rangess_increase__works(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_rangess_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_rangess_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_rangess_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_rangess_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_rangess_increase_h
-#define _TEST__F_string_rangess_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_rangess_increase()
- */
-extern void test__f_string_rangess_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_rangess_increase()
- */
-extern void test__f_string_rangess_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_rangess_increase()
- */
-extern void test__f_string_rangess_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_rangess_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-rangess_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_rangess_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_rangess_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_rangess_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_ranges_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_rangess_increase_by_h
-#define _TEST__F_string_rangess_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_rangess_increase_by()
- */
-extern void test__f_string_rangess_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_rangess_increase_by()
- */
-extern void test__f_string_rangess_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_rangess_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-rangess_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_rangess_resize__works(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_rangess_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_rangess_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_rangess_t data = f_string_rangess_t_initialize;
-
- {
- const f_status_t status = f_string_rangess_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_rangess_resize_h
-#define _TEST__F_string_rangess_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_rangess_resize()
- */
-extern void test__f_string_rangess_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_rangess_resize()
- */
-extern void test__f_string_rangess_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_rangess_resize_h
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-triples_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_triples_adjust__works(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_triples_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string__string_triples_adjust
-#define _TEST__F_string__string_triples_adjust
-
-/**
- * Test that the function works.
- *
- * @see f_string_triples_adjust()
- */
-extern void test__f_string_triples_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_triples_adjust()
- */
-extern void test__f_string_triples_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string__string_triples_adjust
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
f_string_triples_t destination = f_string_triples_t_initialize;
{
- const f_status_t status = f_string_triples_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_triple_t), (void **) &source.array, &source.used, &source.size, &f_string_triples_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-triples_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_triples_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_triples_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_triples_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_triples_decimate_by_h
-#define _TEST__F_triples_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_triples_decimate_by()
- */
-extern void test__f_string_triples_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_triples_decimate_by()
- */
-extern void test__f_string_triples_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_triples_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-triples_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_triples_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_triples_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_triples_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_triples_decrease_by_h
-#define _TEST__F_string_triples_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_triples_decrease_by()
- */
-extern void test__f_string_triples_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_triples_decrease_by()
- */
-extern void test__f_string_triples_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_triples_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t a = { .string = "a", .used = 0, .size = 1 };
+ f_string_dynamic_t b = { .string = "b", .used = 0, .size = 1 };
+ f_string_dynamic_t c = { .string = "c", .used = 0, .size = 1 };
+ f_string_triple_t data = { .a = a, .b = b, .c = c };
+ f_string_triple_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_triples_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].a.size = 1;
+ data_array[0].b.size = 1;
+ data_array[0].c.size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_triples_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].a.size = 1;
+ data_array[0].b.size = 1;
+ data_array[0].c.size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, false);
+ will_return(__wrap_f_memory_array_resize, F_okay);
+
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_triples_delete_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_triples_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_triples_t datas = f_string_triples_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_triple_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].a.string, &datas.array[0].a.used, &datas.array[0].a.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].b.string, &datas.array[0].b.used, &datas.array[0].b.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].c.string, &datas.array[0].c.used, &datas.array[0].c.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_triples_delete_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array[0].a.string);
+ free((void *) datas.array[0].b.string);
+ free((void *) datas.array[0].c.string);
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__triples_delete_callback
+#define _TEST__F_string__triples_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_triples_delete_callback()
+ */
+extern void test__f_string_triples_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_delete_callback()
+ */
+extern void test__f_string_triples_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__triples_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_dynamic_t a = { .string = "a", .used = 0, .size = 1 };
+ f_string_dynamic_t b = { .string = "b", .used = 0, .size = 1 };
+ f_string_dynamic_t c = { .string = "c", .used = 0, .size = 1 };
+ f_string_triple_t data = { .a = a, .b = b, .c = c };
+ f_string_triple_t data_array[] = { data };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_triples_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].a.size = 1;
+ data_array[0].b.size = 1;
+ data_array[0].c.size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_triples_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+
+ data_array[0].a.size = 1;
+ data_array[0].b.size = 1;
+ data_array[0].c.size = 1;
+
+ {
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, false);
+ will_return(__wrap_f_memory_array_adjust, F_okay);
+
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_triples_destroy_callback(0, 1, (void *) data_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_triples_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_triples_t datas = f_string_triples_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_triple_t), (void **) &datas.array, &datas.used, &datas.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].a.string, &datas.array[0].a.used, &datas.array[0].a.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].b.string, &datas.array[0].b.used, &datas.array[0].b.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].c.string, &datas.array[0].c.used, &datas.array[0].c.size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_triples_destroy_callback(0, length, (void *) datas.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datas.size, 0);
+ }
+
+ free((void *) datas.array[0].a.string);
+ free((void *) datas.array[0].b.string);
+ free((void *) datas.array[0].c.string);
+ free((void *) datas.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__triples_destroy_callback
+#define _TEST__F_string__triples_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_triples_destroy_callback()
+ */
+extern void test__f_string_triples_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_destroy_callback()
+ */
+extern void test__f_string_triples_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__triples_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-triples_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_triples_increase__works(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_triples_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_triples_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_triples_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_triples_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_triples_increase_h
-#define _TEST__F_string_triples_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_triples_increase()
- */
-extern void test__f_string_triples_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_triples_increase()
- */
-extern void test__f_string_triples_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_triples_increase()
- */
-extern void test__f_string_triples_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_triples_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-triples_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_triples_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_triples_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_triples_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_triples_increase_by_h
-#define _TEST__F_string_triples_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_triples_increase_by()
- */
-extern void test__f_string_triples_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_triples_increase_by()
- */
-extern void test__f_string_triples_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_triples_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-triples_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_triples_resize__works(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_triples_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_triples_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_triples_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_triples_resize_h
-#define _TEST__F_string_triples_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_triples_resize()
- */
-extern void test__f_string_triples_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_triples_resize()
- */
-extern void test__f_string_triples_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_triples_resize_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-tripless_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_tripless_adjust__works(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_tripless_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_adjust(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_tripless_adjust__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_tripless_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_adjust(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_tripless_adjust_h
-#define _TEST__F_string_tripless_adjust_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_tripless_adjust()
- */
-extern void test__f_string_tripless_adjust__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_tripless_adjust()
- */
-extern void test__f_string_tripless_adjust__parameter_checking(void **state);
-
-#endif // _TEST__F_string_tripless_adjust_h
f_string_tripless_t destination = f_string_tripless_t_initialize;
{
- const f_status_t status = f_string_triples_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_triple_t), (void **) &source.array, &source.used, &source.size, &f_string_triples_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
f_string_tripless_t destination = f_string_tripless_t_initialize;
{
- const f_status_t status = f_string_tripless_resize(length, &source);
+ const f_status_t status = f_memory_arrays_resize(length, sizeof(f_string_triples_t), (void **) &source.array, &source.used, &source.size, &f_string_tripless_delete_callback);
assert_int_equal(status, F_okay);
assert_int_equal(source.used, 0);
/**
* FLL - Level 0
*
- * Project: Type
+ * Project: String
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
+++ /dev/null
-#include "test-string.h"
-#include "test-string-tripless_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_tripless_decimate_by__works(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_tripless_decimate_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_tripless_decimate_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_decimate_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_tripless_decimate_by_h
-#define _TEST__F_string_tripless_decimate_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_tripless_decimate_by()
- */
-extern void test__f_string_tripless_decimate_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_tripless_decimate_by()
- */
-extern void test__f_string_tripless_decimate_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_tripless_decimate_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-tripless_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_tripless_decrease_by__works(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_tripless_decrease_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-void test__f_string_tripless_decrease_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_decrease_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_tripless_decrease_by_h
-#define _TEST__F_string_tripless_decrease_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_tripless_decrease_by()
- */
-extern void test__f_string_tripless_decrease_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_tripless_decrease_by()
- */
-extern void test__f_string_tripless_decrease_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_tripless_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_delete_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_triple_t data = f_string_triple_t_initialize;
+ f_string_triple_t data_array[] = { data };
+ f_string_triples_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_triples_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_resize, true);
+ will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_tripless_delete_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_tripless_delete_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_tripless_t datass = f_string_tripless_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_resize(length, sizeof(f_string_triples_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_resize(1, sizeof(f_string_triple_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_tripless_delete_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__tripless_delete_callback
+#define _TEST__F_string__tripless_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_tripless_delete_callback()
+ */
+extern void test__f_string_tripless_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_delete_callback()
+ */
+extern void test__f_string_tripless_delete_callback__works(void **state);
+
+#endif // _TEST__F_string__tripless_delete_callback
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_destroy_callback__fails(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 0;
+
+ f_string_triple_t data = f_string_triple_t_initialize;
+ f_string_triple_t data_array[] = { data };
+ f_string_triples_t datas = { .array = data_array, .used = 1, .size = 1 };
+ f_string_triples_t datas_array[] = { datas };
+
+ {
+ will_return(__wrap_f_memory_array_adjust, true);
+ will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+ const f_status_t status = f_string_tripless_destroy_callback(0, 1, (void *) datas_array);
+
+ assert_int_equal(status, F_status_set_error(F_failure));
+ }
+}
+
+void test__f_string_tripless_destroy_callback__works(void **state) {
+
+ mock_unwrap = 0;
+ mock_unwrap_f_memory = 1;
+
+ const f_number_unsigned_t length = 1;
+
+ f_string_tripless_t datass = f_string_tripless_t_initialize;
+
+ {
+ f_status_t status = f_memory_array_adjust(length, sizeof(f_string_triples_t), (void **) &datass.array, &datass.used, &datass.size);
+ assert_int_equal(status, F_okay);
+
+ status = f_memory_array_adjust(1, sizeof(f_string_triple_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+ assert_int_equal(status, F_okay);
+ }
+
+ {
+ const f_status_t status = f_string_tripless_destroy_callback(0, length, (void *) datass.array);
+
+ assert_int_equal(status, F_okay);
+ assert_int_equal(datass.array[0].size, 0);
+ }
+
+ free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__tripless_destroy_callback
+#define _TEST__F_string__tripless_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_string_tripless_destroy_callback()
+ */
+extern void test__f_string_tripless_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_destroy_callback()
+ */
+extern void test__f_string_tripless_destroy_callback__works(void **state);
+
+#endif // _TEST__F_string__tripless_destroy_callback
+++ /dev/null
-#include "test-string.h"
-#include "test-string-tripless_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_tripless_increase__works(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_tripless_increase(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_tripless_increase__returns_data_not(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- const f_status_t status = f_string_tripless_increase(length, &data);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_tripless_increase__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_increase(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_tripless_increase_h
-#define _TEST__F_string_tripless_increase_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_tripless_increase()
- */
-extern void test__f_string_tripless_increase__works(void **state);
-
-/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_string_tripless_increase()
- */
-extern void test__f_string_tripless_increase__returns_data_not(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_tripless_increase()
- */
-extern void test__f_string_tripless_increase__parameter_checking(void **state);
-
-#endif // _TEST__F_string_tripless_increase_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-tripless_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_tripless_increase_by__works(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- {
- data.used = length;
-
- const f_status_t status = f_string_tripless_increase_by(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_tripless_increase_by__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_triples_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_increase_by(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_tripless_increase_by_h
-#define _TEST__F_string_tripless_increase_by_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_tripless_increase_by()
- */
-extern void test__f_string_tripless_increase_by__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_tripless_increase_by()
- */
-extern void test__f_string_tripless_increase_by__parameter_checking(void **state);
-
-#endif // _TEST__F_string_tripless_increase_by_h
+++ /dev/null
-#include "test-string.h"
-#include "test-string-tripless_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_string_tripless_resize__works(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_tripless_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, &data);
-
- assert_int_equal(status, F_okay);
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, length);
- }
-
- free((void *) data.array);
-}
-
-void test__f_string_tripless_resize__parameter_checking(void **state) {
-
- const int length = 5;
- f_string_tripless_t data = f_string_tripless_t_initialize;
-
- {
- const f_status_t status = f_string_tripless_resize(length, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- assert_int_equal(data.used, 0);
- assert_int_equal(data.size, 0);
- }
-
- assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Type
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_string_tripless_resize_h
-#define _TEST__F_string_tripless_resize_h
-
-/**
- * Test that the function works.
- *
- * @see f_string_tripless_resize()
- */
-extern void test__f_string_tripless_resize__works(void **state);
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_string_tripless_resize()
- */
-extern void test__f_string_tripless_resize__parameter_checking(void **state);
-
-#endif // _TEST__F_string_tripless_resize_h
cmocka_unit_test(test__f_string_dynamicss_append_all__works),
cmocka_unit_test(test__f_string_dynamicss_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_map_multis_adjust__works),
cmocka_unit_test(test__f_string_map_multis_append__works),
cmocka_unit_test(test__f_string_map_multis_append_all__works),
cmocka_unit_test(test__f_string_map_multis_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_map_multis_decimate_by__works),
- cmocka_unit_test(test__f_string_map_multis_decrease_by__works),
- cmocka_unit_test(test__f_string_map_multis_increase__works),
- cmocka_unit_test(test__f_string_map_multis_increase__returns_data_not),
- cmocka_unit_test(test__f_string_map_multis_increase_by__works),
- cmocka_unit_test(test__f_string_map_multis_resize__works),
-
- cmocka_unit_test(test__f_string_map_multiss_adjust__works),
+
cmocka_unit_test(test__f_string_map_multiss_append__works),
cmocka_unit_test(test__f_string_map_multiss_append__returns_data_not),
cmocka_unit_test(test__f_string_map_multiss_append_all__works),
cmocka_unit_test(test__f_string_map_multiss_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_map_multiss_decimate_by__works),
- cmocka_unit_test(test__f_string_map_multiss_decrease_by__works),
- cmocka_unit_test(test__f_string_map_multiss_increase__works),
- cmocka_unit_test(test__f_string_map_multiss_increase__returns_data_not),
- cmocka_unit_test(test__f_string_map_multiss_increase_by__works),
- cmocka_unit_test(test__f_string_map_multiss_resize__works),
-
- cmocka_unit_test(test__f_string_maps_adjust__works),
+
cmocka_unit_test(test__f_string_maps_append__works),
cmocka_unit_test(test__f_string_maps_append_all__works),
cmocka_unit_test(test__f_string_maps_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_maps_decimate_by__works),
- cmocka_unit_test(test__f_string_maps_decrease_by__works),
- cmocka_unit_test(test__f_string_maps_increase__works),
- cmocka_unit_test(test__f_string_maps_increase__returns_data_not),
- cmocka_unit_test(test__f_string_maps_increase_by__works),
- cmocka_unit_test(test__f_string_maps_resize__works),
-
- cmocka_unit_test(test__f_string_mapss_adjust__works),
+
cmocka_unit_test(test__f_string_mapss_append__works),
cmocka_unit_test(test__f_string_mapss_append__returns_data_not),
cmocka_unit_test(test__f_string_mapss_append_all__works),
cmocka_unit_test(test__f_string_mapss_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_mapss_decimate_by__works),
- cmocka_unit_test(test__f_string_mapss_decrease_by__works),
- cmocka_unit_test(test__f_string_mapss_increase__works),
- cmocka_unit_test(test__f_string_mapss_increase__returns_data_not),
- cmocka_unit_test(test__f_string_mapss_increase_by__works),
- cmocka_unit_test(test__f_string_mapss_resize__works),
cmocka_unit_test(test__f_string_mash__works),
cmocka_unit_test(test__f_string_mash_nulless__works),
cmocka_unit_test(test__f_string_prepend_assure_nulless__works),
cmocka_unit_test(test__f_string_prepend_nulless__works),
- cmocka_unit_test(test__f_string_quantitys_adjust__works),
cmocka_unit_test(test__f_string_quantitys_append__works),
cmocka_unit_test(test__f_string_quantitys_append_all__works),
cmocka_unit_test(test__f_string_quantitys_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_quantitys_decimate_by__works),
- cmocka_unit_test(test__f_string_quantitys_decrease_by__works),
- cmocka_unit_test(test__f_string_quantitys_increase__works),
- cmocka_unit_test(test__f_string_quantitys_increase__returns_data_not),
- cmocka_unit_test(test__f_string_quantitys_increase_by__works),
- cmocka_unit_test(test__f_string_quantitys_resize__works),
-
- cmocka_unit_test(test__f_string_quantityss_adjust__works),
+
cmocka_unit_test(test__f_string_quantityss_append__works),
cmocka_unit_test(test__f_string_quantityss_append__returns_data_not),
cmocka_unit_test(test__f_string_quantityss_append_all__works),
cmocka_unit_test(test__f_string_quantityss_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_quantityss_decimate_by__works),
- cmocka_unit_test(test__f_string_quantityss_decrease_by__works),
- cmocka_unit_test(test__f_string_quantityss_increase__works),
- cmocka_unit_test(test__f_string_quantityss_increase__returns_data_not),
- cmocka_unit_test(test__f_string_quantityss_increase_by__works),
- cmocka_unit_test(test__f_string_quantityss_resize__works),
-
- cmocka_unit_test(test__f_string_ranges_adjust__works),
+
cmocka_unit_test(test__f_string_ranges_append__works),
cmocka_unit_test(test__f_string_ranges_append_all__works),
cmocka_unit_test(test__f_string_ranges_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_ranges_decimate_by__works),
- cmocka_unit_test(test__f_string_ranges_decrease_by__works),
- cmocka_unit_test(test__f_string_ranges_increase__works),
- cmocka_unit_test(test__f_string_ranges_increase__returns_data_not),
- cmocka_unit_test(test__f_string_ranges_increase_by__works),
- cmocka_unit_test(test__f_string_ranges_resize__works),
-
- cmocka_unit_test(test__f_string_rangess_adjust__works),
+
cmocka_unit_test(test__f_string_rangess_append__works),
cmocka_unit_test(test__f_string_rangess_append__returns_data_not),
cmocka_unit_test(test__f_string_rangess_append_all__works),
cmocka_unit_test(test__f_string_rangess_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_rangess_decimate_by__works),
- cmocka_unit_test(test__f_string_rangess_decrease_by__works),
- cmocka_unit_test(test__f_string_rangess_increase__works),
- cmocka_unit_test(test__f_string_rangess_increase__returns_data_not),
- cmocka_unit_test(test__f_string_rangess_increase_by__works),
- cmocka_unit_test(test__f_string_rangess_resize__works),
-
- cmocka_unit_test(test__f_string_triples_adjust__works),
+
cmocka_unit_test(test__f_string_triples_append__works),
cmocka_unit_test(test__f_string_triples_append_all__works),
cmocka_unit_test(test__f_string_triples_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_triples_decimate_by__works),
- cmocka_unit_test(test__f_string_triples_decrease_by__works),
- cmocka_unit_test(test__f_string_triples_increase__works),
- cmocka_unit_test(test__f_string_triples_increase__returns_data_not),
- cmocka_unit_test(test__f_string_triples_increase_by__works),
- cmocka_unit_test(test__f_string_triples_resize__works),
-
- cmocka_unit_test(test__f_string_tripless_adjust__works),
+
cmocka_unit_test(test__f_string_tripless_append__works),
cmocka_unit_test(test__f_string_tripless_append__returns_data_not),
cmocka_unit_test(test__f_string_tripless_append_all__works),
cmocka_unit_test(test__f_string_tripless_append_all__returns_data_not),
- cmocka_unit_test(test__f_string_tripless_decimate_by__works),
- cmocka_unit_test(test__f_string_tripless_decrease_by__works),
- cmocka_unit_test(test__f_string_tripless_increase__works),
- cmocka_unit_test(test__f_string_tripless_increase__returns_data_not),
- cmocka_unit_test(test__f_string_tripless_increase_by__works),
- cmocka_unit_test(test__f_string_tripless_resize__works),
cmocka_unit_test(test__f_string_seek_line__returns_data_not_stop),
cmocka_unit_test(test__f_string_seek_line__returns_none_stop),
cmocka_unit_test(test__f_string_seek_to__returns_none_stop),
cmocka_unit_test(test__f_string_seek_to__works),
+ cmocka_unit_test(test__f_string_dynamicss_delete_callback__fails),
+ cmocka_unit_test(test__f_string_dynamicss_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_map_multis_delete_callback__fails),
+ cmocka_unit_test(test__f_string_map_multis_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_map_multiss_delete_callback__fails),
+ cmocka_unit_test(test__f_string_map_multiss_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_maps_delete_callback__fails),
+ cmocka_unit_test(test__f_string_maps_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_mapss_delete_callback__fails),
+ cmocka_unit_test(test__f_string_mapss_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_quantityss_delete_callback__fails),
+ cmocka_unit_test(test__f_string_quantityss_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_rangess_delete_callback__fails),
+ cmocka_unit_test(test__f_string_rangess_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_triples_delete_callback__fails),
+ cmocka_unit_test(test__f_string_triples_destroy_callback__fails),
+
+ cmocka_unit_test(test__f_string_tripless_delete_callback__fails),
+ cmocka_unit_test(test__f_string_tripless_destroy_callback__fails),
+
#ifndef _di_level_0_parameter_checking_
cmocka_unit_test(test__f_string_append__parameter_checking),
cmocka_unit_test(test__f_string_append_assure__parameter_checking),
cmocka_unit_test(test__f_string_dynamics_append__parameter_checking),
cmocka_unit_test(test__f_string_dynamics_append_all__parameter_checking),
-
cmocka_unit_test(test__f_string_dynamicss_append__parameter_checking),
cmocka_unit_test(test__f_string_dynamicss_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_map_multis_adjust__parameter_checking),
cmocka_unit_test(test__f_string_map_multis_append__parameter_checking),
cmocka_unit_test(test__f_string_map_multis_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_map_multis_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_map_multis_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_map_multis_increase__parameter_checking),
- cmocka_unit_test(test__f_string_map_multis_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_map_multis_resize__parameter_checking),
-
- cmocka_unit_test(test__f_string_map_multiss_adjust__parameter_checking),
cmocka_unit_test(test__f_string_map_multiss_append__parameter_checking),
cmocka_unit_test(test__f_string_map_multiss_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_map_multiss_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_map_multiss_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_map_multiss_increase__parameter_checking),
- cmocka_unit_test(test__f_string_map_multiss_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_map_multiss_resize__parameter_checking),
- cmocka_unit_test(test__f_string_maps_adjust__parameter_checking),
cmocka_unit_test(test__f_string_maps_append__parameter_checking),
cmocka_unit_test(test__f_string_maps_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_maps_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_maps_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_maps_increase__parameter_checking),
- cmocka_unit_test(test__f_string_maps_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_maps_resize__parameter_checking),
-
- cmocka_unit_test(test__f_string_mapss_adjust__parameter_checking),
cmocka_unit_test(test__f_string_mapss_append__parameter_checking),
cmocka_unit_test(test__f_string_mapss_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_mapss_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_mapss_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_mapss_increase__parameter_checking),
- cmocka_unit_test(test__f_string_mapss_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_mapss_resize__parameter_checking),
cmocka_unit_test(test__f_string_mash__parameter_checking),
cmocka_unit_test(test__f_string_mash_nulless__parameter_checking),
cmocka_unit_test(test__f_string_prepend_assure_nulless__parameter_checking),
cmocka_unit_test(test__f_string_prepend_nulless__parameter_checking),
- cmocka_unit_test(test__f_string_quantitys_adjust__parameter_checking),
cmocka_unit_test(test__f_string_quantitys_append__parameter_checking),
cmocka_unit_test(test__f_string_quantitys_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_quantitys_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_quantitys_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_quantitys_increase__parameter_checking),
- cmocka_unit_test(test__f_string_quantitys_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_quantitys_resize__parameter_checking),
-
- cmocka_unit_test(test__f_string_quantityss_adjust__parameter_checking),
cmocka_unit_test(test__f_string_quantityss_append__parameter_checking),
cmocka_unit_test(test__f_string_quantityss_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_quantityss_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_quantityss_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_quantityss_increase__parameter_checking),
- cmocka_unit_test(test__f_string_quantityss_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_quantityss_resize__parameter_checking),
- cmocka_unit_test(test__f_string_ranges_adjust__parameter_checking),
cmocka_unit_test(test__f_string_ranges_append__parameter_checking),
cmocka_unit_test(test__f_string_ranges_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_ranges_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_ranges_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_ranges_increase__parameter_checking),
- cmocka_unit_test(test__f_string_ranges_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_ranges_resize__parameter_checking),
-
- cmocka_unit_test(test__f_string_rangess_adjust__parameter_checking),
cmocka_unit_test(test__f_string_rangess_append__parameter_checking),
cmocka_unit_test(test__f_string_rangess_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_rangess_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_rangess_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_rangess_increase__parameter_checking),
- cmocka_unit_test(test__f_string_rangess_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_rangess_resize__parameter_checking),
- cmocka_unit_test(test__f_string_triples_adjust__parameter_checking),
cmocka_unit_test(test__f_string_triples_append__parameter_checking),
cmocka_unit_test(test__f_string_triples_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_triples_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_triples_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_triples_increase__parameter_checking),
- cmocka_unit_test(test__f_string_triples_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_triples_resize__parameter_checking),
-
- cmocka_unit_test(test__f_string_tripless_adjust__parameter_checking),
cmocka_unit_test(test__f_string_tripless_append__parameter_checking),
cmocka_unit_test(test__f_string_tripless_append_all__parameter_checking),
- cmocka_unit_test(test__f_string_tripless_decimate_by__parameter_checking),
- cmocka_unit_test(test__f_string_tripless_decrease_by__parameter_checking),
- cmocka_unit_test(test__f_string_tripless_increase__parameter_checking),
- cmocka_unit_test(test__f_string_tripless_increase_by__parameter_checking),
- cmocka_unit_test(test__f_string_tripless_resize__parameter_checking),
cmocka_unit_test(test__f_string_seek_line__parameter_checking),
cmocka_unit_test(test__f_string_seek_line_to__parameter_checking),
cmocka_unit_test(test__f_string_seek_to__parameter_checking),
+
+ // f_string_dynamicss_delete_callback() doesn't use parameter checking.
+ // f_string_dynamicss_destroy_callback() doesn't use parameter checking.
+
+ // f_string_map_multis_delete_callback() doesn't use parameter checking.
+ // f_string_map_multis_destroy_callback() doesn't use parameter checking.
+
+ // f_string_map_multiss_delete_callback() doesn't use parameter checking.
+ // f_string_map_multiss_destroy_callback() doesn't use parameter checking.
+
+ // f_string_maps_delete_callback() doesn't use parameter checking.
+ // f_string_maps_destroy_callback() doesn't use parameter checking.
+
+ // f_string_mapss_delete_callback() doesn't use parameter checking.
+ // f_string_mapss_destroy_callback() doesn't use parameter checking.
+
+ // f_string_quantityss_delete_callback() doesn't use parameter checking.
+ // f_string_quantityss_destroy_callback() doesn't use parameter checking.
+
+ // f_string_rangess_delete_callback() doesn't use parameter checking.
+ // f_string_rangess_destroy_callback() doesn't use parameter checking.
+
+ // f_string_triples_delete_callback() doesn't use parameter checking.
+ // f_string_triples_destroy_callback() doesn't use parameter checking.
+
+ // f_string_tripless_delete_callback() doesn't use parameter checking.
+ // f_string_tripless_destroy_callback() doesn't use parameter checking.
#endif // _di_level_0_parameter_checking_
};
#include <fll/level_0/string.h>
// Mock includes.
-//#include "mock-string.h"
+#include "mock-string.h"
// Test includes.
#include "test-string-append.h"
#include "test-string-dynamics_append_all.h"
#include "test-string-dynamicss_append.h"
#include "test-string-dynamicss_append_all.h"
-#include "test-string-map_multis_adjust.h"
+#include "test-string-dynamicss_delete_callback.h"
+#include "test-string-dynamicss_destroy_callback.h"
#include "test-string-map_multis_append.h"
#include "test-string-map_multis_append_all.h"
-#include "test-string-map_multis_decimate_by.h"
-#include "test-string-map_multis_decrease_by.h"
-#include "test-string-map_multis_increase.h"
-#include "test-string-map_multis_increase_by.h"
-#include "test-string-map_multis_resize.h"
-#include "test-string-map_multiss_adjust.h"
+#include "test-string-map_multis_delete_callback.h"
+#include "test-string-map_multis_destroy_callback.h"
#include "test-string-map_multiss_append.h"
#include "test-string-map_multiss_append_all.h"
-#include "test-string-map_multiss_decimate_by.h"
-#include "test-string-map_multiss_decrease_by.h"
-#include "test-string-map_multiss_increase.h"
-#include "test-string-map_multiss_increase_by.h"
-#include "test-string-map_multiss_resize.h"
-#include "test-string-maps_adjust.h"
+#include "test-string-map_multiss_delete_callback.h"
+#include "test-string-map_multiss_destroy_callback.h"
#include "test-string-maps_append.h"
#include "test-string-maps_append_all.h"
-#include "test-string-maps_decimate_by.h"
-#include "test-string-maps_decrease_by.h"
-#include "test-string-maps_increase.h"
-#include "test-string-maps_increase_by.h"
-#include "test-string-maps_resize.h"
-#include "test-string-mapss_adjust.h"
+#include "test-string-maps_delete_callback.h"
+#include "test-string-maps_destroy_callback.h"
#include "test-string-mapss_append.h"
#include "test-string-mapss_append_all.h"
-#include "test-string-mapss_decimate_by.h"
-#include "test-string-mapss_decrease_by.h"
-#include "test-string-mapss_increase.h"
-#include "test-string-mapss_increase_by.h"
-#include "test-string-mapss_resize.h"
+#include "test-string-mapss_delete_callback.h"
+#include "test-string-mapss_destroy_callback.h"
#include "test-string-mash.h"
#include "test-string-mash_nulless.h"
#include "test-string-mish.h"
#include "test-string-prepend_assure.h"
#include "test-string-prepend_assure_nulless.h"
#include "test-string-prepend_nulless.h"
-#include "test-string-quantitys_adjust.h"
#include "test-string-quantitys_append.h"
#include "test-string-quantitys_append_all.h"
-#include "test-string-quantitys_decimate_by.h"
-#include "test-string-quantitys_decrease_by.h"
-#include "test-string-quantitys_increase.h"
-#include "test-string-quantitys_increase_by.h"
-#include "test-string-quantitys_resize.h"
-#include "test-string-quantityss_adjust.h"
#include "test-string-quantityss_append.h"
#include "test-string-quantityss_append_all.h"
-#include "test-string-quantityss_decimate_by.h"
-#include "test-string-quantityss_decrease_by.h"
-#include "test-string-quantityss_increase.h"
-#include "test-string-quantityss_increase_by.h"
-#include "test-string-quantityss_resize.h"
-#include "test-string-ranges_adjust.h"
+#include "test-string-quantityss_delete_callback.h"
+#include "test-string-quantityss_destroy_callback.h"
#include "test-string-ranges_append.h"
#include "test-string-ranges_append_all.h"
-#include "test-string-ranges_decimate_by.h"
-#include "test-string-ranges_decrease_by.h"
-#include "test-string-ranges_increase.h"
-#include "test-string-ranges_increase_by.h"
-#include "test-string-ranges_resize.h"
-#include "test-string-rangess_adjust.h"
#include "test-string-rangess_append.h"
#include "test-string-rangess_append_all.h"
-#include "test-string-rangess_decimate_by.h"
-#include "test-string-rangess_decrease_by.h"
-#include "test-string-rangess_increase.h"
-#include "test-string-rangess_increase_by.h"
-#include "test-string-rangess_resize.h"
+#include "test-string-rangess_delete_callback.h"
+#include "test-string-rangess_destroy_callback.h"
#include "test-string-seek_line.h"
#include "test-string-seek_line_to.h"
#include "test-string-seek_to.h"
-#include "test-string-triples_adjust.h"
#include "test-string-triples_append.h"
#include "test-string-triples_append_all.h"
-#include "test-string-triples_decimate_by.h"
-#include "test-string-triples_decrease_by.h"
-#include "test-string-triples_increase.h"
-#include "test-string-triples_increase_by.h"
-#include "test-string-triples_resize.h"
-#include "test-string-tripless_adjust.h"
+#include "test-string-triples_delete_callback.h"
+#include "test-string-triples_destroy_callback.h"
#include "test-string-tripless_append.h"
#include "test-string-tripless_append_all.h"
-#include "test-string-tripless_decimate_by.h"
-#include "test-string-tripless_decrease_by.h"
-#include "test-string-tripless_increase.h"
-#include "test-string-tripless_increase_by.h"
-#include "test-string-tripless_resize.h"
+#include "test-string-tripless_delete_callback.h"
+#include "test-string-tripless_destroy_callback.h"
#ifdef __cplusplus
extern "C" {
if (!environment) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!name.used) {
- return F_data_not;
- }
+ if (!name.used) return F_data_not;
- f_status_t status = f_string_maps_increase(F_memory_default_allocation_small_d, environment);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_map_t), (void **) &environment->array, &environment->used, &environment->size);
+ if (F_status_is_error(status)) return status;
- environment->array[environment->used].name.used = 0;
- environment->array[environment->used].value.used = 0;
+ environment->array[environment->used].name.used = 0;
+ environment->array[environment->used].value.used = 0;
- status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].name);
+ status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].name);
- if (F_status_is_error_not(status)) {
- status = f_environment_get(name, &environment->array[environment->used].value);
- }
+ if (F_status_is_error_not(status)) {
+ status = f_environment_get(name, &environment->array[environment->used].value);
+ }
- if (F_status_is_error(status) || status == F_data_not || status == F_exist_not) {
- environment->array[environment->used].name.used = 0;
- environment->array[environment->used].value.used = 0;
+ if (F_status_is_error(status) || status == F_data_not || status == F_exist_not) {
+ environment->array[environment->used].name.used = 0;
+ environment->array[environment->used].value.used = 0;
- return status;
+ return status;
+ }
}
++environment->used;
return F_data_not;
}
- f_status_t status = f_string_maps_increase_by(names.used, environment);
+ f_status_t status = f_memory_array_increase_by(names.used, sizeof(f_string_map_t), (void **) &environment->array, &environment->used, &environment->size);
if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < names.used; ++i) {
* F_exist_not if name does not exist.
*
* Errors (with error bit) from: f_environment_get().
+ * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_string_dynamic_append_nulless().
- * Errors (with error bit) from: f_string_maps_increase_by().
*
* @see f_environment_get()
+ * @see f_memory_array_increase_by()
* @see f_string_dynamic_append_nulless()
- * @see f_string_maps_increase_by()
*/
#ifndef _di_fl_environment_load_name_
extern f_status_t fl_environment_load_name(const f_string_static_t name, f_string_maps_t * const environment);
* F_data_not if names.used is 0.
*
* Errors (with error bit) from: f_environment_get().
+ * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_string_dynamic_append_nulless().
- * Errors (with error bit) from: f_string_maps_increase_by().
*
* @see f_environment_get()
+ * @see f_memory_array_increase_by()
* @see f_string_dynamic_append_nulless()
- * @see f_string_maps_increase_by()
*/
#ifndef _di_fl_environment_load_names_
extern f_status_t fl_environment_load_names(const f_string_statics_t names, f_string_maps_t * const environment);
return;
}
- state->status = f_string_ranges_increase(state->step_small, found);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &found->array, &found->used, &found->size);
if (F_status_is_error(state->status)) return;
found->array[found->used].start = range->start;
*
* Errors (with error bit) from: f_fss_skip_past_delimit().
* Errors (with error bit) from: f_fss_skip_past_space().
- * Errors (with error bit) from: f_string_ranges_increase().
+ * Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_utf_buffer_increment().
*
* @see f_fss_skip_past_delimit()
* @see f_fss_skip_past_space()
- * @see f_string_ranges_increase()
+ * @see f_memory_array_increase()
* @see f_utf_buffer_increment()
*/
#ifndef _di_fl_fss_basic_content_read_
return;
}
- state->status = f_string_ranges_increase(state->step_small, found);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &found->array, &found->used, &found->size);
if (F_status_is_error(state->status)) return;
found->array[found->used].start = range->start;
f_fss_seek_to_eol(buffer, range, state);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, comments);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &comments->array, &comments->used, &comments->size);
if (F_status_is_error(state->status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
* F_interrupt (with error bit) if stopping due to an interrupt.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_fss_is_space().
* Errors (with error bit) from: f_fss_seek_to_eol().
* Errors (with error bit) from: f_fss_skip_past_delimit().
- * Errors (with error bit) from: f_string_ranges_increase().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_utf_buffer_increment().
*
- * @see f_memory_array_increase()
- * @see f_memory_array_increase_by()
* @see f_fss_is_space()
* @see f_fss_seek_to_eol()
* @see f_fss_skip_past_delimit()
- * @see f_string_ranges_increase()
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
* @see f_utf_buffer_increment()
*/
#ifndef _di_fl_fss_basic_list_content_read_
f_string_ranges_t objects = f_string_ranges_t_initialize;
- state->status = f_string_ranges_increase(state->step_small, &objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
if (F_status_is_error(state->status)) {
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
if (F_status_is_error(state->status)) {
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
return;
}
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
else {
if (range->start >= buffer.used || range->start > range->stop) {
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_okay_eos : F_okay_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_data_not_eos : F_data_not_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_data_not_eos : F_data_not_stop;
state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, &objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
if (F_status_is_error(state->status)) break;
state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_data_not_eos : F_data_not_stop;
state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, &objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
if (F_status_is_error(state->status)) break;
state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_data_not_eos : F_data_not_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_data_not_eos : F_data_not_stop;
position = found->depth[depth].used;
if (found->depth[depth].array[position].content.size != 1) {
- state->status = f_string_ranges_resize(1, &found->depth[depth].array[position].content);
+ state->status = f_memory_array_resize(1, sizeof(f_string_range_t), (void **) &found->depth[depth].array[position].content.array, &found->depth[depth].array[position].content.used, &found->depth[depth].array[position].content.size);
if (F_status_is_error(state->status)) break;
}
if (F_status_is_error(state->status)) break;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
if (range->start >= buffer.used) {
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_end_not_nest_eos : F_end_not_nest_stop;
comments->used = comments_used;
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
state->status = (range->start >= buffer.used) ? F_data_not_eos : F_data_not_stop;
f_fss_seek_to_eol(buffer, range, state);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, comments);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &comments->array, &comments->used, &comments->size);
if (F_status_is_error(state->status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
} // while
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &positions_start.array, &positions_start.used, &positions_start.size);
- f_string_ranges_resize(0, &objects);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &slashes.array, &slashes.used, &slashes.size);
delimits->used = delimits_used;
* F_interrupt (with error bit) if stopping due to an interrupt.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_fss_is_space().
* Errors (with error bit) from: f_fss_seek_to_eol().
* Errors (with error bit) from: f_fss_skip_past_delimit().
- * Errors (with error bit) from: f_string_ranges_increase().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_utf_buffer_increment().
*
- * @see f_memory_array_increase()
- * @see f_memory_array_increase_by()
* @see f_fss_is_space()
* @see f_fss_seek_to_eol()
* @see f_fss_skip_past_delimit()
- * @see f_string_ranges_increase()
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
* @see f_utf_buffer_increment()
*/
#ifndef _di_fl_fss_embedded_list_content_read_
private_fl_fss_basic_read(buffer, F_false, range, &content_partial, "e, delimits, state);
if (state->status == F_fss_found_object || F_status_set_fine(state->status) == F_fss_found_object_content_not) {
- status = f_string_ranges_increase(state->step_small, found);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &found->array, &found->used, &found->size);
// The private function sets the error bit on unterminated quoted Object.
if (state->status == F_status_set_error(F_fss_found_object_content_not)) {
* F_interrupt (with error bit) if stopping due to an interrupt.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_fss_is_graph().
* Errors (with error bit) from: f_fss_is_space().
* Errors (with error bit) from: f_fss_is_zero_width().
* Errors (with error bit) from: f_fss_skip_past_delimit().
* Errors (with error bit) from: f_fss_skip_past_space().
- * Errors (with error bit) from: f_string_ranges_increase().
+ * Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_utf_buffer_increment().
*
- * @see f_memory_array_increase()
* @see f_fss_is_graph()
* @see f_fss_is_space()
* @see f_fss_is_zero_width()
* @see f_fss_skip_past_delimit()
* @see f_fss_skip_past_space()
- * @see f_string_ranges_increase()
+ * @see f_memory_array_increase()
* @see f_utf_buffer_increment()
* @see fl_fss_basic_object_read()
* @see fl_fss_extended_object_read()
return;
}
- state->status = f_string_ranges_increase(state->step_small, found);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &found->array, &found->used, &found->size);
if (F_status_is_error(state->status)) return;
found->array[found->used].start = range->start;
f_fss_seek_to_eol(buffer, range, state);
if (F_status_is_error(state->status)) break;
- state->status = f_string_ranges_increase(state->step_small, comments);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &comments->array, &comments->used, &comments->size);
if (F_status_is_error(state->status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
* F_interrupt (with error bit) if stopping due to an interrupt.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_fss_is_space().
* Errors (with error bit) from: f_fss_seek_to_eol().
* Errors (with error bit) from: f_fss_skip_past_delimit().
- * Errors (with error bit) from: f_string_ranges_increase().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
* Errors (with error bit) from: f_utf_buffer_increment().
*
- * @see f_memory_array_increase()
- * @see f_memory_array_increase_by()
* @see f_fss_is_space()
* @see f_fss_seek_to_eol()
* @see f_fss_skip_past_delimit()
- * @see f_string_ranges_increase()
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
* @see f_utf_buffer_increment()
*/
#ifndef _di_fl_fss_extended_list_content_read_
matches[j] = F_true;
}
- status = f_string_map_multis_increase(F_fss_default_allocation_step_small_d, values[j]);
+ status = f_memory_array_increase(F_fss_default_allocation_step_small_d, sizeof(f_string_map_multi_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size);
if (F_status_is_error(status)) return status;
if (indexs) {
matches[j] = F_true;
}
- status = f_string_maps_increase(F_fss_default_allocation_step_small_d, values[j]);
+ status = f_memory_array_increase(F_fss_default_allocation_step_small_d, sizeof(f_string_map_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size);
if (F_status_is_error(status)) return status;
if (indexs) {
map_multi = &values[j]->array[k];
}
else {
- status = f_string_map_multis_increase(F_fss_default_allocation_step_small_d, values[j]);
+ status = f_memory_array_increase(F_fss_default_allocation_step_small_d, sizeof(f_string_map_multi_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size);
if (F_status_is_error(status)) return status;
if (indexs) {
map = &values[j]->array[k];
}
else {
- status = f_string_maps_increase(F_fss_default_allocation_step_small_d, values[j]);
+ status = f_memory_array_increase(F_fss_default_allocation_step_small_d, sizeof(f_string_map_t), (void **) &values[j]->array, &values[j]->used, &values[j]->size);
if (F_status_is_error(status)) return status;
if (indexs) {
uint8_t *quoted_object = 0;
do {
- state->status = f_string_ranges_increase(state->step_small, objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects->array, &objects->used, &objects->size);
if (F_status_is_error(state->status)) return;
- state->status = f_string_rangess_increase(state->step_small, contents);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_ranges_t), (void **) &contents->array, &contents->used, &contents->size);
if (F_status_is_error(state->status)) return;
contents->array[contents->used].used = 0;
++objects_quoted->used;
}
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
if (F_status_is_error(status)) {
state->status = status;
if (state->status == F_fss_found_object_content_not) {
found_data = F_true;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_string_ranges_increase().
- * Errors (with error bit) from: f_string_rangess_increase().
* Errors (with error bit) from: fl_fss_basic_content_read().
* Errors (with error bit) from: fl_fss_basic_object_read().
*
* @see f_memory_array_increase()
- * @see f_string_ranges_increase()
- * @see f_string_rangess_increase()
* @see fl_fss_basic_content_read()
* @see fl_fss_basic_object_read()
*/
bool found_data = F_false;
do {
- state->status = f_string_ranges_increase(state->step_small, objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects->array, &objects->used, &objects->size);
if (F_status_is_error(state->status)) return;
- state->status = f_string_rangess_increase(state->step_small, contents);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_ranges_t), (void **) &contents->array, &contents->used, &contents->size);
if (F_status_is_error(state->status)) return;
contents->array[contents->used].used = 0;
if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
++objects->used;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
if (state->status == F_fss_found_object_content_not) {
found_data = F_true;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_string_ranges_increase().
- * Errors (with error bit) from: f_string_rangess_increase().
* Errors (with error bit) from: fl_fss_basic_list_content_read().
* Errors (with error bit) from: fl_fss_basic_list_object_read().
*
* @see f_memory_array_increase()
- * @see f_string_ranges_increase()
- * @see f_string_rangess_increase()
* @see fl_fss_basic_list_content_read()
* @see fl_fss_basic_list_object_read()
*/
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_string_ranges_increase().
- * Errors (with error bit) from: f_string_rangess_increase().
* Errors (with error bit) from: fl_fss_embedded_list_content_read().
* Errors (with error bit) from: fl_fss_embedded_list_object_read().
*
* @see f_memory_array_increase()
- * @see f_string_ranges_increase()
- * @see f_string_rangess_increase()
* @see fl_fss_embedded_list_content_read()
* @see fl_fss_embedded_list_object_read()
*/
f_uint8s_t *quoted_content = 0;
do {
- state->status = f_string_ranges_increase(state->step_small, objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects->array, &objects->used, &objects->size);
if (F_status_is_error(state->status)) return;
- state->status = f_string_rangess_increase(state->step_small, contents);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_ranges_t), (void **) &contents->array, &contents->used, &contents->size);
if (F_status_is_error(state->status)) return;
contents->array[contents->used].used = 0;
++objects_quoted->used;
}
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) return;
contents->array[contents->used++].used = 0;
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_string_ranges_increase().
- * Errors (with error bit) from: f_string_rangess_increase().
* Errors (with error bit) from: fl_fss_extended_content_read().
* Errors (with error bit) from: fl_fss_extended_object_read().
*
* @see f_memory_array_increase()
- * @see f_string_ranges_increase()
- * @see f_string_rangess_increase()
* @see fl_fss_extended_content_read()
* @see fl_fss_extended_object_read()
*/
bool found_data = F_false;
do {
- state->status = f_string_ranges_increase(state->step_small, objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects->array, &objects->used, &objects->size);
if (F_status_is_error(state->status)) return;
- state->status = f_string_rangess_increase(state->step_small, contents);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_ranges_t), (void **) &contents->array, &contents->used, &contents->size);
if (F_status_is_error(state->status)) return;
contents->array[contents->used].used = 0;
if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
++objects->used;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
if (F_status_is_error(state->status)) {
state->status = status;
if (state->status == F_fss_found_object_content_not) {
found_data = F_true;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_string_ranges_increase().
- * Errors (with error bit) from: f_string_rangess_increase().
* Errors (with error bit) from: fl_fss_extended_list_content_read().
* Errors (with error bit) from: fl_fss_extended_list_object_read().
*
* @see f_memory_array_increase()
- * @see f_string_ranges_increase()
- * @see f_string_rangess_increase()
* @see fl_fss_extended_list_content_read()
* @see fl_fss_extended_list_object_read()
*/
bool found_data = F_false;
do {
- state->status = f_string_ranges_increase(state->step_small, objects);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &objects->array, &objects->used, &objects->size);
if (F_status_is_error(state->status)) return;
- state->status = f_string_rangess_increase(state->step_small, contents);
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_string_ranges_t), (void **) &contents->array, &contents->used, &contents->size);
if (F_status_is_error(state->status)) return;
contents->array[contents->used].used = 0;
++objects->used;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
if (F_status_is_error(status)) {
state->status = status;
contents->array[contents->used].used = 0;
if (f_compare_dynamic_partial_string(f_fss_payload_s.string, buffer, f_fss_payload_s.used, objects->array[objects->used]) == F_equal_to) {
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
if (state->status == F_fss_found_object_content_not) {
found_data = F_true;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
if (f_compare_dynamic_partial_string(f_fss_payload_s.string, buffer, f_fss_payload_s.used, objects->array[objects->used]) == F_equal_to) {
++objects->used;
- status = f_string_ranges_increase(state->step_small, &contents->array[contents->used]);
+ status = f_memory_array_increase(state->step_small, sizeof(f_string_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
if (F_status_is_error(status)) {
state->status = status;
* F_number_overflow (with error bit) if the maximum buffer size is reached.
*
* Errors (with error bit) from: f_memory_array_increase().
- * Errors (with error bit) from: f_string_ranges_increase().
- * Errors (with error bit) from: f_string_rangess_increase().
* Errors (with error bit) from: fl_fss_basic_list_content_read().
* Errors (with error bit) from: fl_fss_basic_list_object_read().
*
* @see f_memory_array_increase()
- * @see f_string_ranges_increase()
- * @see f_string_rangess_increase()
* @see fl_fss_basic_list_content_read()
* @see fl_fss_basic_list_object_read()
*/
return;
}
- f_string_ranges_resize(0, &main->cache.objects);
- f_string_rangess_resize(0, &main->cache.contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &main->cache.objects.array, &main->cache.objects.used, &main->cache.objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &main->cache.contents.array, &main->cache.contents.used, &main->cache.contents.size, &f_string_rangess_delete_callback);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &main->cache.delimits.array, &main->cache.delimits.used, &main->cache.delimits.size);
{
f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache.small.string, &main->cache.small.used, &main->cache.small.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache.packet.string, &main->cache.packet.used, &main->cache.packet.size);
- f_string_ranges_resize(0, &main->cache.objects);
- f_string_rangess_resize(0, &main->cache.contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &main->cache.objects.array, &main->cache.objects.used, &main->cache.objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &main->cache.contents.array, &main->cache.contents.used, &main->cache.contents.size, &f_string_rangess_delete_callback);
- f_string_ranges_resize(0, &main->cache.packet_objects);
- f_string_rangess_resize(0, &main->cache.packet_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &main->cache.packet_objects.array, &main->cache.packet_objects.used, &main->cache.packet_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &main->cache.packet_contents.array, &main->cache.packet_contents.used, &main->cache.packet_contents.size, &f_string_rangess_delete_callback);
- f_string_ranges_resize(0, &main->cache.header_objects);
- f_string_rangess_resize(0, &main->cache.header_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &main->cache.header_objects.array, &main->cache.header_objects.used, &main->cache.header_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &main->cache.header_contents.array, &main->cache.header_contents.used, &main->cache.header_contents.size, &f_string_rangess_delete_callback);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &main->cache.delimits.array, &main->cache.delimits.used, &main->cache.delimits.size);
}
* This does not alter main.setting.state.status.
*
* @see f_memory_array_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
+ * @see f_memory_arrays_resize()
* @see fll_program_data_delete()
*/
#ifndef _di_control_main_delete_
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &cache->stack.array, &cache->stack.used, &cache->stack.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &cache->delimits.array, &cache->delimits.used, &cache->delimits.size);
- f_string_ranges_resize(0, &cache->comments);
- f_string_ranges_resize(0, &cache->content_action);
- f_string_ranges_resize(0, &cache->object_actions);
- f_string_ranges_resize(0, &cache->object_items);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &cache->comments.array, &cache->comments.used, &cache->comments.size);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &cache->content_action.array, &cache->content_action.used, &cache->content_action.size);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &cache->object_actions.array, &cache->object_actions.used, &cache->object_actions.size);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &cache->object_items.array, &cache->object_items.used, &cache->object_items.size);
- f_string_rangess_resize(0, &cache->content_actions);
- f_string_rangess_resize(0, &cache->content_items);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &cache->content_actions.array, &cache->content_actions.used, &cache->content_actions.size, &f_string_rangess_delete_callback);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &cache->content_items.array, &cache->content_items.used, &cache->content_items.size, &f_string_rangess_delete_callback);
controller_cache_action_delete_simple(&cache->action);
}
* @see controller_cache_action_delete_simple()
*
* @see f_memory_array_resize()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_resize()
+ * @see f_memory_arrays_resize()
*/
#ifndef _di_controller_cache_delete_simple_
extern void controller_cache_delete_simple(controller_cache_t * const cache) F_attribute_visibility_internal_d;
f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->name.string, &rule->name.used, &rule->name.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->path.string, &rule->path.used, &rule->path.size);
- f_string_maps_resize(0, &rule->define);
- f_string_maps_resize(0, &rule->parameter);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &rule->define.array, &rule->define.used, &rule->define.size, &f_string_maps_delete_callback);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &rule->parameter.array, &rule->parameter.used, &rule->parameter.size, &f_string_maps_delete_callback);
f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &rule->engine_arguments.array, &rule->engine_arguments.used, &rule->engine_arguments.size, &f_string_dynamics_delete_callback);
f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &rule->environment.array, &rule->environment.used, &rule->environment.size, &f_string_dynamics_delete_callback);
controller_control_delete_simple(&setting->control);
- f_string_maps_resize(0, &setting->entry.define);
- f_string_maps_resize(0, &setting->entry.parameter);
+ status = f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &setting->entry.define.array, &setting->entry.define.used, &setting->entry.define.size, &f_string_maps_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &setting->entry.parameter.array, &setting->entry.parameter.used, &setting->entry.parameter.size, &f_string_maps_delete_callback);
- f_string_maps_resize(0, &setting->exit.define);
- f_string_maps_resize(0, &setting->exit.parameter);
+ status = f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &setting->exit.define.array, &setting->exit.define.used, &setting->exit.define.size, &f_string_maps_delete_callback);
+ status = f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &setting->exit.parameter.array, &setting->exit.parameter.used, &setting->exit.parameter.size, &f_string_maps_delete_callback);
controller_entry_items_delete_simple(&setting->entry.items);
controller_entry_items_delete_simple(&setting->exit.items);
#ifndef _di_controller_entry_settings_read_map_
f_status_t controller_entry_settings_read_map(const f_string_static_t buffer, const f_string_ranges_t ranges, f_string_maps_t *setting_maps) {
- f_status_t status = f_string_maps_increase(controller_common_allocation_small_d, setting_maps);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size);
+ if (F_status_is_error(status)) return status;
- setting_maps->array[setting_maps->used].name.used = 0;
- setting_maps->array[setting_maps->used].value.used = 0;
+ setting_maps->array[setting_maps->used].name.used = 0;
+ setting_maps->array[setting_maps->used].value.used = 0;
- status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[0], &setting_maps->array[setting_maps->used].name);
- if (F_status_is_error(status)) return status;
+ status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[0], &setting_maps->array[setting_maps->used].name);
+ if (F_status_is_error(status)) return status;
- status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[1], &setting_maps->array[setting_maps->used].value);
- if (F_status_is_error(status)) return status;
+ status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[1], &setting_maps->array[setting_maps->used].value);
+ if (F_status_is_error(status)) return status;
+ }
++setting_maps->used;
* The map to load the settings into.
*
* @return
+ * Errors (with error bit) from: f_memory_aray_increase().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_maps_increase().
*
+ * @see f_memory_aray_increase()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_maps_increase()
*/
#ifndef _di_controller_entry_settings_read_map_
f_status_t controller_entry_settings_read_map(const f_string_static_t buffer, const f_string_ranges_t ranges, f_string_maps_t *setting_maps) F_attribute_visibility_internal_d;
setting_maps = &rule->parameter;
}
- status = f_string_maps_increase(controller_common_allocation_small_d, setting_maps);
+ status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size);
if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_maps_increase", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
* Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_rip_dynamic_partial_nulless().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_maps_increase().
* Errors (with error bit) from: fll_fss_extended_read().
*
* Errors (with error bit) from: controller_path_canonical_relative().
* @see f_memory_array_increase()
* @see f_rip_dynamic_partial_nulless()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_maps_increase()
* @see fll_fss_extended_read()
*
* @see controller_path_canonical_relative()
f_memory_array_resize(0, sizeof(f_char_t), (void **) &buffer.string, &buffer.used, &buffer.size);
- f_string_ranges_resize(0, &objects);
- f_string_rangess_resize(0, &contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &objects.array, &objects.used, &objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &contents.array, &contents.used, &contents.size, &f_string_rangess_delete_callback);
}
// Error when required settings are not specified.
// Shrink an overly long array.
if (iki_data->content.used > fake_max_over_array_d) {
- f_string_ranges_resize(fake_allocation_large_d, &iki_data->content);
+ f_memory_array_resize(fake_allocation_large_d, sizeof(f_string_range_t), (void **) &iki_data->content.array, &iki_data->content.used, &iki_data->content.size);
}
if (iki_data->delimits.used > fake_max_over_array_d) {
}
if (iki_data->variable.used > fake_max_over_array_d) {
- f_string_ranges_resize(fake_allocation_large_d, &iki_data->variable);
+ f_memory_array_resize(fake_allocation_large_d, sizeof(f_string_range_t), (void **) &iki_data->variable.array, &iki_data->variable.used, &iki_data->variable.size);
}
if (iki_data->vocabulary.used > fake_max_over_array_d) {
- f_string_ranges_resize(fake_allocation_large_d, &iki_data->vocabulary);
+ f_memory_array_resize(fake_allocation_large_d, sizeof(f_string_range_t), (void **) &iki_data->vocabulary.array, &iki_data->vocabulary.used, &iki_data->vocabulary.size);
}
while (iki_data->content.used) {
* The iki data to shrink.
*
* @see f_memory_array_resize()
- * @see f_string_ranges_resize()
*/
#ifndef _di_fake_iki_data_reset_
extern void fake_iki_data_reset(f_iki_data_t * const iki_data);
"f_string_dynamic_partial_append",
"f_string_dynamic_partial_append_nulless",
"f_string_dynamic_prepend",
- "f_string_map_multis_resize",
"f_thread_create",
"f_utf_is_word_dash_plus",
"fl_conversion_dynamic_to_unsigned_detect",
fake_f_f_string_dynamic_partial_append_e,
fake_f_f_string_dynamic_partial_append_nulless_e,
fake_f_f_string_dynamic_prepend_e,
- fake_f_f_string_map_multis_resize_e,
fake_f_f_thread_create_e,
fake_f_f_utf_is_word_dash_plus_e,
fake_f_fl_conversion_dynamic_to_unsigned_detect_e,
if (!build_data) return;
fake_build_setting_delete(&build_data->setting);
- f_string_maps_resize(0, &build_data->environment);
+
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &build_data->environment.array, &build_data->environment.used, &build_data->environment.size, &f_string_maps_delete_callback);
}
#endif // _di_fake_build_data_delete_
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_program_script.string, &build_setting->path_program_script.used, &build_setting->path_program_script.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_program_shared.string, &build_setting->path_program_shared.used, &build_setting->path_program_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_program_static.string, &build_setting->path_program_static.used, &build_setting->path_program_static.size);
+ f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_sources.string, &build_setting->path_sources.used, &build_setting->path_sources.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_sources_object.string, &build_setting->path_sources_object.used, &build_setting->path_sources_object.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->process_post.string, &build_setting->process_post.used, &build_setting->process_post.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->process_pre.string, &build_setting->process_pre.used, &build_setting->process_pre.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_shared.string, &build_stage->file_library_shared.used, &build_stage->file_library_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_static.string, &build_stage->file_library_static.used, &build_stage->file_library_static.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_script.string, &build_stage->file_object_script.used, &build_stage->file_object_script.size);
+ f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_shared.string, &build_stage->file_object_shared.used, &build_stage->file_object_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_static.string, &build_stage->file_object_static.used, &build_stage->file_object_static.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_objects_static.string, &build_stage->file_objects_static.used, &build_stage->file_objects_static.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_process_post.string, &build_stage->file_process_post.used, &build_stage->file_process_post.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries_script.string, &data->path_build_libraries_script.used, &data->path_build_libraries_script.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries_shared.string, &data->path_build_libraries_shared.used, &data->path_build_libraries_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_libraries_static.string, &data->path_build_libraries_static.used, &data->path_build_libraries_static.size);
+ f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects.string, &data->path_build_objects.used, &data->path_build_objects.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects_script.string, &data->path_build_objects_script.used, &data->path_build_objects_script.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects_shared.string, &data->path_build_objects_shared.used, &data->path_build_objects_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &data->path_build_objects_static.string, &data->path_build_objects_static.used, &data->path_build_objects_static.size);
fake_build_setting_delete(&data_make->setting_build);
fake_make_setting_delete(&data_make->setting_make);
- f_string_maps_resize(0, &data_make->environment);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &data_make->environment.array, &data_make->environment.used, &data_make->environment.size, &f_string_maps_delete_callback);
f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.build.array, &data_make->parameter.build.used, &data_make->parameter.build.size, &f_string_dynamics_delete_callback);
f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &data_make->parameter.color.array, &data_make->parameter.color.used, &data_make->parameter.color.size, &f_string_dynamics_delete_callback);
#ifndef _di_fake_make_setting_delete_
void fake_make_setting_delete(fake_make_setting_t * const setting_make) {
- f_string_map_multis_resize(0, &setting_make->parameter);
+ f_memory_arrays_resize(0, sizeof(f_string_map_multi_t), (void **) &setting_make->parameter.array, &setting_make->parameter.used, &setting_make->parameter.size, &f_string_map_multis_delete_callback);
}
#endif // _di_fake_make_setting_delete_
delimits.used = 0;
}
- f_string_ranges_resize(0, &comments);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &comments.array, &comments.used, &comments.size);
if (F_status_is_error(data_make->main->setting.state.status)) {
- f_string_ranges_resize(0, &list_objects);
- f_string_rangess_resize(0, &list_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &list_objects.array, &list_objects.used, &list_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &list_contents.array, &list_contents.used, &list_contents.size, &f_string_rangess_delete_callback);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &delimits.array, &delimits.used, &delimits.size);
return;
fake_print_error(&data_make->main->program.error, macro_fake_f(f_memory_array_resize));
f_fss_set_delete(&settings);
- f_string_ranges_resize(0, &list_objects);
- f_string_rangess_resize(0, &list_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &list_objects.array, &list_objects.used, &list_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &list_contents.array, &list_contents.used, &list_contents.size, &f_string_rangess_delete_callback);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &delimits.array, &delimits.used, &delimits.size);
return;
} // for
}
- f_string_ranges_resize(0, &list_objects);
- f_string_rangess_resize(0, &list_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &list_objects.array, &list_objects.used, &list_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &list_contents.array, &list_contents.used, &list_contents.size, &f_string_rangess_delete_callback);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &delimits.array, &delimits.used, &delimits.size);
if (F_status_is_error(data_make->main->setting.state.status)) {
{
f_string_t function_name = macro_fake_f(macro_f_string_map_multis_t_resize);
- data_make->main->setting.state.status = f_string_map_multis_resize(data_make->main->setting.state.step_small, &data_make->setting_make.parameter);
+ data_make->main->setting.state.status = f_memory_arrays_resize(data_make->main->setting.state.step_small, sizeof(f_string_map_multi_t), (void **) &data_make->setting_make.parameter.array, &data_make->setting_make.parameter.used, &data_make->setting_make.parameter.size, &f_string_map_multis_delete_callback);
if (F_status_is_error_not(data_make->main->setting.state.status)) {
data_make->setting_make.parameter.used = 1;
if (F_status_is_error(data_make->main->setting.state.status)) {
fake_print_error(&data_make->main->program.error, macro_fake_f(fll_fss_snatch_map_apart));
- f_string_map_multis_resize(0, &define);
+ f_memory_arrays_resize(0, sizeof(f_string_map_multi_t), (void **) &define.array, &define.used, &define.size, &f_string_map_multis_delete_callback);
return;
}
f_memory_array_resize(0, sizeof(f_char_t), (void **) &combined.string, &combined.used, &combined.size);
}
- f_string_map_multis_resize(0, &define);
+ f_memory_arrays_resize(0, sizeof(f_string_map_multi_t), (void **) &define.array, &define.used, &define.size, &f_string_map_multis_delete_callback);
if (F_status_is_error(data_make->main->setting.state.status)) return;
* F_interrupt (with error bit) on interrupt signal received.
*
* Errors (with error bit) from: f_fss_apply_delimit().
+ * Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_string_dynamic_append().
* Errors (with error bit) from: f_string_dynamic_partial_append().
- * Errors (with error bit) from: f_string_map_multis_resize().
* Errors (with error bit) from: fll_fss_basic_list_read().
* Errors (with error bit) from: fll_fss_extended_read().
* Errors (with error bit) from: fll_program_standard_signal_received().
* If FALSE, then ignore the program input pipe.
*
* @see f_fss_apply_delimit()
+ * @see f_memory_array_resize()
* @see f_string_dynamic_append()
* @see f_string_dynamic_partial_append()
- * @see f_string_map_multis_resize()
* @see fll_fss_basic_list_read()
* @see fll_fss_extended_read()
* @see fll_program_standard_signal_received()
}
}
else {
- main->setting.state.status = f_string_map_multis_resize(fake_allocation_small_d, &data_make->setting_make.parameter);
+ main->setting.state.status = f_memory_arrays_resize(fake_allocation_small_d, sizeof(f_string_map_multi_t), (void **) &data_make->setting_make.parameter.array, &data_make->setting_make.parameter.used, &data_make->setting_make.parameter.size, &f_string_map_multis_delete_callback);
if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_string_map_multis_resize));
+ fake_print_error(&main->program.error, macro_fake_f(f_memory_arrays_resize));
main->setting.state.status = F_status_set_error(F_failure);
* F_failure (with error bit) on any error.
*
* Errors (with error bit) from: f_memory_array_resize()
- * Errors (with error bit) from: f_string_map_multis_resize()
*
* @see f_memory_array_resize()
- * @see f_string_map_multis_resize()
*/
#ifndef _di_fake_make_operate_process_type_parameter_
extern void fake_make_operate_process_type_parameter(fake_make_data_t * const data_make);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &local_buffer.string, &local_buffer.used, &local_buffer.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &path_file.string, &path_file.used, &path_file.size);
- f_string_ranges_resize(0, &basic_objects);
- f_string_rangess_resize(0, &basic_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &basic_objects.array, &basic_objects.used, &basic_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &basic_contents.array, &basic_contents.used, &basic_contents.size, &f_string_rangess_delete_callback);
if (F_status_set_fine(status) == F_failure || F_status_set_fine(status) == F_parameter) break;
}
}
}
- f_string_ranges_resize(0, &local->rule_objects);
- f_string_rangess_resize(0, &local->rule_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &local->rule_objects.array, &local->rule_objects.used, &local->rule_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &local->rule_contents.array, &local->rule_contents.used, &local->rule_contents.size, &f_string_rangess_delete_callback);
return status;
}
f_memory_array_resize(0, sizeof(f_char_t), (void **) &local->buffer.string, &local->buffer.used, &local->buffer.size);
f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &local->chain_ids.array, &local->chain_ids.used, &local->chain_ids.size);
- f_string_ranges_resize(0, &local->chain_objects);
- f_string_rangess_resize(0, &local->chain_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &local->chain_objects.array, &local->chain_objects.used, &local->chain_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &local->chain_contents.array, &local->chain_contents.used, &local->chain_contents.size, &f_string_rangess_delete_callback);
- f_string_ranges_resize(0, &local->rule_objects);
- f_string_rangess_resize(0, &local->rule_contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &local->rule_objects.array, &local->rule_objects.used, &local->rule_objects.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &local->rule_contents.array, &local->rule_contents.used, &local->rule_contents.size, &f_string_rangess_delete_callback);
return F_okay;
}
"f_file_stream_read_block",
"f_file_stream_read_until",
"f_fss_is_space",
+ "f_memory_array_increase",
"f_memory_array_increase_by",
"f_rip_dynamic",
"f_string_dynamic_append",
"f_string_dynamic_append_assure",
"f_string_dynamic_append_nulless",
- "f_string_ranges_increase",
- "f_string_ranges_increase_by",
- "f_string_rangess_increase",
- "f_string_rangess_increase_by",
"f_string_read_block_increase",
"f_thread_create",
"fl_conversion_dynamic_partial_to_unsigned_detect",
fss_read_f_f_file_stream_read_block_e,
fss_read_f_f_file_stream_read_until_e,
fss_read_f_f_fss_is_space_e,
+ fss_read_f_f_memory_array_increase_e,
fss_read_f_f_memory_array_increase_by_e,
fss_read_f_f_rip_dynamic_e,
fss_read_f_f_string_dynamic_append_e,
fss_read_f_f_string_dynamic_append_assure_e,
fss_read_f_f_string_dynamic_append_nulless_e,
- fss_read_f_f_string_ranges_increase_e,
- fss_read_f_f_string_ranges_increase_by_e,
- fss_read_f_f_string_rangess_increase_e,
- fss_read_f_f_string_rangess_increase_by_e,
fss_read_f_f_string_read_block_increase_e,
fss_read_f_f_thread_create_e,
fss_read_f_fl_conversion_dynamic_partial_to_unsigned_detect_e,
f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size);
- f_string_ranges_resize(0, &setting->objects);
- f_string_ranges_resize(0, &setting->comments);
- f_string_rangess_resize(0, &setting->contents);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &setting->objects.array, &setting->objects.used, &setting->objects.size);
+ f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &setting->comments.array, &setting->comments.used, &setting->comments.size);
+ f_memory_arrays_resize(0, sizeof(f_string_ranges_t), (void **) &setting->contents.array, &setting->contents.used, &setting->contents.size, &f_string_rangess_delete_callback);
f_fss_nest_delete(&setting->nest);
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
*
* @see f_memory_resize()
- * @see f_string_ranges_resize()
*/
#ifndef _di_fss_read_files_resize_
extern f_status_t fss_read_files_resize(const f_number_unsigned_t length, fss_read_files_t * const files);
main->setting.ignoress.used = 0;
- main->setting.state.status = f_string_rangess_increase_by(values_data->used, &main->setting.ignoress);
+ main->setting.state.status = f_memory_array_increase_by(values_data->used, sizeof(f_string_ranges_t), (void **) &main->setting.ignoress.array, &main->setting.ignoress.used, &main->setting.ignoress.size);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_rangess_increase_by));
+ fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by));
return;
}
break;
}
- main->setting.state.status = f_string_ranges_increase_by(total, &main->setting.ignoress.array[j]);
+ main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_string_range_t), (void **) &main->setting.ignoress.array[j].array, &main->setting.ignoress.array[j].used, &main->setting.ignoress.array[j].size);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_ranges_increase_by));
+ fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase_by));
return;
}
"f_memory_arrays_resize",
"f_string_dynamic_append",
"f_string_dynamic_append_nulless",
- "f_string_ranges_increase",
- "f_string_ranges_increase_by",
- "f_string_rangess_increase",
- "f_string_rangess_increase_by",
"f_string_read_block_increase",
"f_thread_create",
"fl_fss_basic_content_write",
fss_write_f_f_memory_arrays_resize_e,
fss_write_f_f_string_dynamic_append_e,
fss_write_f_f_string_dynamic_append_nulless_e,
- fss_write_f_f_string_ranges_increase_e,
- fss_write_f_f_string_ranges_increase_by_e,
- fss_write_f_f_string_rangess_increase_e,
- fss_write_f_f_string_rangess_increase_by_e,
fss_write_f_f_string_read_block_increase_e,
fss_write_f_f_thread_create_e,
fss_write_f_fl_fss_basic_content_write_e,
}
// This is processed in a single set, so there is only ever one Ignores added.
- main->setting.state.status = f_string_rangess_increase(main->setting.state.step_small, &main->setting.ignoress);
+ main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_ranges_t), (void **) &main->setting.ignoress.array, &main->setting.ignoress.used, &main->setting.ignoress.size);
if (F_status_is_error(main->setting.state.status)) {
- fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_rangess_increase));
+ fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase));
return;
}
// Ignore is enabled.
if (flag & 0x2) {
- main->setting.state.status = f_string_ranges_increase(main->setting.state.step_small, main->setting.ignores);
+ main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_range_t), (void **) &main->setting.ignores->array, &main->setting.ignores->used, &main->setting.ignores->size);
if (F_status_is_error(main->setting.state.status)) {
- fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_ranges_increase));
+ fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase));
break;
}
}
// This is processed in a single set, so there is only ever one Ignores added.
- main->setting.state.status = f_string_rangess_increase(main->setting.state.step_small, &main->setting.ignoress);
+ main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_ranges_t), (void **) &main->setting.ignoress.array, &main->setting.ignoress.used, &main->setting.ignoress.size);
if (F_status_is_error(main->setting.state.status)) {
- fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_rangess_increase));
+ fss_write_print_error(&main->program.error, macro_fss_write_f(f_memory_array_increase));
return;
}
main->setting.replace.used = 0;
- main->setting.state.status = f_string_maps_increase_by(main->program.parameters.array[iki_read_parameter_replace_e].values.used / 2, &main->setting.replace);
+ main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[iki_read_parameter_replace_e].values.used / 2, sizeof(f_string_map_t), (void **) &main->setting.replace.array, &main->setting.replace.used, &main->setting.replace.size);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_maps_increase_by));
+ iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_increase_by));
return;
}
main->setting.wrap.used = 0;
- main->setting.state.status = f_string_triples_increase_by(main->program.parameters.array[iki_read_parameter_wrap_e].values.used / 3, &main->setting.wrap);
+ main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[iki_read_parameter_wrap_e].values.used / 3, sizeof(f_string_triple_t), (void **) &main->setting.wrap.array, &main->setting.wrap.used, &main->setting.wrap.size);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_triples_increase_by));
+ iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_increase_by));
return;
}
triple->used = 0;
- main->setting.state.status = f_string_triples_increase_by(parameter.values.used / 3, triple);
+ main->setting.state.status = f_memory_array_increase_by(parameter.values.used / 3, sizeof(f_string_triple_t), (void **) &triple->array, &triple->used, &triple->size);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- iki_read_print_error(&main->program.error, macro_iki_read_f(f_string_triples_increase_by));
+ iki_read_print_error(&main->program.error, macro_iki_read_f(f_memory_array_increase_by));
return F_false;
}
* Errors (with error bit) from: f_file_exists().
* Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_maps_resize().
- * Errors (with error bit) from: f_string_triples_resize().
* Errors (with error bit) from: fll_program_parameter_process_context().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
*
* @see f_file_exists()
* @see f_memory_array_resize()
* @see f_string_dynamic_append()
- * @see f_string_maps_resize()
- * @see f_string_triples_resize()
* @see fll_program_parameter_process_context()
* @see fll_program_parameter_process_verbosity_standard()
*/
* F_okay on success.
*
* Errors (with error bit) from: f_memory_array_resize().
- * Errors (with error bit) from: f_string_triples_resize().
* @param name
* The name of the parameter.
* This is used for printing error messages.
* F_false if not found or not processed.
*
* @see f_memory_array_resize()
- * @see f_string_triples_resize()
*/
#ifndef _di_iki_read_setting_load_parameter_substitution_
extern f_status_t iki_read_setting_load_parameter_substitution(iki_read_main_t * const main, const f_console_parameter_t parameter, const f_string_static_t name, f_string_triples_t *triple);
"f_memory_arrays_resize",
"f_string_dynamic_append_nulless",
"f_string_dynamics_append",
- "f_string_maps_increase_by",
- "f_string_triples_increase_by",
"f_thread_create",
"fl_iki_read",
"fll_program_parameter_process_context_standard",
iki_read_f_f_string_dynamics_append_e,
iki_read_f_f_string_dynamics_increase_by_e,
iki_read_f_f_string_dynamics_resize_e,
- iki_read_f_f_string_maps_increase_by_e,
- iki_read_f_f_string_triples_increase_by_e,
iki_read_f_f_thread_create_e,
iki_read_f_fl_iki_read_e,
iki_read_f_fll_program_parameter_process_context_standard_e,
f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->names.array, &setting->names.used, &setting->names.size, &f_string_dynamics_delete_callback);
f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &setting->files.array, &setting->files.used, &setting->files.size, &f_string_dynamics_delete_callback);
- f_string_maps_resize(0, &setting->replace);
- f_string_triples_resize(0, &setting->reassign);
- f_string_triples_resize(0, &setting->substitute);
- f_string_triples_resize(0, &setting->wrap);
+ f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &setting->replace.array, &setting->replace.used, &setting->replace.size, &f_string_maps_delete_callback);
+
+ f_memory_arrays_resize(0, sizeof(f_string_triple_t), (void **) &setting->reassign.array, &setting->reassign.used, &setting->reassign.size, &f_string_triples_delete_callback);
+ f_memory_arrays_resize(0, sizeof(f_string_triple_t), (void **) &setting->substitute.array, &setting->substitute.used, &setting->substitute.size, &f_string_triples_delete_callback);
+ f_memory_arrays_resize(0, sizeof(f_string_triple_t), (void **) &setting->wrap.array, &setting->wrap.used, &setting->wrap.size, &f_string_triples_delete_callback);
f_iki_data_delete(&setting->data);