From: Kevin Day Date: Sat, 3 Feb 2024 23:45:31 +0000 (-0600) Subject: Refactor: The f_string_quantity_t into f_quantity_t. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=54b8515c34d89410bd33c88885825ca056ecbfec;p=fll Refactor: The f_string_quantity_t into f_quantity_t. This makes the f_string_quantity_t consistent similar to how f_string_range_t was refactored into f_range_t. This is done because there is no actual string value in f_string_quantity_t. There are only numeric values. --- diff --git a/build/disable/level_0/f_console.h b/build/disable/level_0/f_console.h index 3ec25cc..ba0df85 100644 --- a/build/disable/level_0/f_console.h +++ b/build/disable/level_0/f_console.h @@ -7,6 +7,7 @@ #define _di_f_console_parameter_prioritize_left_ #define _di_f_console_parameter_prioritize_right_ #define _di_f_console_parameter_process_ +#define _di_f_console_parameter_reset_ #define _di_f_console_parameters_delete_ #define _di_f_console_parameters_destroy_ #define _di_f_console_parameters_t_ diff --git a/build/disable/level_0/f_fss.h b/build/disable/level_0/f_fss.h index 41ed539..9974283 100644 --- a/build/disable/level_0/f_fss.h +++ b/build/disable/level_0/f_fss.h @@ -42,7 +42,7 @@ #define _di_f_fss_payload_comment_header_begin_s_ #define _di_f_fss_payload_comment_header_end_s_ #define _di_f_fss_payload_comment_header_s_ -#define _di_f_fss_payload_header_map_e_ +#define _di_f_fss_payload_header_map_flag_e_ #define _di_f_fss_payload_object_end_s_ #define _di_f_fss_payload_object_header_s_ #define _di_f_fss_payload_object_id_s_ @@ -57,6 +57,9 @@ #define _di_f_fss_payload_object_type_s_ #define _di_f_fss_payload_s_ #define _di_f_fss_placeholder_s_ +#define _di_f_fss_quote_double_null_s_ +#define _di_f_fss_quote_grave_null_s_ +#define _di_f_fss_quote_single_null_s_ #define _di_f_fss_quote_type_e_ #define _di_f_fss_s_ #define _di_f_fss_seek_to_eol_ diff --git a/build/disable/level_0/f_iki.h b/build/disable/level_0/f_iki.h index 3c85962..09a174c 100644 --- a/build/disable/level_0/f_iki.h +++ b/build/disable/level_0/f_iki.h @@ -19,8 +19,8 @@ #define _di_f_iki_read_ #define _di_f_iki_state_flag_e_ #define _di_f_iki_syntax_placeholder_s_ -#define _di_f_iki_syntax_quote_backtick_s_ #define _di_f_iki_syntax_quote_double_s_ +#define _di_f_iki_syntax_quote_grave_s_ #define _di_f_iki_syntax_quote_single_s_ #define _di_f_iki_syntax_s_ #define _di_f_iki_syntax_separator_s_ diff --git a/build/disable/level_0/f_random.h b/build/disable/level_0/f_random.h new file mode 100644 index 0000000..522c18f --- /dev/null +++ b/build/disable/level_0/f_random.h @@ -0,0 +1,5 @@ +#define _di_f_random_get_ +#define _di_f_random_read_ +#define _di_f_random_seed_ +#define _di_f_random_seed_flag_d_ +#define _di_f_random_seed_set_ diff --git a/build/disable/level_0/f_socket.h b/build/disable/level_0/f_socket.h index f38edcb..cf40546 100644 --- a/build/disable/level_0/f_socket.h +++ b/build/disable/level_0/f_socket.h @@ -1,14 +1,12 @@ #define _di_f_socket_accept_ #define _di_f_socket_address_family_e_ +#define _di_f_socket_address_form_e_ #define _di_f_socket_addressss_delete_callback_ #define _di_f_socket_addressss_destroy_callback_ #define _di_f_socket_addressss_t_ #define _di_f_socket_addresss_t_ #define _di_f_socket_address_t_ #define _di_f_socket_bind_ -#define _di_f_socket_bind_inet4_ -#define _di_f_socket_bind_inet6_ -#define _di_f_socket_bind_local_ #define _di_f_socket_close_e_ #define _di_f_socket_connect_ #define _di_f_socket_create_ diff --git a/build/disable/level_0/f_string.h b/build/disable/level_0/f_string.h index 8cf0ea5..273b91b 100644 --- a/build/disable/level_0/f_string.h +++ b/build/disable/level_0/f_string.h @@ -42,6 +42,8 @@ #define _di_f_string_dynamicss_destroy_callback_ #define _di_f_string_dynamicss_t_ #define _di_f_string_dynamics_t_ +#define _di_f_string_dynamic_strip_null_ +#define _di_f_string_dynamic_strip_null_range_ #define _di_f_string_dynamic_t_ #define _di_f_string_dynamic_terminate_ #define _di_f_string_dynamic_terminate_after_ @@ -80,35 +82,6 @@ #define _di_f_string_prepend_assure_ #define _di_f_string_prepend_assure_nulless_ #define _di_f_string_prepend_nulless_ -#define _di_f_string_quantitys_append_ -#define _di_f_string_quantitys_append_all_ -#define _di_f_string_quantityss_append_ -#define _di_f_string_quantityss_append_all_ -#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_double_empty_c_ -#define _di_f_string_range_doubles_append_ -#define _di_f_string_range_doubles_append_all_ -#define _di_f_string_range_doubless_append_ -#define _di_f_string_range_doubless_append_all_ -#define _di_f_string_range_doubless_delete_callback_ -#define _di_f_string_range_doubless_destroy_callback_ -#define _di_f_string_range_doubless_t_ -#define _di_f_string_range_doubles_t_ -#define _di_f_string_range_double_t_ -#define _di_f_string_range_empty_c_ -#define _di_f_string_ranges_append_ -#define _di_f_string_ranges_append_all_ -#define _di_f_string_rangess_append_ -#define _di_f_string_rangess_append_all_ -#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_seek_line_ #define _di_f_string_seek_line_to_ #define _di_f_string_seek_to_ diff --git a/build/disable/level_0/f_type.h b/build/disable/level_0/f_type.h index 8ca5223..a555044 100644 --- a/build/disable/level_0/f_type.h +++ b/build/disable/level_0/f_type.h @@ -30,6 +30,15 @@ #define _di_f_pollss_t_ #define _di_f_polls_t_ #define _di_f_poll_t_ +#define _di_f_quantityss_t_ +#define _di_f_quantitys_t_ +#define _di_f_quantity_t_ +#define _di_f_range_doubless_t_ +#define _di_f_range_doubles_t_ +#define _di_f_range_double_t_ +#define _di_f_rangess_t_ +#define _di_f_ranges_t_ +#define _di_f_range_t_ #define _di_f_statess_t_ #define _di_f_states_t_ #define _di_f_state_t_ diff --git a/build/disable/level_0/f_type_array.h b/build/disable/level_0/f_type_array.h index a626817..9dca16d 100644 --- a/build/disable/level_0/f_type_array.h +++ b/build/disable/level_0/f_type_array.h @@ -22,6 +22,27 @@ #define _di_f_number_unsignedss_destroy_callback_ #define _di_f_pollss_delete_callback_ #define _di_f_pollss_destroy_callback_ +#define _di_f_quantity_empty_c_ +#define _di_f_quantitys_append_ +#define _di_f_quantitys_append_all_ +#define _di_f_quantityss_append_ +#define _di_f_quantityss_append_all_ +#define _di_f_quantityss_delete_callback_ +#define _di_f_quantityss_destroy_callback_ +#define _di_f_range_double_empty_c_ +#define _di_f_range_doubles_append_ +#define _di_f_range_doubles_append_all_ +#define _di_f_range_doubless_append_ +#define _di_f_range_doubless_append_all_ +#define _di_f_range_doubless_delete_callback_ +#define _di_f_range_doubless_destroy_callback_ +#define _di_f_range_empty_c_ +#define _di_f_ranges_append_ +#define _di_f_ranges_append_all_ +#define _di_f_rangess_append_ +#define _di_f_rangess_append_all_ +#define _di_f_rangess_delete_callback_ +#define _di_f_rangess_destroy_callback_ #define _di_f_statess_delete_callback_ #define _di_f_statess_destroy_callback_ #define _di_f_statusss_delete_callback_ diff --git a/build/disable/level_1/fl_fss.h b/build/disable/level_1/fl_fss.h index b64a80b..3193b3e 100644 --- a/build/disable/level_1/fl_fss.h +++ b/build/disable/level_1/fl_fss.h @@ -1,6 +1,6 @@ +#define _di_f_fss_payload_header_internal_t_ +#define _di_f_fss_payload_header_state_t_ #define _di_f_fss_payload_header_write_d_ -#define _di_f_fss_payload_header_write_internal_t_ -#define _di_f_fss_payload_header_write_state_t_ #define _di_fl_fss_basic_content_read_ #define _di_fl_fss_basic_content_write_ #define _di_fl_fss_basic_list_content_read_ @@ -21,5 +21,5 @@ #define _di_fl_fss_extended_list_object_write_ #define _di_fl_fss_extended_object_read_ #define _di_fl_fss_extended_object_write_ +#define _di_fl_fss_payload_d_ #define _di_fl_fss_payload_header_map_ -#define _di_fl_fss_payload_header_write_ diff --git a/build/level_0/settings b/build/level_0/settings index 72a9b31..ba4a0c0 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -68,11 +68,10 @@ 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/static.c string/statics.c string/staticss.c build_sources_library string/triple.c string/triples.c string/tripless.c build_sources_library time.c -build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c +build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c build_sources_library utf.c private-utf.c private-utf_alphabetic.c private-utf_combining.c private-utf_control.c private-utf_digit.c private-utf_emoji.c private-utf_numeric.c private-utf_phonetic.c private-utf_private.c private-utf_punctuation.c private-utf_subscript.c private-utf_superscript.c private-utf_symbol.c private-utf_unassigned.c private-utf_valid.c private-utf_whitespace.c private-utf_wide.c private-utf_word.c private-utf_zero_width.c build_sources_library utf/common.c utf/convert.c build_sources_library utf/dynamic.c utf/dynamics.c utf/dynamicss.c @@ -117,12 +116,11 @@ 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/static.h string/statics.h string/staticss.h build_sources_headers string/triple.h string/triples.h string/tripless.h build_sources_headers time.h -build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/range.h type/range_double.h type/state.h type/status.h type/time.h -build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h +build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/quantity.h type/range.h type/range_double.h type/state.h type/status.h type/time.h +build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/dynamics.h utf/dynamicss.h utf/is.h utf/is_character.h utf/map.h utf/maps.h utf/mapss.h utf/map_multi.h utf/map_multis.h utf/map_multiss.h utf/static.h utf/statics.h utf/staticss.h utf/string.h utf/triple.h utf/triples.h utf/tripless.h build_sources_headers-thread thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h diff --git a/build/monolithic/settings b/build/monolithic/settings index b4c2c43..17f0d05 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -68,11 +68,10 @@ build_sources_library level_0/private-string.c level_0/string/common.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_library level_0/string/quantity.c level_0/string/quantitys.c level_0/string/quantityss.c build_sources_library level_0/string/static.c level_0/string/statics.c level_0/string/staticss.c build_sources_library level_0/string/triple.c level_0/string/triples.c level_0/string/tripless.c build_sources_library level_0/time.c -build_sources_library level_0/type_array/cell.c level_0/type_array/file.c level_0/type_array/fll_id.c level_0/type_array/int8.c level_0/type_array/int16.c level_0/type_array/int32.c level_0/type_array/int64.c level_0/type_array/int128.c level_0/type_array/number_signed.c level_0/type_array/number_unsigned.c level_0/type_array/poll.c level_0/type_array/range.c level_0/type_array/ranges.c level_0/type_array/rangess.c level_0/type_array/range_double.c level_0/type_array/range_doubles.c level_0/type_array/range_doubless.c level_0/type_array/state.c level_0/type_array/status.c level_0/type_array/uint8.c level_0/type_array/uint16.c level_0/type_array/uint32.c level_0/type_array/uint64.c level_0/type_array/uint128.c +build_sources_library level_0/type_array/cell.c level_0/type_array/file.c level_0/type_array/fll_id.c level_0/type_array/int8.c level_0/type_array/int16.c level_0/type_array/int32.c level_0/type_array/int64.c level_0/type_array/int128.c level_0/type_array/number_signed.c level_0/type_array/number_unsigned.c level_0/type_array/poll.c level_0/type_array/quantity.c level_0/type_array/quantitys.c level_0/type_array/quantityss.c level_0/type_array/range.c level_0/type_array/ranges.c level_0/type_array/rangess.c level_0/type_array/range_double.c level_0/type_array/range_doubles.c level_0/type_array/range_doubless.c level_0/type_array/state.c level_0/type_array/status.c level_0/type_array/uint8.c level_0/type_array/uint16.c level_0/type_array/uint32.c level_0/type_array/uint64.c level_0/type_array/uint128.c build_sources_library level_0/utf.c level_0/private-utf.c level_0/private-utf_alphabetic.c level_0/private-utf_combining.c level_0/private-utf_control.c level_0/private-utf_digit.c level_0/private-utf_emoji.c level_0/private-utf_numeric.c level_0/private-utf_phonetic.c level_0/private-utf_private.c level_0/private-utf_punctuation.c level_0/private-utf_subscript.c level_0/private-utf_superscript.c level_0/private-utf_symbol.c level_0/private-utf_unassigned.c level_0/private-utf_valid.c level_0/private-utf_whitespace.c level_0/private-utf_wide.c level_0/private-utf_word.c level_0/private-utf_zero_width.c build_sources_library level_0/utf/common.c level_0/utf/convert.c build_sources_library level_0/utf/dynamic.c level_0/utf/dynamics.c level_0/utf/dynamicss.c @@ -138,12 +137,11 @@ build_sources_headers level_0/string.h level_0/string/common.h build_sources_headers level_0/string/dynamic.h level_0/string/dynamics.h level_0/string/dynamicss.h build_sources_headers level_0/string/map.h level_0/string/maps.h level_0/string/mapss.h build_sources_headers level_0/string/map_multi.h level_0/string/map_multis.h level_0/string/map_multiss.h -build_sources_headers level_0/string/quantity.h level_0/string/quantitys.h level_0/string/quantityss.h build_sources_headers level_0/string/static.h level_0/string/statics.h level_0/string/staticss.h build_sources_headers level_0/string/triple.h level_0/string/triples.h level_0/string/tripless.h build_sources_headers level_0/time.h -build_sources_headers level_0/type.h level_0/type/cell.h level_0/type/file.h level_0/type/fll.h level_0/type/mode.h level_0/type/number.h level_0/type/range.h level_0/type/range_double.h level_0/type/state.h level_0/type/status.h level_0/type/time.h -build_sources_headers level_0/type_array.h level_0/type_array_file.h level_0/type_array/common.h level_0/type_array/cell.h level_0/type_array/file.h level_0/type_array/fll_id.h level_0/type_array/int8.h level_0/type_array/int16.h level_0/type_array/int32.h level_0/type_array/int64.h level_0/type_array/int128.h level_0/type_array/number_signed.h level_0/type_array/number_unsigned.h level_0/type_array/poll.h level_0/type_array/range.h level_0/type_array/ranges.h level_0/type_array/rangess.h level_0/type_array/range_double.h level_0/type_array/range_doubles.h level_0/type_array/range_doubless.h level_0/type_array/state.h level_0/type_array/status.h level_0/type_array/uint8.h level_0/type_array/uint16.h level_0/type_array/uint32.h level_0/type_array/uint64.h level_0/type_array/uint128.h +build_sources_headers level_0/type.h level_0/type/cell.h level_0/type/file.h level_0/type/fll.h level_0/type/mode.h level_0/type/number.h level_0/type/quantity.h level_0/type/range.h level_0/type/range_double.h level_0/type/state.h level_0/type/status.h level_0/type/time.h +build_sources_headers level_0/type_array.h level_0/type_array_file.h level_0/type_array/common.h level_0/type_array/cell.h level_0/type_array/file.h level_0/type_array/fll_id.h level_0/type_array/int8.h level_0/type_array/int16.h level_0/type_array/int32.h level_0/type_array/int64.h level_0/type_array/int128.h level_0/type_array/number_signed.h level_0/type_array/number_unsigned.h level_0/type_array/poll.h level_0/type_array/quantity.h level_0/type_array/quantitys.h level_0/type_array/quantityss.h level_0/type_array/range.h level_0/type_array/ranges.h level_0/type_array/rangess.h level_0/type_array/range_double.h level_0/type_array/range_doubles.h level_0/type_array/range_doubless.h level_0/type_array/state.h level_0/type_array/status.h level_0/type_array/uint8.h level_0/type_array/uint16.h level_0/type_array/uint32.h level_0/type_array/uint64.h level_0/type_array/uint128.h build_sources_headers level_0/utf.h level_0/utf/common.h level_0/utf/convert.h level_0/utf/dynamic.h level_0/utf/dynamics.h level_0/utf/dynamicss.h level_0/utf/is.h level_0/utf/is_character.h level_0/utf/map.h level_0/utf/maps.h level_0/utf/mapss.h level_0/utf/map_multi.h level_0/utf/map_multis.h level_0/utf/map_multiss.h level_0/utf/static.h level_0/utf/statics.h level_0/utf/staticss.h level_0/utf/string.h level_0/utf/triple.h level_0/utf/triples.h level_0/utf/tripless.h build_sources_headers level_1/control_group.h diff --git a/build/stand_alone/byte_dump.settings b/build/stand_alone/byte_dump.settings index 02f7a64..5452f5b 100644 --- a/build/stand_alone/byte_dump.settings +++ b/build/stand_alone/byte_dump.settings @@ -31,7 +31,7 @@ build_sources_program fll/level_0/memory.c fll/level_0/private-memory.c fll/leve 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.cfll/level_0/string/quantity.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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/range.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 diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index 65386e1..8539e74 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -219,6 +219,7 @@ //#define _di_f_console_parameter_prioritize_left_ //#define _di_f_console_parameter_prioritize_right_ //#define _di_f_console_parameter_process_ +#define _di_f_console_parameter_reset_ //#define _di_f_console_parameters_delete_ #define _di_f_console_parameters_destroy_ //#define _di_f_console_parameters_t_ @@ -571,7 +572,10 @@ #define _di_f_fss_payload_comment_header_begin_s_ #define _di_f_fss_payload_comment_header_end_s_ #define _di_f_fss_payload_comment_header_s_ +#define _di_f_fss_payload_header_internal_t_ #define _di_f_fss_payload_header_map_flag_e_ +#define _di_f_fss_payload_header_state_t_ +#define _di_f_fss_payload_header_write_d_ #define _di_f_fss_payload_object_end_s_ #define _di_f_fss_payload_object_header_s_ #define _di_f_fss_payload_object_id_s_ @@ -784,6 +788,7 @@ #define _di_fl_fss_extended_list_object_write_ //#define _di_fl_fss_extended_object_read_ #define _di_fl_fss_extended_object_write_ +#define _di_fl_fss_payload_d_ #define _di_fl_fss_payload_header_map_ #define _di_fl_fss_payload_header_maps_ //#define _di_fl_iki_read_ @@ -1312,9 +1317,20 @@ #define _di_f_print_to_safely_terminated_ #define _di_f_print_to_terminated_ //#define _di_f_print_write_max_d_ +#define _di_f_quantity_empty_c_ +#define _di_f_quantitys_append_ +#define _di_f_quantitys_append_all_ +#define _di_f_quantityss_append_ +#define _di_f_quantityss_append_all_ +#define _di_f_quantityss_delete_callback_ +#define _di_f_quantityss_destroy_callback_ +#define _di_f_quantityss_t_ +#define _di_f_quantitys_t_ +#define _di_f_quantity_t_ #define _di_f_random_get_ #define _di_f_random_read_ #define _di_f_random_seed_ +#define _di_f_random_seed_flag_d_ #define _di_f_random_seed_set_ #define _di_f_range_double_empty_c_ #define _di_f_range_doubles_append_ @@ -1512,15 +1528,6 @@ #define _di_f_string_prepend_assure_ #define _di_f_string_prepend_assure_nulless_ #define _di_f_string_prepend_nulless_ -#define _di_f_string_quantitys_append_ -#define _di_f_string_quantitys_append_all_ -#define _di_f_string_quantityss_append_ -#define _di_f_string_quantityss_append_all_ -#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_seek_line_ #define _di_f_string_seek_line_to_ #define _di_f_string_seek_to_ diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index a97b7ea..d59884c 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -56,8 +56,8 @@ build_sources_program fll/level_0/print.c fll/level_0/private-print.c fll/level_ 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 -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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/range.c fll/level_0/type_array/ranges.c fll/level_0/type_array/rangess.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/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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/quantity.c fll/level_0/type_array/quantitys.c fll/level_0/type_array/quantityss.c fll/level_0/type_array/range.c fll/level_0/type_array/ranges.c fll/level_0/type_array/rangess.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/dynamics.c fll/level_0/utf/dynamicss.c fll/level_0/utf/is.c fll/level_0/utf/is_character.c fll/level_0/utf/map.c fll/level_0/utf/maps.c fll/level_0/utf/mapss.c fll/level_0/utf/map_multi.c fll/level_0/utf/map_multis.c fll/level_0/utf/map_multiss.c fll/level_0/utf/static.c fll/level_0/utf/statics.c fll/level_0/utf/staticss.c fll/level_0/utf/string.c fll/level_0/utf/triple.c fll/level_0/utf/triples.c fll/level_0/utf/tripless.c build_sources_program fll/level_0/utf/private-dynamics.c fll/level_0/utf/private-maps.c fll/level_0/utf/private-map_multis.c fll/level_0/utf/private-string.c fll/level_0/utf/private-triples.c diff --git a/build/stand_alone/firewall.settings b/build/stand_alone/firewall.settings index 4354860..1d8cb19 100644 --- a/build/stand_alone/firewall.settings +++ b/build/stand_alone/firewall.settings @@ -40,9 +40,9 @@ build_sources_program fll/level_0/path.c fll/level_0/private-path.c fll/level_0/ 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/quantity.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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/range.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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/quantity.c fll/level_0/type_array/range.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 diff --git a/build/stand_alone/utf8.settings b/build/stand_alone/utf8.settings index 60e92cf..ed4d515 100644 --- a/build/stand_alone/utf8.settings +++ b/build/stand_alone/utf8.settings @@ -32,8 +32,8 @@ 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 -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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/range.c fll/level_0/type_array/ranges.c fll/level_0/type_array/rangess.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/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/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_signed.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/quantity.c fll/level_0/type_array/quantitys.c fll/level_0/type_array/quantityss.c fll/level_0/type_array/range.c fll/level_0/type_array/ranges.c fll/level_0/type_array/rangess.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/dynamics.c fll/level_0/utf/dynamicss.c fll/level_0/utf/is.c fll/level_0/utf/is_character.c fll/level_0/utf/map.c fll/level_0/utf/maps.c fll/level_0/utf/mapss.c fll/level_0/utf/map_multi.c fll/level_0/utf/map_multis.c fll/level_0/utf/map_multiss.c fll/level_0/utf/static.c fll/level_0/utf/statics.c fll/level_0/utf/staticss.c fll/level_0/utf/string.c fll/level_0/utf/triple.c fll/level_0/utf/triples.c fll/level_0/utf/tripless.c build_sources_program fll/level_0/utf/private-dynamics.c fll/level_0/utf/private-maps.c fll/level_0/utf/private-map_multis.c fll/level_0/utf/private-string.c fll/level_0/utf/private-triples.c diff --git a/level_0/f_abstruse/c/abstruse/enum.h b/level_0/f_abstruse/c/abstruse/enum.h index 35260bb..fac37bb 100644 --- a/level_0/f_abstruse/c/abstruse/enum.h +++ b/level_0/f_abstruse/c/abstruse/enum.h @@ -43,8 +43,8 @@ extern "C" { * - maps: Maps to f_string_maps_t. * - map_multi: Maps to f_string_map_multi_t. * - map_multis: Maps to f_string_map_multis_t. - * - quantity: Maps to f_string_quantity_t. - * - quantitys: Maps to f_string_quantitys_t. + * - quantity: Maps to f_quantity_t. + * - quantitys: Maps to f_quantitys_t. * - range: Maps to f_range_t. * - ranges: Maps to f_ranges_t. * - triple: Maps to f_string_triple_t. diff --git a/level_0/f_abstruse/c/abstruse/private-abstruse.c b/level_0/f_abstruse/c/abstruse/private-abstruse.c index c94594c..893792a 100644 --- a/level_0/f_abstruse/c/abstruse/private-abstruse.c +++ b/level_0/f_abstruse/c/abstruse/private-abstruse.c @@ -131,7 +131,7 @@ extern "C" { case f_abstruse_quantitys_e: if (abstruse->is.a_quantitys.size) { - return f_memory_array_resize(0, sizeof(f_string_quantity_t), (void **) &abstruse->is.a_quantitys.array, &abstruse->is.a_quantitys.used, &abstruse->is.a_quantitys.size); + return f_memory_array_resize(0, sizeof(f_quantity_t), (void **) &abstruse->is.a_quantitys.array, &abstruse->is.a_quantitys.used, &abstruse->is.a_quantitys.size); } break; @@ -299,7 +299,7 @@ extern "C" { case f_abstruse_quantitys_e: if (abstruse->is.a_quantitys.size) { - return f_memory_array_adjust(0, sizeof(f_string_quantity_t), (void **) &abstruse->is.a_quantitys.array, &abstruse->is.a_quantitys.used, &abstruse->is.a_quantitys.size); + return f_memory_array_adjust(0, sizeof(f_quantity_t), (void **) &abstruse->is.a_quantitys.array, &abstruse->is.a_quantitys.used, &abstruse->is.a_quantitys.size); } break; diff --git a/level_0/f_abstruse/c/abstruse/type.h b/level_0/f_abstruse/c/abstruse/type.h index f5c2e9c..b58a793 100644 --- a/level_0/f_abstruse/c/abstruse/type.h +++ b/level_0/f_abstruse/c/abstruse/type.h @@ -48,8 +48,8 @@ extern "C" { f_string_maps_t a_maps; f_string_map_multi_t a_map_multi; f_string_map_multis_t a_map_multis; - f_string_quantity_t a_quantity; - f_string_quantitys_t a_quantitys; + f_quantity_t a_quantity; + f_quantitys_t a_quantitys; f_string_triple_t a_triple; f_string_triples_t a_triples; void * a_void; diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index e1092c2..656f25d 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -35,9 +35,6 @@ #include #include #include -#include -#include -#include #include #include #include diff --git a/level_0/f_string/c/string/quantity.c b/level_0/f_string/c/string/quantity.c deleted file mode 100644 index 19bfbd9..0000000 --- a/level_0/f_string/c/string/quantity.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "../string.h" -#include "../private-string.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_string/c/string/quantity.h b/level_0/f_string/c/string/quantity.h deleted file mode 100644 index 8dee426..0000000 --- a/level_0/f_string/c/string/quantity.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: String - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Defines quantity string data. - * - * This is auto-included by string.h and should not need to be explicitly included. - */ -#ifndef _F_string_quantity_h -#define _F_string_quantity_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Store string quantity. - * - * Similar to f_range_t, except total is relative to start and is not an absolute stop position. - * - * Two common uses for when total is 0 is: - * 1) Exactly that, process a total of 0 strings bytes. - * 2) Process with no limit, aka infinite. - * - * Properties: - * - start: The position where the string starts (based on some string/buffer). - * - total: The total number of elements within that string/buffer the quantity represents. - */ -#ifndef _di_f_string_quantity_t_ - typedef struct { - f_number_unsigned_t start; - f_number_unsigned_t total; - } f_string_quantity_t; - - #define f_string_quantity_t_initialize { 0, 0 } - - #define macro_f_string_quantity_t_initialize_1(start, total) { start, total } - - #define macro_f_string_quantity_t_clear(quantity) \ - quantity.start = 0; \ - quantity.total = 0; -#endif // _di_f_string_quantity_t_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _F_string_quantity_h diff --git a/level_0/f_string/c/string/quantitys.h b/level_0/f_string/c/string/quantitys.h deleted file mode 100644 index 74ed1f6..0000000 --- a/level_0/f_string/c/string/quantitys.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: String - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Defines quantity string data. - * - * This is auto-included by string.h and should not need to be explicitly included. - */ -#ifndef _F_string_quantitys_h -#define _F_string_quantitys_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * An array of string quantitys. - * - * Properties: - * - array: The array of string quantitys. - * - size: Total amount of allocated space. - * - used: Total number of allocated spaces used. - */ -#ifndef _di_f_string_quantitys_t_ - typedef struct { - f_string_quantity_t *array; - - f_number_unsigned_t size; - f_number_unsigned_t used; - } f_string_quantitys_t; - - #define f_string_quantitys_t_initialize { 0, 0, 0 } - - #define macro_f_string_quantitys_t_initialize_1(array, size, used) { array, size, used } - #define macro_f_string_quantitys_t_initialize_2(array, length) { array, length, length } - - #define macro_f_string_quantitys_t_clear(quantitys) \ - quantitys.array = 0; \ - quantitys.size = 0; \ - quantitys.used = 0; -#endif // _di_f_string_quantitys_t_ - -/** - * Append the single source quantity onto the destination. - * - * @param source - * The source quantity to append. - * @param destination - * The destination quantitys the source is appended onto. - * - * @return - * F_okay on success. - * F_data_not on success, but there is nothing to append (size == 0). - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_quantitys_append_ - extern f_status_t f_string_quantitys_append(const f_string_quantity_t source, f_string_quantitys_t * const destination); -#endif // _di_f_string_quantitys_append_ - -/** - * Append the source quantitys onto the destination. - * - * @param source - * The source quantitys to append. - * @param destination - * The destination quantitys the source is appended onto. - * - * @return - * F_okay on success. - * F_data_not on success, but there is nothing to append (size == 0). - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_string_quantitys_append_all_ - 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_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _F_string_quantitys_h diff --git a/level_0/f_string/data/build/settings b/level_0/f_string/data/build/settings index c051c73..829f193 100644 --- a/level_0/f_string/data/build/settings +++ b/level_0/f_string/data/build/settings @@ -38,7 +38,6 @@ 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/static.c string/statics.c string/staticss.c build_sources_library string/triple.c string/triples.c string/tripless.c @@ -46,7 +45,6 @@ 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/static.h string/statics.h string/staticss.h build_sources_headers string/triple.h string/triples.h string/tripless.h diff --git a/level_0/f_string/data/build/settings-mocks b/level_0/f_string/data/build/settings-mocks index 55fb344..43e3b9d 100644 --- a/level_0/f_string/data/build/settings-mocks +++ b/level_0/f_string/data/build/settings-mocks @@ -25,7 +25,6 @@ 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/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 @@ -34,7 +33,6 @@ 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/static.h string/statics.h string/staticss.h build_sources_headers string/triple.h string/triples.h string/tripless.h diff --git a/level_0/f_string/data/build/settings-tests b/level_0/f_string/data/build/settings-tests index 9ff452d..d597463 100644 --- a/level_0/f_string/data/build/settings-tests +++ b/level_0/f_string/data/build/settings-tests @@ -49,8 +49,6 @@ build_sources_program test-string-mapss_delete_callback.c test-string-mapss_dest 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_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-seek_line.c test-string-seek_line_to.c test-string-seek_to.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 diff --git a/level_0/f_string/tests/unit/c/test-string-quantitys_append.c b/level_0/f_string/tests/unit/c/test-string-quantitys_append.c deleted file mode 100644 index 181186d..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantitys_append.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "test-string.h" -#include "test-string-quantitys_append.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_string_quantitys_append__works(void **state) { - - const f_string_quantity_t source = macro_f_string_quantity_t_initialize_1(1, 2); - f_string_quantitys_t destination = f_string_quantitys_t_initialize; - - { - const f_status_t status = f_string_quantitys_append(source, &destination); - - assert_int_equal(status, F_okay); - assert_int_equal(destination.used, 1); - assert_int_equal(destination.array[0].start, source.start); - assert_int_equal(destination.array[0].total, source.total); - } - - free((void *) destination.array); -} - -void test__f_string_quantitys_append__parameter_checking(void **state) { - - const f_string_quantity_t data = f_string_quantity_t_initialize; - - { - const f_status_t status = f_string_quantitys_append(data, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - } -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_string/tests/unit/c/test-string-quantitys_append.h b/level_0/f_string/tests/unit/c/test-string-quantitys_append.h deleted file mode 100644 index 8f023bd..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantitys_append.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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_quantitys_append_h -#define _TEST__F_string_quantitys_append_h - -/** - * Test that the function works. - * - * @see f_string_quantitys_append() - */ -extern void test__f_string_quantitys_append__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_string_quantitys_append() - */ -extern void test__f_string_quantitys_append__parameter_checking(void **state); - -#endif // _TEST__F_string_quantitys_append_h diff --git a/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c b/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c deleted file mode 100644 index e872384..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-string.h" -#include "test-string-quantitys_append_all.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_string_quantitys_append_all__works(void **state) { - - const int length_sources = 2; - - f_string_quantity_t sources_array[] = { - macro_f_string_quantity_t_initialize_1(1, 2), - macro_f_string_quantity_t_initialize_1(3, 4), - }; - - const f_string_quantitys_t source = macro_f_string_quantitys_t_initialize_1(sources_array, 0, length_sources); - f_string_quantitys_t destination = f_string_quantitys_t_initialize; - - { - const f_status_t status = f_string_quantitys_append_all(source, &destination); - - assert_int_equal(status, F_okay); - assert_int_equal(destination.used, source.used); - assert_int_equal(destination.size, source.used); - - for (f_number_unsigned_t i = 0; i < length_sources; ++i) { - - assert_int_equal(destination.array[i].start, source.array[i].start); - assert_int_equal(destination.array[i].total, source.array[i].total); - } // for - } - - free((void *) destination.array); -} - -void test__f_string_quantitys_append_all__returns_data_not(void **state) { - - const int length = 5; - f_string_quantitys_t source = f_string_quantitys_t_initialize; - f_string_quantitys_t destination = f_string_quantitys_t_initialize; - - { - 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); - assert_int_equal(source.size, length); - } - - { - const f_status_t status = f_string_quantitys_append_all(source, &destination); - - assert_int_equal(status, F_data_not); - assert_int_equal(destination.used, 0); - assert_int_equal(destination.size, 0); - assert_null(destination.array); - } - - free((void *) source.array); -} - -void test__f_string_quantitys_append_all__parameter_checking(void **state) { - - const f_string_quantitys_t data = f_string_quantitys_t_initialize; - - { - const f_status_t status = f_string_quantitys_append_all(data, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - } -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.h b/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.h deleted file mode 100644 index 0c22220..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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_quantitys_append_all_h -#define _TEST__F_string_quantitys_append_all_h - -/** - * Test that the function works. - * - * @see f_string_quantitys_append_all() - */ -extern void test__f_string_quantitys_append_all__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_string_quantitys_append_all() - */ -extern void test__f_string_quantitys_append_all__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_string_quantitys_append_all() - */ -extern void test__f_string_quantitys_append_all__parameter_checking(void **state); - -#endif // _TEST__F_string_quantitys_append_all_h diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_append.c b/level_0/f_string/tests/unit/c/test-string-quantityss_append.c deleted file mode 100644 index 801fbf7..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_append.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-string.h" -#include "test-string-quantityss_append.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_string_quantityss_append__works(void **state) { - - const int length_sources = 2; - - f_string_quantity_t sources_array[] = { - macro_f_string_quantity_t_initialize_1(1, 2), - macro_f_string_quantity_t_initialize_1(3, 4), - }; - - const f_string_quantitys_t source = macro_f_string_quantitys_t_initialize_1(sources_array, 0, length_sources); - f_string_quantityss_t destination = f_string_quantityss_t_initialize; - - { - const f_status_t status = f_string_quantityss_append(source, &destination); - - assert_int_equal(status, F_okay); - assert_int_equal(destination.array[0].used, length_sources); - - for (f_number_unsigned_t i = 0; i < length_sources; ++i) { - - assert_int_equal(destination.array[0].array[i].start, sources_array[i].start); - assert_int_equal(destination.array[0].array[i].total, sources_array[i].total); - } // for - } - - free((void *) destination.array[0].array); - free((void *) destination.array); -} - -void test__f_string_quantityss_append__returns_data_not(void **state) { - - const int length = 5; - f_string_quantitys_t source = f_string_quantityss_t_initialize; - f_string_quantityss_t destination = f_string_quantityss_t_initialize; - - { - 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); - assert_int_equal(source.size, length); - } - - { - const f_status_t status = f_string_quantityss_append(source, &destination); - - assert_int_equal(status, F_data_not); - assert_int_equal(destination.used, 0); - assert_int_equal(destination.size, 0); - assert_null(destination.array); - } - - free((void *) source.array); -} - -void test__f_string_quantityss_append__parameter_checking(void **state) { - - f_string_quantitys_t data = f_string_quantitys_t_initialize; - - { - const f_status_t status = f_string_quantityss_append(data, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - } -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_append.h b/level_0/f_string/tests/unit/c/test-string-quantityss_append.h deleted file mode 100644 index 7ef50a9..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_append.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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_append_h -#define _TEST__F_string_quantityss_append_h - -/** - * Test that the function works. - * - * @see f_string_quantityss_append() - */ -extern void test__f_string_quantityss_append__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_string_quantityss_append() - */ -extern void test__f_string_quantityss_append__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_string_quantityss_append() - */ -extern void test__f_string_quantityss_append__parameter_checking(void **state); - -#endif // _TEST__F_string_quantityss_append_h diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_append_all.c b/level_0/f_string/tests/unit/c/test-string-quantityss_append_all.c deleted file mode 100644 index 73a9a7b..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_append_all.c +++ /dev/null @@ -1,93 +0,0 @@ -#include "test-string.h" -#include "test-string-quantityss_append_all.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_string_quantityss_append_all__works(void **state) { - - const int length_sources = 2; - const int length_sources_set = 2; - - f_string_quantity_t sources_array1[] = { - macro_f_string_quantity_t_initialize_1(1, 2), - macro_f_string_quantity_t_initialize_1(3, 4), - }; - - f_string_quantity_t sources_array2[] = { - macro_f_string_quantity_t_initialize_1(5, 6), - macro_f_string_quantity_t_initialize_1(7, 8), - }; - - f_string_quantitys_t sources_set_array[] = { - macro_f_string_quantitys_t_initialize_1(sources_array1, 0, length_sources), - macro_f_string_quantitys_t_initialize_1(sources_array2, 0, length_sources), - }; - - const f_string_quantityss_t source = macro_f_string_quantityss_t_initialize_1(sources_set_array, 0, length_sources_set); - f_string_quantityss_t destination = f_string_quantityss_t_initialize; - - { - const f_status_t status = f_string_quantityss_append_all(source, &destination); - - assert_int_equal(status, F_okay); - assert_int_equal(destination.used, source.used); - - for (f_number_unsigned_t j = 0; j < length_sources_set; ++j) { - - for (f_number_unsigned_t i = 0; i < length_sources; ++i) { - - assert_int_equal(destination.array[j].array[i].start, sources_set_array[j].array[i].start); - assert_int_equal(destination.array[j].array[i].total, sources_set_array[j].array[i].total); - } // for - } // for - } - - for (f_number_unsigned_t i = 0; i < destination.used; ++i) { - free((void *) destination.array[i].array); - } // for - - free((void *) destination.array); -} - -void test__f_string_quantityss_append_all__returns_data_not(void **state) { - - const int length = 5; - f_string_quantityss_t source = f_string_quantityss_t_initialize; - f_string_quantityss_t destination = f_string_quantityss_t_initialize; - - { - 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); - assert_int_equal(source.size, length); - } - - { - const f_status_t status = f_string_quantityss_append_all(source, &destination); - - assert_int_equal(status, F_data_not); - assert_int_equal(destination.used, 0); - assert_int_equal(destination.size, 0); - assert_null(destination.array); - } - - free((void *) source.array); -} - -void test__f_string_quantityss_append_all__parameter_checking(void **state) { - - const f_string_quantityss_t data = f_string_quantityss_t_initialize; - - { - const f_status_t status = f_string_quantityss_append_all(data, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - } -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_append_all.h b/level_0/f_string/tests/unit/c/test-string-quantityss_append_all.h deleted file mode 100644 index 28f45bc..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_append_all.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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_append_all_h -#define _TEST__F_string_quantityss_append_all_h - -/** - * Test that the function works. - * - * @see f_string_quantityss_append_all() - */ -extern void test__f_string_quantityss_append_all__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_string_quantityss_append_all() - */ -extern void test__f_string_quantityss_append_all__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_string_quantityss_append_all() - */ -extern void test__f_string_quantityss_append_all__parameter_checking(void **state); - -#endif // _TEST__F_string_quantityss_append_all_h diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-quantityss_delete_callback.c deleted file mode 100644 index 061a069..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_delete_callback.c +++ /dev/null @@ -1,57 +0,0 @@ -#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 diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_delete_callback.h b/level_0/f_string/tests/unit/c/test-string-quantityss_delete_callback.h deleted file mode 100644 index 4f3ec97..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_delete_callback.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-quantityss_destroy_callback.c deleted file mode 100644 index 35fe553..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_destroy_callback.c +++ /dev/null @@ -1,57 +0,0 @@ -#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 diff --git a/level_0/f_string/tests/unit/c/test-string-quantityss_destroy_callback.h b/level_0/f_string/tests/unit/c/test-string-quantityss_destroy_callback.h deleted file mode 100644 index f88891b..0000000 --- a/level_0/f_string/tests/unit/c/test-string-quantityss_destroy_callback.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 diff --git a/level_0/f_string/tests/unit/c/test-string.c b/level_0/f_string/tests/unit/c/test-string.c index a162a31..7abebf3 100644 --- a/level_0/f_string/tests/unit/c/test-string.c +++ b/level_0/f_string/tests/unit/c/test-string.c @@ -124,15 +124,6 @@ int main(void) { 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_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_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_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), @@ -185,11 +176,6 @@ int main(void) { cmocka_unit_test(test__f_string_mapss_delete_callback__works), cmocka_unit_test(test__f_string_mapss_destroy_callback__works), - 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_quantityss_delete_callback__works), - cmocka_unit_test(test__f_string_quantityss_destroy_callback__works), - 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_triples_delete_callback__works), @@ -274,11 +260,6 @@ int main(void) { 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_append__parameter_checking), - cmocka_unit_test(test__f_string_quantitys_append_all__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_triples_append__parameter_checking), cmocka_unit_test(test__f_string_triples_append_all__parameter_checking), cmocka_unit_test(test__f_string_tripless_append__parameter_checking), @@ -308,9 +289,6 @@ int main(void) { // 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_triples_delete_callback() doesn't use parameter checking. // f_string_triples_destroy_callback() doesn't use parameter checking. diff --git a/level_0/f_string/tests/unit/c/test-string.h b/level_0/f_string/tests/unit/c/test-string.h index 109711d..fbe350c 100644 --- a/level_0/f_string/tests/unit/c/test-string.h +++ b/level_0/f_string/tests/unit/c/test-string.h @@ -93,12 +93,6 @@ #include "test-string-prepend_assure.h" #include "test-string-prepend_assure_nulless.h" #include "test-string-prepend_nulless.h" -#include "test-string-quantitys_append.h" -#include "test-string-quantitys_append_all.h" -#include "test-string-quantityss_append.h" -#include "test-string-quantityss_append_all.h" -#include "test-string-quantityss_delete_callback.h" -#include "test-string-quantityss_destroy_callback.h" #include "test-string-seek_line.h" #include "test-string-seek_line_to.h" #include "test-string-seek_to.h" diff --git a/level_0/f_type/c/type.h b/level_0/f_type/c/type.h index c518a42..bdd7464 100644 --- a/level_0/f_type/c/type.h +++ b/level_0/f_type/c/type.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/level_0/f_type/c/type/quantity.h b/level_0/f_type/c/type/quantity.h new file mode 100644 index 0000000..7ca7613 --- /dev/null +++ b/level_0/f_type/c/type/quantity.h @@ -0,0 +1,105 @@ +/** + * FLL - Level 0 + * + * Project: Type + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Defines quantity type data. + * + * This is auto-included by type.h and should not need to be explicitly included. + */ +#ifndef _F_quantity_h +#define _F_quantity_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Store quantity range based on a start position and a total. + * + * Similar to f_range_t, except total is relative to start and is not an absolute stop position. + * + * Two common uses for when total is 0 is: + * 1) Exactly that, process a total of 0 strings bytes. + * 2) Process with no limit, aka infinite. + * + * Properties: + * - start: The position where the string starts (based on some string/buffer). + * - total: The total number of elements within that string/buffer the quantity represents. + */ +#ifndef _di_f_quantity_t_ + typedef struct { + f_number_unsigned_t start; + f_number_unsigned_t total; + } f_quantity_t; + + #define f_quantity_t_initialize { 0, 0 } + + #define macro_f_quantity_t_initialize_1(start, total) { start, total } + + #define macro_f_quantity_t_clear(quantity) \ + quantity.start = 0; \ + quantity.total = 0; +#endif // _di_f_quantity_t_ + +/** + * An array of quantitys. + * + * Properties: + * - array: The array of quantitys. + * - size: Total amount of allocated space. + * - used: Total number of allocated spaces used. + */ +#ifndef _di_f_quantitys_t_ + typedef struct { + f_quantity_t *array; + + f_number_unsigned_t size; + f_number_unsigned_t used; + } f_quantitys_t; + + #define f_quantitys_t_initialize { 0, 0, 0 } + + #define macro_f_quantitys_t_initialize_1(array, size, used) { array, size, used } + #define macro_f_quantitys_t_initialize_2(array, length) { array, length, length } + + #define macro_f_quantitys_t_clear(quantitys) \ + quantitys.array = 0; \ + quantitys.size = 0; \ + quantitys.used = 0; +#endif // _di_f_quantitys_t_ + +/** + * This holds an array of f_quantitys_t. + * + * Properties: + * - array: The array of quantitys arrays. + * - size: Total amount of allocated space. + * - used: Total number of allocated spaces used. + */ +#ifndef _di_f_quantityss_t_ + typedef struct { + f_quantitys_t *array; + + f_number_unsigned_t size; + f_number_unsigned_t used; + } f_quantityss_t; + + #define f_quantityss_t_initialize { 0, 0, 0 } + + #define macro_f_quantityss_t_initialize_1(array, size, used) { array, size, used } + #define macro_f_quantityss_t_initialize_2(array, length) { array, length, length } + + #define macro_f_quantityss_t_clear(quantityss) \ + quantityss.array = 0; \ + quantityss.size = 0; \ + quantityss.used = 0; +#endif // _di_f_quantityss_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_quantity_h diff --git a/level_0/f_type/data/build/settings b/level_0/f_type/data/build/settings index c033a5b..d769cf1 100644 --- a/level_0/f_type/data/build/settings +++ b/level_0/f_type/data/build/settings @@ -32,7 +32,7 @@ build_language c build_libraries -lc -build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/range.h type/range_double.h type/state.h type/status.h type/time.h +build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/quantity.h type/range.h type/range_double.h type/state.h type/status.h type/time.h build_script yes build_shared yes diff --git a/level_0/f_type_array/c/type_array.h b/level_0/f_type_array/c/type_array.h index b6a03c6..c409392 100644 --- a/level_0/f_type_array/c/type_array.h +++ b/level_0/f_type_array/c/type_array.h @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include #include #include #include diff --git a/level_0/f_type_array/c/type_array/quantity.c b/level_0/f_type_array/c/type_array/quantity.c new file mode 100644 index 0000000..f569d9f --- /dev/null +++ b/level_0/f_type_array/c/type_array/quantity.c @@ -0,0 +1,14 @@ +#include "../type_array.h" +#include "quantity.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_quantity_empty_c_ + const f_quantity_t f_quantity_empty_c = { 0, 0 }; +#endif // _di_f_quantity_empty_c_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/c/type_array/quantity.h b/level_0/f_type_array/c/type_array/quantity.h new file mode 100644 index 0000000..eb0aca6 --- /dev/null +++ b/level_0/f_type_array/c/type_array/quantity.h @@ -0,0 +1,32 @@ +/** + * FLL - Level 0 + * + * Project: Type + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Defines data to be used for/by type (array) related functionality. + * + * This is auto-included by type_array.h and should not need to be explicitly included. + */ +#ifndef _F_type_array_quantity_h +#define _F_type_array_quantity_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Provide a static empty quantity. + * + * This is intended to represent an empty or disabled quantity. + */ +#ifndef _di_f_quantity_empty_c_ + extern const f_quantity_t f_quantity_empty_c; +#endif // _di_f_quantity_empty_c_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_type_array_quantity_h diff --git a/level_0/f_string/c/string/quantitys.c b/level_0/f_type_array/c/type_array/quantitys.c similarity index 52% rename from level_0/f_string/c/string/quantitys.c rename to level_0/f_type_array/c/type_array/quantitys.c index 134e102..28f0a0d 100644 --- a/level_0/f_string/c/string/quantitys.c +++ b/level_0/f_type_array/c/type_array/quantitys.c @@ -1,18 +1,18 @@ -#include "../string.h" -#include "../private-string.h" +#include "../type_array.h" +#include "quantitys.h" #ifdef __cplusplus extern "C" { #endif -#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_f_quantitys_append_ + f_status_t f_quantitys_append(const f_quantity_t source, f_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_ { - 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); + const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_quantity_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } @@ -21,10 +21,10 @@ extern "C" { return F_okay; } -#endif // _di_f_string_quantitys_append_ +#endif // _di_f_quantitys_append_ -#ifndef _di_f_string_quantitys_append_all_ - f_status_t f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination) { +#ifndef _di_f_quantitys_append_all_ + f_status_t f_quantitys_append_all(const f_quantitys_t source, f_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_ @@ -32,19 +32,19 @@ extern "C" { if (!source.used) return F_data_not; { - const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_quantity_t), (void **) &destination->array, &destination->used, &destination->size); + const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_quantity_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->array[destination->used].start = source.array[i].start; - destination->array[destination->used].total = source.array[i].total; + destination->array[destination->used++].total = source.array[i].total; } // for return F_okay; } -#endif // _di_f_string_quantitys_append_all_ +#endif // _di_f_quantitys_append_all_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_type_array/c/type_array/quantitys.h b/level_0/f_type_array/c/type_array/quantitys.h new file mode 100644 index 0000000..38dd611 --- /dev/null +++ b/level_0/f_type_array/c/type_array/quantitys.h @@ -0,0 +1,63 @@ +/** + * FLL - Level 0 + * + * Project: Type + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Defines data to be used for/by type (array) related functionality. + * + * This is auto-included by type_array.h and should not need to be explicitly included. + */ +#ifndef _F_type_array_quantitys_h +#define _F_type_array_quantitys_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Append the single source quantity onto the destination. + * + * @param source + * The source quantity to append. + * @param destination + * The destination quantitys the source is appended onto. + * + * @return + * F_okay on success. + * F_data_not on success, but there is nothing to append (size == 0). + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_memory_resize(). + */ +#ifndef _di_f_quantitys_append_ + extern f_status_t f_quantitys_append(const f_quantity_t source, f_quantitys_t * const destination); +#endif // _di_f_quantitys_append_ + +/** + * Append the source quantitys onto the destination. + * + * @param source + * The source quantitys to append. + * @param destination + * The destination quantitys the source is appended onto. + * + * @return + * F_okay on success. + * F_data_not on success, but there is nothing to append (size == 0). + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_memory_resize(). + */ +#ifndef _di_f_quantitys_append_all_ + extern f_status_t f_quantitys_append_all(const f_quantitys_t source, f_quantitys_t * const destination); +#endif // _di_f_quantitys_append_all_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_type_array_quantitys_h diff --git a/level_0/f_string/c/string/quantityss.c b/level_0/f_type_array/c/type_array/quantityss.c similarity index 55% rename from level_0/f_string/c/string/quantityss.c rename to level_0/f_type_array/c/type_array/quantityss.c index 72a1ec3..7148b16 100644 --- a/level_0/f_string/c/string/quantityss.c +++ b/level_0/f_type_array/c/type_array/quantityss.c @@ -1,12 +1,12 @@ -#include "../string.h" -#include "../private-string.h" +#include "../type_array.h" +#include "quantityss.h" #ifdef __cplusplus extern "C" { #endif -#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_f_quantityss_append_ + f_status_t f_quantityss_append(const f_quantitys_t source, f_quantityss_t * const destination) { #ifndef _di_level_0_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -14,14 +14,14 @@ extern "C" { if (!source.used) return F_data_not; { - 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); + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_quantitys_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - f_string_quantitys_t * const destination_inner = &destination->array[destination->used]; + f_quantitys_t * const destination_inner = &destination->array[destination->used]; destination_inner->used = 0; 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); + status = f_memory_array_increase_by(source.used, sizeof(f_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) { @@ -36,10 +36,10 @@ extern "C" { return F_okay; } -#endif // _di_f_string_quantityss_append_ +#endif // _di_f_quantityss_append_ -#ifndef _di_f_string_quantityss_append_all_ - f_status_t f_string_quantityss_append_all(const f_string_quantityss_t source, f_string_quantityss_t * const destination) { +#ifndef _di_f_quantityss_append_all_ + f_status_t f_quantityss_append_all(const f_quantityss_t source, f_quantityss_t * const destination) { #ifndef _di_level_0_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -47,10 +47,10 @@ extern "C" { if (!source.used) return F_data_not; { - f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_quantitys_t), (void **) &destination->array, &destination->used, &destination->size); + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_quantitys_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - f_string_quantitys_t * destination_inner = 0; + f_quantitys_t * destination_inner = 0; f_number_unsigned_t j = 0; for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { @@ -59,7 +59,7 @@ extern "C" { destination_inner->used = 0; 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); + status = f_memory_array_increase_by(source.array[i].used, sizeof(f_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; for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) { @@ -73,19 +73,19 @@ extern "C" { return F_okay; } -#endif // _di_f_string_quantityss_append_all_ +#endif // _di_f_quantityss_append_all_ -#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) { +#ifndef _di_f_quantityss_delete_callback_ + f_status_t f_quantityss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { { - f_string_quantitys_t * const array = (f_string_quantitys_t *) void_array; + f_quantitys_t * const array = (f_quantitys_t *) void_array; f_status_t status = F_okay; for (f_number_unsigned_t i = start; i < stop; ++i) { if (array[i].size && array[i].array) { - status = f_memory_array_resize(0, sizeof(f_string_quantity_t), (void **) &array[i].array, &array[i].used, &array[i].size); + status = f_memory_array_resize(0, sizeof(f_quantity_t), (void **) &array[i].array, &array[i].used, &array[i].size); if (F_status_is_error(status)) return status; } } // for @@ -93,19 +93,19 @@ extern "C" { return F_okay; } -#endif // _di_f_string_quantityss_delete_callback_ +#endif // _di_f_quantityss_delete_callback_ -#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) { +#ifndef _di_f_quantityss_destroy_callback_ + f_status_t f_quantityss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { { - f_string_quantitys_t * const array = (f_string_quantitys_t *) void_array; + f_quantitys_t * const array = (f_quantitys_t *) void_array; f_status_t status = F_okay; for (f_number_unsigned_t i = start; i < stop; ++i) { if (array[i].size && array[i].array) { - status = f_memory_array_adjust(0, sizeof(f_string_quantity_t), (void **) &array[i].array, &array[i].used, &array[i].size); + status = f_memory_array_adjust(0, sizeof(f_quantity_t), (void **) &array[i].array, &array[i].used, &array[i].size); if (F_status_is_error(status)) return status; } } // for @@ -113,7 +113,8 @@ extern "C" { return F_okay; } -#endif // _di_f_string_quantityss_destroy_callback_ +#endif // _di_f_quantityss_destroy_callback_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_string/c/string/quantityss.h b/level_0/f_type_array/c/type_array/quantityss.h similarity index 53% rename from level_0/f_string/c/string/quantityss.h rename to level_0/f_type_array/c/type_array/quantityss.h index 7e3810c..1db6e0b 100644 --- a/level_0/f_string/c/string/quantityss.h +++ b/level_0/f_type_array/c/type_array/quantityss.h @@ -1,49 +1,22 @@ /** * FLL - Level 0 * - * Project: String + * Project: Type * API Version: 0.7 * Licenses: lgpl-2.1-or-later * - * Defines quantity string data. + * Defines data to be used for/by type (array) related functionality. * - * This is auto-included by string.h and should not need to be explicitly included. + * This is auto-included by type_array.h and should not need to be explicitly included. */ -#ifndef _F_string_quantityss_h -#define _F_string_quantityss_h +#ifndef _F_type_array_quantityss_h +#define _F_type_array_quantityss_h #ifdef __cplusplus extern "C" { #endif /** - * This holds an array of f_string_quantitys_t. - * - * Properties: - * - array: The array of quantitys arrays. - * - size: Total amount of allocated space. - * - used: Total number of allocated spaces used. - */ -#ifndef _di_f_string_quantityss_t_ - typedef struct { - f_string_quantitys_t *array; - - f_number_unsigned_t size; - f_number_unsigned_t used; - } f_string_quantityss_t; - - #define f_string_quantityss_t_initialize { 0, 0, 0 } - - #define macro_f_string_quantityss_t_initialize_1(array, size, used) { array, size, used } - #define macro_f_string_quantityss_t_initialize_2(array, length) { array, length, length } - - #define macro_f_string_quantityss_t_clear(quantityss) \ - quantityss.array = 0; \ - quantityss.size = 0; \ - quantityss.used = 0; -#endif // _di_f_string_quantityss_t_ - -/** * Append the single source quantitys onto the destination. * * @param source @@ -59,9 +32,9 @@ extern "C" { * * Errors (with error bit) from: f_memory_resize(). */ -#ifndef _di_f_string_quantityss_append_ - extern f_status_t f_string_quantityss_append(const f_string_quantitys_t source, f_string_quantityss_t * const destination); -#endif // _di_f_string_quantityss_append_ +#ifndef _di_f_quantityss_append_ + extern f_status_t f_quantityss_append(const f_quantitys_t source, f_quantityss_t * const destination); +#endif // _di_f_quantityss_append_ /** * Append the source quantityss onto the destination. @@ -79,12 +52,12 @@ extern "C" { * * Errors (with error bit) from: f_memory_resize(). */ -#ifndef _di_f_string_quantityss_append_all_ - extern f_status_t f_string_quantityss_append_all(const f_string_quantityss_t source, f_string_quantityss_t * const destination); -#endif // _di_f_string_quantityss_append_all_ +#ifndef _di_f_quantityss_append_all_ + extern f_status_t f_quantityss_append_all(const f_quantityss_t source, f_quantityss_t * const destination); +#endif // _di_f_quantityss_append_all_ /** - * A callback intended to be passed to f_memory_arrayss_resize() for an f_string_quantityss_t structure. + * A callback intended to be passed to f_memory_arrayss_resize() for an f_quantityss_t structure. * * This is only called when shrinking the array and generally should perform deallocations. * @@ -107,12 +80,12 @@ extern "C" { * * @see f_memory_array_resize() */ -#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_ +#ifndef _di_f_quantityss_delete_callback_ + extern f_status_t f_quantityss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_quantityss_delete_callback_ /** - * A callback intended to be passed to f_memory_arrayss_adjust() for an f_string_quantityss_t structure. + * A callback intended to be passed to f_memory_arrayss_adjust() for an f_quantityss_t structure. * * This is only called when shrinking the array and generally should perform deallocations. * @@ -135,12 +108,12 @@ extern "C" { * * @see f_memory_array_adjust() */ -#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_ +#ifndef _di_f_quantityss_destroy_callback_ + extern f_status_t f_quantityss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_quantityss_destroy_callback_ #ifdef __cplusplus } // extern "C" #endif -#endif // _F_string_quantityss_h +#endif // _F_type_array_quantityss_h diff --git a/level_0/f_type_array/data/build/settings b/level_0/f_type_array/data/build/settings index 38b960a..48a82c4 100644 --- a/level_0/f_type_array/data/build/settings +++ b/level_0/f_type_array/data/build/settings @@ -33,9 +33,9 @@ build_language c build_libraries -lc build_libraries-individual -lf_memory -build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c +build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c -build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h +build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h build_script yes build_shared yes diff --git a/level_0/f_type_array/data/build/settings-mocks b/level_0/f_type_array/data/build/settings-mocks index b9a7a7b..2bfe367 100644 --- a/level_0/f_type_array/data/build/settings-mocks +++ b/level_0/f_type_array/data/build/settings-mocks @@ -30,10 +30,10 @@ build_language c build_libraries -lc build_libraries-individual -lf_memory -build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c +build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c build_sources_library ../../tests/unit/c/mock-type_array.c -build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h +build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h build_script yes build_shared yes diff --git a/level_0/f_type_array/data/build/settings-tests b/level_0/f_type_array/data/build/settings-tests index 33d3009..f1bc7a7 100644 --- a/level_0/f_type_array/data/build/settings-tests +++ b/level_0/f_type_array/data/build/settings-tests @@ -34,6 +34,8 @@ build_sources_program test-type_array-int128ss_delete_callback.c test-type_array build_sources_program test-type_array-number_signedss_delete_callback.c test-type_array-number_signedss_destroy_callback.c build_sources_program test-type_array-number_unsignedss_delete_callback.c test-type_array-number_unsignedss_destroy_callback.c build_sources_program test-type_array-pollss_delete_callback.c test-type_array-pollss_destroy_callback.c +build_sources_program test-type_array-quantitys_append.c test-type_array-quantitys_append_all.c test-type_array-quantityss_append.c test-type_array-quantityss_append_all.c +build_sources_program test-type_array-quantityss_delete_callback.c test-type_array-quantityss_destroy_callback.c build_sources_program test-type_array-ranges_append.c test-type_array-ranges_append_all.c test-type_array-rangess_append.c test-type_array-rangess_append_all.c build_sources_program test-type_array-rangess_delete_callback.c test-type_array-rangess_destroy_callback.c build_sources_program test-type_array-range_doubles_append.c test-type_array-range_doubles_append_all.c test-type_array-range_doubless_append.c test-type_array-range_doubless_append_all.c diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append.c b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append.c new file mode 100644 index 0000000..d2ac352 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append.c @@ -0,0 +1,38 @@ +#include "test-type_array.h" +#include "test-type_array-quantitys_append.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_type_array_quantitys_append__works(void **state) { + + const f_quantity_t source = macro_f_quantity_t_initialize_1(1, 2); + f_quantitys_t destination = f_quantitys_t_initialize; + + { + const f_status_t status = f_quantitys_append(source, &destination); + + assert_int_equal(status, F_okay); + assert_int_equal(destination.used, 1); + assert_int_equal(destination.array[0].start, source.start); + assert_int_equal(destination.array[0].total, source.total); + } + + free((void *) destination.array); +} + +void test__f_type_array_quantitys_append__parameter_checking(void **state) { + + const f_quantity_t data = f_quantity_t_initialize; + + { + const f_status_t status = f_quantitys_append(data, 0); + + assert_int_equal(status, F_status_set_error(F_parameter)); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append.h b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append.h new file mode 100644 index 0000000..1b5f135 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append.h @@ -0,0 +1,27 @@ +/** + * 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_type_array__quantitys_append_h +#define _TEST__F_type_array__quantitys_append_h + +/** + * Test that the function works. + * + * @see f_quantitys_append() + */ +extern void test__f_type_array_quantitys_append__works(void **state); + +/** + * Test that the function correctly fails on invalid parameter. + * + * @see f_quantitys_append() + */ +extern void test__f_type_array_quantitys_append__parameter_checking(void **state); + +#endif // _TEST__F_type_array__quantitys_append_h diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append_all.c b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append_all.c new file mode 100644 index 0000000..a4fe8ca --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append_all.c @@ -0,0 +1,76 @@ +#include "test-type_array.h" +#include "test-type_array-quantitys_append_all.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_type_array_quantitys_append_all__works(void **state) { + + const int length_sources = 2; + + f_quantity_t sources_array[] = { + macro_f_quantity_t_initialize_1(1, 2), + macro_f_quantity_t_initialize_1(3, 4), + }; + + const f_quantitys_t source = macro_f_quantitys_t_initialize_1(sources_array, 0, length_sources); + f_quantitys_t destination = f_quantitys_t_initialize; + + { + const f_status_t status = f_quantitys_append_all(source, &destination); + + assert_int_equal(status, F_okay); + assert_int_equal(destination.used, source.used); + assert_int_equal(destination.size, source.used); + + for (f_number_unsigned_t i = 0; i < length_sources; ++i) { + + assert_int_equal(destination.array[i].start, source.array[i].start); + assert_int_equal(destination.array[i].total, source.array[i].total); + } // for + } + + free((void *) destination.array); +} + +void test__f_type_array_quantitys_append_all__returns_data_not(void **state) { + + const int length = 5; + f_quantitys_t source = f_quantitys_t_initialize; + f_quantitys_t destination = f_quantitys_t_initialize; + + { + const f_status_t status = f_memory_array_resize(length, sizeof(f_quantity_t), (void **) &source.array, &source.used, &source.size); + + assert_int_equal(status, F_okay); + assert_int_equal(source.used, 0); + assert_int_equal(source.size, length); + } + + { + const f_status_t status = f_quantitys_append_all(source, &destination); + + assert_int_equal(status, F_data_not); + assert_int_equal(destination.used, 0); + assert_int_equal(destination.size, 0); + assert_null(destination.array); + } + + free((void *) source.array); +} + +void test__f_type_array_quantitys_append_all__parameter_checking(void **state) { + + const f_quantitys_t data = f_quantitys_t_initialize; + + { + const f_status_t status = f_quantitys_append_all(data, 0); + + assert_int_equal(status, F_status_set_error(F_parameter)); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append_all.h b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append_all.h new file mode 100644 index 0000000..17839c2 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantitys_append_all.h @@ -0,0 +1,34 @@ +/** + * 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_type_array__quantitys_append_all_h +#define _TEST__F_type_array__quantitys_append_all_h + +/** + * Test that the function works. + * + * @see f_quantitys_append_all() + */ +extern void test__f_type_array_quantitys_append_all__works(void **state); + +/** + * Test that the function returns F_data_not when asked to copy an empty structure. + * + * @see f_quantitys_append_all() + */ +extern void test__f_type_array_quantitys_append_all__returns_data_not(void **state); + +/** + * Test that the function correctly fails on invalid parameter. + * + * @see f_quantitys_append_all() + */ +extern void test__f_type_array_quantitys_append_all__parameter_checking(void **state); + +#endif // _TEST__F_type_array__quantitys_append_all_h diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append.c b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append.c new file mode 100644 index 0000000..91da59d --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append.c @@ -0,0 +1,76 @@ +#include "test-type_array.h" +#include "test-type_array-quantityss_append.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_type_array_quantityss_append__works(void **state) { + + const int length_sources = 2; + + f_quantity_t sources_array[] = { + macro_f_quantity_t_initialize_1(1, 2), + macro_f_quantity_t_initialize_1(3, 4), + }; + + const f_quantitys_t source = macro_f_quantitys_t_initialize_1(sources_array, 0, length_sources); + f_quantityss_t destination = f_quantityss_t_initialize; + + { + const f_status_t status = f_quantityss_append(source, &destination); + + assert_int_equal(status, F_okay); + assert_int_equal(destination.array[0].used, length_sources); + + for (f_number_unsigned_t i = 0; i < length_sources; ++i) { + + assert_int_equal(destination.array[0].array[i].start, sources_array[i].start); + assert_int_equal(destination.array[0].array[i].total, sources_array[i].total); + } // for + } + + free((void *) destination.array[0].array); + free((void *) destination.array); +} + +void test__f_type_array_quantityss_append__returns_data_not(void **state) { + + const int length = 5; + f_quantitys_t source = f_quantityss_t_initialize; + f_quantityss_t destination = f_quantityss_t_initialize; + + { + const f_status_t status = f_memory_arrays_resize(length, sizeof(f_quantitys_t), (void **) &source.array, &source.used, &source.size, &f_quantityss_delete_callback); + + assert_int_equal(status, F_okay); + assert_int_equal(source.used, 0); + assert_int_equal(source.size, length); + } + + { + const f_status_t status = f_quantityss_append(source, &destination); + + assert_int_equal(status, F_data_not); + assert_int_equal(destination.used, 0); + assert_int_equal(destination.size, 0); + assert_null(destination.array); + } + + free((void *) source.array); +} + +void test__f_type_array_quantityss_append__parameter_checking(void **state) { + + f_quantitys_t data = f_quantitys_t_initialize; + + { + const f_status_t status = f_quantityss_append(data, 0); + + assert_int_equal(status, F_status_set_error(F_parameter)); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append.h b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append.h new file mode 100644 index 0000000..bea2655 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append.h @@ -0,0 +1,34 @@ +/** + * 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_type_array__quantityss_append_h +#define _TEST__F_type_array__quantityss_append_h + +/** + * Test that the function works. + * + * @see f_quantityss_append() + */ +extern void test__f_type_array_quantityss_append__works(void **state); + +/** + * Test that the function returns F_data_not when asked to copy an empty structure. + * + * @see f_quantityss_append() + */ +extern void test__f_type_array_quantityss_append__returns_data_not(void **state); + +/** + * Test that the function correctly fails on invalid parameter. + * + * @see f_quantityss_append() + */ +extern void test__f_type_array_quantityss_append__parameter_checking(void **state); + +#endif // _TEST__F_type_array__quantityss_append_h diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append_all.c b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append_all.c new file mode 100644 index 0000000..6b8e3dc --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append_all.c @@ -0,0 +1,93 @@ +#include "test-type_array.h" +#include "test-type_array-quantityss_append_all.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_type_array_quantityss_append_all__works(void **state) { + + const int length_sources = 2; + const int length_sources_set = 2; + + f_quantity_t sources_array1[] = { + macro_f_quantity_t_initialize_1(1, 2), + macro_f_quantity_t_initialize_1(3, 4), + }; + + f_quantity_t sources_array2[] = { + macro_f_quantity_t_initialize_1(5, 6), + macro_f_quantity_t_initialize_1(7, 8), + }; + + f_quantitys_t sources_set_array[] = { + macro_f_quantitys_t_initialize_1(sources_array1, 0, length_sources), + macro_f_quantitys_t_initialize_1(sources_array2, 0, length_sources), + }; + + const f_quantityss_t source = macro_f_quantityss_t_initialize_1(sources_set_array, 0, length_sources_set); + f_quantityss_t destination = f_quantityss_t_initialize; + + { + const f_status_t status = f_quantityss_append_all(source, &destination); + + assert_int_equal(status, F_okay); + assert_int_equal(destination.used, source.used); + + for (f_number_unsigned_t j = 0; j < length_sources_set; ++j) { + + for (f_number_unsigned_t i = 0; i < length_sources; ++i) { + + assert_int_equal(destination.array[j].array[i].start, sources_set_array[j].array[i].start); + assert_int_equal(destination.array[j].array[i].total, sources_set_array[j].array[i].total); + } // for + } // for + } + + for (f_number_unsigned_t i = 0; i < destination.used; ++i) { + free((void *) destination.array[i].array); + } // for + + free((void *) destination.array); +} + +void test__f_type_array_quantityss_append_all__returns_data_not(void **state) { + + const int length = 5; + f_quantityss_t source = f_quantityss_t_initialize; + f_quantityss_t destination = f_quantityss_t_initialize; + + { + const f_status_t status = f_memory_arrays_resize(length, sizeof(f_quantitys_t), (void **) &source.array, &source.used, &source.size, &f_quantityss_delete_callback); + + assert_int_equal(status, F_okay); + assert_int_equal(source.used, 0); + assert_int_equal(source.size, length); + } + + { + const f_status_t status = f_quantityss_append_all(source, &destination); + + assert_int_equal(status, F_data_not); + assert_int_equal(destination.used, 0); + assert_int_equal(destination.size, 0); + assert_null(destination.array); + } + + free((void *) source.array); +} + +void test__f_type_array_quantityss_append_all__parameter_checking(void **state) { + + const f_quantityss_t data = f_quantityss_t_initialize; + + { + const f_status_t status = f_quantityss_append_all(data, 0); + + assert_int_equal(status, F_status_set_error(F_parameter)); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append_all.h b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append_all.h new file mode 100644 index 0000000..2b08e94 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_append_all.h @@ -0,0 +1,34 @@ +/** + * 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_type_array__quantityss_append_all_h +#define _TEST__F_type_array__quantityss_append_all_h + +/** + * Test that the function works. + * + * @see f_quantityss_append_all() + */ +extern void test__f_type_array_quantityss_append_all__works(void **state); + +/** + * Test that the function returns F_data_not when asked to copy an empty structure. + * + * @see f_quantityss_append_all() + */ +extern void test__f_type_array_quantityss_append_all__returns_data_not(void **state); + +/** + * Test that the function correctly fails on invalid parameter. + * + * @see f_quantityss_append_all() + */ +extern void test__f_type_array_quantityss_append_all__parameter_checking(void **state); + +#endif // _TEST__F_type_array__quantityss_append_all_h diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_delete_callback.c b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_delete_callback.c new file mode 100644 index 0000000..7c8a63b --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_delete_callback.c @@ -0,0 +1,57 @@ +#include "test-type_array.h" +#include "test-type_array-quantityss_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_type_array_quantityss_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_quantity_t data = f_quantity_t_initialize; + f_quantity_t data_array[] = { data }; + f_quantitys_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_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_quantityss_delete_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_type_array_quantityss_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_quantityss_t datass = f_quantityss_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_quantitys_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_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_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 diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_delete_callback.h b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_delete_callback.h new file mode 100644 index 0000000..6a00e95 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_delete_callback.h @@ -0,0 +1,27 @@ +/** + * 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_type_array__quantityss_delete_callback +#define _TEST__F_type_array__quantityss_delete_callback + +/** + * Test that the function fails. + * + * @see f_quantityss_delete_callback() + */ +extern void test__f_type_array_quantityss_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_quantityss_delete_callback() + */ +extern void test__f_type_array_quantityss_delete_callback__works(void **state); + +#endif // _TEST__F_type_array__quantityss_delete_callback diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_destroy_callback.c b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_destroy_callback.c new file mode 100644 index 0000000..625a5d9 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_destroy_callback.c @@ -0,0 +1,57 @@ +#include "test-type_array.h" +#include "test-type_array-quantityss_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_type_array_quantityss_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_quantity_t data = f_quantity_t_initialize; + f_quantity_t data_array[] = { data }; + f_quantitys_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_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_quantityss_destroy_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_type_array_quantityss_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_quantityss_t datass = f_quantityss_t_initialize; + + { + f_status_t status = f_memory_array_adjust(length, sizeof(f_quantitys_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_adjust(1, sizeof(f_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_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 diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_destroy_callback.h b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_destroy_callback.h new file mode 100644 index 0000000..8f2dff0 --- /dev/null +++ b/level_0/f_type_array/tests/unit/c/test-type_array-quantityss_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * 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_type_array__quantityss_destroy_callback +#define _TEST__F_type_array__quantityss_destroy_callback + +/** + * Test that the function fails. + * + * @see f_quantityss_destroy_callback() + */ +extern void test__f_type_array_quantityss_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_quantityss_destroy_callback() + */ +extern void test__f_type_array_quantityss_destroy_callback__works(void **state); + +#endif // _TEST__F_type_array__quantityss_destroy_callback diff --git a/level_0/f_type_array/tests/unit/c/test-type_array.c b/level_0/f_type_array/tests/unit/c/test-type_array.c index f18509c..67d18e5 100644 --- a/level_0/f_type_array/tests/unit/c/test-type_array.c +++ b/level_0/f_type_array/tests/unit/c/test-type_array.c @@ -83,6 +83,20 @@ int main(void) { cmocka_unit_test(test__f_type_array_pollss_destroy_callback__fails), cmocka_unit_test(test__f_type_array_pollss_destroy_callback__works), + cmocka_unit_test(test__f_type_array_quantitys_append__works), + cmocka_unit_test(test__f_type_array_quantitys_append_all__works), + cmocka_unit_test(test__f_type_array_quantitys_append_all__returns_data_not), + + cmocka_unit_test(test__f_type_array_quantityss_append__works), + cmocka_unit_test(test__f_type_array_quantityss_append__returns_data_not), + cmocka_unit_test(test__f_type_array_quantityss_append_all__works), + cmocka_unit_test(test__f_type_array_quantityss_append_all__returns_data_not), + + cmocka_unit_test(test__f_type_array_quantityss_delete_callback__fails), + cmocka_unit_test(test__f_type_array_quantityss_destroy_callback__fails), + cmocka_unit_test(test__f_type_array_quantityss_delete_callback__works), + cmocka_unit_test(test__f_type_array_quantityss_destroy_callback__works), + cmocka_unit_test(test__f_type_array_ranges_append__works), cmocka_unit_test(test__f_type_array_ranges_append_all__works), cmocka_unit_test(test__f_type_array_ranges_append_all__returns_data_not), @@ -173,6 +187,14 @@ int main(void) { // f_pollss_destroy_callback() doesn't use parameter checking. // f_pollss_delete_callback() doesn't use parameter checking. + cmocka_unit_test(test__f_type_array_quantitys_append__parameter_checking), + cmocka_unit_test(test__f_type_array_quantitys_append_all__parameter_checking), + cmocka_unit_test(test__f_type_array_quantityss_append__parameter_checking), + cmocka_unit_test(test__f_type_array_quantityss_append_all__parameter_checking), + + // f_quantityss_delete_callback() doesn't use parameter checking. + // f_quantityss_destroy_callback() doesn't use parameter checking. + cmocka_unit_test(test__f_type_array_ranges_append__parameter_checking), cmocka_unit_test(test__f_type_array_ranges_append_all__parameter_checking), cmocka_unit_test(test__f_type_array_rangess_append__parameter_checking), diff --git a/level_0/f_type_array/tests/unit/c/test-type_array.h b/level_0/f_type_array/tests/unit/c/test-type_array.h index 30ebcc0..9c46ac9 100644 --- a/level_0/f_type_array/tests/unit/c/test-type_array.h +++ b/level_0/f_type_array/tests/unit/c/test-type_array.h @@ -52,6 +52,12 @@ #include "test-type_array-number_unsignedss_destroy_callback.h" #include "test-type_array-pollss_delete_callback.h" #include "test-type_array-pollss_destroy_callback.h" +#include "test-type_array-quantitys_append.h" +#include "test-type_array-quantitys_append_all.h" +#include "test-type_array-quantityss_append.h" +#include "test-type_array-quantityss_append_all.h" +#include "test-type_array-quantityss_delete_callback.h" +#include "test-type_array-quantityss_destroy_callback.h" #include "test-type_array-ranges_append.h" #include "test-type_array-ranges_append_all.h" #include "test-type_array-rangess_append.h" diff --git a/level_1/fl_status_string/data/build/dependencies b/level_1/fl_status_string/data/build/dependencies index 06e84ce..b3af143 100644 --- a/level_1/fl_status_string/data/build/dependencies +++ b/level_1/fl_status_string/data/build/dependencies @@ -5,6 +5,7 @@ f_status f_memory f_string f_utf +f_type_array f_compare f_conversion f_parse diff --git a/level_1/fl_status_string/data/build/settings b/level_1/fl_status_string/data/build/settings index af5a811..9220a1c 100644 --- a/level_1/fl_status_string/data/build/settings +++ b/level_1/fl_status_string/data/build/settings @@ -31,7 +31,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lf_compare -lf_conversion -lf_parse -lf_memory -lf_status_string -lf_string -lf_utf +build_libraries-individual -lf_compare -lf_conversion -lf_parse -lf_memory -lf_status_string -lf_string -lf_type_array -lf_utf build_sources_library status_string.c diff --git a/level_1/fl_status_string/data/build/settings-tests b/level_1/fl_status_string/data/build/settings-tests index 3920c16..ac28a61 100644 --- a/level_1/fl_status_string/data/build/settings-tests +++ b/level_1/fl_status_string/data/build/settings-tests @@ -23,7 +23,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -lcmocka -build_libraries-individual -lf_compare -lf_conversion -lf_memory -lf_parse -lf_status_string -lf_string -lf_utf -lfl_status_string +build_libraries-individual -lf_compare -lf_conversion -lf_memory -lf_parse -lf_status_string -lf_string -lf_type_array -lf_utf -lfl_status_string build_sources_program test-status_string-from.c build_sources_program test-status_string.c diff --git a/level_3/fss_read/c/main/process_normal.c b/level_3/fss_read/c/main/process_normal.c index cd7677d..32c31ca 100644 --- a/level_3/fss_read/c/main/process_normal.c +++ b/level_3/fss_read/c/main/process_normal.c @@ -304,7 +304,6 @@ extern "C" { ++(*line); } else { - f_number_unsigned_t line_original = 0; f_number_unsigned_t j = 0; f_number_unsigned_t k = 0; @@ -312,7 +311,6 @@ extern "C" { if (fss_read_signal_check(main)) return; - line_original = *line; main->setting.range = main->setting.contents.array[at].array[i]; k = 0; diff --git a/level_3/fss_read/c/payload/fss_read.c b/level_3/fss_read/c/payload/fss_read.c index 73c40fe..b5bbb0b 100644 --- a/level_3/fss_read/c/payload/fss_read.c +++ b/level_3/fss_read/c/payload/fss_read.c @@ -91,8 +91,9 @@ extern "C" { fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamic_append)); } else { - main->setting.objects.array[main->setting.objects.used++].stop = main->setting.objects.array[main->setting.objects.used].start + f_fss_payload_s.used - 1; + main->setting.objects.array[main->setting.objects.used].stop = main->setting.objects.array[main->setting.objects.used].start + f_fss_payload_s.used - 1; main->setting.contents.array[main->setting.contents.used++].used = 0; + ++main->setting.objects.used; main->setting.state.status = F_okay; }