From: Kevin Day Date: Sun, 27 Aug 2023 21:52:26 +0000 (-0500) Subject: Update: Wrap up re-designing the memory logic. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=90ba600651e8240de4141eb49f613e246e3c8db4;p=fll Update: Wrap up re-designing the memory logic. Update the unit tests and stand alone builds as needed. Also clear out the stand alone builds that are out of date and require being rebuilt from the ground up. --- diff --git a/build/level_0/settings b/build/level_0/settings index 203deb9..14b918e 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -79,11 +79,7 @@ build_sources_library utf/map.c utf/maps.c utf/mapss.c build_sources_library utf/map_multi.c utf/map_multis.c utf/map_multiss.c build_sources_library utf/static.c utf/statics.c utf/staticss.c build_sources_library utf/string.c utf/triple.c utf/triples.c utf/tripless.c -build_sources_library utf/private-dynamic.c utf/private-dynamics.c utf/private-dynamicss.c -build_sources_library utf/private-map_multis.c utf/private-map_multiss.c -build_sources_library utf/private-maps.c utf/private-mapss.c -build_sources_library utf/private-string.c -build_sources_library utf/private-triples.c utf/private-tripless.c +build_sources_library utf/private-dynamics.c utf/private-maps.c utf/private-map_multis.c utf/private-string.c utf/private-triples.c build_sources_library-thread thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c diff --git a/build/monolithic/settings b/build/monolithic/settings index 1e19131..c8ae523 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -79,11 +79,7 @@ build_sources_library level_0/utf/map.c level_0/utf/maps.c level_0/utf/mapss.c build_sources_library level_0/utf/map_multi.c level_0/utf/map_multis.c level_0/utf/map_multiss.c build_sources_library level_0/utf/static.c level_0/utf/statics.c level_0/utf/staticss.c build_sources_library level_0/utf/string.c level_0/utf/triple.c level_0/utf/triples.c level_0/utf/tripless.c -build_sources_library level_0/utf/private-dynamic.c level_0/utf/private-dynamics.c level_0/utf/private-dynamicss.c -build_sources_library level_0/utf/private-maps.c level_0/utf/private-mapss.c -build_sources_library level_0/utf/private-map_multis.c level_0/utf/private-map_multiss.c -build_sources_library level_0/utf/private-string.c -build_sources_library level_0/utf/private-triples.c level_0/utf/private-tripless.c +build_sources_library level_0/utf/private-dynamics.c level_0/utf/private-maps.c level_0/utf/private-map_multis.c level_0/utf/private-string.c level_0/utf/private-triples.c build_sources_library level_1/control_group.c build_sources_library level_1/conversion.c level_1/private-conversion.c level_1/conversion/common.c diff --git a/build/stand_alone/byte_dump.config.h b/build/stand_alone/byte_dump.config.h index 7993afd..5c97d92 100644 --- a/build/stand_alone/byte_dump.config.h +++ b/build/stand_alone/byte_dump.config.h @@ -1,1115 +1,16 @@ -// A config.h file for defining all code being disabled for compiling the stand alone Byte Dump. -// To assist in building this file use (may need to omit --defined-only): "nm --defined-only -f p programs/shared/byte_dump | grep -oP '^(f|fl|fll)_[^\s]+'". -// To get the list of all possible functions, use something like: "grep -hor '#ifndef _di_f_.*\>' level_0/f_color/" | sed -e 's|^#ifndef |#define |g' | sort | uniq. - -#define _di_f_color_code_t_ -//#define _di_f_color_context_delete_ -#define _di_f_color_context_destroy_ -//#define _di_f_color_context_t_ -//#define _di_f_color_format_t_ -//#define _di_f_color_load_context_ -//#define _di_f_color_max_size_d_ -//#define _di_f_color_mode_t_ -#define _di_f_color_save_1_ -#define _di_f_color_save_2_ -#define _di_f_color_save_3_ -#define _di_f_color_save_4_ -#define _di_f_color_save_5_ -//#define _di_f_color_set_context_t_ -//#define _di_f_color_set_string_empty_s_ -//#define _di_f_color_set_t_ -//#define _di_f_color_s_ -//#define _di_f_color_strings_s_ -//#define _di_f_color_t_ -//#define _di_f_color_terminal_s_ - -//#define _di_f_console_arguments_t_ -#define _di_f_console_environment_process_ -#define _di_f_console_identify_ -//#define _di_f_console_ids_ -//#define _di_f_console_length_size_ -//#define _di_f_console_parameter_ids_t_ -//#define _di_f_console_parameter_id_t_ -//#define _di_f_console_parameter_prioritize_left_ -//#define _di_f_console_parameter_prioritize_right_ -//#define _di_f_console_parameter_process_ -//#define _di_f_console_parameters_delete_ -#define _di_f_console_parameters_destroy_ -//#define _di_f_console_parameters_t_ -//#define _di_f_console_parameter_t_ -//#define _di_f_console_standard_s_ -//#define _di_f_console_symbol_s_ -//#define _di_f_console_types_t_ -//#define _di_f_console_verbosity_ - -//#define _di_f_conversion_character_is_binary_ -//#define _di_f_conversion_character_is_decimal_ -#define _di_f_conversion_character_is_duodecimal_ -#define _di_f_conversion_character_is_hexidecimal_ -#define _di_f_conversion_character_is_octal_ -//#define _di_f_conversion_character_to_binary_ -//#define _di_f_conversion_character_to_decimal_ -//#define _di_f_conversion_character_to_duodecimal_ -//#define _di_f_conversion_character_to_hexidecimal_ -//#define _di_f_conversion_character_to_octal_ -//#define _di_f_conversion_data_flag_d_ -//#define _di_f_conversion_data_t_ -#define _di_f_conversion_data_d_ -//#define _di_f_conversion_d_ -//#define _di_f_conversion_number_signed_print_ -#define _di_f_conversion_number_signed_to_string_ -//#define _di_f_conversion_number_unsigned_print_ -#define _di_f_conversion_number_unsigned_to_string_ - -#define _di_f_file_access_ -#define _di_f_file_access_at_ -#define _di_f_file_access_mode_d_ -#define _di_f_file_at_d_ -#define _di_f_file_clone_ -//#define _di_f_file_close_ -#define _di_f_file_close_flush_ -#define _di_f_file_copy_ -#define _di_f_file_create_ -#define _di_f_file_create_at_ -#define _di_f_file_create_device_ -#define _di_f_file_create_device_at_ -#define _di_f_file_create_fifo_ -#define _di_f_file_create_fifo_at_ -#define _di_f_file_create_node_ -#define _di_f_file_create_node_at_ -//#define _di_f_file_defaults_ -#define _di_f_file_descriptor_ -//#define _di_f_file_exists_ -#define _di_f_file_exists_at_ -//#define _di_f_file_flag_d_ -#define _di_f_file_flush_ -#define _di_f_file_group_read_ -#define _di_f_file_is_ -#define _di_f_file_is_at_ -#define _di_f_file_link_ -#define _di_f_file_link_at_ -#define _di_f_file_link_hard_ -#define _di_f_file_link_hard_at_ -#define _di_f_file_link_read_ -#define _di_f_file_link_read_at_ -#define _di_f_file_mode_determine_ -#define _di_f_file_mode_from_string_ -#define _di_f_file_mode_read_ -#define _di_f_file_mode_read_at_ -#define _di_f_file_mode_set_ -#define _di_f_file_mode_set_at_ -#define _di_f_file_mode_t_ -#define _di_f_file_mode_to_mode_ -#define _di_f_file_name_base_ -#define _di_f_file_name_directory_ -//#define _di_f_file_open_ -#define _di_f_file_open_at_ -//#define _di_f_file_open_mode_s_ -//#define _di_f_file_operation_s_ -#define _di_f_file_owner_read_ -#define _di_f_file_read_ -#define _di_f_file_read_block_ -#define _di_f_file_read_until_ -#define _di_f_file_remove_ -#define _di_f_file_remove_at_ -#define _di_f_file_rename_ -#define _di_f_file_rename_at_ -#define _di_f_file_role_change_ -#define _di_f_file_role_change_at_ -#define _di_f_file_seek_ -#define _di_f_file_seeks_d_ -#define _di_f_file_size_ -#define _di_f_file_size_at_ -#define _di_f_file_size_by_id_ -#define _di_f_file_stat_ -#define _di_f_file_stat_at_ -#define _di_f_file_stat_by_id_ -#define _di_f_file_stat_flags_e_ -//#define _di_f_file_stream_close_ -//#define _di_f_file_stream_open_ -#define _di_f_file_stream_open_descriptor_ -#define _di_f_file_stream_read_ -#define _di_f_file_stream_read_block_ -#define _di_f_file_stream_read_until_ -#define _di_f_file_stream_reopen_ -#define _di_f_file_stream_write_ -#define _di_f_file_stream_write_block_ -#define _di_f_file_stream_write_range_ -#define _di_f_file_stream_write_until_ -//#define _di_f_file_t_ -#define _di_f_file_touch_ -#define _di_f_file_touch_at_ -#define _di_f_file_type_ -#define _di_f_file_type_at_ -#define _di_f_file_type_d_ -#define _di_f_file_umask_get_ -#define _di_f_file_umask_set_ -#define _di_f_file_write_ -#define _di_f_file_write_block_ -#define _di_f_file_write_range_ -#define _di_f_file_write_until_ - -#define _di_f_memory_adjust_ -//#define _di_f_memory_default_d_ -#define _di_f_memory_delete_ -#define _di_f_memory_destroy_ -#define _di_f_memory_new_ -#define _di_f_memory_new_aligned_ -//#define _di_f_memory_resize_ -#define _di_f_memory_structure_adjust_ -#define _di_f_memory_structure_decimate_by_ -#define _di_f_memory_structure_decrease_by_ -#define _di_f_memory_structure_increase_ -#define _di_f_memory_structure_increase_by_ -#define _di_f_memory_structure_resize_ - -#define _di_f_number_unsigneds_adjust_ -#define _di_f_number_unsigneds_append_ -#define _di_f_number_unsigneds_append_all_ -#define _di_f_number_unsigneds_decimate_by_ -#define _di_f_number_unsigneds_decrease_by_ -//#define _di_f_number_unsigneds_increase_ -//#define _di_f_number_unsigneds_increase_by_ -//#define _di_f_number_unsigneds_resize_ -#define _di_f_number_unsignedss_adjust_ -#define _di_f_number_unsignedss_append_ -#define _di_f_number_unsignedss_append_all_ -#define _di_f_number_unsignedss_decimate_by_ -#define _di_f_number_unsignedss_decrease_by_ -#define _di_f_number_unsignedss_increase_ -#define _di_f_number_unsignedss_increase_by_ -#define _di_f_number_unsignedss_resize_ -#define _di_f_number_unsignedss_t_ -//#define _di_f_number_unsigneds_t_ -//#define _di_f_number_unsigned_t_ - -#define _di_f_pipe_error_exists_ -//#define _di_f_pipe_input_exists_ -#define _di_f_pipe_output_exists_ - -//#define _di_f_print_ -//#define _di_f_print_character_ -//#define _di_f_print_character_safely_ -#define _di_f_print_character_safely_get_ -//#define _di_f_print_dynamic_ -#define _di_f_print_dynamic_except_partial_ -#define _di_f_print_dynamic_except_partial_raw_ -#define _di_f_print_dynamic_except_partial_raw_safely_ -#define _di_f_print_dynamic_except_partial_safely_ -#define _di_f_print_dynamic_partial_ -#define _di_f_print_dynamic_partial_raw_ -#define _di_f_print_dynamic_partial_raw_safely_ -#define _di_f_print_dynamic_partial_safely_ -//#define _di_f_print_dynamic_raw_ -//#define _di_f_print_dynamic_raw_safely_ -//#define _di_f_print_dynamic_safely_ -#define _di_f_print_except_ -#define _di_f_print_except_dynamic_ -#define _di_f_print_except_dynamic_partial_ -#define _di_f_print_except_dynamic_partial_raw_ -#define _di_f_print_except_dynamic_partial_raw_safely_ -#define _di_f_print_except_dynamic_partial_safely_ -#define _di_f_print_except_dynamic_raw_ -#define _di_f_print_except_dynamic_raw_safely_ -#define _di_f_print_except_dynamic_safely_ -//#define _di_f_print_except_in_ -//#define _di_f_print_except_in_dynamic_ -#define _di_f_print_except_in_dynamic_partial_ -#define _di_f_print_except_in_dynamic_partial_raw_ -#define _di_f_print_except_in_dynamic_partial_raw_safely_ -#define _di_f_print_except_in_dynamic_partial_safely_ -//#define _di_f_print_except_in_dynamic_raw_ -//#define _di_f_print_except_in_dynamic_raw_safely_ -//#define _di_f_print_except_in_dynamic_safely_ -//#define _di_f_print_except_in_raw_ -//#define _di_f_print_except_in_raw_safely_ -//#define _di_f_print_except_in_safely_ -#define _di_f_print_except_raw_ -#define _di_f_print_except_raw_safely_ -#define _di_f_print_except_safely_ -//#define _di_f_print_format_flag_d_ -//#define _di_f_print_format_type_e_ -//#define _di_f_print_raw_ -//#define _di_f_print_raw_safely_ -#define _di_f_print_raw_terminated_ -//#define _di_f_print_safely_ -#define _di_f_print_safely_get_ -//#define _di_f_print_safely_terminated_ -//#define _di_f_print_sequence_s_ -//#define _di_f_print_sequences_set_control_s_ -//#define _di_f_print_terminated_ -#define _di_f_print_to_ -#define _di_f_print_to_character_ -#define _di_f_print_to_character_safely_ -#define _di_f_print_to_dynamic_ -#define _di_f_print_to_dynamic_partial_ -#define _di_f_print_to_dynamic_partial_raw_ -#define _di_f_print_to_dynamic_partial_raw_safely_ -#define _di_f_print_to_dynamic_partial_safely_ -#define _di_f_print_to_dynamic_raw_ -#define _di_f_print_to_dynamic_raw_safely_ -#define _di_f_print_to_dynamic_safely_ -#define _di_f_print_to_except_ -#define _di_f_print_to_except_dynamic_ -#define _di_f_print_to_except_dynamic_partial_ -#define _di_f_print_to_except_dynamic_partial_raw_ -#define _di_f_print_to_except_dynamic_partial_raw_safely_ -#define _di_f_print_to_except_dynamic_partial_safely_ -#define _di_f_print_to_except_dynamic_raw_ -#define _di_f_print_to_except_dynamic_raw_safely_ -#define _di_f_print_to_except_dynamic_safely_ -#define _di_f_print_to_except_in_ -#define _di_f_print_to_except_in_dynamic_ -#define _di_f_print_to_except_in_dynamic_partial_ -#define _di_f_print_to_except_in_dynamic_partial_raw_ -#define _di_f_print_to_except_in_dynamic_partial_raw_safely_ -#define _di_f_print_to_except_in_dynamic_partial_safely_ -#define _di_f_print_to_except_in_dynamic_raw_ -#define _di_f_print_to_except_in_dynamic_raw_safely_ -#define _di_f_print_to_except_in_dynamic_safely_ -#define _di_f_print_to_except_in_raw_ -#define _di_f_print_to_except_in_raw_safely_ -#define _di_f_print_to_except_in_safely_ -#define _di_f_print_to_except_raw_ -#define _di_f_print_to_except_raw_safely_ -#define _di_f_print_to_except_safely_ -#define _di_f_print_to_raw_ -#define _di_f_print_to_raw_safely_ -#define _di_f_print_to_raw_terminated_ -#define _di_f_print_to_safely_ -#define _di_f_print_to_safely_terminated_ -#define _di_f_print_to_terminated_ -//#define _di_f_print_write_max_d_ - -#define _di_f_signal_action_ -//#define _di_f_signal_close_ -#define _di_f_signal_how_t_ -//#define _di_f_signal_mask_ -//#define _di_f_signal_open_ -#define _di_f_signal_pause_ -#define _di_f_signal_queue_ -//#define _di_f_signal_read_ -#define _di_f_signal_send_ -//#define _di_f_signal_set_add_ -//#define _di_f_signal_set_delete_ -//#define _di_f_signal_set_empty_ -//#define _di_f_signal_set_fill_ -#define _di_f_signal_set_has_ -#define _di_f_signal_suspend_ -//#define _di_f_signal_t_ -#define _di_f_signal_wait_ -#define _di_f_signal_wait_until_ - -//#define _di_f_status_e_ - -//#define _di_f_char_t_ -#define _di_f_string_append_ -#define _di_f_string_append_assure_ -#define _di_f_string_append_assure_nulless_ -#define _di_f_string_append_nulless_ -//#define _di_f_string_ascii_s_ -#define _di_f_string_constant_t_ -#define _di_f_string_dynamic_append_ -#define _di_f_string_dynamic_append_assure_ -#define _di_f_string_dynamic_append_assure_nulless_ -#define _di_f_string_dynamic_append_nulless_ -#define _di_f_string_dynamic_mash_ -#define _di_f_string_dynamic_mash_nulless_ -#define _di_f_string_dynamic_mish_ -#define _di_f_string_dynamic_mish_nulless_ -#define _di_f_string_dynamic_partial_append_ -#define _di_f_string_dynamic_partial_append_assure_ -#define _di_f_string_dynamic_partial_append_assure_nulless_ -#define _di_f_string_dynamic_partial_append_nulless_ -#define _di_f_string_dynamic_partial_mash_ -#define _di_f_string_dynamic_partial_mash_nulless_ -#define _di_f_string_dynamic_partial_mish_ -#define _di_f_string_dynamic_partial_mish_nulless_ -#define _di_f_string_dynamic_partial_prepend_ -#define _di_f_string_dynamic_partial_prepend_assure_ -#define _di_f_string_dynamic_partial_prepend_assure_nulless_ -#define _di_f_string_dynamic_partial_prepend_nulless_ -#define _di_f_string_dynamic_prepend_ -#define _di_f_string_dynamic_prepend_assure_ -#define _di_f_string_dynamic_prepend_assure_nulless_ -#define _di_f_string_dynamic_prepend_nulless_ -#define _di_f_string_dynamics_append_ -#define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamic_seek_line_ -#define _di_f_string_dynamic_seek_line_to_ -#define _di_f_string_dynamic_seek_to_ -#define _di_f_string_dynamicss_append_ -#define _di_f_string_dynamicss_append_all_ -#define _di_f_string_dynamicss_t_ -//#define _di_f_string_dynamics_t_ -//#define _di_f_string_dynamic_t_ -#define _di_f_string_dynamic_terminate_ -//#define _di_f_string_dynamic_terminate_after_ -//#define _di_f_string_empty_s_ -//#define _di_f_string_eol_s_ -#define _di_f_string_map_multis_adjust_ -#define _di_f_string_map_multis_append_ -#define _di_f_string_map_multis_append_all_ -#define _di_f_string_map_multis_decimate_by_ -#define _di_f_string_map_multis_decrease_by_ -#define _di_f_string_map_multis_increase_ -#define _di_f_string_map_multis_increase_by_ -#define _di_f_string_map_multis_resize_ -#define _di_f_string_map_multiss_adjust_ -#define _di_f_string_map_multiss_append_ -#define _di_f_string_map_multiss_append_all_ -#define _di_f_string_map_multiss_decimate_by_ -#define _di_f_string_map_multiss_decrease_by_ -#define _di_f_string_map_multiss_increase_ -#define _di_f_string_map_multiss_increase_by_ -#define _di_f_string_map_multiss_resize_ -//#define _di_f_string_map_multiss_t_ -//#define _di_f_string_map_multis_t_ -//#define _di_f_string_map_multi_t_ -#define _di_f_string_maps_adjust_ -#define _di_f_string_maps_append_ -#define _di_f_string_maps_append_all_ -#define _di_f_string_maps_decimate_by_ -#define _di_f_string_maps_decrease_by_ -#define _di_f_string_maps_increase_ -#define _di_f_string_maps_increase_by_ -#define _di_f_string_maps_resize_ -#define _di_f_string_mapss_adjust_ -#define _di_f_string_mapss_append_ -#define _di_f_string_mapss_append_all_ -#define _di_f_string_mapss_decimate_by_ -#define _di_f_string_mapss_decrease_by_ -#define _di_f_string_mapss_increase_ -#define _di_f_string_mapss_increase_by_ -#define _di_f_string_mapss_resize_ -//#define _di_f_string_mapss_t_ -//#define _di_f_string_maps_t_ -//#define _di_f_string_map_t_ -#define _di_f_string_mash_ -#define _di_f_string_mash_nulless_ -#define _di_f_string_mish_ -#define _di_f_string_mish_nulless_ -#define _di_f_string_null_s_ -#define _di_f_string_placeholder_s_ -#define _di_f_string_prepend_ -#define _di_f_string_prepend_assure_ -#define _di_f_string_prepend_assure_nulless_ -#define _di_f_string_prepend_nulless_ -#define _di_f_string_quantitys_adjust_ -#define _di_f_string_quantitys_append_ -#define _di_f_string_quantitys_append_all_ -#define _di_f_string_quantitys_decimate_by_ -#define _di_f_string_quantitys_decrease_by_ -#define _di_f_string_quantitys_increase_ -#define _di_f_string_quantitys_increase_by_ -#define _di_f_string_quantitys_resize_ -#define _di_f_string_quantityss_adjust_ -#define _di_f_string_quantityss_append_ -#define _di_f_string_quantityss_append_all_ -#define _di_f_string_quantityss_decimate_by_ -#define _di_f_string_quantityss_decrease_by_ -#define _di_f_string_quantityss_increase_ -#define _di_f_string_quantityss_increase_by_ -#define _di_f_string_quantityss_resize_ -//#define _di_f_string_quantityss_t_ -//#define _di_f_string_quantitys_t_ -//#define _di_f_string_quantity_t_ -#define _di_f_string_ranges_adjust_ -#define _di_f_string_ranges_append_ -#define _di_f_string_ranges_append_all_ -#define _di_f_string_ranges_decimate_by_ -#define _di_f_string_ranges_decrease_by_ -#define _di_f_string_ranges_increase_ -#define _di_f_string_ranges_increase_by_ -#define _di_f_string_ranges_resize_ -#define _di_f_string_rangess_adjust_ -#define _di_f_string_rangess_append_ -#define _di_f_string_rangess_append_all_ -#define _di_f_string_rangess_decimate_by_ -#define _di_f_string_rangess_decrease_by_ -#define _di_f_string_rangess_increase_ -#define _di_f_string_rangess_increase_by_ -#define _di_f_string_rangess_resize_ -//#define _di_f_string_rangess_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_ -//#define _di_f_string_space_s_ -#define _di_f_string_staticss_t_ -//#define _di_f_string_statics_t_ -//#define _di_f_string_static_t_ -//#define _di_f_string_t_ -#define _di_f_string_triples_adjust_ -#define _di_f_string_triples_append_ -#define _di_f_string_triples_append_all_ -#define _di_f_string_triples_decimate_by_ -#define _di_f_string_triples_decrease_by_ -#define _di_f_string_triples_increase_ -#define _di_f_string_triples_increase_by_ -#define _di_f_string_triples_resize_ -#define _di_f_string_tripless_adjust_ -#define _di_f_string_tripless_append_ -#define _di_f_string_tripless_append_all_ -#define _di_f_string_tripless_decimate_by_ -#define _di_f_string_tripless_decrease_by_ -#define _di_f_string_tripless_increase_ -#define _di_f_string_tripless_increase_by_ -#define _di_f_string_tripless_resize_ -//#define _di_f_string_tripless_t_ -//#define _di_f_string_triples_t_ -//#define _di_f_string_triple_t_ - -#define _di_f_cells_adjust_ -#define _di_f_cells_append_ -#define _di_f_cells_append_all_ -#define _di_f_cells_decimate_by_ -#define _di_f_cells_decrease_by_ -#define _di_f_cells_increase_ -#define _di_f_cells_increase_by_ -#define _di_f_cells_resize_ -#define _di_f_cellss_adjust_ -#define _di_f_cellss_append_ -#define _di_f_cellss_append_all_ -#define _di_f_cellss_decimate_by_ -#define _di_f_cellss_decrease_by_ -#define _di_f_cellss_increase_ -#define _di_f_cellss_increase_by_ -#define _di_f_cellss_resize_ -#define _di_f_cellss_t_ -#define _di_f_cells_t_ -#define _di_f_fll_ids_adjust_ -#define _di_f_fll_ids_append_ -#define _di_f_fll_ids_append_all_ -#define _di_f_fll_ids_decimate_by_ -#define _di_f_fll_ids_decrease_by_ -#define _di_f_fll_ids_increase_ -#define _di_f_fll_ids_increase_by_ -#define _di_f_fll_ids_resize_ -#define _di_f_fll_idss_adjust_ -#define _di_f_fll_idss_append_ -#define _di_f_fll_idss_append_all_ -#define _di_f_fll_idss_decimate_by_ -#define _di_f_fll_idss_decrease_by_ -#define _di_f_fll_idss_increase_ -#define _di_f_fll_idss_increase_by_ -#define _di_f_fll_idss_resize_ -#define _di_f_fll_idss_t_ -#define _di_f_fll_ids_t_ -#define _di_f_int128s_adjust_ -#define _di_f_int128s_append_ -#define _di_f_int128s_append_all_ -#define _di_f_int128s_decimate_by_ -#define _di_f_int128s_decrease_by_ -#define _di_f_int128s_increase_ -#define _di_f_int128s_increase_by_ -#define _di_f_int128s_resize_ -#define _di_f_int128ss_adjust_ -#define _di_f_int128ss_append_ -#define _di_f_int128ss_append_all_ -#define _di_f_int128ss_decimate_by_ -#define _di_f_int128ss_decrease_by_ -#define _di_f_int128ss_increase_ -#define _di_f_int128ss_increase_by_ -#define _di_f_int128ss_resize_ -#define _di_f_int128ss_t_ -#define _di_f_int128s_t_ -#define _di_f_int16s_adjust_ -#define _di_f_int16s_append_ -#define _di_f_int16s_append_all_ -#define _di_f_int16s_decimate_by_ -#define _di_f_int16s_decrease_by_ -#define _di_f_int16s_increase_ -#define _di_f_int16s_increase_by_ -#define _di_f_int16s_resize_ -#define _di_f_int16ss_adjust_ -#define _di_f_int16ss_append_ -#define _di_f_int16ss_append_all_ -#define _di_f_int16ss_decimate_by_ -#define _di_f_int16ss_decrease_by_ -#define _di_f_int16ss_increase_ -#define _di_f_int16ss_increase_by_ -#define _di_f_int16ss_resize_ -#define _di_f_int16ss_t_ -#define _di_f_int16s_t_ -#define _di_f_int32s_adjust_ -#define _di_f_int32s_append_ -#define _di_f_int32s_append_all_ -#define _di_f_int32s_decimate_by_ -#define _di_f_int32s_decrease_by_ -#define _di_f_int32s_increase_ -#define _di_f_int32s_increase_by_ -#define _di_f_int32s_resize_ -#define _di_f_int32ss_adjust_ -#define _di_f_int32ss_append_ -#define _di_f_int32ss_append_all_ -#define _di_f_int32ss_decimate_by_ -#define _di_f_int32ss_decrease_by_ -#define _di_f_int32ss_increase_ -#define _di_f_int32ss_increase_by_ -#define _di_f_int32ss_resize_ -#define _di_f_int32ss_t_ -#define _di_f_int32s_t_ -#define _di_f_int64s_adjust_ -#define _di_f_int64s_append_ -#define _di_f_int64s_append_all_ -#define _di_f_int64s_decimate_by_ -#define _di_f_int64s_decrease_by_ -#define _di_f_int64s_increase_ -#define _di_f_int64s_increase_by_ -#define _di_f_int64s_resize_ -#define _di_f_int64ss_adjust_ -#define _di_f_int64ss_append_ -#define _di_f_int64ss_append_all_ -#define _di_f_int64ss_decimate_by_ -#define _di_f_int64ss_decrease_by_ -#define _di_f_int64ss_increase_ -#define _di_f_int64ss_increase_by_ -#define _di_f_int64ss_resize_ -#define _di_f_int64ss_t_ -#define _di_f_int64s_t_ -#define _di_f_int8s_adjust_ -#define _di_f_int8s_append_ -#define _di_f_int8s_append_all_ -#define _di_f_int8s_decimate_by_ -#define _di_f_int8s_decrease_by_ -#define _di_f_int8s_increase_ -#define _di_f_int8s_increase_by_ -#define _di_f_int8s_resize_ -#define _di_f_int8ss_adjust_ -#define _di_f_int8ss_append_ -#define _di_f_int8ss_append_all_ -#define _di_f_int8ss_decimate_by_ -#define _di_f_int8ss_decrease_by_ -#define _di_f_int8ss_increase_ -#define _di_f_int8ss_increase_by_ -#define _di_f_int8ss_resize_ -#define _di_f_int8ss_t_ -#define _di_f_int8_t_ -#define _di_f_states_adjust_ -#define _di_f_states_append_ -#define _di_f_states_append_all_ -#define _di_f_states_decimate_by_ -#define _di_f_states_decrease_by_ -#define _di_f_states_increase_ -#define _di_f_states_increase_by_ -#define _di_f_states_resize_ -#define _di_f_statess_adjust_ -#define _di_f_statess_append_ -#define _di_f_statess_append_all_ -#define _di_f_statess_decimate_by_ -#define _di_f_statess_decrease_by_ -#define _di_f_statess_increase_ -#define _di_f_statess_increase_by_ -#define _di_f_statess_resize_ -#define _di_f_statess_t_ -#define _di_f_states_t_ -#define _di_f_statuss_adjust_ -#define _di_f_statuss_append_ -#define _di_f_statuss_append_all_ -#define _di_f_statuss_decimate_by_ -#define _di_f_statuss_decrease_by_ -#define _di_f_statuss_increase_ -#define _di_f_statuss_increase_by_ -#define _di_f_statuss_resize_ -#define _di_f_statusss_adjust_ -#define _di_f_statusss_append_ -#define _di_f_statusss_append_all_ -#define _di_f_statusss_decimate_by_ -#define _di_f_statusss_decrease_by_ -#define _di_f_statusss_increase_ -#define _di_f_statusss_increase_by_ -#define _di_f_statusss_resize_ -#define _di_f_statusss_t_ -#define _di_f_statuss_t_ -#define _di_f_uint128s_adjust_ -#define _di_f_uint128s_append_ -#define _di_f_uint128s_append_all_ -#define _di_f_uint128s_decimate_by_ -#define _di_f_uint128s_decrease_by_ -#define _di_f_uint128s_increase_ -#define _di_f_uint128s_increase_by_ -#define _di_f_uint128s_resize_ -#define _di_f_uint128ss_adjust_ -#define _di_f_uint128ss_append_ -#define _di_f_uint128ss_append_all_ -#define _di_f_uint128ss_decimate_by_ -#define _di_f_uint128ss_decrease_by_ -#define _di_f_uint128ss_increase_ -#define _di_f_uint128ss_increase_by_ -#define _di_f_uint128ss_resize_ -#define _di_f_uint128ss_t_ -#define _di_f_uint128s_t_ -#define _di_f_uint16s_adjust_ -#define _di_f_uint16s_append_ -#define _di_f_uint16s_append_all_ -#define _di_f_uint16s_decimate_by_ -#define _di_f_uint16s_decrease_by_ -#define _di_f_uint16s_increase_ -#define _di_f_uint16s_increase_by_ -#define _di_f_uint16s_resize_ -#define _di_f_uint16ss_adjust_ -#define _di_f_uint16ss_append_ -#define _di_f_uint16ss_append_all_ -#define _di_f_uint16ss_decimate_by_ -#define _di_f_uint16ss_decrease_by_ -#define _di_f_uint16ss_increase_ -#define _di_f_uint16ss_increase_by_ -#define _di_f_uint16ss_resize_ -#define _di_f_uint16ss_t_ -#define _di_f_uint16s_t_ -#define _di_f_uint32s_adjust_ -#define _di_f_uint32s_append_ -#define _di_f_uint32s_append_all_ -#define _di_f_uint32s_decimate_by_ -#define _di_f_uint32s_decrease_by_ -#define _di_f_uint32s_increase_ -#define _di_f_uint32s_increase_by_ -#define _di_f_uint32s_resize_ -#define _di_f_uint32ss_adjust_ -#define _di_f_uint32ss_append_ -#define _di_f_uint32ss_append_all_ -#define _di_f_uint32ss_decimate_by_ -#define _di_f_uint32ss_decrease_by_ -#define _di_f_uint32ss_increase_ -#define _di_f_uint32ss_increase_by_ -#define _di_f_uint32ss_resize_ -#define _di_f_uint32ss_t_ -#define _di_f_uint32s_t_ -#define _di_f_uint64s_adjust_ -#define _di_f_uint64s_append_ -#define _di_f_uint64s_append_all_ -#define _di_f_uint64s_decimate_by_ -#define _di_f_uint64s_decrease_by_ -#define _di_f_uint64s_increase_ -#define _di_f_uint64s_increase_by_ -#define _di_f_uint64s_resize_ -#define _di_f_uint64ss_adjust_ -#define _di_f_uint64ss_append_ -#define _di_f_uint64ss_append_all_ -#define _di_f_uint64ss_decimate_by_ -#define _di_f_uint64ss_decrease_by_ -#define _di_f_uint64ss_increase_ -#define _di_f_uint64ss_increase_by_ -#define _di_f_uint64ss_resize_ -#define _di_f_uint64ss_t_ -#define _di_f_uint64s_t_ -#define _di_f_uint8s_adjust_ -#define _di_f_uint8s_append_ -#define _di_f_uint8s_append_all_ -#define _di_f_uint8s_decimate_by_ -#define _di_f_uint8s_decrease_by_ -#define _di_f_uint8s_increase_ -#define _di_f_uint8s_increase_by_ -#define _di_f_uint8s_resize_ -#define _di_f_uint8ss_adjust_ -#define _di_f_uint8ss_append_ -#define _di_f_uint8ss_append_all_ -#define _di_f_uint8ss_decimate_by_ -#define _di_f_uint8ss_decrease_by_ -#define _di_f_uint8ss_increase_ -#define _di_f_uint8ss_increase_by_ -#define _di_f_uint8ss_resize_ -#define _di_f_uint8ss_t_ -#define _di_f_uint8s_t_ - -#define _di_f_utf_buffer_decrement_ -#define _di_f_utf_buffer_increment_ -//#define _di_f_utf_byte_d_ -#define _di_f_utf_character_is_ -#define _di_f_utf_character_is_alphabetic_ -#define _di_f_utf_character_is_alphabetic_digit_ -#define _di_f_utf_character_is_alphabetic_numeric_ -#define _di_f_utf_character_is_ascii_ -//#define _di_f_utf_character_is_combining_ -//#define _di_f_utf_character_is_control_ -#define _di_f_utf_character_is_control_code_ -#define _di_f_utf_character_is_control_format_ -#define _di_f_utf_character_is_control_picture_ -#define _di_f_utf_character_is_digit_ -#define _di_f_utf_character_is_emoji_ -#define _di_f_utf_character_is_fragment_ -#define _di_f_utf_character_is_graph_ -#define _di_f_utf_character_is_numeric_ -#define _di_f_utf_character_is_phonetic_ -#define _di_f_utf_character_is_private_ -#define _di_f_utf_character_is_punctuation_ -#define _di_f_utf_character_is_subscript_ -#define _di_f_utf_character_is_superscript_ -#define _di_f_utf_character_is_symbol_ -//#define _di_f_utf_character_is_unassigned_ -//#define _di_f_utf_character_is_valid_ -//#define _di_f_utf_character_is_whitespace_ -#define _di_f_utf_character_is_whitespace_modifier_ -#define _di_f_utf_character_is_whitespace_other_ -#define _di_f_utf_character_is_whitespace_zero_width_ -//#define _di_f_utf_character_is_wide_ -#define _di_f_utf_character_is_word_ -#define _di_f_utf_character_is_word_dash_ -#define _di_f_utf_character_is_word_dash_plus_ -//#define _di_f_utf_character_is_zero_width_ -#define _di_f_utf_character_unicode_from_ -#define _di_f_utf_character_unicode_string_to_ -#define _di_f_utf_character_unicode_to_ -//#define _di_f_utf_char_t_ -#define _di_f_utf_char_s_ -#define _di_f_utf_char_to_char_ -//#define _di_f_utf_char_to_character_ -#define _di_f_utf_is_ -#define _di_f_utf_is_alphabetic_ -#define _di_f_utf_is_alphabetic_digit_ -#define _di_f_utf_is_alphabetic_numeric_ -#define _di_f_utf_is_ascii_ -//#define _di_f_utf_is_combining_ -//#define _di_f_utf_is_control_ -#define _di_f_utf_is_control_code_ -#define _di_f_utf_is_control_format_ -#define _di_f_utf_is_control_picture_ -#define _di_f_utf_is_digit_ -#define _di_f_utf_is_emoji_ -#define _di_f_utf_is_fragment_ -#define _di_f_utf_is_graph_ -#define _di_f_utf_is_numeric_ -#define _di_f_utf_is_phonetic_ -#define _di_f_utf_is_private_ -#define _di_f_utf_is_punctuation_ -#define _di_f_utf_is_subscript_ -#define _di_f_utf_is_superscript_ -#define _di_f_utf_is_symbol_ -#define _di_f_utf_is_unassigned_ -//#define _di_f_utf_is_valid_ -//#define _di_f_utf_is_whitespace_ -#define _di_f_utf_is_whitespace_modifier_ -#define _di_f_utf_is_whitespace_other_ -#define _di_f_utf_is_whitespace_zero_width_ -#define _di_f_utf_is_wide_ -#define _di_f_utf_is_word_ -#define _di_f_utf_is_word_dash_ -#define _di_f_utf_is_word_dash_plus_ -#define _di_f_utf_is_zero_width_ -#define _di_f_utf_space_s_ -#define _di_f_utf_string_append_ -#define _di_f_utf_string_append_assure_ -#define _di_f_utf_string_append_assure_nulless_ -#define _di_f_utf_string_append_nulless_ -#define _di_f_utf_string_dynamic_adjust_ -#define _di_f_utf_string_dynamic_append_ -#define _di_f_utf_string_dynamic_append_assure_ -#define _di_f_utf_string_dynamic_append_assure_nulless_ -#define _di_f_utf_string_dynamic_append_nulless_ -#define _di_f_utf_string_dynamic_decimate_by_ -#define _di_f_utf_string_dynamic_decrease_by_ -#define _di_f_utf_string_dynamic_increase_ -#define _di_f_utf_string_dynamic_increase_by_ -#define _di_f_utf_string_dynamic_mash_ -#define _di_f_utf_string_dynamic_mash_nulless_ -#define _di_f_utf_string_dynamic_mish_ -#define _di_f_utf_string_dynamic_mish_nulless_ -#define _di_f_utf_string_dynamic_partial_append_ -#define _di_f_utf_string_dynamic_partial_append_assure_ -#define _di_f_utf_string_dynamic_partial_append_assure_nulless_ -#define _di_f_utf_string_dynamic_partial_append_nulless_ -#define _di_f_utf_string_dynamic_partial_mash_ -#define _di_f_utf_string_dynamic_partial_mash_nulless_ -#define _di_f_utf_string_dynamic_partial_mish_ -#define _di_f_utf_string_dynamic_partial_mish_nulless_ -#define _di_f_utf_string_dynamic_partial_prepend_ -#define _di_f_utf_string_dynamic_partial_prepend_assure_ -#define _di_f_utf_string_dynamic_partial_prepend_assure_nulless_ -#define _di_f_utf_string_dynamic_partial_prepend_nulless_ -#define _di_f_utf_string_dynamic_prepend_ -#define _di_f_utf_string_dynamic_prepend_assure_ -#define _di_f_utf_string_dynamic_prepend_assure_nulless_ -#define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamics_append_ -#define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamic_seek_line_ -#define _di_f_utf_string_dynamic_seek_line_to_ -#define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamicss_append_ -#define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_t_ -//#define _di_f_utf_string_dynamics_t_ -//#define _di_f_utf_string_dynamic_t_ -#define _di_f_utf_string_dynamic_terminate_ -//#define _di_f_utf_string_dynamic_terminate_after_ -#define _di_f_utf_string_empty_s_ -#define _di_f_utf_string_map_multis_adjust_ -#define _di_f_utf_string_map_multis_append_ -#define _di_f_utf_string_map_multis_append_all_ -#define _di_f_utf_string_map_multis_decimate_by_ -#define _di_f_utf_string_map_multis_decrease_by_ -#define _di_f_utf_string_map_multis_increase_ -#define _di_f_utf_string_map_multis_increase_by_ -//#define _di_f_utf_string_map_multis_resize_ -#define _di_f_utf_string_map_multiss_adjust_ -#define _di_f_utf_string_map_multiss_append_ -#define _di_f_utf_string_map_multiss_append_all_ -#define _di_f_utf_string_map_multiss_decimate_by_ -#define _di_f_utf_string_map_multiss_decrease_by_ -#define _di_f_utf_string_map_multiss_increase_ -#define _di_f_utf_string_map_multiss_increase_by_ -#define _di_f_utf_string_map_multiss_resize_ -//#define _di_f_utf_string_map_multiss_t_ -//#define _di_f_utf_string_map_multis_t_ -//#define _di_f_utf_string_map_multi_t_ -#define _di_f_utf_string_maps_adjust_ -#define _di_f_utf_string_maps_append_ -#define _di_f_utf_string_maps_append_all_ -#define _di_f_utf_string_maps_decimate_by_ -#define _di_f_utf_string_maps_decrease_by_ -#define _di_f_utf_string_maps_increase_ -#define _di_f_utf_string_maps_increase_by_ -#define _di_f_utf_string_maps_resize_ -#define _di_f_utf_string_mapss_adjust_ -#define _di_f_utf_string_mapss_append_ -#define _di_f_utf_string_mapss_append_all_ -#define _di_f_utf_string_mapss_decimate_by_ -#define _di_f_utf_string_mapss_decrease_by_ -#define _di_f_utf_string_mapss_increase_ -#define _di_f_utf_string_mapss_increase_by_ -#define _di_f_utf_string_mapss_resize_ -//#define _di_f_utf_string_mapss_t_ -//#define _di_f_utf_string_maps_t_ -//#define _di_f_utf_string_map_t_ -#define _di_f_utf_string_mash_ -#define _di_f_utf_string_mash_nulless_ -#define _di_f_utf_string_mish_ -#define _di_f_utf_string_mish_nulless_ -#define _di_f_utf_string_prepend_ -#define _di_f_utf_string_prepend_assure_ -#define _di_f_utf_string_prepend_assure_nulless_ -#define _di_f_utf_string_prepend_nulless_ -#define _di_f_utf_string_seek_line_ -#define _di_f_utf_string_seek_line_to_ -#define _di_f_utf_string_seek_to_ -#define _di_f_utf_string_staticss_t_ -//#define _di_f_utf_string_statics_t_ -//#define _di_f_utf_string_static_t_ -//#define _di_f_utf_string_t_ -#define _di_f_utf_string_triples_adjust_ -#define _di_f_utf_string_triples_append_ -#define _di_f_utf_string_triples_append_all_ -#define _di_f_utf_string_triples_decimate_by_ -#define _di_f_utf_string_triples_decrease_by_ -#define _di_f_utf_string_triples_increase_ -#define _di_f_utf_string_triples_increase_by_ -#define _di_f_utf_string_triples_resize_ -#define _di_f_utf_string_tripless_adjust_ -#define _di_f_utf_string_tripless_append_ -#define _di_f_utf_string_tripless_append_all_ -#define _di_f_utf_string_tripless_decimate_by_ -#define _di_f_utf_string_tripless_decrease_by_ -#define _di_f_utf_string_tripless_increase_ -#define _di_f_utf_string_tripless_increase_by_ -#define _di_f_utf_string_tripless_resize_ -//#define _di_f_utf_string_tripless_t_ -//#define _di_f_utf_string_triples_t_ -//#define _di_f_utf_string_triple_t_ -#define _di_f_utf_substitute_s_ -#define _di_f_utf_unicode_from_ -#define _di_f_utf_unicode_string_to_ -#define _di_f_utf_unicode_to_ -#define _di_f_utf_width_e_ - -//#define _di_fl_conversion_data_flag_d_ -//#define _di_fl_conversion_data_t_ -//#define _di_fl_conversion_data_c_ -#define _di_fl_conversion_dynamic_partial_to_signed_ -#define _di_fl_conversion_dynamic_partial_to_signed_detect_ -#define _di_fl_conversion_dynamic_partial_to_unsigned_ -#define _di_fl_conversion_dynamic_partial_to_unsigned_detect_ -#define _di_fl_conversion_dynamic_to_signed_ -#define _di_fl_conversion_dynamic_to_signed_detect_ -#define _di_fl_conversion_dynamic_to_unsigned_ -//#define _di_fl_conversion_dynamic_to_unsigned_detect_ - -//#define _di_fl_print_format_ -#define _di_fl_print_format_convert_ -//#define _di_fl_print_string_va_ -//#define _di_fl_print_t_ -#define _di_fl_print_trim_ -#define _di_fl_print_trim_dynamic_ -#define _di_fl_print_trim_dynamic_partial_ -#define _di_fl_print_trim_dynamic_partial_raw_ -#define _di_fl_print_trim_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_dynamic_partial_safely_ -#define _di_fl_print_trim_dynamic_raw_ -#define _di_fl_print_trim_dynamic_raw_safely_ -#define _di_fl_print_trim_dynamic_safely_ -#define _di_fl_print_trim_except_ -#define _di_fl_print_trim_except_dynamic_ -#define _di_fl_print_trim_except_dynamic_partial_ -#define _di_fl_print_trim_except_dynamic_partial_raw_ -#define _di_fl_print_trim_except_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_except_dynamic_partial_safely_ -#define _di_fl_print_trim_except_dynamic_raw_ -#define _di_fl_print_trim_except_dynamic_raw_safely_ -#define _di_fl_print_trim_except_dynamic_safely_ -#define _di_fl_print_trim_except_in_ -#define _di_fl_print_trim_except_in_dynamic_ -#define _di_fl_print_trim_except_in_dynamic_partial_ -#define _di_fl_print_trim_except_in_dynamic_partial_raw_ -#define _di_fl_print_trim_except_in_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_except_in_dynamic_partial_safely_ -#define _di_fl_print_trim_except_in_dynamic_raw_ -#define _di_fl_print_trim_except_in_dynamic_raw_safely_ -#define _di_fl_print_trim_except_in_dynamic_safely_ -#define _di_fl_print_trim_except_in_raw_ -#define _di_fl_print_trim_except_in_raw_safely_ -#define _di_fl_print_trim_except_in_safely_ -#define _di_fl_print_trim_except_raw_ -#define _di_fl_print_trim_except_raw_safely_ -#define _di_fl_print_trim_except_safely_ -#define _di_fl_print_trim_raw_ -#define _di_fl_print_trim_raw_safely_ -#define _di_fl_print_trim_safely_ - -#define _di_fl_string_compare_ -#define _di_fl_string_compare_except_ -#define _di_fl_string_compare_except_trim_ -#define _di_fl_string_compare_trim_ -#define _di_fl_string_dynamic_compare_ -#define _di_fl_string_dynamic_compare_except_ -#define _di_fl_string_dynamic_compare_except_string_ -#define _di_fl_string_dynamic_compare_except_trim_ -#define _di_fl_string_dynamic_compare_except_trim_string_ -#define _di_fl_string_dynamic_compare_string_ -#define _di_fl_string_dynamic_compare_trim_ -#define _di_fl_string_dynamic_compare_trim_string_ -#define _di_fl_string_dynamic_partial_compare_ -#define _di_fl_string_dynamic_partial_compare_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_ -#define _di_fl_string_dynamic_partial_compare_except_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_string_ -#define _di_fl_string_dynamic_partial_compare_except_trim_ -#define _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_trim_string_ -#define _di_fl_string_dynamic_partial_compare_string_ -#define _di_fl_string_dynamic_partial_compare_trim_ -#define _di_fl_string_dynamic_partial_compare_trim_dynamic_ -#define _di_fl_string_dynamic_partial_compare_trim_string_ -#define _di_fl_string_dynamic_partial_fll_identify_ -#define _di_fl_string_dynamic_partial_rip_ -#define _di_fl_string_dynamic_partial_rip_nulless_ -#define _di_fl_string_dynamic_rip_ -#define _di_fl_string_dynamic_rip_nulless_ -#define _di_fl_string_dynamic_seek_line_to_utf_character_ -#define _di_fl_string_dynamic_seek_line_until_graph_ -#define _di_fl_string_dynamic_seek_line_until_graph_non_ -#define _di_fl_string_dynamic_seek_to_utf_character_ -#define _di_fl_string_rip_ -#define _di_fl_string_rip_nulless_ -#define _di_fl_string_seek_line_to_utf_character_ -#define _di_fl_string_seek_line_until_graph_ -#define _di_fl_string_seek_line_until_graph_non_ -#define _di_fl_string_seek_to_utf_character_ - -//#define _di_fll_error_file_print_ -//#define _di_fll_error_file_type_e_ -#define _di_fll_error_parameter_integer_print_ -//#define _di_fll_error_print_ - -#define _di_fll_print_ -#define _di_fll_print_character_ -#define _di_fll_print_character_safely_ -#define _di_fll_print_dynamic_ -#define _di_fll_print_dynamic_partial_ -#define _di_fll_print_dynamic_partial_raw_ -#define _di_fll_print_dynamic_partial_raw_safely_ -#define _di_fll_print_dynamic_partial_safely_ -//#define _di_fll_print_dynamic_raw_ -#define _di_fll_print_dynamic_raw_safely_ -#define _di_fll_print_dynamic_safely_ -#define _di_fll_print_except_ -#define _di_fll_print_except_dynamic_ -#define _di_fll_print_except_dynamic_partial_ -#define _di_fll_print_except_dynamic_partial_raw_ -#define _di_fll_print_except_dynamic_partial_raw_safely_ -#define _di_fll_print_except_dynamic_partial_safely_ -#define _di_fll_print_except_dynamic_raw_ -#define _di_fll_print_except_dynamic_raw_safely_ -#define _di_fll_print_except_dynamic_safely_ -#define _di_fll_print_except_in_ -#define _di_fll_print_except_in_dynamic_ -#define _di_fll_print_except_in_dynamic_partial_ -#define _di_fll_print_except_in_dynamic_partial_raw_ -#define _di_fll_print_except_in_dynamic_partial_raw_safely_ -#define _di_fll_print_except_in_dynamic_partial_safely_ -#define _di_fll_print_except_in_dynamic_raw_ -#define _di_fll_print_except_in_dynamic_raw_safely_ -#define _di_fll_print_except_in_dynamic_safely_ -#define _di_fll_print_except_in_raw_ -#define _di_fll_print_except_in_raw_safely_ -#define _di_fll_print_except_in_safely_ -#define _di_fll_print_except_raw_ -#define _di_fll_print_except_raw_safely_ -#define _di_fll_print_except_safely_ -//#define _di_fll_print_format_ -#define _di_fll_print_format_convert_ -#define _di_fll_print_raw_ -#define _di_fll_print_raw_safely_ -#define _di_fll_print_raw_terminated_ -#define _di_fll_print_safely_ -#define _di_fll_print_safely_terminated_ -#define _di_fll_print_string_va_ -#define _di_fll_print_terminated_ -#define _di_fll_print_trim_ -#define _di_fll_print_trim_dynamic_ -#define _di_fll_print_trim_dynamic_partial_ -#define _di_fll_print_trim_dynamic_partial_raw_ -#define _di_fll_print_trim_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_dynamic_partial_safely_ -#define _di_fll_print_trim_dynamic_raw_ -#define _di_fll_print_trim_dynamic_raw_safely_ -#define _di_fll_print_trim_dynamic_safely_ -#define _di_fll_print_trim_except_ -#define _di_fll_print_trim_except_dynamic_ -#define _di_fll_print_trim_except_dynamic_partial_ -#define _di_fll_print_trim_except_dynamic_partial_raw_ -#define _di_fll_print_trim_except_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_except_dynamic_partial_safely_ -#define _di_fll_print_trim_except_dynamic_raw_ -#define _di_fll_print_trim_except_dynamic_raw_safely_ -#define _di_fll_print_trim_except_dynamic_safely_ -#define _di_fll_print_trim_except_in_ -#define _di_fll_print_trim_except_in_dynamic_ -#define _di_fll_print_trim_except_in_dynamic_partial_ -#define _di_fll_print_trim_except_in_dynamic_partial_raw_ -#define _di_fll_print_trim_except_in_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_except_in_dynamic_partial_safely_ -#define _di_fll_print_trim_except_in_dynamic_raw_ -#define _di_fll_print_trim_except_in_dynamic_raw_safely_ -#define _di_fll_print_trim_except_in_dynamic_safely_ -#define _di_fll_print_trim_except_in_raw_ -#define _di_fll_print_trim_except_in_raw_safely_ -#define _di_fll_print_trim_except_in_safely_ -#define _di_fll_print_trim_except_raw_ -#define _di_fll_print_trim_except_raw_safely_ -#define _di_fll_print_trim_except_safely_ -#define _di_fll_print_trim_raw_ -#define _di_fll_print_trim_raw_safely_ -#define _di_fll_print_trim_safely_ - -//#define _di_fll_program_data_delete_ -#define _di_fll_program_data_destroy_ -//#define _di_fll_program_data_t_ -#define _di_fll_program_parameter_additional_append_ -#define _di_fll_program_parameter_additional_mash_ -#define _di_fll_program_parameter_additional_rip_ -#define _di_fll_program_parameter_additional_rip_mash_ -#define _di_fll_program_parameter_long_print_cannot_use_with_ -//#define _di_fll_program_parameter_process_ -//#define _di_fll_program_parameter_process_empty_ -//#define _di_fll_program_parameter_s_ -//#define _di_fll_program_print_help_header_ -//#define _di_fll_program_print_help_option_ -//#define _di_fll_program_print_help_option_long_ -#define _di_fll_program_print_help_option_other_ -//#define _di_fll_program_print_help_usage_ -//#define _di_fll_program_print_version_ -//#define _di_fll_program_standard_setdown_ -//#define _di_fll_program_standard_setup_ -//#define _di_fll_program_standard_signal_received_ -#define _di_fll_program_standard_signal_state_ +// A config.h file for defining all code being disabled for compiling the stand alone Featureless Make. +// To assist in building this file use (may need to omit --defined-only): "nm --defined-only -f p programs/shared/fake | grep -oP '^(f|fl|fll)_[^\s]+'". +// To get the list of all possible functions, use something like: "grep -horP '\b_di_f_\w*\b' level_0/f_color/". +// +// Note that some special defines may need to be manually added, such as: +// #define _di_private_inline_f_print_to_error_ +// #define _di_private_inline_private_f_print_to_error_ +// +// Example: +// echo > /tmp/all.txt +// for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_signal f_socket f_thread f_time ; do grep -horP '\b_di_f_\w*\b' level_0/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_0/$i/c >> /tmp/all.txt ; done +// for i in fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print ; do grep -horP '\b_di_fl_\w*\b' level_1/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_1/$i/c >> /tmp/all.txt ; done +// for i in fll_error fll_execute fll_file fll_fss fll_print fll_program ; do grep -horP '\b_di_fll_\w*\b' level_2/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_2/$i/c >> /tmp/all.txt ; done +// sort /tmp/all.txt | uniq | sed -e 's|^_|#define &|g' > /tmp/sorted.txt +// echo "#define _di_private_inline_f_print_to_error_" >> /tmp/sorted.txt +// echo "#define _di_private_inline_private_f_print_to_error_" >> /tmp/sorted.txt diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index 779efde..dd517cb 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -193,7 +193,7 @@ #define _di_f_compare_utf_except_ #define _di_f_compare_utf_except_trim_ #define _di_f_compare_utf_trim_ -#define _di_f_compare_utf_utf_dynamic_partial_trim_ +#define _di_f_compare_utf_utf_string_dynamic_partial_trim_ //#define _di_f_console_arguments_t_ #define _di_f_console_environment_process_ //#define _di_f_console_flag_e_ @@ -541,33 +541,17 @@ //#define _di_f_fss_item_t_ #define _di_f_fss_named_delete_ #define _di_f_fss_named_destroy_ -#define _di_f_fss_named_increase_ -#define _di_f_fss_named_increase_by_ -#define _di_f_fss_nameds_adjust_ -#define _di_f_fss_nameds_decimate_by_ -#define _di_f_fss_nameds_decrease_by_ //#define _di_f_fss_nameds_delete_callback_ #define _di_f_fss_nameds_destroy_callback_ -#define _di_f_fss_nameds_resize_ #define _di_f_fss_namedss_delete_callback_ #define _di_f_fss_namedss_destroy_callback_ #define _di_f_fss_namedss_t_ //#define _di_f_fss_nameds_t_ //#define _di_f_fss_named_t_ -#define _di_f_fss_nest_adjust_ -#define _di_f_fss_nest_decimate_by_ -#define _di_f_fss_nest_decrease_by_ #define _di_f_fss_nest_delete_ #define _di_f_fss_nest_destroy_ -#define _di_f_fss_nest_resize_ -#define _di_f_fss_nests_adjust_ -#define _di_f_fss_nests_decimate_by_ -#define _di_f_fss_nests_decrease_by_ #define _di_f_fss_nests_delete_callback_ #define _di_f_fss_nests_destroy_callback_ -#define _di_f_fss_nests_increase_ -#define _di_f_fss_nests_increase_by_ -#define _di_f_fss_nests_resize_ #define _di_f_fss_nestss_delete_callback_ #define _di_f_fss_nestss_destroy_callback_ #define _di_f_fss_nestss_t_ @@ -583,34 +567,17 @@ #define _di_f_fss_set_decrease_by_ //#define _di_f_fss_set_delete_ #define _di_f_fss_set_destroy_ -#define _di_f_fss_set_increase_ -#define _di_f_fss_set_increase_by_ -#define _di_f_fss_set_quote_adjust_ -#define _di_f_fss_set_quote_decimate_by_ -#define _di_f_fss_set_quote_decrease_by_ #define _di_f_fss_set_quote_delete_ #define _di_f_fss_set_quote_destroy_ -#define _di_f_fss_set_quote_increase_ -#define _di_f_fss_set_quote_increase_by_ -#define _di_f_fss_set_quote_resize_ -#define _di_f_fss_set_quotes_adjust_ -#define _di_f_fss_set_quotes_decimate_by_ -#define _di_f_fss_set_quotes_decrease_by_ #define _di_f_fss_set_quotes_delete_callback_ #define _di_f_fss_set_quotes_destroy_callback_ -#define _di_f_fss_set_quotes_resize_ #define _di_f_fss_set_quotess_delete_callback_ #define _di_f_fss_set_quotess_destroy_callback_ #define _di_f_fss_set_quotess_t_ #define _di_f_fss_set_quotes_t_ #define _di_f_fss_set_quote_t_ -#define _di_f_fss_set_resize_ -#define _di_f_fss_sets_adjust_ -#define _di_f_fss_sets_decimate_by_ -#define _di_f_fss_sets_decrease_by_ #define _di_f_fss_sets_delete_callback_ #define _di_f_fss_sets_destroy_callback_ -#define _di_f_fss_sets_resize_ #define _di_f_fss_setss_delete_callback_ #define _di_f_fss_setss_destroy_callback_ #define _di_f_fss_setss_t_ @@ -622,31 +589,19 @@ #define _di_f_fss_simple_packet_identify_ #define _di_f_fss_simple_packet_ranges_append_ #define _di_f_fss_simple_packet_ranges_append_all_ -#define _di_f_fss_simple_packet_rangess_adjust_ #define _di_f_fss_simple_packet_rangess_append_ #define _di_f_fss_simple_packet_rangess_append_all_ -#define _di_f_fss_simple_packet_rangess_decimate_by_ -#define _di_f_fss_simple_packet_rangess_decrease_by_ -#define _di_f_fss_simple_packet_rangess_resize_ #define _di_f_fss_simple_packet_rangess_t_ #define _di_f_fss_simple_packet_ranges_t_ #define _di_f_fss_simple_packet_range_t_ -#define _di_f_fss_simple_packets_adjust_ #define _di_f_fss_simple_packets_append_ #define _di_f_fss_simple_packets_append_all_ -#define _di_f_fss_simple_packets_decimate_by_ -#define _di_f_fss_simple_packets_decrease_by_ #define _di_f_fss_simple_packets_delete_callback_ #define _di_f_fss_simple_packets_destroy_callback_ -#define _di_f_fss_simple_packets_resize_ -#define _di_f_fss_simple_packetss_adjust_ #define _di_f_fss_simple_packetss_append_ #define _di_f_fss_simple_packetss_append_all_ -#define _di_f_fss_simple_packetss_decimate_by_ -#define _di_f_fss_simple_packetss_decrease_by_ #define _di_f_fss_simple_packetss_delete_callback_ #define _di_f_fss_simple_packetss_destroy_callback_ -#define _di_f_fss_simple_packetss_resize_ #define _di_f_fss_simple_packetss_t_ #define _di_f_fss_simple_packets_t_ #define _di_f_fss_simple_packet_t_ @@ -1842,15 +1797,10 @@ #define _di_f_utf_string_append_assure_nulless_ #define _di_f_utf_string_append_mash_ #define _di_f_utf_string_append_nulless_ -#define _di_f_utf_string_dynamic_adjust_ #define _di_f_utf_string_dynamic_append_ #define _di_f_utf_string_dynamic_append_assure_ #define _di_f_utf_string_dynamic_append_assure_nulless_ #define _di_f_utf_string_dynamic_append_nulless_ -#define _di_f_utf_string_dynamic_decimate_by_ -#define _di_f_utf_string_dynamic_decrease_by_ -#define _di_f_utf_string_dynamic_increase_ -#define _di_f_utf_string_dynamic_increase_by_ #define _di_f_utf_string_dynamic_mash_ #define _di_f_utf_string_dynamic_mash_nulless_ #define _di_f_utf_string_dynamic_mish_ @@ -1873,73 +1823,42 @@ #define _di_f_utf_string_dynamic_prepend_assure_ #define _di_f_utf_string_dynamic_prepend_assure_nulless_ #define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamic_resize_ -#define _di_f_utf_string_dynamics_adjust_ #define _di_f_utf_string_dynamics_append_ #define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamics_decimate_by_ -#define _di_f_utf_string_dynamics_decrease_by -#define _di_f_utf_string_dynamics_decrease_by_ #define _di_f_utf_string_dynamic_seek_line_ #define _di_f_utf_string_dynamic_seek_line_to_ #define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamics_increase -#define _di_f_utf_string_dynamics_increase_ -#define _di_f_utf_string_dynamics_increase_by -#define _di_f_utf_string_dynamics_increase_by_ -#define _di_f_utf_string_dynamics_resize_ -#define _di_f_utf_string_dynamicss_adjust_ +#define _di_f_utf_string_dynamics_delete_callback_ +#define _di_f_utf_string_dynamics_destroy_callback_ #define _di_f_utf_string_dynamicss_append_ #define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_decimate_by_ -#define _di_f_utf_string_dynamicss_decrease_by_ -#define _di_f_utf_string_dynamicss_increase_ -#define _di_f_utf_string_dynamicss_increase_by_ -#define _di_f_utf_string_dynamicss_resize_ +#define _di_f_utf_string_dynamicss_delete_callback_ +#define _di_f_utf_string_dynamicss_destroy_callback_ #define _di_f_utf_string_dynamicss_t_ //#define _di_f_utf_string_dynamics_t_ //#define _di_f_utf_string_dynamic_t_ #define _di_f_utf_string_dynamic_terminate_ //#define _di_f_utf_string_dynamic_terminate_after_ #define _di_f_utf_string_empty_s_ -#define _di_f_utf_string_map_multis_adjust_ #define _di_f_utf_string_map_multis_append_ #define _di_f_utf_string_map_multis_append_all_ -#define _di_f_utf_string_map_multis_decimate_by_ -#define _di_f_utf_string_map_multis_decrease_by -#define _di_f_utf_string_map_multis_decrease_by_ -#define _di_f_utf_string_map_multis_increase -#define _di_f_utf_string_map_multis_increase_ -#define _di_f_utf_string_map_multis_increase_by -#define _di_f_utf_string_map_multis_increase_by_ -#define _di_f_utf_string_map_multis_resize_ -#define _di_f_utf_string_map_multiss_adjust_ +#define _di_f_utf_string_map_multis_delete_callback_ +#define _di_f_utf_string_map_multis_destroy_callback_ #define _di_f_utf_string_map_multiss_append_ #define _di_f_utf_string_map_multiss_append_all_ -#define _di_f_utf_string_map_multiss_decimate_by_ -#define _di_f_utf_string_map_multiss_decrease_by_ -#define _di_f_utf_string_map_multiss_increase_ -#define _di_f_utf_string_map_multiss_increase_by_ -#define _di_f_utf_string_map_multiss_resize_ +#define _di_f_utf_string_map_multiss_delete_callback_ +#define _di_f_utf_string_map_multiss_destroy_callback_ #define _di_f_utf_string_map_multiss_t_ #define _di_f_utf_string_map_multis_t_ #define _di_f_utf_string_map_multi_t_ -#define _di_f_utf_string_maps_adjust_ #define _di_f_utf_string_maps_append_ #define _di_f_utf_string_maps_append_all_ -#define _di_f_utf_string_maps_decimate_by_ -#define _di_f_utf_string_maps_decrease_by_ -#define _di_f_utf_string_maps_increase_ -#define _di_f_utf_string_maps_increase_by_ -#define _di_f_utf_string_maps_resize_ -#define _di_f_utf_string_mapss_adjust_ +#define _di_f_utf_string_maps_delete_callback_ +#define _di_f_utf_string_maps_destroy_callback_ #define _di_f_utf_string_mapss_append_ #define _di_f_utf_string_mapss_append_all_ -#define _di_f_utf_string_mapss_decimate_by_ -#define _di_f_utf_string_mapss_decrease_by_ -#define _di_f_utf_string_mapss_increase_ -#define _di_f_utf_string_mapss_increase_by_ -#define _di_f_utf_string_mapss_resize_ +#define _di_f_utf_string_mapss_delete_callback_ +#define _di_f_utf_string_mapss_destroy_callback_ #define _di_f_utf_string_mapss_t_ #define _di_f_utf_string_maps_t_ #define _di_f_utf_string_map_t_ @@ -1958,22 +1877,14 @@ //#define _di_f_utf_string_statics_t_ //#define _di_f_utf_string_static_t_ //#define _di_f_utf_string_t_ -#define _di_f_utf_string_triples_adjust_ #define _di_f_utf_string_triples_append_ #define _di_f_utf_string_triples_append_all_ -#define _di_f_utf_string_triples_decimate_by_ -#define _di_f_utf_string_triples_decrease_by_ -#define _di_f_utf_string_triples_increase_ -#define _di_f_utf_string_triples_increase_by_ -#define _di_f_utf_string_triples_resize_ -#define _di_f_utf_string_tripless_adjust_ +#define _di_f_utf_string_triples_delete_callback_ +#define _di_f_utf_string_triples_destroy_callback_ #define _di_f_utf_string_tripless_append_ #define _di_f_utf_string_tripless_append_all_ -#define _di_f_utf_string_tripless_decimate_by_ -#define _di_f_utf_string_tripless_decrease_by_ -#define _di_f_utf_string_tripless_increase_ -#define _di_f_utf_string_tripless_increase_by_ -#define _di_f_utf_string_tripless_resize_ +#define _di_f_utf_string_tripless_delete_callback_ +#define _di_f_utf_string_tripless_destroy_callback_ #define _di_f_utf_string_tripless_t_ #define _di_f_utf_string_triples_t_ #define _di_f_utf_string_triple_t_ diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index abbcbb1..abeb2f4 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -59,7 +59,7 @@ build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c build_sources_program fll/level_0/utf/common.c fll/level_0/utf/convert.c fll/level_0/utf/dynamic.c fll/level_0/utf/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-dynamic.c fll/level_0/utf/private-dynamics.c fll/level_0/utf/private-dynamicss.c fll/level_0/utf/private-maps.c fll/level_0/utf/private-mapss.c fll/level_0/utf/private-map_multis.c fll/level_0/utf/private-map_multiss.c fll/level_0/utf/private-string.c fll/level_0/utf/private-triples.c fll/level_0/utf/private-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 build_sources_program-thread fll/level_0/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 diff --git a/build/stand_alone/firewall.config.h b/build/stand_alone/firewall.config.h index debb97c..5c97d92 100644 --- a/build/stand_alone/firewall.config.h +++ b/build/stand_alone/firewall.config.h @@ -1,1566 +1,16 @@ -// A config.h file for defining all code being disabled for compiling the stand alone UTF8. -// To assist in building this file use (may need to omit --defined-only): "nm --defined-only -f p programs/shared/utf8 | grep -oP '^(f|fl|fll)_[^\s]+'". -// To get the list of all possible functions, use something like: "grep -hor '#ifndef _di_f_.*\>' level_0/f_color/" | sed -e 's|^#ifndef |#define |g' | sort | uniq. - -#define _di_f_account_by_id_ -#define _di_f_account_by_name_ -//#define _di_f_account_d_ -#define _di_f_account_group_id_by_name_ -#define _di_f_account_group_name_by_id_ -#define _di_f_account_id_by_name_ -#define _di_f_account_name_by_id_ -#define _di_f_accounts_t_ -//#define _di_f_account_t_ - -#define _di_f_capability_ambient_get_ -#define _di_f_capability_ambient_reset_ -#define _di_f_capability_ambient_set_ -#define _di_f_capability_clear_ -#define _di_f_capability_clear_flag_ -#define _di_f_capability_compare_ -#define _di_f_capability_copy_ -#define _di_f_capability_copy_external_ -#define _di_f_capability_copy_internal_ -#define _di_f_capability_delete_ -#define _di_f_capability_file_descriptor_get_ -#define _di_f_capability_file_descriptor_set_ -#define _di_f_capability_file_get_ -#define _di_f_capability_file_set_ -#define _di_f_capability_flag_get_ -#define _di_f_capability_flag_set_ -#define _di_f_capability_from_name_ -#define _di_f_capability_from_text_ -#define _di_f_capability_groups_set_ -#define _di_f_capability_initialize_ -#define _di_f_capability_mode_get_ -#define _di_f_capability_mode_get_name_ -#define _di_f_capability_mode_set_ -#define _di_f_capability_owner_get_ -#define _di_f_capability_owner_set_ -#define _di_f_capability_process_bound_drop_ -#define _di_f_capability_process_bound_get_ -#define _di_f_capability_process_get_ -#define _di_f_capability_process_get_by_id_ -//#define _di_f_capability_process_set_ -#define _di_f_capability_security_bits_get_ -#define _di_f_capability_security_bits_set_ -#define _di_f_capability_size_ -#define _di_f_capability_supported_ -#define _di_f_capability_supported_ambient_ -#define _di_f_capability_supported_code_ -//#define _di_f_capability_t_ -#define _di_f_capability_to_name_ -#define _di_f_capability_to_text_ -#define _di_f_capability_user_set_ - -#define _di_f_color_code_t_ -//#define _di_f_color_context_delete_ -#define _di_f_color_context_destroy_ -//#define _di_f_color_context_t_ -//#define _di_f_color_format_t_ -//#define _di_f_color_load_context_ -//#define _di_f_color_max_size_d_ -//#define _di_f_color_mode_t_ -#define _di_f_color_save_1_ -#define _di_f_color_save_2_ -#define _di_f_color_save_3_ -#define _di_f_color_save_4_ -#define _di_f_color_save_5_ -//#define _di_f_color_set_context_t_ -//#define _di_f_color_set_string_empty_s_ -//#define _di_f_color_set_t_ -//#define _di_f_color_s_ -//#define _di_f_color_strings_s_ -//#define _di_f_color_t_ -//#define _di_f_color_terminal_s_ - -//#define _di_f_console_arguments_t_ -#define _di_f_console_environment_process_ -#define _di_f_console_identify_ -//#define _di_f_console_ids_ -//#define _di_f_console_length_size_ -//#define _di_f_console_parameter_ids_t_ -//#define _di_f_console_parameter_id_t_ -//#define _di_f_console_parameter_prioritize_left_ -//#define _di_f_console_parameter_prioritize_right_ -//#define _di_f_console_parameter_process_ -//#define _di_f_console_parameters_delete_ -#define _di_f_console_parameters_destroy_ -//#define _di_f_console_parameters_t_ -//#define _di_f_console_parameter_t_ -//#define _di_f_console_standard_s_ -//#define _di_f_console_symbol_s_ -//#define _di_f_console_types_t_ -//#define _di_f_console_verbosity_ - -#define _di_f_control_group_copy_ -//#define _di_f_control_group_s_ -//#define _di_f_control_group_t_ - -#define _di_f_conversion_character_is_binary_ -//#define _di_f_conversion_character_is_decimal_ -#define _di_f_conversion_character_is_duodecimal_ -#define _di_f_conversion_character_is_hexidecimal_ -#define _di_f_conversion_character_is_octal_ -//#define _di_f_conversion_character_to_binary_ -//#define _di_f_conversion_character_to_decimal_ -//#define _di_f_conversion_character_to_duodecimal_ -//#define _di_f_conversion_character_to_hexidecimal_ -//#define _di_f_conversion_character_to_octal_ -//#define _di_f_conversion_data_flag_d_ -//#define _di_f_conversion_data_t_ -#define _di_f_conversion_data_d_ -//#define _di_f_conversion_d_ -//#define _di_f_conversion_number_signed_print_ -#define _di_f_conversion_number_signed_to_string_ -//#define _di_f_conversion_number_unsigned_print_ -#define _di_f_conversion_number_unsigned_to_string_ -//#define _di_f_type_number_64_t_ - -#define _di_f_directory_at_d_ -#define _di_f_directory_create_ -#define _di_f_directory_create_at_ -#define _di_f_directory_exists_ -#define _di_f_directory_exists_at_ -//#define _di_f_directory_flag_d_ -#define _di_f_directory_is_ -#define _di_f_directory_is_at_ -//#define _di_f_directory_d_ -//#define _di_f_directory_list_ -#define _di_f_directory_listing_t_ -#define _di_f_directory_open_ -#define _di_f_directory_open_at_ -#define _di_f_directory_remove_ -#define _di_f_directory_remove_custom_ -#define _di_f_directory_statuss_t_ -//#define _di_f_directory_status_t_ -//#define _di_f_directory_s_ -#define _di_f_directory_touch_ -#define _di_f_directory_touch_at_ - -#define _di_f_environment_clear_ -//#define _di_f_environment_d_ -#define _di_f_environment_exists_ -//#define _di_f_environment_get_ -#define _di_f_environment_get_all_ -#define _di_f_environment_secure_is_ -//#define _di_f_environment_set_ -#define _di_f_environment_unset_ - -//#define _di_f_execute_e_ -//#define _di_f_execute_result_t_ -//#define _di_f_execute_scheduler_t_ -#define _di_f_execute_status_from_status_ -#define _di_f_execute_status_to_status_ - -#define _di_f_file_access_ -#define _di_f_file_access_at_ -#define _di_f_file_access_mode_d_ -#define _di_f_file_at_d_ -#define _di_f_file_clone_ -//#define _di_f_file_close_ -#define _di_f_file_close_flush_ -#define _di_f_file_copy_ -#define _di_f_file_create_ -#define _di_f_file_create_at_ -#define _di_f_file_create_device_ -#define _di_f_file_create_device_at_ -#define _di_f_file_create_fifo_ -#define _di_f_file_create_fifo_at_ -#define _di_f_file_create_node_ -#define _di_f_file_create_node_at_ -//#define _di_f_file_defaults_ -#define _di_f_file_descriptor_ -//#define _di_f_file_exists_ -#define _di_f_file_exists_at_ -//#define _di_f_file_flag_d_ -#define _di_f_file_flush_ -#define _di_f_file_group_read_ -#define _di_f_file_is_ -#define _di_f_file_is_at_ -#define _di_f_file_link_ -#define _di_f_file_link_at_ -#define _di_f_file_link_hard_ -#define _di_f_file_link_hard_at_ -#define _di_f_file_link_read_ -#define _di_f_file_link_read_at_ -#define _di_f_file_mode_determine_ -#define _di_f_file_mode_from_string_ -#define _di_f_file_mode_read_ -#define _di_f_file_mode_read_at_ -#define _di_f_file_mode_set_ -#define _di_f_file_mode_set_at_ -#define _di_f_file_mode_t_ -#define _di_f_file_mode_to_mode_ -#define _di_f_file_name_base_ -#define _di_f_file_name_directory_ -//#define _di_f_file_open_ -#define _di_f_file_open_at_ -//#define _di_f_file_open_mode_s_ -//#define _di_f_file_operation_s_ -#define _di_f_file_owner_read_ -//#define _di_f_file_read_ -//#define _di_f_file_read_block_ -#define _di_f_file_read_until_ -#define _di_f_file_remove_ -#define _di_f_file_remove_at_ -#define _di_f_file_rename_ -#define _di_f_file_rename_at_ -#define _di_f_file_role_change_ -#define _di_f_file_role_change_at_ -#define _di_f_file_seek_ -#define _di_f_file_seeks_d_ -#define _di_f_file_size_ -#define _di_f_file_size_at_ -#define _di_f_file_size_by_id_ -#define _di_f_file_stat_ -#define _di_f_file_stat_at_ -#define _di_f_file_stat_by_id_ -#define _di_f_file_stat_flags_e_ -//#define _di_f_file_stream_close_ -//#define _di_f_file_stream_open_ -#define _di_f_file_stream_open_descriptor_ -#define _di_f_file_stream_read_ -//#define _di_f_file_stream_read_block_ -#define _di_f_file_stream_read_until_ -#define _di_f_file_stream_reopen_ -#define _di_f_file_stream_write_ -#define _di_f_file_stream_write_block_ -#define _di_f_file_stream_write_range_ -#define _di_f_file_stream_write_until_ -//#define _di_f_file_t_ -#define _di_f_file_touch_ -#define _di_f_file_touch_at_ -#define _di_f_file_type_ -#define _di_f_file_type_at_ -#define _di_f_file_type_d_ -#define _di_f_file_umask_get_ -#define _di_f_file_umask_set_ -//#define _di_f_file_write_ -#define _di_f_file_write_block_ -#define _di_f_file_write_range_ -#define _di_f_file_write_until_ - -//#define _di_f_fss_apply_delimit_ -#define _di_f_fss_apply_delimit_range_ -//#define _di_f_fss_e_ -#define _di_f_fss_commentss_t_ -//#define _di_f_fss_comments_t_ -//#define _di_f_fss_comment_t_ -#define _di_f_fss_complete_e_ -//#define _di_f_fss_contents_t_ -//#define _di_f_fss_content_t_ -#define _di_f_fss_count_lines_ -#define _di_f_fss_count_lines_range_ -//#define _di_f_fss_default_d_ -//#define _di_f_fss_placeholder_s_ -#define _di_f_fss_delimitss_t_ -//#define _di_f_fss_delimits_t_ -//#define _di_f_fss_delimit_t_ -//#define _di_f_fss_fail_utf_ -//#define _di_f_fss_fail_utf_to_false_ -#define _di_f_fss_is_combining_ -//#define _di_f_fss_is_graph_ -//#define _di_f_fss_is_space_ -//#define _di_f_fss_is_zero_width_ -#define _di_f_fss_items_adjust_ -#define _di_f_fss_items_decimate_by_ -#define _di_f_fss_items_decrease_by_ -#define _di_f_fss_items_increase_ -#define _di_f_fss_items_increase_by_ -#define _di_f_fss_items_resize_ -#define _di_f_fss_items_t_ -#define _di_f_fss_item_t_ -#define _di_f_fss_named_adjust_ -#define _di_f_fss_named_decimate_by_ -#define _di_f_fss_named_decrease_by_ -#define _di_f_fss_named_increase_ -#define _di_f_fss_named_increase_by_ -#define _di_f_fss_named_resize_ -#define _di_f_fss_nameds_adjust_ -#define _di_f_fss_nameds_decimate_by_ -#define _di_f_fss_nameds_decrease_by_ -#define _di_f_fss_nameds_increase_ -#define _di_f_fss_nameds_increase_by_ -#define _di_f_fss_nameds_resize_ -#define _di_f_fss_nameds_t_ -#define _di_f_fss_named_t_ -#define _di_f_fss_nest_adjust_ -#define _di_f_fss_nest_decimate_by_ -#define _di_f_fss_nest_decrease_by_ -#define _di_f_fss_nest_increase_ -#define _di_f_fss_nest_increase_by_ -#define _di_f_fss_nest_resize_ -#define _di_f_fss_nests_adjust_ -#define _di_f_fss_nests_decimate_by_ -#define _di_f_fss_nests_decrease_by_ -#define _di_f_fss_nests_increase_ -#define _di_f_fss_nests_increase_by_ -#define _di_f_fss_nests_resize_ -#define _di_f_fss_nests_t_ -#define _di_f_fss_nest_t_ -//#define _di_f_fss_objects_t_ -//#define _di_f_fss_object_t_ -//#define _di_f_fss_quotess_t_ -//#define _di_f_fss_quotes_t_ -//#define _di_f_fss_quote_t_ -//#define _di_f_fss_quote_type_ -//#define _di_f_fss_seek_to_eol_ -#define _di_f_fss_set_adjust_ -#define _di_f_fss_set_decimate_by_ -#define _di_f_fss_set_decrease_by_ -#define _di_f_fss_set_increase_ -#define _di_f_fss_set_increase_by_ -#define _di_f_fss_set_quote_adjust_ -#define _di_f_fss_set_quote_decimate_by_ -#define _di_f_fss_set_quote_decrease_by_ -#define _di_f_fss_set_quote_increase_ -#define _di_f_fss_set_quote_increase_by_ -#define _di_f_fss_set_quote_resize_ -#define _di_f_fss_set_quotes_adjust_ -#define _di_f_fss_set_quotes_decimate_by_ -#define _di_f_fss_set_quotes_decrease_by_ -#define _di_f_fss_set_quotes_increase_ -#define _di_f_fss_set_quotes_increase_by_ -#define _di_f_fss_set_quotes_resize_ -#define _di_f_fss_set_quotes_t_ -#define _di_f_fss_set_quote_t_ -#define _di_f_fss_set_resize_ -#define _di_f_fss_sets_adjust_ -#define _di_f_fss_sets_decimate_by_ -#define _di_f_fss_sets_decrease_by_ -#define _di_f_fss_sets_increase_ -#define _di_f_fss_sets_increase_by_ -#define _di_f_fss_sets_resize_ -#define _di_f_fss_sets_t_ -#define _di_f_fss_set_t_ -//#define _di_f_fss_skip_past_delimit_ -//#define _di_f_fss_skip_past_space_ -//#define _di_f_fss_state_flag_e_ -//#define _di_f_fss_status_codes_e_ -//#define _di_f_fss_status_error_e_ -//#define _di_f_fss_status_success_e_ -//#define _di_f_fss_status_warning_e_ -//#define _di_f_fss_s_ - -//#define _di_f_limit_process_ -#define _di_f_limit_sets_adjust_ -#define _di_f_limit_sets_append_ -#define _di_f_limit_sets_append_all_ -#define _di_f_limit_sets_decimate_by_ -#define _di_f_limit_sets_decrease_by_ -#define _di_f_limit_sets_increase_ -#define _di_f_limit_sets_increase_by_ -#define _di_f_limit_sets_resize_ -#define _di_f_limit_setss_adjust_ -#define _di_f_limit_setss_append_ -#define _di_f_limit_setss_append_all_ -#define _di_f_limit_setss_decimate_by_ -#define _di_f_limit_setss_decrease_by_ -#define _di_f_limit_setss_increase_ -#define _di_f_limit_setss_increase_by_ -#define _di_f_limit_setss_resize_ -#define _di_f_limit_setss_t_ -//#define _di_f_limit_sets_t_ -//#define _di_f_limit_set_t_ -#define _di_f_limit_values_adjust_ -#define _di_f_limit_values_append_ -#define _di_f_limit_values_append_all_ -#define _di_f_limit_values_decimate_by_ -#define _di_f_limit_values_decrease_by_ -#define _di_f_limit_values_increase_ -#define _di_f_limit_values_increase_by_ -#define _di_f_limit_values_resize_ -#define _di_f_limit_valuess_adjust_ -#define _di_f_limit_valuess_append_ -#define _di_f_limit_valuess_append_all_ -#define _di_f_limit_valuess_decimate_by_ -#define _di_f_limit_valuess_decrease_by_ -#define _di_f_limit_valuess_increase_ -#define _di_f_limit_valuess_increase_by_ -#define _di_f_limit_valuess_resize_ -#define _di_f_limit_valuess_t_ -#define _di_f_limit_values_t_ -//#define _di_f_limit_value_t_ - -#define _di_f_memory_adjust_ -//#define _di_f_memory_default_d_ -//#define _di_f_memory_delete_ -#define _di_f_memory_destroy_ -#define _di_f_memory_new_ -#define _di_f_memory_new_aligned_ -//#define _di_f_memory_resize_ -#define _di_f_memory_structure_adjust_ -#define _di_f_memory_structure_decimate_by_ -#define _di_f_memory_structure_decrease_by_ -#define _di_f_memory_structure_increase_ -#define _di_f_memory_structure_increase_by_ -#define _di_f_memory_structure_resize_ - -#define _di_f_number_unsigneds_adjust_ -#define _di_f_number_unsigneds_append_ -#define _di_f_number_unsigneds_append_all_ -#define _di_f_number_unsigneds_decimate_by_ -#define _di_f_number_unsigneds_decrease_by_ -//#define _di_f_number_unsigneds_increase_ -//#define _di_f_number_unsigneds_increase_by_ -//#define _di_f_number_unsigneds_resize_ -#define _di_f_number_unsignedss_adjust_ -#define _di_f_number_unsignedss_append_ -#define _di_f_number_unsignedss_append_all_ -#define _di_f_number_unsignedss_decimate_by_ -#define _di_f_number_unsignedss_decrease_by_ -#define _di_f_number_unsignedss_increase_ -#define _di_f_number_unsignedss_increase_by_ -#define _di_f_number_unsignedss_resize_ -#define _di_f_number_unsignedss_t_ -//#define _di_f_number_unsigneds_t_ -//#define _di_f_number_unsigned_t_ - -#define _di_f_path_change_ -#define _di_f_path_change_at_ -#define _di_f_path_current_ -//#define _di_f_path_d_ -//#define _di_f_path_s_ -#define _di_f_path_is_ -#define _di_f_path_is_absolute_ -#define _di_f_path_is_relative_ -#define _di_f_path_is_relative_current_ -#define _di_f_path_real_ -#define _di_f_path_tree_hierarchy_standard_d_ -#define _di_f_path_tree_kevux_standard_d_ - -#define _di_f_pipe_error_exists_ -//#define _di_f_pipe_input_exists_ -#define _di_f_pipe_output_exists_ - -//#define _di_f_print_ -#define _di_f_print_character_ -#define _di_f_print_character_safely_ -#define _di_f_print_character_safely_get_ -//#define _di_f_print_dynamic_ -#define _di_f_print_dynamic_except_partial_ -#define _di_f_print_dynamic_except_partial_raw_ -#define _di_f_print_dynamic_except_partial_raw_safely_ -#define _di_f_print_dynamic_except_partial_safely_ -#define _di_f_print_dynamic_partial_ -#define _di_f_print_dynamic_partial_raw_ -#define _di_f_print_dynamic_partial_raw_safely_ -#define _di_f_print_dynamic_partial_safely_ -//#define _di_f_print_dynamic_raw_ -//#define _di_f_print_dynamic_raw_safely_ -//#define _di_f_print_dynamic_safely_ -#define _di_f_print_except_ -#define _di_f_print_except_dynamic_ -#define _di_f_print_except_dynamic_partial_ -#define _di_f_print_except_dynamic_partial_raw_ -#define _di_f_print_except_dynamic_partial_raw_safely_ -#define _di_f_print_except_dynamic_partial_safely_ -#define _di_f_print_except_dynamic_raw_ -#define _di_f_print_except_dynamic_raw_safely_ -#define _di_f_print_except_dynamic_safely_ -//#define _di_f_print_except_in_ -//#define _di_f_print_except_in_dynamic_ -#define _di_f_print_except_in_dynamic_partial_ -#define _di_f_print_except_in_dynamic_partial_raw_ -#define _di_f_print_except_in_dynamic_partial_raw_safely_ -#define _di_f_print_except_in_dynamic_partial_safely_ -//#define _di_f_print_except_in_dynamic_raw_ -//#define _di_f_print_except_in_dynamic_raw_safely_ -//#define _di_f_print_except_in_dynamic_safely_ -//#define _di_f_print_except_in_raw_ -//#define _di_f_print_except_in_raw_safely_ -//#define _di_f_print_except_in_safely_ -#define _di_f_print_except_raw_ -#define _di_f_print_except_raw_safely_ -#define _di_f_print_except_safely_ -//#define _di_f_print_format_flag_d_ -//#define _di_f_print_format_type_e_ -//#define _di_f_print_raw_ -//#define _di_f_print_raw_safely_ -#define _di_f_print_raw_terminated_ -//#define _di_f_print_safely_ -#define _di_f_print_safely_get_ -//#define _di_f_print_safely_terminated_ -//#define _di_f_print_sequence_s_ -//#define _di_f_print_sequences_set_control_s_ -//#define _di_f_print_terminated_ -//#define _di_f_print_to_ -#define _di_f_print_to_character_ -#define _di_f_print_to_character_safely_ -#define _di_f_print_to_dynamic_ -#define _di_f_print_to_dynamic_partial_ -#define _di_f_print_to_dynamic_partial_raw_ -#define _di_f_print_to_dynamic_partial_raw_safely_ -#define _di_f_print_to_dynamic_partial_safely_ -#define _di_f_print_to_dynamic_raw_ -#define _di_f_print_to_dynamic_raw_safely_ -#define _di_f_print_to_dynamic_safely_ -#define _di_f_print_to_except_ -#define _di_f_print_to_except_dynamic_ -#define _di_f_print_to_except_dynamic_partial_ -#define _di_f_print_to_except_dynamic_partial_raw_ -#define _di_f_print_to_except_dynamic_partial_raw_safely_ -#define _di_f_print_to_except_dynamic_partial_safely_ -#define _di_f_print_to_except_dynamic_raw_ -#define _di_f_print_to_except_dynamic_raw_safely_ -#define _di_f_print_to_except_dynamic_safely_ -#define _di_f_print_to_except_in_ -#define _di_f_print_to_except_in_dynamic_ -#define _di_f_print_to_except_in_dynamic_partial_ -#define _di_f_print_to_except_in_dynamic_partial_raw_ -#define _di_f_print_to_except_in_dynamic_partial_raw_safely_ -#define _di_f_print_to_except_in_dynamic_partial_safely_ -#define _di_f_print_to_except_in_dynamic_raw_ -#define _di_f_print_to_except_in_dynamic_raw_safely_ -#define _di_f_print_to_except_in_dynamic_safely_ -#define _di_f_print_to_except_in_raw_ -#define _di_f_print_to_except_in_raw_safely_ -#define _di_f_print_to_except_in_safely_ -#define _di_f_print_to_except_raw_ -#define _di_f_print_to_except_raw_safely_ -#define _di_f_print_to_except_safely_ -#define _di_f_print_to_raw_ -#define _di_f_print_to_raw_safely_ -#define _di_f_print_to_raw_terminated_ -#define _di_f_print_to_safely_ -#define _di_f_print_to_safely_terminated_ -#define _di_f_print_to_terminated_ -//#define _di_f_print_write_max_d_ - -#define _di_f_signal_action_ -//#define _di_f_signal_close_ -//#define _di_f_signal_how_t_ -//#define _di_f_signal_mask_ -//#define _di_f_signal_open_ -#define _di_f_signal_pause_ -#define _di_f_signal_queue_ -//#define _di_f_signal_read_ -#define _di_f_signal_send_ -//#define _di_f_signal_set_add_ -//#define _di_f_signal_set_delete_ -//#define _di_f_signal_set_empty_ -//#define _di_f_signal_set_fill_ -#define _di_f_signal_set_has_ -#define _di_f_signal_suspend_ -//#define _di_f_signal_t_ -#define _di_f_signal_wait_ -#define _di_f_signal_wait_until_ - -//#define _di_f_status_e_ - -//#define _di_f_char_t_ -//#define _di_f_string_append_ -#define _di_f_string_append_assure_ -#define _di_f_string_append_assure_nulless_ -#define _di_f_string_append_nulless_ -//#define _di_f_string_ascii_s_ -#define _di_f_string_constant_t_ -#define _di_f_string_dynamic_adjust_ -//#define _di_f_string_dynamic_append_ -//#define _di_f_string_dynamic_append_assure_ -#define _di_f_string_dynamic_append_assure_nulless_ -//#define _di_f_string_dynamic_append_nulless_ -#define _di_f_string_dynamic_decimate_by_ -#define _di_f_string_dynamic_decrease_by_ -//#define _di_f_string_dynamic_increase_ -//#define _di_f_string_dynamic_increase_by_ -#define _di_f_string_dynamic_mash_ -#define _di_f_string_dynamic_mash_nulless_ -#define _di_f_string_dynamic_mish_ -#define _di_f_string_dynamic_mish_nulless_ -//#define _di_f_string_dynamic_partial_append_ -#define _di_f_string_dynamic_partial_append_assure_ -#define _di_f_string_dynamic_partial_append_assure_nulless_ -#define _di_f_string_dynamic_partial_append_nulless_ -#define _di_f_string_dynamic_partial_mash_ -#define _di_f_string_dynamic_partial_mash_nulless_ -#define _di_f_string_dynamic_partial_mish_ -#define _di_f_string_dynamic_partial_mish_nulless_ -#define _di_f_string_dynamic_partial_prepend_ -#define _di_f_string_dynamic_partial_prepend_assure_ -#define _di_f_string_dynamic_partial_prepend_assure_nulless_ -#define _di_f_string_dynamic_partial_prepend_nulless_ -#define _di_f_string_dynamic_prepend_ -#define _di_f_string_dynamic_prepend_assure_ -#define _di_f_string_dynamic_prepend_assure_nulless_ -#define _di_f_string_dynamic_prepend_nulless_ -#define _di_f_string_dynamics_append_ -#define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamic_seek_line_ -#define _di_f_string_dynamic_seek_line_to_ -#define _di_f_string_dynamic_seek_to_ -#define _di_f_string_dynamicss_append_ -#define _di_f_string_dynamicss_append_all_ -//#define _di_f_string_dynamicss_t_ -//#define _di_f_string_dynamics_t_ -//#define _di_f_string_dynamic_t_ -//#define _di_f_string_dynamic_terminate_ -//#define _di_f_string_dynamic_terminate_after_ -//#define _di_f_string_empty_s_ -//#define _di_f_string_eol_s_ -#define _di_f_string_map_multis_adjust_ -#define _di_f_string_map_multis_append_ -#define _di_f_string_map_multis_append_all_ -#define _di_f_string_map_multis_decimate_by_ -#define _di_f_string_map_multis_decrease_by_ -//#define _di_f_string_map_multis_increase_ -#define _di_f_string_map_multis_increase_by_ -//#define _di_f_string_map_multis_resize_ -#define _di_f_string_map_multiss_adjust_ -#define _di_f_string_map_multiss_append_ -#define _di_f_string_map_multiss_append_all_ -#define _di_f_string_map_multiss_decimate_by_ -#define _di_f_string_map_multiss_decrease_by_ -#define _di_f_string_map_multiss_increase_ -#define _di_f_string_map_multiss_increase_by_ -#define _di_f_string_map_multiss_resize_ -//#define _di_f_string_map_multiss_t_ -//#define _di_f_string_map_multis_t_ -//#define _di_f_string_map_multi_t_ -#define _di_f_string_maps_adjust_ -//#define _di_f_string_maps_append_ -#define _di_f_string_maps_append_all_ -#define _di_f_string_maps_decimate_by_ -#define _di_f_string_maps_decrease_by_ -//#define _di_f_string_maps_increase_ -//#define _di_f_string_maps_increase_by_ -//#define _di_f_string_maps_resize_ -#define _di_f_string_mapss_adjust_ -#define _di_f_string_mapss_append_ -#define _di_f_string_mapss_append_all_ -#define _di_f_string_mapss_decimate_by_ -#define _di_f_string_mapss_decrease_by_ -#define _di_f_string_mapss_increase_ -#define _di_f_string_mapss_increase_by_ -#define _di_f_string_mapss_resize_ -//#define _di_f_string_mapss_t_ -//#define _di_f_string_maps_t_ -//#define _di_f_string_map_t_ -//#define _di_f_string_mash_ -#define _di_f_string_mash_nulless_ -#define _di_f_string_mish_ -#define _di_f_string_mish_nulless_ -//#define _di_f_string_null_s_ -//#define _di_f_string_placeholder_s_ -#define _di_f_string_prepend_ -#define _di_f_string_prepend_assure_ -#define _di_f_string_prepend_assure_nulless_ -#define _di_f_string_prepend_nulless_ -#define _di_f_string_quantitys_adjust_ -#define _di_f_string_quantitys_append_ -#define _di_f_string_quantitys_append_all_ -#define _di_f_string_quantitys_decimate_by_ -#define _di_f_string_quantitys_decrease_by_ -#define _di_f_string_quantitys_increase_ -#define _di_f_string_quantitys_increase_by_ -#define _di_f_string_quantitys_resize_ -#define _di_f_string_quantityss_adjust_ -#define _di_f_string_quantityss_append_ -#define _di_f_string_quantityss_append_all_ -#define _di_f_string_quantityss_decimate_by_ -#define _di_f_string_quantityss_decrease_by_ -#define _di_f_string_quantityss_increase_ -#define _di_f_string_quantityss_increase_by_ -#define _di_f_string_quantityss_resize_ -//#define _di_f_string_quantityss_t_ -//#define _di_f_string_quantitys_t_ -//#define _di_f_string_quantity_t_ -#define _di_f_string_ranges_adjust_ -#define _di_f_string_ranges_append_ -#define _di_f_string_ranges_append_all_ -#define _di_f_string_ranges_decimate_by_ -#define _di_f_string_ranges_decrease_by_ -//#define _di_f_string_ranges_increase_ -#define _di_f_string_ranges_increase_by_ -//#define _di_f_string_ranges_resize_ -#define _di_f_string_rangess_adjust_ -#define _di_f_string_rangess_append_ -#define _di_f_string_rangess_append_all_ -#define _di_f_string_rangess_decimate_by_ -#define _di_f_string_rangess_decrease_by_ -//#define _di_f_string_rangess_increase_ -#define _di_f_string_rangess_increase_by_ -//#define _di_f_string_rangess_resize_ -//#define _di_f_string_rangess_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_ -//#define _di_f_string_space_s_ -//#define _di_f_string_staticss_t_ -//#define _di_f_string_statics_t_ -//#define _di_f_string_static_t_ -//#define _di_f_string_t_ -#define _di_f_string_triples_adjust_ -#define _di_f_string_triples_append_ -#define _di_f_string_triples_append_all_ -#define _di_f_string_triples_decimate_by_ -#define _di_f_string_triples_decrease_by_ -#define _di_f_string_triples_increase_ -#define _di_f_string_triples_increase_by_ -#define _di_f_string_triples_resize_ -#define _di_f_string_tripless_adjust_ -#define _di_f_string_tripless_append_ -#define _di_f_string_tripless_append_all_ -#define _di_f_string_tripless_decimate_by_ -#define _di_f_string_tripless_decrease_by_ -#define _di_f_string_tripless_increase_ -#define _di_f_string_tripless_increase_by_ -#define _di_f_string_tripless_resize_ -//#define _di_f_string_tripless_t_ -//#define _di_f_string_triples_t_ -//#define _di_f_string_triple_t_ - -#define _di_f_thread_at_fork_ -#define _di_f_thread_attribute_affinity_get_ -#define _di_f_thread_attribute_affinity_set_ -#define _di_f_thread_attribute_concurrency_get_ -#define _di_f_thread_attribute_concurrency_set_ -#define _di_f_thread_attribute_create_ -#define _di_f_thread_attribute_default_get_ -#define _di_f_thread_attribute_default_set_ -#define _di_f_thread_attribute_delete_ -#define _di_f_thread_attribute_detach_get_ -#define _di_f_thread_attribute_detach_set_ -#define _di_f_thread_attribute_guard_get_ -#define _di_f_thread_attribute_guard_set_ -#define _di_f_thread_attribute_scheduler_inherit_get_ -#define _di_f_thread_attribute_scheduler_inherit_set_ -#define _di_f_thread_attribute_scheduler_parameter_get_ -#define _di_f_thread_attribute_scheduler_parameter_set_ -#define _di_f_thread_attribute_scheduler_policy_get_ -#define _di_f_thread_attribute_scheduler_policy_set_ -#define _di_f_thread_attribute_scope_get_ -#define _di_f_thread_attribute_scope_set_ -//#define _di_f_thread_attributes_t_ -#define _di_f_thread_attribute_stack_get_ -#define _di_f_thread_attribute_stack_set_ -#define _di_f_thread_attribute_stack_size_get_ -#define _di_f_thread_attribute_stack_size_set_ -//#define _di_f_thread_attribute_t_ -#define _di_f_thread_barrier_attribute_create_ -#define _di_f_thread_barrier_attribute_delete_ -#define _di_f_thread_barrier_attribute_shared_get_ -#define _di_f_thread_barrier_attribute_shared_set_ -//#define _di_f_thread_barrier_attributes_t_ -//#define _di_f_thread_barrier_attribute_t_ -#define _di_f_thread_barrier_create_ -#define _di_f_thread_barrier_delete_ -//#define _di_f_thread_barriers_t_ -//#define _di_f_thread_barrier_t_ -#define _di_f_thread_barrier_wait_ -#define _di_f_thread_caller_ -#define _di_f_thread_cancel_ -#define _di_f_thread_cancel_state_set_ -#define _di_f_thread_cancel_test_ -#define _di_f_thread_cancel_type_set_ -#define _di_f_thread_clock_get_id_ -#define _di_f_thread_compare_ -#define _di_f_thread_condition_attribute_clock_get_ -#define _di_f_thread_condition_attribute_clock_set_ -#define _di_f_thread_condition_attribute_create_ -#define _di_f_thread_condition_attribute_delete_ -#define _di_f_thread_condition_attribute_shared_get_ -#define _di_f_thread_condition_attribute_shared_set_ -//#define _di_f_thread_condition_attributes_t_ -//#define _di_f_thread_condition_attribute_t_ -#define _di_f_thread_condition_create_ -#define _di_f_thread_condition_delete_ -#define _di_f_thread_condition_signal_ -#define _di_f_thread_condition_signal_all_ -//#define _di_f_thread_conditions_t_ -//#define _di_f_thread_condition_t_ -#define _di_f_thread_condition_wait_ -#define _di_f_thread_condition_wait_timed_ -#define _di_f_thread_create_ -#define _di_f_thread_detach_ -#define _di_f_thread_exit_ -//#define _di_f_thread_ids_t_ -//#define _di_f_thread_id_t_ -#define _di_f_thread_join_ -#define _di_f_thread_join_timed_ -#define _di_f_thread_join_try_ -#define _di_f_thread_key_create_ -#define _di_f_thread_key_delete_ -#define _di_f_thread_key_get_ -#define _di_f_thread_key_set_ -//#define _di_f_thread_keys_t_ -//#define _di_f_thread_key_t_ -#define _di_f_thread_lock_attribute_create_ -#define _di_f_thread_lock_attribute_delete_ -#define _di_f_thread_lock_attribute_shared_get_ -#define _di_f_thread_lock_attribute_shared_set_ -//#define _di_f_thread_lock_attributes_t_ -//#define _di_f_thread_lock_attribute_t_ -#define _di_f_thread_lock_create_ -#define _di_f_thread_lock_delete_ -#define _di_f_thread_lock_read_ -#define _di_f_thread_lock_read_timed_ -#define _di_f_thread_lock_read_try_ -//#define _di_f_thread_locks_t_ -//#define _di_f_thread_lock_t_ -#define _di_f_thread_lock_write_ -#define _di_f_thread_lock_write_timed_ -#define _di_f_thread_lock_write_try_ -#define _di_f_thread_mutex_attribute_create_ -#define _di_f_thread_mutex_attribute_delete_ -#define _di_f_thread_mutex_attribute_priority_ceiling_get_ -#define _di_f_thread_mutex_attribute_priority_ceiling_set_ -#define _di_f_thread_mutex_attribute_protocol_get_ -#define _di_f_thread_mutex_attribute_protocol_set_ -#define _di_f_thread_mutex_attribute_shared_get_ -#define _di_f_thread_mutex_attribute_shared_set_ -//#define _di_f_thread_mutex_attributes_t_ -//#define _di_f_thread_mutex_attribute_t_ -#define _di_f_thread_mutex_attribute_type_get_ -#define _di_f_thread_mutex_attribute_type_set_ -#define _di_f_thread_mutex_create_ -#define _di_f_thread_mutex_delete_ -#define _di_f_thread_mutex_lock_ -#define _di_f_thread_mutex_lock_timed_ -#define _di_f_thread_mutex_lock_try_ -#define _di_f_thread_mutex_priority_ceiling_get_ -#define _di_f_thread_mutex_priority_ceiling_set_ -//#define _di_f_thread_mutexs_t_ -//#define _di_f_thread_mutex_t_ -#define _di_f_thread_mutex_unlock_ -#define _di_f_thread_once_ -//#define _di_f_thread_onces_t_ -//#define _di_f_thread_once_t_ -#define _di_f_thread_scheduler_parameter_get_ -#define _di_f_thread_scheduler_parameter_set_ -#define _di_f_thread_scheduler_priority_set_ -#define _di_f_thread_semaphore_create_ -#define _di_f_thread_semaphore_delete_ -#define _di_f_thread_semaphore_file_close_ -#define _di_f_thread_semaphore_file_delete_ -#define _di_f_thread_semaphore_file_open_ -#define _di_f_thread_semaphore_lock_ -#define _di_f_thread_semaphore_lock_timed_ -#define _di_f_thread_semaphore_lock_try_ -//#define _di_f_thread_semaphores_t_ -//#define _di_f_thread_semaphore_t_ -#define _di_f_thread_semaphore_unlock_ -#define _di_f_thread_semaphore_value_get_ -//#define _di_f_thread_sets_t_ -//#define _di_f_thread_set_t_ -//#define _di_f_thread_signal_mask_ -#define _di_f_thread_signal_queue_ -#define _di_f_thread_signal_write_ -#define _di_f_thread_spin_create_ -#define _di_f_thread_spin_delete_ -#define _di_f_thread_spin_lock_ -#define _di_f_thread_spin_lock_try_ -//#define _di_f_thread_spins_t_ -//#define _di_f_thread_spin_t_ -#define _di_f_thread_spin_unlock_ -#define _di_f_thread_unlock_ - -#define _di_f_cells_adjust_ -#define _di_f_cells_append_ -#define _di_f_cells_append_all_ -#define _di_f_cells_decimate_by_ -#define _di_f_cells_decrease_by_ -#define _di_f_cells_increase_ -#define _di_f_cells_increase_by_ -#define _di_f_cells_resize_ -#define _di_f_cellss_adjust_ -#define _di_f_cellss_append_ -#define _di_f_cellss_append_all_ -#define _di_f_cellss_decimate_by_ -#define _di_f_cellss_decrease_by_ -#define _di_f_cellss_increase_ -#define _di_f_cellss_increase_by_ -#define _di_f_cellss_resize_ -#define _di_f_cellss_t_ -#define _di_f_cells_t_ -#define _di_f_fll_ids_adjust_ -#define _di_f_fll_ids_append_ -#define _di_f_fll_ids_append_all_ -#define _di_f_fll_ids_decimate_by_ -#define _di_f_fll_ids_decrease_by_ -#define _di_f_fll_ids_increase_ -#define _di_f_fll_ids_increase_by_ -#define _di_f_fll_ids_resize_ -#define _di_f_fll_idss_adjust_ -#define _di_f_fll_idss_append_ -#define _di_f_fll_idss_append_all_ -#define _di_f_fll_idss_decimate_by_ -#define _di_f_fll_idss_decrease_by_ -#define _di_f_fll_idss_increase_ -#define _di_f_fll_idss_increase_by_ -#define _di_f_fll_idss_resize_ -#define _di_f_fll_idss_t_ -#define _di_f_fll_ids_t_ -#define _di_f_int128s_adjust_ -#define _di_f_int128s_append_ -#define _di_f_int128s_append_all_ -#define _di_f_int128s_decimate_by_ -#define _di_f_int128s_decrease_by_ -#define _di_f_int128s_increase_ -#define _di_f_int128s_increase_by_ -#define _di_f_int128s_resize_ -#define _di_f_int128ss_adjust_ -#define _di_f_int128ss_append_ -#define _di_f_int128ss_append_all_ -#define _di_f_int128ss_decimate_by_ -#define _di_f_int128ss_decrease_by_ -#define _di_f_int128ss_increase_ -#define _di_f_int128ss_increase_by_ -#define _di_f_int128ss_resize_ -#define _di_f_int128ss_t_ -#define _di_f_int128s_t_ -#define _di_f_int16s_adjust_ -#define _di_f_int16s_append_ -#define _di_f_int16s_append_all_ -#define _di_f_int16s_decimate_by_ -#define _di_f_int16s_decrease_by_ -#define _di_f_int16s_increase_ -#define _di_f_int16s_increase_by_ -#define _di_f_int16s_resize_ -#define _di_f_int16ss_adjust_ -#define _di_f_int16ss_append_ -#define _di_f_int16ss_append_all_ -#define _di_f_int16ss_decimate_by_ -#define _di_f_int16ss_decrease_by_ -#define _di_f_int16ss_increase_ -#define _di_f_int16ss_increase_by_ -#define _di_f_int16ss_resize_ -#define _di_f_int16ss_t_ -#define _di_f_int16s_t_ -#define _di_f_int32s_adjust_ -#define _di_f_int32s_append_ -#define _di_f_int32s_append_all_ -#define _di_f_int32s_decimate_by_ -#define _di_f_int32s_decrease_by_ -#define _di_f_int32s_increase_ -#define _di_f_int32s_increase_by_ -#define _di_f_int32s_resize_ -#define _di_f_int32ss_adjust_ -#define _di_f_int32ss_append_ -#define _di_f_int32ss_append_all_ -#define _di_f_int32ss_decimate_by_ -#define _di_f_int32ss_decrease_by_ -#define _di_f_int32ss_increase_ -#define _di_f_int32ss_increase_by_ -#define _di_f_int32ss_resize_ -#define _di_f_int32ss_t_ -#define _di_f_int32s_t_ -#define _di_f_int64s_adjust_ -#define _di_f_int64s_append_ -#define _di_f_int64s_append_all_ -#define _di_f_int64s_decimate_by_ -#define _di_f_int64s_decrease_by_ -#define _di_f_int64s_increase_ -#define _di_f_int64s_increase_by_ -#define _di_f_int64s_resize_ -#define _di_f_int64ss_adjust_ -#define _di_f_int64ss_append_ -#define _di_f_int64ss_append_all_ -#define _di_f_int64ss_decimate_by_ -#define _di_f_int64ss_decrease_by_ -#define _di_f_int64ss_increase_ -#define _di_f_int64ss_increase_by_ -#define _di_f_int64ss_resize_ -#define _di_f_int64ss_t_ -#define _di_f_int64s_t_ -#define _di_f_int8s_adjust_ -#define _di_f_int8s_append_ -#define _di_f_int8s_append_all_ -#define _di_f_int8s_decimate_by_ -#define _di_f_int8s_decrease_by_ -#define _di_f_int8s_increase_ -#define _di_f_int8s_increase_by_ -#define _di_f_int8s_resize_ -#define _di_f_int8ss_adjust_ -#define _di_f_int8ss_append_ -#define _di_f_int8ss_append_all_ -#define _di_f_int8ss_decimate_by_ -#define _di_f_int8ss_decrease_by_ -#define _di_f_int8ss_increase_ -#define _di_f_int8ss_increase_by_ -#define _di_f_int8ss_resize_ -#define _di_f_int8ss_t_ -#define _di_f_int8_t_ -#define _di_f_states_adjust_ -#define _di_f_states_append_ -#define _di_f_states_append_all_ -#define _di_f_states_decimate_by_ -#define _di_f_states_decrease_by_ -#define _di_f_states_increase_ -#define _di_f_states_increase_by_ -#define _di_f_states_resize_ -#define _di_f_statess_adjust_ -#define _di_f_statess_append_ -#define _di_f_statess_append_all_ -#define _di_f_statess_decimate_by_ -#define _di_f_statess_decrease_by_ -#define _di_f_statess_increase_ -#define _di_f_statess_increase_by_ -#define _di_f_statess_resize_ -#define _di_f_statess_t_ -#define _di_f_states_t_ -#define _di_f_statuss_adjust_ -#define _di_f_statuss_append_ -#define _di_f_statuss_append_all_ -#define _di_f_statuss_decimate_by_ -#define _di_f_statuss_decrease_by_ -#define _di_f_statuss_increase_ -#define _di_f_statuss_increase_by_ -#define _di_f_statuss_resize_ -#define _di_f_statusss_adjust_ -#define _di_f_statusss_append_ -#define _di_f_statusss_append_all_ -#define _di_f_statusss_decimate_by_ -#define _di_f_statusss_decrease_by_ -#define _di_f_statusss_increase_ -#define _di_f_statusss_increase_by_ -#define _di_f_statusss_resize_ -#define _di_f_statusss_t_ -#define _di_f_statuss_t_ -#define _di_f_uint128s_adjust_ -#define _di_f_uint128s_append_ -#define _di_f_uint128s_append_all_ -#define _di_f_uint128s_decimate_by_ -#define _di_f_uint128s_decrease_by_ -#define _di_f_uint128s_increase_ -#define _di_f_uint128s_increase_by_ -#define _di_f_uint128s_resize_ -#define _di_f_uint128ss_adjust_ -#define _di_f_uint128ss_append_ -#define _di_f_uint128ss_append_all_ -#define _di_f_uint128ss_decimate_by_ -#define _di_f_uint128ss_decrease_by_ -#define _di_f_uint128ss_increase_ -#define _di_f_uint128ss_increase_by_ -#define _di_f_uint128ss_resize_ -#define _di_f_uint128ss_t_ -#define _di_f_uint128s_t_ -#define _di_f_uint16s_adjust_ -#define _di_f_uint16s_append_ -#define _di_f_uint16s_append_all_ -#define _di_f_uint16s_decimate_by_ -#define _di_f_uint16s_decrease_by_ -#define _di_f_uint16s_increase_ -#define _di_f_uint16s_increase_by_ -#define _di_f_uint16s_resize_ -#define _di_f_uint16ss_adjust_ -#define _di_f_uint16ss_append_ -#define _di_f_uint16ss_append_all_ -#define _di_f_uint16ss_decimate_by_ -#define _di_f_uint16ss_decrease_by_ -#define _di_f_uint16ss_increase_ -#define _di_f_uint16ss_increase_by_ -#define _di_f_uint16ss_resize_ -#define _di_f_uint16ss_t_ -#define _di_f_uint16s_t_ -#define _di_f_uint32s_adjust_ -#define _di_f_uint32s_append_ -#define _di_f_uint32s_append_all_ -#define _di_f_uint32s_decimate_by_ -#define _di_f_uint32s_decrease_by_ -#define _di_f_uint32s_increase_ -#define _di_f_uint32s_increase_by_ -#define _di_f_uint32s_resize_ -#define _di_f_uint32ss_adjust_ -#define _di_f_uint32ss_append_ -#define _di_f_uint32ss_append_all_ -#define _di_f_uint32ss_decimate_by_ -#define _di_f_uint32ss_decrease_by_ -#define _di_f_uint32ss_increase_ -#define _di_f_uint32ss_increase_by_ -#define _di_f_uint32ss_resize_ -#define _di_f_uint32ss_t_ -#define _di_f_uint32s_t_ -#define _di_f_uint64s_adjust_ -#define _di_f_uint64s_append_ -#define _di_f_uint64s_append_all_ -#define _di_f_uint64s_decimate_by_ -#define _di_f_uint64s_decrease_by_ -#define _di_f_uint64s_increase_ -#define _di_f_uint64s_increase_by_ -#define _di_f_uint64s_resize_ -#define _di_f_uint64ss_adjust_ -#define _di_f_uint64ss_append_ -#define _di_f_uint64ss_append_all_ -#define _di_f_uint64ss_decimate_by_ -#define _di_f_uint64ss_decrease_by_ -#define _di_f_uint64ss_increase_ -#define _di_f_uint64ss_increase_by_ -#define _di_f_uint64ss_resize_ -#define _di_f_uint64ss_t_ -#define _di_f_uint64s_t_ -#define _di_f_uint8s_adjust_ -#define _di_f_uint8s_append_ -#define _di_f_uint8s_append_all_ -#define _di_f_uint8s_decimate_by_ -#define _di_f_uint8s_decrease_by_ -//#define _di_f_uint8s_increase_ -#define _di_f_uint8s_increase_by_ -//#define _di_f_uint8s_resize_ -#define _di_f_uint8ss_adjust_ -#define _di_f_uint8ss_append_ -#define _di_f_uint8ss_append_all_ -#define _di_f_uint8ss_decimate_by_ -#define _di_f_uint8ss_decrease_by_ -//#define _di_f_uint8ss_increase_ -#define _di_f_uint8ss_increase_by_ -//#define _di_f_uint8ss_resize_ -//#define _di_f_uint8ss_t_ -//#define _di_f_uint8s_t_ - -#define _di_f_utf_buffer_decrement_ -//#define _di_f_utf_buffer_increment_ -//#define _di_f_utf_byte_d_ -#define _di_f_utf_character_is_ -#define _di_f_utf_character_is_alphabetic_ -#define _di_f_utf_character_is_alphabetic_digit_ -#define _di_f_utf_character_is_alphabetic_numeric_ -#define _di_f_utf_character_is_ascii_ -#define _di_f_utf_character_is_combining_ -#define _di_f_utf_character_is_control_ -#define _di_f_utf_character_is_control_code_ -#define _di_f_utf_character_is_control_format_ -#define _di_f_utf_character_is_control_picture_ -#define _di_f_utf_character_is_digit_ -#define _di_f_utf_character_is_emoji_ -#define _di_f_utf_character_is_fragment_ -#define _di_f_utf_character_is_graph_ -#define _di_f_utf_character_is_numeric_ -#define _di_f_utf_character_is_phonetic_ -#define _di_f_utf_character_is_private_ -#define _di_f_utf_character_is_punctuation_ -#define _di_f_utf_character_is_subscript_ -#define _di_f_utf_character_is_superscript_ -#define _di_f_utf_character_is_symbol_ -#define _di_f_utf_character_is_unassigned_ -#define _di_f_utf_character_is_valid_ -#define _di_f_utf_character_is_whitespace_ -#define _di_f_utf_character_is_whitespace_modifier_ -#define _di_f_utf_character_is_whitespace_other_ -#define _di_f_utf_character_is_whitespace_zero_width_ -#define _di_f_utf_character_is_wide_ -#define _di_f_utf_character_is_word_ -#define _di_f_utf_character_is_word_dash_ -#define _di_f_utf_character_is_word_dash_plus_ -#define _di_f_utf_character_is_zero_width_ -#define _di_f_utf_character_unicode_from_ -#define _di_f_utf_character_unicode_string_to_ -#define _di_f_utf_character_unicode_to_ -//#define _di_f_utf_char_t_ -#define _di_f_utf_char_s_ -#define _di_f_utf_char_to_char_ -//#define _di_f_utf_char_to_character_ -#define _di_f_utf_is_ -#define _di_f_utf_is_alphabetic_ -#define _di_f_utf_is_alphabetic_digit_ -#define _di_f_utf_is_alphabetic_numeric_ -#define _di_f_utf_is_ascii_ -//#define _di_f_utf_is_combining_ -//#define _di_f_utf_is_control_ -#define _di_f_utf_is_control_code_ -#define _di_f_utf_is_control_format_ -#define _di_f_utf_is_control_picture_ -#define _di_f_utf_is_digit_ -#define _di_f_utf_is_emoji_ -#define _di_f_utf_is_fragment_ -//#define _di_f_utf_is_graph_ -#define _di_f_utf_is_numeric_ -#define _di_f_utf_is_phonetic_ -#define _di_f_utf_is_private_ -#define _di_f_utf_is_punctuation_ -#define _di_f_utf_is_subscript_ -#define _di_f_utf_is_superscript_ -#define _di_f_utf_is_symbol_ -#define _di_f_utf_is_unassigned_ -//#define _di_f_utf_is_valid_ -//#define _di_f_utf_is_whitespace_ -#define _di_f_utf_is_whitespace_modifier_ -#define _di_f_utf_is_whitespace_other_ -#define _di_f_utf_is_whitespace_zero_width_ -#define _di_f_utf_is_wide_ -#define _di_f_utf_is_word_ -#define _di_f_utf_is_word_dash_ -#define _di_f_utf_is_word_dash_plus_ -//#define _di_f_utf_is_zero_width_ -#define _di_f_utf_space_s_ -#define _di_f_utf_string_append_ -#define _di_f_utf_string_append_assure_ -#define _di_f_utf_string_append_assure_nulless_ -#define _di_f_utf_string_append_nulless_ -#define _di_f_utf_string_dynamic_append_ -#define _di_f_utf_string_dynamic_append_assure_ -#define _di_f_utf_string_dynamic_append_assure_nulless_ -#define _di_f_utf_string_dynamic_append_nulless_ -#define _di_f_utf_string_dynamic_mash_ -#define _di_f_utf_string_dynamic_mash_nulless_ -#define _di_f_utf_string_dynamic_mish_ -#define _di_f_utf_string_dynamic_mish_nulless_ -#define _di_f_utf_string_dynamic_partial_append_ -#define _di_f_utf_string_dynamic_partial_append_assure_ -#define _di_f_utf_string_dynamic_partial_append_assure_nulless_ -#define _di_f_utf_string_dynamic_partial_append_nulless_ -#define _di_f_utf_string_dynamic_partial_mash_ -#define _di_f_utf_string_dynamic_partial_mash_nulless_ -#define _di_f_utf_string_dynamic_partial_mish_ -#define _di_f_utf_string_dynamic_partial_mish_nulless_ -#define _di_f_utf_string_dynamic_partial_prepend_ -#define _di_f_utf_string_dynamic_partial_prepend_assure_ -#define _di_f_utf_string_dynamic_partial_prepend_assure_nulless_ -#define _di_f_utf_string_dynamic_partial_prepend_nulless_ -#define _di_f_utf_string_dynamic_prepend_ -#define _di_f_utf_string_dynamic_prepend_assure_ -#define _di_f_utf_string_dynamic_prepend_assure_nulless_ -#define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamics_append_ -#define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamic_seek_line_ -#define _di_f_utf_string_dynamic_seek_line_to_ -#define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamicss_append_ -#define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_t_ -//#define _di_f_utf_string_dynamics_t_ -//#define _di_f_utf_string_dynamic_t_ -#define _di_f_utf_string_dynamic_terminate_ -#define _di_f_utf_string_dynamic_terminate_after_ -#define _di_f_utf_string_empty_s_ -#define _di_f_utf_string_map_multis_adjust_ -#define _di_f_utf_string_map_multis_append_ -#define _di_f_utf_string_map_multis_append_all_ -#define _di_f_utf_string_map_multis_decimate_by_ -#define _di_f_utf_string_map_multis_decrease_by_ -#define _di_f_utf_string_map_multis_increase_ -#define _di_f_utf_string_map_multis_increase_by_ -#define _di_f_utf_string_map_multis_resize_ -#define _di_f_utf_string_map_multiss_adjust_ -#define _di_f_utf_string_map_multiss_append_ -#define _di_f_utf_string_map_multiss_append_all_ -#define _di_f_utf_string_map_multiss_decimate_by_ -#define _di_f_utf_string_map_multiss_decrease_by_ -#define _di_f_utf_string_map_multiss_increase_ -#define _di_f_utf_string_map_multiss_increase_by_ -#define _di_f_utf_string_map_multiss_resize_ -//#define _di_f_utf_string_map_multiss_t_ -//#define _di_f_utf_string_map_multis_t_ -//#define _di_f_utf_string_map_multi_t_ -#define _di_f_utf_string_maps_adjust_ -#define _di_f_utf_string_maps_append_ -#define _di_f_utf_string_maps_append_all_ -#define _di_f_utf_string_maps_decimate_by_ -#define _di_f_utf_string_maps_decrease_by_ -#define _di_f_utf_string_maps_increase_ -#define _di_f_utf_string_maps_increase_by_ -#define _di_f_utf_string_maps_resize_ -#define _di_f_utf_string_mapss_adjust_ -#define _di_f_utf_string_mapss_append_ -#define _di_f_utf_string_mapss_append_all_ -#define _di_f_utf_string_mapss_decimate_by_ -#define _di_f_utf_string_mapss_decrease_by_ -#define _di_f_utf_string_mapss_increase_ -#define _di_f_utf_string_mapss_increase_by_ -#define _di_f_utf_string_mapss_resize_ -//#define _di_f_utf_string_mapss_t_ -//#define _di_f_utf_string_maps_t_ -//#define _di_f_utf_string_map_t_ -#define _di_f_utf_string_mash_ -#define _di_f_utf_string_mash_nulless_ -#define _di_f_utf_string_mish_ -#define _di_f_utf_string_mish_nulless_ -#define _di_f_utf_string_prepend_ -#define _di_f_utf_string_prepend_assure_ -#define _di_f_utf_string_prepend_assure_nulless_ -#define _di_f_utf_string_prepend_nulless_ -#define _di_f_utf_string_seek_line_ -#define _di_f_utf_string_seek_line_to_ -#define _di_f_utf_string_seek_to_ -#define _di_f_utf_string_staticss_t_ -//#define _di_f_utf_string_statics_t_ -//#define _di_f_utf_string_static_t_ -//#define _di_f_utf_string_t_ -#define _di_f_utf_string_triples_adjust_ -#define _di_f_utf_string_triples_append_ -#define _di_f_utf_string_triples_append_all_ -#define _di_f_utf_string_triples_decimate_by_ -#define _di_f_utf_string_triples_decrease_by_ -#define _di_f_utf_string_triples_increase_ -#define _di_f_utf_string_triples_increase_by_ -#define _di_f_utf_string_triples_resize_ -#define _di_f_utf_string_tripless_adjust_ -#define _di_f_utf_string_tripless_append_ -#define _di_f_utf_string_tripless_append_all_ -#define _di_f_utf_string_tripless_decimate_by_ -#define _di_f_utf_string_tripless_decrease_by_ -#define _di_f_utf_string_tripless_increase_ -#define _di_f_utf_string_tripless_increase_by_ -#define _di_f_utf_string_tripless_resize_ -//#define _di_f_utf_string_tripless_t_ -//#define _di_f_utf_string_triples_t_ -//#define _di_f_utf_string_triple_t_ -#define _di_f_utf_substitute_s_ -#define _di_f_utf_unicode_from_ -#define _di_f_utf_unicode_string_to_ -#define _di_f_utf_unicode_to_ -#define _di_f_utf_width_e_ - -//#define _di_fl_control_group_apply_ - -//#define _di_fl_conversion_data_flag_d_ -//#define _di_fl_conversion_data_t_ -#define _di_fl_conversion_data_c_ -#define _di_fl_conversion_dynamic_partial_to_signed_ -#define _di_fl_conversion_dynamic_partial_to_signed_detect_ -#define _di_fl_conversion_dynamic_partial_to_unsigned_ -#define _di_fl_conversion_dynamic_partial_to_unsigned_detect_ -#define _di_fl_conversion_dynamic_to_signed_ -#define _di_fl_conversion_dynamic_to_signed_detect_ -#define _di_fl_conversion_dynamic_to_unsigned_ -#define _di_fl_conversion_dynamic_to_unsigned_detect_ - -#define _di_fl_environment_load_name_ -#define _di_fl_environment_load_names_ -//#define _di_fl_environment_path_explode_ -#define _di_fl_environment_path_explode_reverse_ - -//#define _di_fl_fss_basic_content_read_ -#define _di_fl_fss_basic_content_write_ -//#define _di_fl_fss_basic_list_content_read_ -#define _di_fl_fss_basic_list_content_write_ -//#define _di_fl_fss_basic_list_object_read_ -#define _di_fl_fss_basic_list_object_write_ -//#define _di_fl_fss_basic_object_read_ -#define _di_fl_fss_basic_object_write_ -#define _di_fl_fss_embedded_list_content_read_ -#define _di_fl_fss_embedded_list_content_write_ -#define _di_fl_fss_embedded_list_object_read_ -#define _di_fl_fss_embedded_list_object_write_ -//#define _di_fl_fss_extended_content_read_ -#define _di_fl_fss_extended_content_write_ -#define _di_fl_fss_extended_list_content_read_ -#define _di_fl_fss_extended_list_content_write_ -#define _di_fl_fss_extended_list_object_read_ -#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_print_format_ -#define _di_fl_print_format_convert_ -//#define _di_fl_print_string_va_ -//#define _di_fl_print_t_ -#define _di_fl_print_trim_ -#define _di_fl_print_trim_dynamic_ -#define _di_fl_print_trim_dynamic_partial_ -#define _di_fl_print_trim_dynamic_partial_raw_ -#define _di_fl_print_trim_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_dynamic_partial_safely_ -#define _di_fl_print_trim_dynamic_raw_ -#define _di_fl_print_trim_dynamic_raw_safely_ -#define _di_fl_print_trim_dynamic_safely_ -#define _di_fl_print_trim_except_ -#define _di_fl_print_trim_except_dynamic_ -#define _di_fl_print_trim_except_dynamic_partial_ -#define _di_fl_print_trim_except_dynamic_partial_raw_ -#define _di_fl_print_trim_except_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_except_dynamic_partial_safely_ -#define _di_fl_print_trim_except_dynamic_raw_ -#define _di_fl_print_trim_except_dynamic_raw_safely_ -#define _di_fl_print_trim_except_dynamic_safely_ -#define _di_fl_print_trim_except_in_ -#define _di_fl_print_trim_except_in_dynamic_ -#define _di_fl_print_trim_except_in_dynamic_partial_ -#define _di_fl_print_trim_except_in_dynamic_partial_raw_ -#define _di_fl_print_trim_except_in_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_except_in_dynamic_partial_safely_ -#define _di_fl_print_trim_except_in_dynamic_raw_ -#define _di_fl_print_trim_except_in_dynamic_raw_safely_ -#define _di_fl_print_trim_except_in_dynamic_safely_ -#define _di_fl_print_trim_except_in_raw_ -#define _di_fl_print_trim_except_in_raw_safely_ -#define _di_fl_print_trim_except_in_safely_ -#define _di_fl_print_trim_except_raw_ -#define _di_fl_print_trim_except_raw_safely_ -#define _di_fl_print_trim_except_safely_ -#define _di_fl_print_trim_raw_ -#define _di_fl_print_trim_raw_safely_ -#define _di_fl_print_trim_safely_ - -#define _di_fl_string_compare_ -#define _di_fl_string_compare_except_ -#define _di_fl_string_compare_except_trim_ -#define _di_fl_string_compare_trim_ -//#define _di_fl_string_dynamic_compare_ -#define _di_fl_string_dynamic_compare_except_ -#define _di_fl_string_dynamic_compare_except_string_ -#define _di_fl_string_dynamic_compare_except_trim_ -#define _di_fl_string_dynamic_compare_except_trim_string_ -//#define _di_fl_string_dynamic_compare_string_ -#define _di_fl_string_dynamic_compare_trim_ -#define _di_fl_string_dynamic_compare_trim_string_ -#define _di_fl_string_dynamic_partial_compare_ -#define _di_fl_string_dynamic_partial_compare_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_ -#define _di_fl_string_dynamic_partial_compare_except_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_string_ -#define _di_fl_string_dynamic_partial_compare_except_trim_ -#define _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_trim_string_ -//#define _di_fl_string_dynamic_partial_compare_string_ -#define _di_fl_string_dynamic_partial_compare_trim_ -#define _di_fl_string_dynamic_partial_compare_trim_dynamic_ -#define _di_fl_string_dynamic_partial_compare_trim_string_ -#define _di_fl_string_dynamic_partial_fll_identify_ -#define _di_fl_string_dynamic_partial_rip_ -#define _di_fl_string_dynamic_partial_rip_nulless_ -//#define _di_fl_string_dynamic_rip_ -#define _di_fl_string_dynamic_rip_nulless_ -#define _di_fl_string_dynamic_seek_line_to_utf_character_ -#define _di_fl_string_dynamic_seek_line_until_graph_ -#define _di_fl_string_dynamic_seek_line_until_graph_non_ -#define _di_fl_string_dynamic_seek_to_utf_character_ -#define _di_fl_string_rip_ -#define _di_fl_string_rip_nulless_ -#define _di_fl_string_seek_line_to_utf_character_ -#define _di_fl_string_seek_line_until_graph_ -#define _di_fl_string_seek_line_until_graph_non_ -#define _di_fl_string_seek_to_utf_character_ - -//#define _di_fll_error_file_print_ -//#define _di_fll_error_file_type_e_ -#define _di_fll_error_parameter_integer_print_ -//#define _di_fll_error_print_ - -#define _di_fll_execute_arguments_add_ -#define _di_fll_execute_arguments_add_parameter_ -#define _di_fll_execute_arguments_add_parameter_set_ -#define _di_fll_execute_arguments_add_set_ -#define _di_fll_execute_into_ -//#define _di_fll_execute_program_ - -//#define _di_fll_fss_basic_list_read_ -#define _di_fll_fss_basic_list_write_ -//#define _di_fll_fss_basic_read_ -#define _di_fll_fss_basic_write_ -#define _di_fll_fss_embedded_list_read_ -#define _di_fll_fss_embedded_list_write_ -#define _di_fll_fss_extended_list_read_ -#define _di_fll_fss_extended_list_write_ -//#define _di_fll_fss_extended_read_ -#define _di_fll_fss_extended_write_ -#define _di_fll_fss_identify_ -#define _di_fll_fss_payload_read_ -#define _di_fll_fss_payload_write_ -#define _di_fll_fss_snatch_ -#define _di_fll_fss_snatch_apart_ -#define _di_fll_fss_snatch_map_ -#define _di_fll_fss_snatch_map_apart_ -#define _di_fll_fss_snatch_map_mash_ -#define _di_fll_fss_snatch_map_mash_apart_ -#define _di_fll_fss_snatch_map_together_ -#define _di_fll_fss_snatch_mash_ -#define _di_fll_fss_snatch_mash_apart_ -#define _di_fll_fss_snatch_together_ - -#define _di_fll_print_ -#define _di_fll_print_character_ -#define _di_fll_print_character_safely_ -#define _di_fll_print_dynamic_ -#define _di_fll_print_dynamic_partial_ -#define _di_fll_print_dynamic_partial_raw_ -#define _di_fll_print_dynamic_partial_raw_safely_ -#define _di_fll_print_dynamic_partial_safely_ -//#define _di_fll_print_dynamic_raw_ -#define _di_fll_print_dynamic_raw_safely_ -#define _di_fll_print_dynamic_safely_ -#define _di_fll_print_except_ -#define _di_fll_print_except_dynamic_ -#define _di_fll_print_except_dynamic_partial_ -#define _di_fll_print_except_dynamic_partial_raw_ -#define _di_fll_print_except_dynamic_partial_raw_safely_ -#define _di_fll_print_except_dynamic_partial_safely_ -#define _di_fll_print_except_dynamic_raw_ -#define _di_fll_print_except_dynamic_raw_safely_ -#define _di_fll_print_except_dynamic_safely_ -#define _di_fll_print_except_in_ -#define _di_fll_print_except_in_dynamic_ -#define _di_fll_print_except_in_dynamic_partial_ -#define _di_fll_print_except_in_dynamic_partial_raw_ -#define _di_fll_print_except_in_dynamic_partial_raw_safely_ -#define _di_fll_print_except_in_dynamic_partial_safely_ -#define _di_fll_print_except_in_dynamic_raw_ -#define _di_fll_print_except_in_dynamic_raw_safely_ -#define _di_fll_print_except_in_dynamic_safely_ -#define _di_fll_print_except_in_raw_ -#define _di_fll_print_except_in_raw_safely_ -#define _di_fll_print_except_in_safely_ -#define _di_fll_print_except_raw_ -#define _di_fll_print_except_raw_safely_ -#define _di_fll_print_except_safely_ -//#define _di_fll_print_format_ -#define _di_fll_print_format_convert_ -#define _di_fll_print_raw_ -#define _di_fll_print_raw_safely_ -#define _di_fll_print_raw_terminated_ -#define _di_fll_print_safely_ -#define _di_fll_print_safely_terminated_ -#define _di_fll_print_string_va_ -#define _di_fll_print_terminated_ -#define _di_fll_print_trim_ -#define _di_fll_print_trim_dynamic_ -#define _di_fll_print_trim_dynamic_partial_ -#define _di_fll_print_trim_dynamic_partial_raw_ -#define _di_fll_print_trim_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_dynamic_partial_safely_ -#define _di_fll_print_trim_dynamic_raw_ -#define _di_fll_print_trim_dynamic_raw_safely_ -#define _di_fll_print_trim_dynamic_safely_ -#define _di_fll_print_trim_except_ -#define _di_fll_print_trim_except_dynamic_ -#define _di_fll_print_trim_except_dynamic_partial_ -#define _di_fll_print_trim_except_dynamic_partial_raw_ -#define _di_fll_print_trim_except_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_except_dynamic_partial_safely_ -#define _di_fll_print_trim_except_dynamic_raw_ -#define _di_fll_print_trim_except_dynamic_raw_safely_ -#define _di_fll_print_trim_except_dynamic_safely_ -#define _di_fll_print_trim_except_in_ -#define _di_fll_print_trim_except_in_dynamic_ -#define _di_fll_print_trim_except_in_dynamic_partial_ -#define _di_fll_print_trim_except_in_dynamic_partial_raw_ -#define _di_fll_print_trim_except_in_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_except_in_dynamic_partial_safely_ -#define _di_fll_print_trim_except_in_dynamic_raw_ -#define _di_fll_print_trim_except_in_dynamic_raw_safely_ -#define _di_fll_print_trim_except_in_dynamic_safely_ -#define _di_fll_print_trim_except_in_raw_ -#define _di_fll_print_trim_except_in_raw_safely_ -#define _di_fll_print_trim_except_in_safely_ -#define _di_fll_print_trim_except_raw_ -#define _di_fll_print_trim_except_raw_safely_ -#define _di_fll_print_trim_except_safely_ -#define _di_fll_print_trim_raw_ -#define _di_fll_print_trim_raw_safely_ -#define _di_fll_print_trim_safely_ - -//#define _di_fll_program_data_delete_ -#define _di_fll_program_data_destroy_ -//#define _di_fll_program_data_t_ -#define _di_fll_program_parameter_additional_append_ -#define _di_fll_program_parameter_additional_mash_ -//#define _di_fll_program_parameter_additional_rip_ -#define _di_fll_program_parameter_additional_rip_mash_ -#define _di_fll_program_parameter_long_print_cannot_use_with_ -//#define _di_fll_program_parameter_process_ -//#define _di_fll_program_parameter_process_empty_ -//#define _di_fll_program_parameter_s_ -//#define _di_fll_program_print_help_header_ -//#define _di_fll_program_print_help_option_ -//#define _di_fll_program_print_help_option_long_ -#define _di_fll_program_print_help_option_other_ -//#define _di_fll_program_print_help_usage_ -//#define _di_fll_program_print_version_ -//#define _di_fll_program_standard_setdown_ -//#define _di_fll_program_standard_setup_ -//#define _di_fll_program_standard_signal_received_ -//#define _di_fll_program_standard_signal_state_ +// A config.h file for defining all code being disabled for compiling the stand alone Featureless Make. +// To assist in building this file use (may need to omit --defined-only): "nm --defined-only -f p programs/shared/fake | grep -oP '^(f|fl|fll)_[^\s]+'". +// To get the list of all possible functions, use something like: "grep -horP '\b_di_f_\w*\b' level_0/f_color/". +// +// Note that some special defines may need to be manually added, such as: +// #define _di_private_inline_f_print_to_error_ +// #define _di_private_inline_private_f_print_to_error_ +// +// Example: +// echo > /tmp/all.txt +// for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_signal f_socket f_thread f_time ; do grep -horP '\b_di_f_\w*\b' level_0/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_0/$i/c >> /tmp/all.txt ; done +// for i in fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print ; do grep -horP '\b_di_fl_\w*\b' level_1/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_1/$i/c >> /tmp/all.txt ; done +// for i in fll_error fll_execute fll_file fll_fss fll_print fll_program ; do grep -horP '\b_di_fll_\w*\b' level_2/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_2/$i/c >> /tmp/all.txt ; done +// sort /tmp/all.txt | uniq | sed -e 's|^_|#define &|g' > /tmp/sorted.txt +// echo "#define _di_private_inline_f_print_to_error_" >> /tmp/sorted.txt +// echo "#define _di_private_inline_private_f_print_to_error_" >> /tmp/sorted.txt diff --git a/build/stand_alone/utf8.config.h b/build/stand_alone/utf8.config.h index 3c692c5..5c97d92 100644 --- a/build/stand_alone/utf8.config.h +++ b/build/stand_alone/utf8.config.h @@ -1,1114 +1,16 @@ -// A config.h file for defining all code being disabled for compiling the stand alone UTF8. -// To assist in building this file use (may need to omit --defined-only): "nm --defined-only -f p programs/shared/utf8 | grep -oP '^(f|fl|fll)_[^\s]+'". -// To get the list of all possible functions, use something like: "grep -hor '#ifndef _di_f_.*\>' level_0/f_color/" | sed -e 's|^#ifndef |#define |g' | sort | uniq. - -#define _di_f_color_code_t_ -//#define _di_f_color_context_delete_ -#define _di_f_color_context_destroy_ -//#define _di_f_color_context_t_ -//#define _di_f_color_format_t_ -//#define _di_f_color_load_context_ -//#define _di_f_color_max_size_d_ -//#define _di_f_color_mode_t_ -#define _di_f_color_save_1_ -#define _di_f_color_save_2_ -#define _di_f_color_save_3_ -#define _di_f_color_save_4_ -#define _di_f_color_save_5_ -//#define _di_f_color_set_context_t_ -//#define _di_f_color_set_string_empty_s_ -//#define _di_f_color_set_t_ -//#define _di_f_color_s_ -//#define _di_f_color_strings_s_ -//#define _di_f_color_t_ -//#define _di_f_color_terminal_s_ - -//#define _di_f_console_arguments_t_ -#define _di_f_console_environment_process_ -#define _di_f_console_identify_ -//#define _di_f_console_ids_ -//#define _di_f_console_length_size_ -//#define _di_f_console_parameter_ids_t_ -//#define _di_f_console_parameter_id_t_ -//#define _di_f_console_parameter_prioritize_left_ -//#define _di_f_console_parameter_prioritize_right_ -//#define _di_f_console_parameter_process_ -//#define _di_f_console_parameters_delete_ -#define _di_f_console_parameters_destroy_ -//#define _di_f_console_parameters_t_ -//#define _di_f_console_parameter_t_ -//#define _di_f_console_standard_s_ -//#define _di_f_console_symbol_s_ -//#define _di_f_console_types_t_ -//#define _di_f_console_verbosity_ - -#define _di_f_conversion_character_is_binary_ -//#define _di_f_conversion_character_is_decimal_ -#define _di_f_conversion_character_is_duodecimal_ -#define _di_f_conversion_character_is_hexidecimal_ -#define _di_f_conversion_character_is_octal_ -//#define _di_f_conversion_character_to_binary_ -//#define _di_f_conversion_character_to_decimal_ -//#define _di_f_conversion_character_to_duodecimal_ -//#define _di_f_conversion_character_to_hexidecimal_ -//#define _di_f_conversion_character_to_octal_ -//#define _di_f_conversion_data_flag_d_ -//#define _di_f_conversion_data_t_ -#define _di_f_conversion_data_d_ -//#define _di_f_conversion_d_ -//#define _di_f_conversion_number_signed_print_ -#define _di_f_conversion_number_signed_to_string_ -//#define _di_f_conversion_number_unsigned_print_ -#define _di_f_conversion_number_unsigned_to_string_ - -#define _di_f_file_access_ -#define _di_f_file_access_at_ -#define _di_f_file_access_mode_d_ -#define _di_f_file_at_d_ -#define _di_f_file_clone_ -//#define _di_f_file_close_ -#define _di_f_file_close_flush_ -#define _di_f_file_copy_ -#define _di_f_file_create_ -#define _di_f_file_create_at_ -#define _di_f_file_create_device_ -#define _di_f_file_create_device_at_ -#define _di_f_file_create_fifo_ -#define _di_f_file_create_fifo_at_ -#define _di_f_file_create_node_ -#define _di_f_file_create_node_at_ -//#define _di_f_file_defaults_ -#define _di_f_file_descriptor_ -//#define _di_f_file_exists_ -#define _di_f_file_exists_at_ -//#define _di_f_file_flag_d_ -#define _di_f_file_flush_ -#define _di_f_file_group_read_ -#define _di_f_file_is_ -#define _di_f_file_is_at_ -#define _di_f_file_link_ -#define _di_f_file_link_at_ -#define _di_f_file_link_hard_ -#define _di_f_file_link_hard_at_ -#define _di_f_file_link_read_ -#define _di_f_file_link_read_at_ -#define _di_f_file_mode_determine_ -#define _di_f_file_mode_from_string_ -#define _di_f_file_mode_read_ -#define _di_f_file_mode_read_at_ -#define _di_f_file_mode_set_ -#define _di_f_file_mode_set_at_ -#define _di_f_file_mode_t_ -#define _di_f_file_mode_to_mode_ -#define _di_f_file_name_base_ -#define _di_f_file_name_directory_ -#define _di_f_file_open_ -#define _di_f_file_open_at_ -//#define _di_f_file_open_mode_s_ -//#define _di_f_file_operation_s_ -#define _di_f_file_owner_read_ -#define _di_f_file_read_ -#define _di_f_file_read_block_ -#define _di_f_file_read_until_ -#define _di_f_file_remove_ -#define _di_f_file_remove_at_ -#define _di_f_file_rename_ -#define _di_f_file_rename_at_ -#define _di_f_file_role_change_ -#define _di_f_file_role_change_at_ -#define _di_f_file_seek_ -#define _di_f_file_seeks_d_ -#define _di_f_file_size_ -#define _di_f_file_size_at_ -#define _di_f_file_size_by_id_ -#define _di_f_file_stat_ -#define _di_f_file_stat_at_ -#define _di_f_file_stat_by_id_ -#define _di_f_file_stat_flags_e_ -//#define _di_f_file_stream_close_ -//#define _di_f_file_stream_open_ -#define _di_f_file_stream_open_descriptor_ -#define _di_f_file_stream_read_ -//#define _di_f_file_stream_read_block_ -#define _di_f_file_stream_read_until_ -#define _di_f_file_stream_reopen_ -#define _di_f_file_stream_write_ -#define _di_f_file_stream_write_block_ -#define _di_f_file_stream_write_range_ -#define _di_f_file_stream_write_until_ -//#define _di_f_file_t_ -#define _di_f_file_touch_ -#define _di_f_file_touch_at_ -#define _di_f_file_type_ -#define _di_f_file_type_at_ -#define _di_f_file_type_d_ -#define _di_f_file_umask_get_ -#define _di_f_file_umask_set_ -#define _di_f_file_write_ -#define _di_f_file_write_block_ -#define _di_f_file_write_range_ -#define _di_f_file_write_until_ - -#define _di_f_memory_adjust_ -//#define _di_f_memory_default_d_ -#define _di_f_memory_delete_ -#define _di_f_memory_destroy_ -#define _di_f_memory_new_ -#define _di_f_memory_new_aligned_ -//#define _di_f_memory_resize_ -#define _di_f_memory_structure_adjust_ -#define _di_f_memory_structure_decimate_by_ -#define _di_f_memory_structure_decrease_by_ -#define _di_f_memory_structure_increase_ -#define _di_f_memory_structure_increase_by_ -#define _di_f_memory_structure_resize_ - -#define _di_f_number_unsigneds_adjust_ -#define _di_f_number_unsigneds_append_ -#define _di_f_number_unsigneds_append_all_ -#define _di_f_number_unsigneds_decimate_by_ -#define _di_f_number_unsigneds_decrease_by_ -//#define _di_f_number_unsigneds_increase_ -//#define _di_f_number_unsigneds_increase_by_ -//#define _di_f_number_unsigneds_resize_ -#define _di_f_number_unsignedss_adjust_ -#define _di_f_number_unsignedss_append_ -#define _di_f_number_unsignedss_append_all_ -#define _di_f_number_unsignedss_decimate_by_ -#define _di_f_number_unsignedss_decrease_by_ -#define _di_f_number_unsignedss_increase_ -#define _di_f_number_unsignedss_increase_by_ -#define _di_f_number_unsignedss_resize_ -#define _di_f_number_unsignedss_t_ -//#define _di_f_number_unsigneds_t_ -//#define _di_f_number_unsigned_t_ - -#define _di_f_pipe_error_exists_ -//#define _di_f_pipe_input_exists_ -#define _di_f_pipe_output_exists_ - -//#define _di_f_print_ -#define _di_f_print_character_ -#define _di_f_print_character_safely_ -#define _di_f_print_character_safely_get_ -//#define _di_f_print_dynamic_ -#define _di_f_print_dynamic_except_partial_ -#define _di_f_print_dynamic_except_partial_raw_ -#define _di_f_print_dynamic_except_partial_raw_safely_ -#define _di_f_print_dynamic_except_partial_safely_ -#define _di_f_print_dynamic_partial_ -#define _di_f_print_dynamic_partial_raw_ -#define _di_f_print_dynamic_partial_raw_safely_ -#define _di_f_print_dynamic_partial_safely_ -//#define _di_f_print_dynamic_raw_ -//#define _di_f_print_dynamic_raw_safely_ -//#define _di_f_print_dynamic_safely_ -#define _di_f_print_except_ -#define _di_f_print_except_dynamic_ -#define _di_f_print_except_dynamic_partial_ -#define _di_f_print_except_dynamic_partial_raw_ -#define _di_f_print_except_dynamic_partial_raw_safely_ -#define _di_f_print_except_dynamic_partial_safely_ -#define _di_f_print_except_dynamic_raw_ -#define _di_f_print_except_dynamic_raw_safely_ -#define _di_f_print_except_dynamic_safely_ -//#define _di_f_print_except_in_ -//#define _di_f_print_except_in_dynamic_ -#define _di_f_print_except_in_dynamic_partial_ -#define _di_f_print_except_in_dynamic_partial_raw_ -#define _di_f_print_except_in_dynamic_partial_raw_safely_ -#define _di_f_print_except_in_dynamic_partial_safely_ -//#define _di_f_print_except_in_dynamic_raw_ -//#define _di_f_print_except_in_dynamic_raw_safely_ -//#define _di_f_print_except_in_dynamic_safely_ -//#define _di_f_print_except_in_raw_ -//#define _di_f_print_except_in_raw_safely_ -//#define _di_f_print_except_in_safely_ -#define _di_f_print_except_raw_ -#define _di_f_print_except_raw_safely_ -#define _di_f_print_except_safely_ -//#define _di_f_print_format_flag_d_ -//#define _di_f_print_format_type_e_ -//#define _di_f_print_raw_ -//#define _di_f_print_raw_safely_ -#define _di_f_print_raw_terminated_ -//#define _di_f_print_safely_ -#define _di_f_print_safely_get_ -//#define _di_f_print_safely_terminated_ -//#define _di_f_print_sequence_s_ -//#define _di_f_print_sequences_set_control_s_ -//#define _di_f_print_terminated_ -#define _di_f_print_to_ -#define _di_f_print_to_character_ -#define _di_f_print_to_character_safely_ -#define _di_f_print_to_dynamic_ -#define _di_f_print_to_dynamic_partial_ -#define _di_f_print_to_dynamic_partial_raw_ -#define _di_f_print_to_dynamic_partial_raw_safely_ -#define _di_f_print_to_dynamic_partial_safely_ -#define _di_f_print_to_dynamic_raw_ -#define _di_f_print_to_dynamic_raw_safely_ -#define _di_f_print_to_dynamic_safely_ -#define _di_f_print_to_except_ -#define _di_f_print_to_except_dynamic_ -#define _di_f_print_to_except_dynamic_partial_ -#define _di_f_print_to_except_dynamic_partial_raw_ -#define _di_f_print_to_except_dynamic_partial_raw_safely_ -#define _di_f_print_to_except_dynamic_partial_safely_ -#define _di_f_print_to_except_dynamic_raw_ -#define _di_f_print_to_except_dynamic_raw_safely_ -#define _di_f_print_to_except_dynamic_safely_ -#define _di_f_print_to_except_in_ -#define _di_f_print_to_except_in_dynamic_ -#define _di_f_print_to_except_in_dynamic_partial_ -#define _di_f_print_to_except_in_dynamic_partial_raw_ -#define _di_f_print_to_except_in_dynamic_partial_raw_safely_ -#define _di_f_print_to_except_in_dynamic_partial_safely_ -#define _di_f_print_to_except_in_dynamic_raw_ -#define _di_f_print_to_except_in_dynamic_raw_safely_ -#define _di_f_print_to_except_in_dynamic_safely_ -#define _di_f_print_to_except_in_raw_ -#define _di_f_print_to_except_in_raw_safely_ -#define _di_f_print_to_except_in_safely_ -#define _di_f_print_to_except_raw_ -#define _di_f_print_to_except_raw_safely_ -#define _di_f_print_to_except_safely_ -#define _di_f_print_to_raw_ -#define _di_f_print_to_raw_safely_ -#define _di_f_print_to_raw_terminated_ -#define _di_f_print_to_safely_ -#define _di_f_print_to_safely_terminated_ -#define _di_f_print_to_terminated_ -//#define _di_f_print_write_max_d_ - -#define _di_f_signal_action_ -//#define _di_f_signal_close_ -#define _di_f_signal_how_t_ -//#define _di_f_signal_mask_ -//#define _di_f_signal_open_ -#define _di_f_signal_pause_ -#define _di_f_signal_queue_ -//#define _di_f_signal_read_ -#define _di_f_signal_send_ -//#define _di_f_signal_set_add_ -//#define _di_f_signal_set_delete_ -//#define _di_f_signal_set_empty_ -//#define _di_f_signal_set_fill_ -#define _di_f_signal_set_has_ -#define _di_f_signal_suspend_ -//#define _di_f_signal_t_ -#define _di_f_signal_wait_ -#define _di_f_signal_wait_until_ - -//#define _di_f_status_e_ - -//#define _di_f_char_t_ -#define _di_f_string_append_ -#define _di_f_string_append_assure_ -#define _di_f_string_append_assure_nulless_ -#define _di_f_string_append_nulless_ -//#define _di_f_string_ascii_s_ -#define _di_f_string_constant_t_ -#define _di_f_string_dynamic_adjust_ -#define _di_f_string_dynamic_append_ -#define _di_f_string_dynamic_append_assure_ -#define _di_f_string_dynamic_append_assure_nulless_ -#define _di_f_string_dynamic_decimate_by_ -#define _di_f_string_dynamic_decrease_by_ -#define _di_f_string_dynamic_increase_ -//#define _di_f_string_dynamic_increase_by_ -#define _di_f_string_dynamic_mash_ -#define _di_f_string_dynamic_mash_nulless_ -#define _di_f_string_dynamic_mish_ -#define _di_f_string_dynamic_mish_nulless_ -#define _di_f_string_dynamic_partial_append_ -#define _di_f_string_dynamic_partial_append_assure_ -#define _di_f_string_dynamic_partial_append_assure_nulless_ -#define _di_f_string_dynamic_partial_append_nulless_ -#define _di_f_string_dynamic_partial_mash_ -#define _di_f_string_dynamic_partial_mash_nulless_ -#define _di_f_string_dynamic_partial_mish_ -#define _di_f_string_dynamic_partial_mish_nulless_ -#define _di_f_string_dynamic_partial_prepend_ -#define _di_f_string_dynamic_partial_prepend_assure_ -#define _di_f_string_dynamic_partial_prepend_assure_nulless_ -#define _di_f_string_dynamic_partial_prepend_nulless_ -#define _di_f_string_dynamic_prepend_ -#define _di_f_string_dynamic_prepend_assure_ -#define _di_f_string_dynamic_prepend_assure_nulless_ -#define _di_f_string_dynamic_prepend_nulless_ -#define _di_f_string_dynamics_append_ -#define _di_f_string_dynamics_append_all_ -#define _di_f_string_dynamic_seek_line_ -#define _di_f_string_dynamic_seek_line_to_ -#define _di_f_string_dynamic_seek_to_ -#define _di_f_string_dynamicss_append_ -#define _di_f_string_dynamicss_append_all_ -#define _di_f_string_dynamicss_t_ -//#define _di_f_string_dynamics_t_ -//#define _di_f_string_dynamic_t_ -#define _di_f_string_dynamic_terminate_ -//#define _di_f_string_dynamic_terminate_after_ -//#define _di_f_string_empty_s_ -//#define _di_f_string_eol_s_ -#define _di_f_string_map_multis_adjust_ -#define _di_f_string_map_multis_append_ -#define _di_f_string_map_multis_append_all_ -#define _di_f_string_map_multis_decimate_by_ -#define _di_f_string_map_multis_decrease_by_ -#define _di_f_string_map_multis_increase_ -#define _di_f_string_map_multis_increase_by_ -#define _di_f_string_map_multis_resize_ -#define _di_f_string_map_multiss_adjust_ -#define _di_f_string_map_multiss_append_ -#define _di_f_string_map_multiss_append_all_ -#define _di_f_string_map_multiss_decimate_by_ -#define _di_f_string_map_multiss_decrease_by_ -#define _di_f_string_map_multiss_increase_ -#define _di_f_string_map_multiss_increase_by_ -#define _di_f_string_map_multiss_resize_ -//#define _di_f_string_map_multiss_t_ -//#define _di_f_string_map_multis_t_ -//#define _di_f_string_map_multi_t_ -#define _di_f_string_maps_adjust_ -#define _di_f_string_maps_append_ -#define _di_f_string_maps_append_all_ -#define _di_f_string_maps_decimate_by_ -#define _di_f_string_maps_decrease_by_ -#define _di_f_string_maps_increase_ -#define _di_f_string_maps_increase_by_ -#define _di_f_string_maps_resize_ -#define _di_f_string_mapss_adjust_ -#define _di_f_string_mapss_append_ -#define _di_f_string_mapss_append_all_ -#define _di_f_string_mapss_decimate_by_ -#define _di_f_string_mapss_decrease_by_ -#define _di_f_string_mapss_increase_ -#define _di_f_string_mapss_increase_by_ -#define _di_f_string_mapss_resize_ -//#define _di_f_string_mapss_t_ -//#define _di_f_string_maps_t_ -//#define _di_f_string_map_t_ -#define _di_f_string_mash_ -#define _di_f_string_mash_nulless_ -#define _di_f_string_mish_ -#define _di_f_string_mish_nulless_ -#define _di_f_string_null_s_ -#define _di_f_string_placeholder_s_ -#define _di_f_string_prepend_ -#define _di_f_string_prepend_assure_ -#define _di_f_string_prepend_assure_nulless_ -#define _di_f_string_prepend_nulless_ -#define _di_f_string_quantitys_adjust_ -#define _di_f_string_quantitys_append_ -#define _di_f_string_quantitys_append_all_ -#define _di_f_string_quantitys_decimate_by_ -#define _di_f_string_quantitys_decrease_by_ -#define _di_f_string_quantitys_increase_ -#define _di_f_string_quantitys_increase_by_ -#define _di_f_string_quantitys_resize_ -#define _di_f_string_quantityss_adjust_ -#define _di_f_string_quantityss_append_ -#define _di_f_string_quantityss_append_all_ -#define _di_f_string_quantityss_decimate_by_ -#define _di_f_string_quantityss_decrease_by_ -#define _di_f_string_quantityss_increase_ -#define _di_f_string_quantityss_increase_by_ -#define _di_f_string_quantityss_resize_ -//#define _di_f_string_quantityss_t_ -//#define _di_f_string_quantitys_t_ -//#define _di_f_string_quantity_t_ -#define _di_f_string_ranges_adjust_ -#define _di_f_string_ranges_append_ -#define _di_f_string_ranges_append_all_ -#define _di_f_string_ranges_decimate_by_ -#define _di_f_string_ranges_decrease_by_ -#define _di_f_string_ranges_increase_ -#define _di_f_string_ranges_increase_by_ -#define _di_f_string_ranges_resize_ -#define _di_f_string_rangess_adjust_ -#define _di_f_string_rangess_append_ -#define _di_f_string_rangess_append_all_ -#define _di_f_string_rangess_decimate_by_ -#define _di_f_string_rangess_decrease_by_ -#define _di_f_string_rangess_increase_ -#define _di_f_string_rangess_increase_by_ -#define _di_f_string_rangess_resize_ -//#define _di_f_string_rangess_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_ -//#define _di_f_string_space_s_ -#define _di_f_string_staticss_t_ -//#define _di_f_string_statics_t_ -//#define _di_f_string_static_t_ -//#define _di_f_string_t_ -#define _di_f_string_triples_adjust_ -#define _di_f_string_triples_append_ -#define _di_f_string_triples_append_all_ -#define _di_f_string_triples_decimate_by_ -#define _di_f_string_triples_decrease_by_ -#define _di_f_string_triples_increase_ -#define _di_f_string_triples_increase_by_ -#define _di_f_string_triples_resize_ -#define _di_f_string_tripless_adjust_ -#define _di_f_string_tripless_append_ -#define _di_f_string_tripless_append_all_ -#define _di_f_string_tripless_decimate_by_ -#define _di_f_string_tripless_decrease_by_ -#define _di_f_string_tripless_increase_ -#define _di_f_string_tripless_increase_by_ -#define _di_f_string_tripless_resize_ -//#define _di_f_string_tripless_t_ -//#define _di_f_string_triples_t_ -//#define _di_f_string_triple_t_ - -#define _di_f_cells_adjust_ -#define _di_f_cells_append_ -#define _di_f_cells_append_all_ -#define _di_f_cells_decimate_by_ -#define _di_f_cells_decrease_by_ -#define _di_f_cells_increase_ -#define _di_f_cells_increase_by_ -#define _di_f_cells_resize_ -#define _di_f_cellss_adjust_ -#define _di_f_cellss_append_ -#define _di_f_cellss_append_all_ -#define _di_f_cellss_decimate_by_ -#define _di_f_cellss_decrease_by_ -#define _di_f_cellss_increase_ -#define _di_f_cellss_increase_by_ -#define _di_f_cellss_resize_ -#define _di_f_cellss_t_ -#define _di_f_cells_t_ -#define _di_f_fll_ids_adjust_ -#define _di_f_fll_ids_append_ -#define _di_f_fll_ids_append_all_ -#define _di_f_fll_ids_decimate_by_ -#define _di_f_fll_ids_decrease_by_ -#define _di_f_fll_ids_increase_ -#define _di_f_fll_ids_increase_by_ -#define _di_f_fll_ids_resize_ -#define _di_f_fll_idss_adjust_ -#define _di_f_fll_idss_append_ -#define _di_f_fll_idss_append_all_ -#define _di_f_fll_idss_decimate_by_ -#define _di_f_fll_idss_decrease_by_ -#define _di_f_fll_idss_increase_ -#define _di_f_fll_idss_increase_by_ -#define _di_f_fll_idss_resize_ -#define _di_f_fll_idss_t_ -#define _di_f_fll_ids_t_ -#define _di_f_int128s_adjust_ -#define _di_f_int128s_append_ -#define _di_f_int128s_append_all_ -#define _di_f_int128s_decimate_by_ -#define _di_f_int128s_decrease_by_ -#define _di_f_int128s_increase_ -#define _di_f_int128s_increase_by_ -#define _di_f_int128s_resize_ -#define _di_f_int128ss_adjust_ -#define _di_f_int128ss_append_ -#define _di_f_int128ss_append_all_ -#define _di_f_int128ss_decimate_by_ -#define _di_f_int128ss_decrease_by_ -#define _di_f_int128ss_increase_ -#define _di_f_int128ss_increase_by_ -#define _di_f_int128ss_resize_ -#define _di_f_int128ss_t_ -#define _di_f_int128s_t_ -#define _di_f_int16s_adjust_ -#define _di_f_int16s_append_ -#define _di_f_int16s_append_all_ -#define _di_f_int16s_decimate_by_ -#define _di_f_int16s_decrease_by_ -#define _di_f_int16s_increase_ -#define _di_f_int16s_increase_by_ -#define _di_f_int16s_resize_ -#define _di_f_int16ss_adjust_ -#define _di_f_int16ss_append_ -#define _di_f_int16ss_append_all_ -#define _di_f_int16ss_decimate_by_ -#define _di_f_int16ss_decrease_by_ -#define _di_f_int16ss_increase_ -#define _di_f_int16ss_increase_by_ -#define _di_f_int16ss_resize_ -#define _di_f_int16ss_t_ -#define _di_f_int16s_t_ -#define _di_f_int32s_adjust_ -#define _di_f_int32s_append_ -#define _di_f_int32s_append_all_ -#define _di_f_int32s_decimate_by_ -#define _di_f_int32s_decrease_by_ -#define _di_f_int32s_increase_ -#define _di_f_int32s_increase_by_ -#define _di_f_int32s_resize_ -#define _di_f_int32ss_adjust_ -#define _di_f_int32ss_append_ -#define _di_f_int32ss_append_all_ -#define _di_f_int32ss_decimate_by_ -#define _di_f_int32ss_decrease_by_ -#define _di_f_int32ss_increase_ -#define _di_f_int32ss_increase_by_ -#define _di_f_int32ss_resize_ -#define _di_f_int32ss_t_ -#define _di_f_int32s_t_ -#define _di_f_int64s_adjust_ -#define _di_f_int64s_append_ -#define _di_f_int64s_append_all_ -#define _di_f_int64s_decimate_by_ -#define _di_f_int64s_decrease_by_ -#define _di_f_int64s_increase_ -#define _di_f_int64s_increase_by_ -#define _di_f_int64s_resize_ -#define _di_f_int64ss_adjust_ -#define _di_f_int64ss_append_ -#define _di_f_int64ss_append_all_ -#define _di_f_int64ss_decimate_by_ -#define _di_f_int64ss_decrease_by_ -#define _di_f_int64ss_increase_ -#define _di_f_int64ss_increase_by_ -#define _di_f_int64ss_resize_ -#define _di_f_int64ss_t_ -#define _di_f_int64s_t_ -#define _di_f_int8s_adjust_ -#define _di_f_int8s_append_ -#define _di_f_int8s_append_all_ -#define _di_f_int8s_decimate_by_ -#define _di_f_int8s_decrease_by_ -#define _di_f_int8s_increase_ -#define _di_f_int8s_increase_by_ -#define _di_f_int8s_resize_ -#define _di_f_int8ss_adjust_ -#define _di_f_int8ss_append_ -#define _di_f_int8ss_append_all_ -#define _di_f_int8ss_decimate_by_ -#define _di_f_int8ss_decrease_by_ -#define _di_f_int8ss_increase_ -#define _di_f_int8ss_increase_by_ -#define _di_f_int8ss_resize_ -#define _di_f_int8ss_t_ -#define _di_f_int8_t_ -#define _di_f_states_adjust_ -#define _di_f_states_append_ -#define _di_f_states_append_all_ -#define _di_f_states_decimate_by_ -#define _di_f_states_decrease_by_ -#define _di_f_states_increase_ -#define _di_f_states_increase_by_ -#define _di_f_states_resize_ -#define _di_f_statess_adjust_ -#define _di_f_statess_append_ -#define _di_f_statess_append_all_ -#define _di_f_statess_decimate_by_ -#define _di_f_statess_decrease_by_ -#define _di_f_statess_increase_ -#define _di_f_statess_increase_by_ -#define _di_f_statess_resize_ -#define _di_f_statess_t_ -#define _di_f_states_t_ -#define _di_f_statuss_adjust_ -#define _di_f_statuss_append_ -#define _di_f_statuss_append_all_ -#define _di_f_statuss_decimate_by_ -#define _di_f_statuss_decrease_by_ -#define _di_f_statuss_increase_ -#define _di_f_statuss_increase_by_ -#define _di_f_statuss_resize_ -#define _di_f_statusss_adjust_ -#define _di_f_statusss_append_ -#define _di_f_statusss_append_all_ -#define _di_f_statusss_decimate_by_ -#define _di_f_statusss_decrease_by_ -#define _di_f_statusss_increase_ -#define _di_f_statusss_increase_by_ -#define _di_f_statusss_resize_ -#define _di_f_statusss_t_ -#define _di_f_statuss_t_ -#define _di_f_uint128s_adjust_ -#define _di_f_uint128s_append_ -#define _di_f_uint128s_append_all_ -#define _di_f_uint128s_decimate_by_ -#define _di_f_uint128s_decrease_by_ -#define _di_f_uint128s_increase_ -#define _di_f_uint128s_increase_by_ -#define _di_f_uint128s_resize_ -#define _di_f_uint128ss_adjust_ -#define _di_f_uint128ss_append_ -#define _di_f_uint128ss_append_all_ -#define _di_f_uint128ss_decimate_by_ -#define _di_f_uint128ss_decrease_by_ -#define _di_f_uint128ss_increase_ -#define _di_f_uint128ss_increase_by_ -#define _di_f_uint128ss_resize_ -#define _di_f_uint128ss_t_ -#define _di_f_uint128s_t_ -#define _di_f_uint16s_adjust_ -#define _di_f_uint16s_append_ -#define _di_f_uint16s_append_all_ -#define _di_f_uint16s_decimate_by_ -#define _di_f_uint16s_decrease_by_ -#define _di_f_uint16s_increase_ -#define _di_f_uint16s_increase_by_ -#define _di_f_uint16s_resize_ -#define _di_f_uint16ss_adjust_ -#define _di_f_uint16ss_append_ -#define _di_f_uint16ss_append_all_ -#define _di_f_uint16ss_decimate_by_ -#define _di_f_uint16ss_decrease_by_ -#define _di_f_uint16ss_increase_ -#define _di_f_uint16ss_increase_by_ -#define _di_f_uint16ss_resize_ -#define _di_f_uint16ss_t_ -#define _di_f_uint16s_t_ -#define _di_f_uint32s_adjust_ -#define _di_f_uint32s_append_ -#define _di_f_uint32s_append_all_ -#define _di_f_uint32s_decimate_by_ -#define _di_f_uint32s_decrease_by_ -#define _di_f_uint32s_increase_ -#define _di_f_uint32s_increase_by_ -#define _di_f_uint32s_resize_ -#define _di_f_uint32ss_adjust_ -#define _di_f_uint32ss_append_ -#define _di_f_uint32ss_append_all_ -#define _di_f_uint32ss_decimate_by_ -#define _di_f_uint32ss_decrease_by_ -#define _di_f_uint32ss_increase_ -#define _di_f_uint32ss_increase_by_ -#define _di_f_uint32ss_resize_ -#define _di_f_uint32ss_t_ -#define _di_f_uint32s_t_ -#define _di_f_uint64s_adjust_ -#define _di_f_uint64s_append_ -#define _di_f_uint64s_append_all_ -#define _di_f_uint64s_decimate_by_ -#define _di_f_uint64s_decrease_by_ -#define _di_f_uint64s_increase_ -#define _di_f_uint64s_increase_by_ -#define _di_f_uint64s_resize_ -#define _di_f_uint64ss_adjust_ -#define _di_f_uint64ss_append_ -#define _di_f_uint64ss_append_all_ -#define _di_f_uint64ss_decimate_by_ -#define _di_f_uint64ss_decrease_by_ -#define _di_f_uint64ss_increase_ -#define _di_f_uint64ss_increase_by_ -#define _di_f_uint64ss_resize_ -#define _di_f_uint64ss_t_ -#define _di_f_uint64s_t_ -#define _di_f_uint8s_adjust_ -#define _di_f_uint8s_append_ -#define _di_f_uint8s_append_all_ -#define _di_f_uint8s_decimate_by_ -#define _di_f_uint8s_decrease_by_ -#define _di_f_uint8s_increase_ -#define _di_f_uint8s_increase_by_ -#define _di_f_uint8s_resize_ -#define _di_f_uint8ss_adjust_ -#define _di_f_uint8ss_append_ -#define _di_f_uint8ss_append_all_ -#define _di_f_uint8ss_decimate_by_ -#define _di_f_uint8ss_decrease_by_ -#define _di_f_uint8ss_increase_ -#define _di_f_uint8ss_increase_by_ -#define _di_f_uint8ss_resize_ -#define _di_f_uint8ss_t_ -#define _di_f_uint8s_t_ - -#define _di_f_utf_buffer_decrement_ -#define _di_f_utf_buffer_increment_ -//#define _di_f_utf_byte_d_ -#define _di_f_utf_character_is_ -#define _di_f_utf_character_is_alphabetic_ -#define _di_f_utf_character_is_alphabetic_digit_ -#define _di_f_utf_character_is_alphabetic_numeric_ -#define _di_f_utf_character_is_ascii_ -#define _di_f_utf_character_is_combining_ -#define _di_f_utf_character_is_control_ -#define _di_f_utf_character_is_control_code_ -#define _di_f_utf_character_is_control_format_ -#define _di_f_utf_character_is_control_picture_ -#define _di_f_utf_character_is_digit_ -#define _di_f_utf_character_is_emoji_ -#define _di_f_utf_character_is_fragment_ -#define _di_f_utf_character_is_graph_ -#define _di_f_utf_character_is_numeric_ -#define _di_f_utf_character_is_phonetic_ -#define _di_f_utf_character_is_private_ -#define _di_f_utf_character_is_punctuation_ -#define _di_f_utf_character_is_subscript_ -#define _di_f_utf_character_is_superscript_ -#define _di_f_utf_character_is_symbol_ -#define _di_f_utf_character_is_unassigned_ -#define _di_f_utf_character_is_valid_ -#define _di_f_utf_character_is_whitespace_ -#define _di_f_utf_character_is_whitespace_modifier_ -#define _di_f_utf_character_is_whitespace_other_ -#define _di_f_utf_character_is_whitespace_zero_width_ -#define _di_f_utf_character_is_wide_ -#define _di_f_utf_character_is_word_ -#define _di_f_utf_character_is_word_dash_ -#define _di_f_utf_character_is_word_dash_plus_ -#define _di_f_utf_character_is_zero_width_ -#define _di_f_utf_character_unicode_from_ -#define _di_f_utf_character_unicode_string_to_ -#define _di_f_utf_character_unicode_to_ -//#define _di_f_utf_char_t_ -#define _di_f_utf_char_s_ -#define _di_f_utf_char_to_char_ -//#define _di_f_utf_char_to_character_ -#define _di_f_utf_is_ -#define _di_f_utf_is_alphabetic_ -#define _di_f_utf_is_alphabetic_digit_ -#define _di_f_utf_is_alphabetic_numeric_ -#define _di_f_utf_is_ascii_ -//#define _di_f_utf_is_combining_ -//#define _di_f_utf_is_control_ -#define _di_f_utf_is_control_code_ -#define _di_f_utf_is_control_format_ -#define _di_f_utf_is_control_picture_ -#define _di_f_utf_is_digit_ -#define _di_f_utf_is_emoji_ -#define _di_f_utf_is_fragment_ -//#define _di_f_utf_is_graph_ -#define _di_f_utf_is_numeric_ -#define _di_f_utf_is_phonetic_ -//#define _di_f_utf_is_private_ -#define _di_f_utf_is_punctuation_ -#define _di_f_utf_is_subscript_ -#define _di_f_utf_is_superscript_ -#define _di_f_utf_is_symbol_ -#define _di_f_utf_is_unassigned_ -//#define _di_f_utf_is_valid_ -//#define _di_f_utf_is_whitespace_ -#define _di_f_utf_is_whitespace_modifier_ -#define _di_f_utf_is_whitespace_other_ -#define _di_f_utf_is_whitespace_zero_width_ -//#define _di_f_utf_is_wide_ -#define _di_f_utf_is_word_ -#define _di_f_utf_is_word_dash_ -#define _di_f_utf_is_word_dash_plus_ -#define _di_f_utf_is_zero_width_ -#define _di_f_utf_space_s_ -#define _di_f_utf_string_append_ -#define _di_f_utf_string_append_assure_ -#define _di_f_utf_string_append_assure_nulless_ -#define _di_f_utf_string_append_nulless_ -#define _di_f_utf_string_dynamic_append_ -#define _di_f_utf_string_dynamic_append_assure_ -#define _di_f_utf_string_dynamic_append_assure_nulless_ -#define _di_f_utf_string_dynamic_append_nulless_ -#define _di_f_utf_string_dynamic_mash_ -#define _di_f_utf_string_dynamic_mash_nulless_ -#define _di_f_utf_string_dynamic_mish_ -#define _di_f_utf_string_dynamic_mish_nulless_ -#define _di_f_utf_string_dynamic_partial_append_ -#define _di_f_utf_string_dynamic_partial_append_assure_ -#define _di_f_utf_string_dynamic_partial_append_assure_nulless_ -#define _di_f_utf_string_dynamic_partial_append_nulless_ -#define _di_f_utf_string_dynamic_partial_mash_ -#define _di_f_utf_string_dynamic_partial_mash_nulless_ -#define _di_f_utf_string_dynamic_partial_mish_ -#define _di_f_utf_string_dynamic_partial_mish_nulless_ -#define _di_f_utf_string_dynamic_partial_prepend_ -#define _di_f_utf_string_dynamic_partial_prepend_assure_ -#define _di_f_utf_string_dynamic_partial_prepend_assure_nulless_ -#define _di_f_utf_string_dynamic_partial_prepend_nulless_ -#define _di_f_utf_string_dynamic_prepend_ -#define _di_f_utf_string_dynamic_prepend_assure_ -#define _di_f_utf_string_dynamic_prepend_assure_nulless_ -#define _di_f_utf_string_dynamic_prepend_nulless_ -#define _di_f_utf_string_dynamics_append_ -#define _di_f_utf_string_dynamics_append_all_ -#define _di_f_utf_string_dynamic_seek_line_ -#define _di_f_utf_string_dynamic_seek_line_to_ -#define _di_f_utf_string_dynamic_seek_to_ -#define _di_f_utf_string_dynamicss_append_ -#define _di_f_utf_string_dynamicss_append_all_ -#define _di_f_utf_string_dynamicss_t_ -//#define _di_f_utf_string_dynamics_t_ -//#define _di_f_utf_string_dynamic_t_ -#define _di_f_utf_string_dynamic_terminate_ -#define _di_f_utf_string_dynamic_terminate_after_ -#define _di_f_utf_string_empty_s_ -#define _di_f_utf_string_map_multis_adjust_ -#define _di_f_utf_string_map_multis_append_ -#define _di_f_utf_string_map_multis_append_all_ -#define _di_f_utf_string_map_multis_decimate_by_ -#define _di_f_utf_string_map_multis_decrease_by_ -#define _di_f_utf_string_map_multis_increase_ -#define _di_f_utf_string_map_multis_increase_by_ -#define _di_f_utf_string_map_multis_resize_ -#define _di_f_utf_string_map_multiss_adjust_ -#define _di_f_utf_string_map_multiss_append_ -#define _di_f_utf_string_map_multiss_append_all_ -#define _di_f_utf_string_map_multiss_decimate_by_ -#define _di_f_utf_string_map_multiss_decrease_by_ -#define _di_f_utf_string_map_multiss_increase_ -#define _di_f_utf_string_map_multiss_increase_by_ -#define _di_f_utf_string_map_multiss_resize_ -//#define _di_f_utf_string_map_multiss_t_ -//#define _di_f_utf_string_map_multis_t_ -//#define _di_f_utf_string_map_multi_t_ -#define _di_f_utf_string_maps_adjust_ -#define _di_f_utf_string_maps_append_ -#define _di_f_utf_string_maps_append_all_ -#define _di_f_utf_string_maps_decimate_by_ -#define _di_f_utf_string_maps_decrease_by_ -#define _di_f_utf_string_maps_increase_ -#define _di_f_utf_string_maps_increase_by_ -#define _di_f_utf_string_maps_resize_ -#define _di_f_utf_string_mapss_adjust_ -#define _di_f_utf_string_mapss_append_ -#define _di_f_utf_string_mapss_append_all_ -#define _di_f_utf_string_mapss_decimate_by_ -#define _di_f_utf_string_mapss_decrease_by_ -#define _di_f_utf_string_mapss_increase_ -#define _di_f_utf_string_mapss_increase_by_ -#define _di_f_utf_string_mapss_resize_ -//#define _di_f_utf_string_mapss_t_ -//#define _di_f_utf_string_maps_t_ -//#define _di_f_utf_string_map_t_ -#define _di_f_utf_string_mash_ -#define _di_f_utf_string_mash_nulless_ -#define _di_f_utf_string_mish_ -#define _di_f_utf_string_mish_nulless_ -#define _di_f_utf_string_prepend_ -#define _di_f_utf_string_prepend_assure_ -#define _di_f_utf_string_prepend_assure_nulless_ -#define _di_f_utf_string_prepend_nulless_ -#define _di_f_utf_string_seek_line_ -#define _di_f_utf_string_seek_line_to_ -#define _di_f_utf_string_seek_to_ -#define _di_f_utf_string_staticss_t_ -//#define _di_f_utf_string_statics_t_ -//#define _di_f_utf_string_static_t_ -//#define _di_f_utf_string_t_ -#define _di_f_utf_string_triples_adjust_ -#define _di_f_utf_string_triples_append_ -#define _di_f_utf_string_triples_append_all_ -#define _di_f_utf_string_triples_decimate_by_ -#define _di_f_utf_string_triples_decrease_by_ -#define _di_f_utf_string_triples_increase_ -#define _di_f_utf_string_triples_increase_by_ -#define _di_f_utf_string_triples_resize_ -#define _di_f_utf_string_tripless_adjust_ -#define _di_f_utf_string_tripless_append_ -#define _di_f_utf_string_tripless_append_all_ -#define _di_f_utf_string_tripless_decimate_by_ -#define _di_f_utf_string_tripless_decrease_by_ -#define _di_f_utf_string_tripless_increase_ -#define _di_f_utf_string_tripless_increase_by_ -#define _di_f_utf_string_tripless_resize_ -//#define _di_f_utf_string_tripless_t_ -//#define _di_f_utf_string_triples_t_ -//#define _di_f_utf_string_triple_t_ -#define _di_f_utf_substitute_s_ -//#define _di_f_utf_unicode_from_ -//#define _di_f_utf_unicode_string_to_ -//#define _di_f_utf_unicode_to_ -#define _di_f_utf_width_e_ - -//#define _di_fl_conversion_data_flag_d_ -//#define _di_fl_conversion_data_t_ -//#define _di_fl_conversion_data_c_ -#define _di_fl_conversion_dynamic_partial_to_signed_ -#define _di_fl_conversion_dynamic_partial_to_signed_detect_ -#define _di_fl_conversion_dynamic_partial_to_unsigned_ -#define _di_fl_conversion_dynamic_partial_to_unsigned_detect_ -#define _di_fl_conversion_dynamic_to_signed_ -#define _di_fl_conversion_dynamic_to_signed_detect_ -#define _di_fl_conversion_dynamic_to_unsigned_ -//#define _di_fl_conversion_dynamic_to_unsigned_detect_ - -//#define _di_fl_print_format_ -#define _di_fl_print_format_convert_ -//#define _di_fl_print_string_va_ -//#define _di_fl_print_t_ -#define _di_fl_print_trim_ -#define _di_fl_print_trim_dynamic_ -#define _di_fl_print_trim_dynamic_partial_ -#define _di_fl_print_trim_dynamic_partial_raw_ -#define _di_fl_print_trim_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_dynamic_partial_safely_ -#define _di_fl_print_trim_dynamic_raw_ -#define _di_fl_print_trim_dynamic_raw_safely_ -#define _di_fl_print_trim_dynamic_safely_ -#define _di_fl_print_trim_except_ -#define _di_fl_print_trim_except_dynamic_ -#define _di_fl_print_trim_except_dynamic_partial_ -#define _di_fl_print_trim_except_dynamic_partial_raw_ -#define _di_fl_print_trim_except_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_except_dynamic_partial_safely_ -#define _di_fl_print_trim_except_dynamic_raw_ -#define _di_fl_print_trim_except_dynamic_raw_safely_ -#define _di_fl_print_trim_except_dynamic_safely_ -#define _di_fl_print_trim_except_in_ -#define _di_fl_print_trim_except_in_dynamic_ -#define _di_fl_print_trim_except_in_dynamic_partial_ -#define _di_fl_print_trim_except_in_dynamic_partial_raw_ -#define _di_fl_print_trim_except_in_dynamic_partial_raw_safely_ -#define _di_fl_print_trim_except_in_dynamic_partial_safely_ -#define _di_fl_print_trim_except_in_dynamic_raw_ -#define _di_fl_print_trim_except_in_dynamic_raw_safely_ -#define _di_fl_print_trim_except_in_dynamic_safely_ -#define _di_fl_print_trim_except_in_raw_ -#define _di_fl_print_trim_except_in_raw_safely_ -#define _di_fl_print_trim_except_in_safely_ -#define _di_fl_print_trim_except_raw_ -#define _di_fl_print_trim_except_raw_safely_ -#define _di_fl_print_trim_except_safely_ -#define _di_fl_print_trim_raw_ -#define _di_fl_print_trim_raw_safely_ -#define _di_fl_print_trim_safely_ - -#define _di_fl_string_compare_ -#define _di_fl_string_compare_except_ -#define _di_fl_string_compare_except_trim_ -#define _di_fl_string_compare_trim_ -#define _di_fl_string_dynamic_compare_ -#define _di_fl_string_dynamic_compare_except_ -#define _di_fl_string_dynamic_compare_except_string_ -#define _di_fl_string_dynamic_compare_except_trim_ -#define _di_fl_string_dynamic_compare_except_trim_string_ -#define _di_fl_string_dynamic_compare_string_ -#define _di_fl_string_dynamic_compare_trim_ -#define _di_fl_string_dynamic_compare_trim_string_ -#define _di_fl_string_dynamic_partial_compare_ -#define _di_fl_string_dynamic_partial_compare_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_ -#define _di_fl_string_dynamic_partial_compare_except_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_string_ -#define _di_fl_string_dynamic_partial_compare_except_trim_ -#define _di_fl_string_dynamic_partial_compare_except_trim_dynamic_ -#define _di_fl_string_dynamic_partial_compare_except_trim_string_ -#define _di_fl_string_dynamic_partial_compare_string_ -#define _di_fl_string_dynamic_partial_compare_trim_ -#define _di_fl_string_dynamic_partial_compare_trim_dynamic_ -#define _di_fl_string_dynamic_partial_compare_trim_string_ -#define _di_fl_string_dynamic_partial_fll_identify_ -#define _di_fl_string_dynamic_partial_rip_ -#define _di_fl_string_dynamic_partial_rip_nulless_ -#define _di_fl_string_dynamic_rip_ -#define _di_fl_string_dynamic_rip_nulless_ -#define _di_fl_string_dynamic_seek_line_to_utf_character_ -#define _di_fl_string_dynamic_seek_line_until_graph_ -#define _di_fl_string_dynamic_seek_line_until_graph_non_ -#define _di_fl_string_dynamic_seek_to_utf_character_ -#define _di_fl_string_rip_ -#define _di_fl_string_rip_nulless_ -#define _di_fl_string_seek_line_to_utf_character_ -#define _di_fl_string_seek_line_until_graph_ -#define _di_fl_string_seek_line_until_graph_non_ -#define _di_fl_string_seek_to_utf_character_ - -//#define _di_fll_error_file_print_ -//#define _di_fll_error_file_type_e_ -#define _di_fll_error_parameter_integer_print_ -//#define _di_fll_error_print_ - -#define _di_fll_print_ -#define _di_fll_print_character_ -#define _di_fll_print_character_safely_ -#define _di_fll_print_dynamic_ -#define _di_fll_print_dynamic_partial_ -#define _di_fll_print_dynamic_partial_raw_ -#define _di_fll_print_dynamic_partial_raw_safely_ -#define _di_fll_print_dynamic_partial_safely_ -//#define _di_fll_print_dynamic_raw_ -#define _di_fll_print_dynamic_raw_safely_ -#define _di_fll_print_dynamic_safely_ -#define _di_fll_print_except_ -#define _di_fll_print_except_dynamic_ -#define _di_fll_print_except_dynamic_partial_ -#define _di_fll_print_except_dynamic_partial_raw_ -#define _di_fll_print_except_dynamic_partial_raw_safely_ -#define _di_fll_print_except_dynamic_partial_safely_ -#define _di_fll_print_except_dynamic_raw_ -#define _di_fll_print_except_dynamic_raw_safely_ -#define _di_fll_print_except_dynamic_safely_ -#define _di_fll_print_except_in_ -#define _di_fll_print_except_in_dynamic_ -#define _di_fll_print_except_in_dynamic_partial_ -#define _di_fll_print_except_in_dynamic_partial_raw_ -#define _di_fll_print_except_in_dynamic_partial_raw_safely_ -#define _di_fll_print_except_in_dynamic_partial_safely_ -#define _di_fll_print_except_in_dynamic_raw_ -#define _di_fll_print_except_in_dynamic_raw_safely_ -#define _di_fll_print_except_in_dynamic_safely_ -#define _di_fll_print_except_in_raw_ -#define _di_fll_print_except_in_raw_safely_ -#define _di_fll_print_except_in_safely_ -#define _di_fll_print_except_raw_ -#define _di_fll_print_except_raw_safely_ -#define _di_fll_print_except_safely_ -//#define _di_fll_print_format_ -#define _di_fll_print_format_convert_ -#define _di_fll_print_raw_ -#define _di_fll_print_raw_safely_ -#define _di_fll_print_raw_terminated_ -#define _di_fll_print_safely_ -#define _di_fll_print_safely_terminated_ -#define _di_fll_print_string_va_ -#define _di_fll_print_terminated_ -#define _di_fll_print_trim_ -#define _di_fll_print_trim_dynamic_ -#define _di_fll_print_trim_dynamic_partial_ -#define _di_fll_print_trim_dynamic_partial_raw_ -#define _di_fll_print_trim_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_dynamic_partial_safely_ -#define _di_fll_print_trim_dynamic_raw_ -#define _di_fll_print_trim_dynamic_raw_safely_ -#define _di_fll_print_trim_dynamic_safely_ -#define _di_fll_print_trim_except_ -#define _di_fll_print_trim_except_dynamic_ -#define _di_fll_print_trim_except_dynamic_partial_ -#define _di_fll_print_trim_except_dynamic_partial_raw_ -#define _di_fll_print_trim_except_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_except_dynamic_partial_safely_ -#define _di_fll_print_trim_except_dynamic_raw_ -#define _di_fll_print_trim_except_dynamic_raw_safely_ -#define _di_fll_print_trim_except_dynamic_safely_ -#define _di_fll_print_trim_except_in_ -#define _di_fll_print_trim_except_in_dynamic_ -#define _di_fll_print_trim_except_in_dynamic_partial_ -#define _di_fll_print_trim_except_in_dynamic_partial_raw_ -#define _di_fll_print_trim_except_in_dynamic_partial_raw_safely_ -#define _di_fll_print_trim_except_in_dynamic_partial_safely_ -#define _di_fll_print_trim_except_in_dynamic_raw_ -#define _di_fll_print_trim_except_in_dynamic_raw_safely_ -#define _di_fll_print_trim_except_in_dynamic_safely_ -#define _di_fll_print_trim_except_in_raw_ -#define _di_fll_print_trim_except_in_raw_safely_ -#define _di_fll_print_trim_except_in_safely_ -#define _di_fll_print_trim_except_raw_ -#define _di_fll_print_trim_except_raw_safely_ -#define _di_fll_print_trim_except_safely_ -#define _di_fll_print_trim_raw_ -#define _di_fll_print_trim_raw_safely_ -#define _di_fll_print_trim_safely_ - -//#define _di_fll_program_data_delete_ -#define _di_fll_program_data_destroy_ -//#define _di_fll_program_data_t_ -#define _di_fll_program_parameter_additional_append_ -#define _di_fll_program_parameter_additional_mash_ -#define _di_fll_program_parameter_additional_rip_ -#define _di_fll_program_parameter_additional_rip_mash_ -#define _di_fll_program_parameter_long_print_cannot_use_with_ -//#define _di_fll_program_parameter_process_ -//#define _di_fll_program_parameter_process_empty_ -#define _di_fll_program_parameter_s_ -//#define _di_fll_program_print_help_header_ -//#define _di_fll_program_print_help_option_ -#define _di_fll_program_print_help_option_long_ -#define _di_fll_program_print_help_option_other_ -//#define _di_fll_program_print_help_usage_ -//#define _di_fll_program_print_version_ -//#define _di_fll_program_standard_setdown_ -//#define _di_fll_program_standard_setup_ -//#define _di_fll_program_standard_signal_received_ -#define _di_fll_program_standard_signal_state_ +// A config.h file for defining all code being disabled for compiling the stand alone Featureless Make. +// To assist in building this file use (may need to omit --defined-only): "nm --defined-only -f p programs/shared/fake | grep -oP '^(f|fl|fll)_[^\s]+'". +// To get the list of all possible functions, use something like: "grep -horP '\b_di_f_\w*\b' level_0/f_color/". +// +// Note that some special defines may need to be manually added, such as: +// #define _di_private_inline_f_print_to_error_ +// #define _di_private_inline_private_f_print_to_error_ +// +// Example: +// echo > /tmp/all.txt +// for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_signal f_socket f_thread f_time ; do grep -horP '\b_di_f_\w*\b' level_0/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_0/$i/c >> /tmp/all.txt ; done +// for i in fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print ; do grep -horP '\b_di_fl_\w*\b' level_1/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_1/$i/c >> /tmp/all.txt ; done +// for i in fll_error fll_execute fll_file fll_fss fll_print fll_program ; do grep -horP '\b_di_fll_\w*\b' level_2/$i/c >> /tmp/all.txt ; grep -horP '\b_di_macro_\w*\b' level_2/$i/c >> /tmp/all.txt ; done +// sort /tmp/all.txt | uniq | sed -e 's|^_|#define &|g' > /tmp/sorted.txt +// echo "#define _di_private_inline_f_print_to_error_" >> /tmp/sorted.txt +// echo "#define _di_private_inline_private_f_print_to_error_" >> /tmp/sorted.txt diff --git a/build/stand_alone/utf8.settings b/build/stand_alone/utf8.settings index 8a0175e..f1d6a5a 100644 --- a/build/stand_alone/utf8.settings +++ b/build/stand_alone/utf8.settings @@ -36,7 +36,7 @@ build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c build_sources_program fll/level_0/type_array/cell.c fll/level_0/type_array/file.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/number_unsigned.c fll/level_0/type_array/poll.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c build_sources_program fll/level_0/utf/common.c fll/level_0/utf/convert.c fll/level_0/utf/dynamic.c fll/level_0/utf/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-dynamic.c fll/level_0/utf/private-dynamics.c fll/level_0/utf/private-dynamicss.c fll/level_0/utf/private-maps.c fll/level_0/utf/private-mapss.c fll/level_0/utf/private-map_multis.c fll/level_0/utf/private-map_multiss.c fll/level_0/utf/private-string.c fll/level_0/utf/private-triples.c fll/level_0/utf/private-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 build_sources_program fll/level_1/conversion.c fll/level_1/private-conversion.c fll/level_1/conversion/common.c build_sources_program fll/level_1/print.c fll/level_1/private-print.c fll/level_1/print/common.c diff --git a/level_0/f_compare/c/compare/utf.c b/level_0/f_compare/c/compare/utf.c index 13af375..216220e 100644 --- a/level_0/f_compare/c/compare/utf.c +++ b/level_0/f_compare/c/compare/utf.c @@ -246,7 +246,7 @@ extern "C" { : range2.stop + 1 ); } -#endif // _di_f_compare_utf_utf_dynamic_partial_trim_ +#endif // _di_f_compare_utf_utf_string_dynamic_partial_trim_ #ifndef _di_f_compare_utf_dynamic_partial_trim_dynamic_ f_status_t f_compare_utf_dynamic_partial_trim_dynamic(const f_utf_string_static_t string1, const f_utf_string_static_t string2, const f_string_range_t range2) { diff --git a/level_0/f_string/data/build/settings-tests b/level_0/f_string/data/build/settings-tests index 13885d5..03af2d4 100644 --- a/level_0/f_string/data/build/settings-tests +++ b/level_0/f_string/data/build/settings-tests @@ -37,6 +37,7 @@ build_sources_program test-string-dynamic_prepend.c test-string-dynamic_prepend_ build_sources_program test-string-dynamic_seek_line.c test-string-dynamic_seek_line_to.c test-string-dynamic_seek_to.c build_sources_program test-string-dynamic_terminate.c test-string-dynamic_terminate_after.c build_sources_program test-string-dynamics_append.c test-string-dynamics_append_all.c test-string-dynamicss_append.c test-string-dynamicss_append_all.c +build_sources_program test-string-dynamics_delete_callback.c test-string-dynamics_destroy_callback.c build_sources_program test-string-dynamicss_delete_callback.c test-string-dynamicss_destroy_callback.c build_sources_program test-string-map_multis_append.c test-string-map_multis_append_all.c test-string-map_multiss_append.c test-string-map_multiss_append_all.c build_sources_program test-string-map_multis_delete_callback.c test-string-map_multis_destroy_callback.c diff --git a/level_0/f_string/tests/unit/c/test-string-dynamics_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-dynamics_delete_callback.c index a3c44e4..b33b12c 100644 --- a/level_0/f_string/tests/unit/c/test-string-dynamics_delete_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-dynamics_delete_callback.c @@ -10,7 +10,7 @@ void test__f_string_dynamics_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_dynamic_t data = f_string_dynamic_t_initialize; + f_string_dynamic_t data = { .string = "", .used = 0, .size = 1 }; f_string_dynamic_t data_array[] = { data }; { @@ -35,13 +35,16 @@ void test__f_string_dynamics_delete_callback__works(void **state) { { f_status_t status = f_memory_array_resize(length, sizeof(f_string_dynamic_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].string, &datas.array[0].used, &datas.array[0].size); + assert_int_equal(status, F_okay); } { const f_status_t status = f_string_dynamics_delete_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].size, 0); } free((void *) datas.array); diff --git a/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.c index 7b98038..5b1aab4 100644 --- a/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.c @@ -10,7 +10,7 @@ void test__f_string_dynamics_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_dynamic_t data = f_string_dynamic_t_initialize; + f_string_dynamic_t data = { .string = "", .used = 0, .size = 1 }; f_string_dynamic_t data_array[] = { data }; { @@ -35,13 +35,16 @@ void test__f_string_dynamics_destroy_callback__works(void **state) { { f_status_t status = f_memory_array_resize(length, sizeof(f_string_dynamic_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].string, &datas.array[0].used, &datas.array[0].size); + assert_int_equal(status, F_okay); } { const f_status_t status = f_string_dynamics_destroy_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].size, 0); } free((void *) datas.array); diff --git a/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.h b/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.h index 5449891..b7e1a50 100644 --- a/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.h +++ b/level_0/f_string/tests/unit/c/test-string-dynamics_destroy_callback.h @@ -7,21 +7,21 @@ * * Test the array types in the type project. */ -#ifndef _TEST__F_string__dynamicss_destroy_callback -#define _TEST__F_string__dynamicss_destroy_callback +#ifndef _TEST__F_string__dynamics_destroy_callback +#define _TEST__F_string__dynamics_destroy_callback /** * Test that the function fails. * - * @see f_string_dynamicss_destroy_callback() + * @see f_string_dynamics_destroy_callback() */ -extern void test__f_string_dynamicss_destroy_callback__fails(void **state); +extern void test__f_string_dynamics_destroy_callback__fails(void **state); /** * Test that the function works. * - * @see f_string_dynamicss_destroy_callback() + * @see f_string_dynamics_destroy_callback() */ -extern void test__f_string_dynamicss_destroy_callback__works(void **state); +extern void test__f_string_dynamics_destroy_callback__works(void **state); -#endif // _TEST__F_string__dynamicss_destroy_callback +#endif // _TEST__F_string__dynamics_destroy_callback diff --git a/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c index 0a42c92..1562825 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c @@ -89,11 +89,11 @@ void test__f_string_map_multis_delete_callback__works(void **state) { const f_status_t status = f_string_map_multis_delete_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); } free((void *) datas.array[0].name.string); - free((void *) datas.array[0].value.array[0].string); free((void *) datas.array[0].value.array); free((void *) datas.array); } diff --git a/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c index ba5959e..6c892d1 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c @@ -89,11 +89,11 @@ void test__f_string_map_multis_destroy_callback__works(void **state) { const f_status_t status = f_string_map_multis_destroy_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); } free((void *) datas.array[0].name.string); - free((void *) datas.array[0].value.array[0].string); free((void *) datas.array[0].value.array); free((void *) datas.array); } diff --git a/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c index ed56012..66adc06 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c @@ -64,7 +64,8 @@ void test__f_string_maps_delete_callback__works(void **state) { const f_status_t status = f_string_maps_delete_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); } free((void *) datas.array[0].name.string); diff --git a/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c index c1ccc1d..b125cbc 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c @@ -64,7 +64,8 @@ void test__f_string_maps_destroy_callback__works(void **state) { const f_status_t status = f_string_maps_destroy_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); } free((void *) datas.array[0].name.string); diff --git a/level_0/f_string/tests/unit/c/test-string-triples_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-triples_delete_callback.c index 9b2362e..4856830 100644 --- a/level_0/f_string/tests/unit/c/test-string-triples_delete_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-triples_delete_callback.c @@ -88,7 +88,9 @@ void test__f_string_triples_delete_callback__works(void **state) { const f_status_t status = f_string_triples_delete_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].a.size, 0); + assert_int_equal(datas.array[0].b.size, 0); + assert_int_equal(datas.array[0].c.size, 0); } free((void *) datas.array[0].a.string); diff --git a/level_0/f_string/tests/unit/c/test-string-triples_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-triples_destroy_callback.c index a3804ae..6400c6f 100644 --- a/level_0/f_string/tests/unit/c/test-string-triples_destroy_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-triples_destroy_callback.c @@ -88,7 +88,9 @@ void test__f_string_triples_destroy_callback__works(void **state) { const f_status_t status = f_string_triples_destroy_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.size, 0); + assert_int_equal(datas.array[0].a.size, 0); + assert_int_equal(datas.array[0].b.size, 0); + assert_int_equal(datas.array[0].c.size, 0); } free((void *) datas.array[0].a.string); 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 1d889ce..a677ea3 100644 --- a/level_0/f_string/tests/unit/c/test-string.c +++ b/level_0/f_string/tests/unit/c/test-string.c @@ -156,32 +156,55 @@ int main(void) { cmocka_unit_test(test__f_string_seek_to__returns_none_stop), cmocka_unit_test(test__f_string_seek_to__works), + cmocka_unit_test(test__f_string_dynamics_delete_callback__fails), + cmocka_unit_test(test__f_string_dynamics_destroy_callback__fails), + cmocka_unit_test(test__f_string_dynamics_delete_callback__works), + cmocka_unit_test(test__f_string_dynamics_destroy_callback__works), + cmocka_unit_test(test__f_string_dynamicss_delete_callback__fails), cmocka_unit_test(test__f_string_dynamicss_destroy_callback__fails), + cmocka_unit_test(test__f_string_dynamicss_delete_callback__works), + cmocka_unit_test(test__f_string_dynamicss_destroy_callback__works), cmocka_unit_test(test__f_string_map_multis_delete_callback__fails), cmocka_unit_test(test__f_string_map_multis_destroy_callback__fails), + cmocka_unit_test(test__f_string_map_multis_delete_callback__works), + cmocka_unit_test(test__f_string_map_multis_destroy_callback__works), cmocka_unit_test(test__f_string_map_multiss_delete_callback__fails), cmocka_unit_test(test__f_string_map_multiss_destroy_callback__fails), + cmocka_unit_test(test__f_string_map_multiss_delete_callback__works), + cmocka_unit_test(test__f_string_map_multiss_destroy_callback__works), cmocka_unit_test(test__f_string_maps_delete_callback__fails), cmocka_unit_test(test__f_string_maps_destroy_callback__fails), + cmocka_unit_test(test__f_string_maps_delete_callback__works), + cmocka_unit_test(test__f_string_maps_destroy_callback__works), cmocka_unit_test(test__f_string_mapss_delete_callback__fails), cmocka_unit_test(test__f_string_mapss_destroy_callback__fails), + cmocka_unit_test(test__f_string_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_rangess_delete_callback__fails), cmocka_unit_test(test__f_string_rangess_destroy_callback__fails), + cmocka_unit_test(test__f_string_rangess_delete_callback__works), + cmocka_unit_test(test__f_string_rangess_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), + cmocka_unit_test(test__f_string_triples_destroy_callback__works), cmocka_unit_test(test__f_string_tripless_delete_callback__fails), cmocka_unit_test(test__f_string_tripless_destroy_callback__fails), + cmocka_unit_test(test__f_string_tripless_delete_callback__works), + cmocka_unit_test(test__f_string_tripless_destroy_callback__works), #ifndef _di_level_0_parameter_checking_ cmocka_unit_test(test__f_string_append__parameter_checking), @@ -275,6 +298,9 @@ int main(void) { cmocka_unit_test(test__f_string_seek_to__parameter_checking), + // f_string_dynamics_delete_callback() doesn't use parameter checking. + // f_string_dynamics_destroy_callback() doesn't use parameter checking. + // f_string_dynamicss_delete_callback() doesn't use parameter checking. // f_string_dynamicss_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 c34ebd7..178438d 100644 --- a/level_0/f_string/tests/unit/c/test-string.h +++ b/level_0/f_string/tests/unit/c/test-string.h @@ -61,6 +61,8 @@ #include "test-string-dynamic_terminate_after.h" #include "test-string-dynamics_append.h" #include "test-string-dynamics_append_all.h" +#include "test-string-dynamics_delete_callback.h" +#include "test-string-dynamics_destroy_callback.h" #include "test-string-dynamicss_append.h" #include "test-string-dynamicss_append_all.h" #include "test-string-dynamicss_delete_callback.h" diff --git a/level_0/f_utf/c/utf/common.c b/level_0/f_utf/c/utf/common.c index decd1d8..11fe573 100644 --- a/level_0/f_utf/c/utf/common.c +++ b/level_0/f_utf/c/utf/common.c @@ -6,11 +6,11 @@ extern "C" { #ifndef _di_f_utf_space_s_ #ifndef _di_f_utf_space_em_s_ - const f_char_t f_utf_space_em_s[F_utf_space_em_s_length] = { 0xe2, 0x80, 0x83 }; + const f_char_t f_utf_space_em_s[F_utf_space_em_s_length] = { 0xe2, 0x80, 0x83 }; #endif // _di_f_f_utf_space_em_s_ #ifndef _di_f_utf_space_em_quad_s_ - const f_char_t f_utf_space_em_quad_s[F_utf_space_em_quad_s_length] = { 0xe2, 0x80, 0x81 }; + const f_char_t f_utf_space_em_quad_s[F_utf_space_em_quad_s_length] = { 0xe2, 0x80, 0x81 }; #endif // _di_f_f_utf_space_em_quad_s_ #ifndef _di_f_utf_space_em_per_three_s_ @@ -18,15 +18,15 @@ extern "C" { #endif // _di_f_f_utf_space_em_per_three_s_ #ifndef _di_f_utf_space_em_per_four_s_ - const f_char_t f_utf_space_em_per_four_s[F_utf_space_em_per_four_s_length] = { 0xe2, 0x80, 0x85 }; + const f_char_t f_utf_space_em_per_four_s[F_utf_space_em_per_four_s_length] = { 0xe2, 0x80, 0x85 }; #endif // _di_f_f_utf_space_em_per_four_s_ #ifndef _di_f_utf_space_em_per_six_s_ - const f_char_t f_utf_space_em_per_six_s[F_utf_space_em_per_six_s_length] = { 0xe2, 0x80, 0x86 }; + const f_char_t f_utf_space_em_per_six_s[F_utf_space_em_per_six_s_length] = { 0xe2, 0x80, 0x86 }; #endif // _di_f_f_utf_space_em_per_six_s_ #ifndef _di_f_utf_space_en_s_ - const f_char_t f_utf_space_en_s[F_utf_space_en_s_length] = { 0xe2, 0x80, 0x82 }; + const f_char_t f_utf_space_en_s[F_utf_space_en_s_length] = { 0xe2, 0x80, 0x82 }; #endif // _di_f_f_utf_space_en_s_ #ifndef _di_f_utf_space_en_quad_s_ @@ -38,7 +38,7 @@ extern "C" { #endif // _di_f_f_utf_space_line_feed_reverse_s_ #ifndef _di_f_utf_space_line_next_s_ - const f_char_t f_utf_space_line_next_s[F_utf_space_line_next_s_length] = { 0xc2, 0x85 }; + const f_char_t f_utf_space_line_next_s[F_utf_space_line_next_s_length] = { 0xc2, 0x85 }; #endif // _di_f_f_utf_space_line_next_s_ #ifndef _di_f_utf_space_medium_mathematical_s_ @@ -46,7 +46,7 @@ extern "C" { #endif // _di_f_f_utf_space_medium_mathematical_s_ #ifndef _di_f_utf_space_no_break_s_ - const f_char_t f_utf_space_no_break_s[F_utf_space_no_break_s_length] = { 0xc2, 0xa0 }; + const f_char_t f_utf_space_no_break_s[F_utf_space_no_break_s_length] = { 0xc2, 0xa0 }; #endif // _di_f_f_utf_space_no_break_s_ #ifndef _di_f_utf_space_no_break_narrow_s_ @@ -54,11 +54,11 @@ extern "C" { #endif // _di_f_f_utf_space_no_break_narrow_s_ #ifndef _di_f_utf_space_ogham_s_ - const f_char_t f_utf_space_ogham_s[F_utf_space_ogham_s_length] = { 0xe1, 0x9a, 0x80 }; + const f_char_t f_utf_space_ogham_s[F_utf_space_ogham_s_length] = { 0xe1, 0x9a, 0x80 }; #endif // _di_f_f_utf_space_ogham_s_ #ifndef _di_f_utf_space_figure_s_ - const f_char_t f_utf_space_figure_s[F_utf_space_figure_s_length] = { 0xe2, 0x80, 0x87 }; + const f_char_t f_utf_space_figure_s[F_utf_space_figure_s_length] = { 0xe2, 0x80, 0x87 }; #endif // _di_f_f_utf_space_figure_s_ #ifndef _di_f_utf_space_punctuation_s_ @@ -66,11 +66,11 @@ extern "C" { #endif // _di_f_f_utf_space_punctuation_s_ #ifndef _di_f_utf_space_thin_s_ - const f_char_t f_utf_space_thin_s[F_utf_space_thin_s_length] = { 0xe2, 0x80, 0x89 }; + const f_char_t f_utf_space_thin_s[F_utf_space_thin_s_length] = { 0xe2, 0x80, 0x89 }; #endif // _di_f_f_utf_space_thin_s_ #ifndef _di_f_utf_space_hair_s_ - const f_char_t f_utf_space_hair_s[F_utf_space_hair_s_length] = { 0xe2, 0x80, 0x8a }; + const f_char_t f_utf_space_hair_s[F_utf_space_hair_s_length] = { 0xe2, 0x80, 0x8a }; #endif // _di_f_f_utf_space_hair_s_ #ifndef _di_f_utf_space_ideographic_s_ @@ -78,7 +78,7 @@ extern "C" { #endif // _di_f_f_utf_space_ideographic_s_ #ifndef _di_f_utf_space_separator_line_s_ - const f_char_t f_utf_space_separator_line_s[F_utf_space_separator_line_s_length] = { 0xe2, 0x80, 0xa8 }; + const f_char_t f_utf_space_separator_line_s[F_utf_space_separator_line_s_length] = { 0xe2, 0x80, 0xa8 }; #endif // _di_f_f_utf_space_separator_line_s_ #ifndef _di_f_utf_space_separator_paragraph_s_ @@ -100,7 +100,7 @@ extern "C" { #endif // _di_f_f_utf_substitute_middle_dot_s_ #ifndef _di_f_utf_substitute_open_box_s_ - const f_char_t f_utf_substitute_open_box_s[F_utf_substitute_open_box_s_length] = { 0xe2, 0x90, 0xa3 }; + const f_char_t f_utf_substitute_open_box_s[F_utf_substitute_open_box_s_length] = { 0xe2, 0x90, 0xa3 }; #endif // _di_f_f_utf_substitute_open_box_s_ #ifndef _di_f_utf_substitute_open_box_shouldered_s_ diff --git a/level_0/f_utf/c/utf/common.h b/level_0/f_utf/c/utf/common.h index 470051f..3b1e9a3 100644 --- a/level_0/f_utf/c/utf/common.h +++ b/level_0/f_utf/c/utf/common.h @@ -366,12 +366,6 @@ extern "C" { #define macro_f_utf_string_t_initialize_1(string) string #define macro_f_utf_string_t_clear(string) string = 0; - - #define macro_f_utf_string_t_resize(status, string, length_old, length_new) status = f_memory_resize(length_old, length_new, sizeof(f_utf_string_t), (void **) & string); - #define macro_f_utf_string_t_adjust(status, string, length_old, length_new) status = f_memory_adjust(length_old, length_new, sizeof(f_utf_string_t), (void **) & string); - - #define macro_f_utf_string_t_delete_simple(string, length) f_memory_resize(length, 0, sizeof(f_utf_string_t), (void **) & string); - #define macro_f_utf_string_t_destroy_simple(string, length) f_memory_adjust(length, 0, sizeof(f_utf_string_t), (void **) & string); #endif // _di_f_utf_string_t_ /** diff --git a/level_0/f_utf/c/utf/dynamic.c b/level_0/f_utf/c/utf/dynamic.c index 3d8f9c9..e1a722b 100644 --- a/level_0/f_utf/c/utf/dynamic.c +++ b/level_0/f_utf/c/utf/dynamic.c @@ -1,23 +1,12 @@ #include "../utf.h" #include "../private-utf.h" #include "static.h" -#include "private-dynamic.h" #include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_f_utf_string_dynamic_adjust_ - f_status_t f_utf_string_dynamic_adjust(const f_number_unsigned_t length, f_utf_string_dynamic_t * const dynamic) { - #ifndef _di_level_0_parameter_checking_ - if (!dynamic) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_dynamic_adjust(length, dynamic); - } -#endif // _di_f_utf_string_dynamic_adjust_ - #ifndef _di_f_utf_string_dynamic_append_ f_status_t f_utf_string_dynamic_append(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -71,30 +60,32 @@ extern "C" { return private_f_utf_string_append_nulless(source.string, source.used, destination); } - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= source.used && j <= destination->used) { + while (i <= source.used && j <= destination->used) { - if (!source.string[source.used - i]) { - ++i; + if (!source.string[source.used - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source.string[source.used - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append_nulless(source.string, source.used, destination); - } + if (source.string[source.used - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append_nulless(source.string, source.used, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -112,74 +103,6 @@ extern "C" { } #endif // _di_f_utf_string_dynamic_append_nulless_ -#ifndef _di_f_utf_string_dynamic_decimate_by_ - f_status_t f_utf_string_dynamic_decimate_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic) { - #ifndef _di_level_0_parameter_checking_ - if (!dynamic) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - if (dynamic->size > amount) { - return private_f_utf_string_dynamic_adjust(dynamic->size - amount, dynamic); - } - - return private_f_utf_string_dynamic_adjust(0, dynamic); - } -#endif // _di_f_utf_string_dynamic_decimate_by_ - -#ifndef _di_f_utf_string_dynamic_decrease_by_ - f_status_t f_utf_string_dynamic_decrease_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic) { - #ifndef _di_level_0_parameter_checking_ - if (!dynamic) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - if (dynamic->size > amount) { - return private_f_utf_string_dynamic_resize(dynamic->size - amount, dynamic); - } - - return private_f_utf_string_dynamic_resize(0, dynamic); - } -#endif // _di_f_utf_string_dynamic_decrease_by_ - -#ifndef _di_f_utf_string_dynamic_increase_ - f_status_t f_utf_string_dynamic_increase(const f_number_unsigned_t step, f_utf_string_dynamic_t * const dynamic) { - #ifndef _di_level_0_parameter_checking_ - if (!dynamic) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (step && dynamic->used + 1 > dynamic->size) { - f_number_unsigned_t length = dynamic->used + step; - - if (length > F_string_t_size_d) { - if (dynamic->used + 1 > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - length = F_string_t_size_d; - } - - return private_f_utf_string_dynamic_resize(length, dynamic); - } - - return F_data_not; - } -#endif // _di_f_utf_string_dynamic_increase_ - -#ifndef _di_f_utf_string_dynamic_increase_by_ - f_status_t f_utf_string_dynamic_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic) { - #ifndef _di_level_0_parameter_checking_ - if (!dynamic) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - return private_f_utf_string_dynamic_increase_by(amount, dynamic); - } -#endif // _di_f_utf_string_dynamic_increase_by_ - #ifndef _di_f_utf_string_dynamic_mash_ f_status_t f_utf_string_dynamic_mash(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -276,25 +199,27 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (range.start >= source.used) return F_data_not_eos; - const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; + { + const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; - if (destination->used < length) { - return private_f_utf_string_append(source.string + range.start, length, destination); - } + if (destination->used < length) { + return private_f_utf_string_append(source.string + range.start, length, destination); + } - const f_number_unsigned_t stop = range.stop >= source.used ? source.used : range.stop + 1; - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + const f_number_unsigned_t stop = range.stop >= source.used ? source.used : range.stop + 1; + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (source.string[stop - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append(source.string + range.start, length, destination); - } + if (source.string[stop - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append(source.string + range.start, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -310,37 +235,39 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (range.start >= source.used) return F_data_not_eos; - const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; + { + const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; - if (!destination->used) { - return private_f_utf_string_append_nulless(source.string + range.start, length, destination); - } + if (!destination->used) { + return private_f_utf_string_append_nulless(source.string + range.start, length, destination); + } - const f_number_unsigned_t stop = range.stop >= source.used ? source.used : range.stop + 1; - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + const f_number_unsigned_t stop = range.stop >= source.used ? source.used : range.stop + 1; + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source.string[stop - i]) { - ++i; + if (!source.string[stop - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source.string[stop - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append_nulless(source.string + range.start, length, destination); - } + if (source.string[stop - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append_nulless(source.string + range.start, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -484,24 +411,26 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (range.start >= source.used) return F_data_not_eos; - const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; + { + const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; - if (destination->used < length) { - return private_f_utf_string_prepend(source.string + range.start, length, destination); - } + if (destination->used < length) { + return private_f_utf_string_prepend(source.string + range.start, length, destination); + } - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (source.string[i + range.start] != destination->string[j]) { - return private_f_utf_string_prepend(source.string + range.start, length, destination); - } + if (source.string[i + range.start] != destination->string[j]) { + return private_f_utf_string_prepend(source.string + range.start, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -517,36 +446,38 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (range.start >= source.used) return F_data_not_eos; - const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; + { + const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1; - if (!destination->used) { - return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination); - } + if (!destination->used) { + return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination); + } - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source.string[i + range.start]) { - ++i; + if (!source.string[i + range.start]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source.string[i + range.start] != destination->string[j]) { - return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination); - } + if (source.string[i + range.start] != destination->string[j]) { + return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -590,18 +521,17 @@ extern "C" { return private_f_utf_string_prepend(source.string, source.used, destination); } - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; - - while (i < source.used && j < destination->used) { + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - if (source.string[i] != destination->string[j]) { - return private_f_utf_string_prepend(source.string, source.used, destination); - } + for (; i < source.used && j < destination->used; ++i, ++j) { - ++i; - ++j; - } // while + if (source.string[i] != destination->string[j]) { + return private_f_utf_string_prepend(source.string, source.used, destination); + } + } // for + } return F_okay; } @@ -660,16 +590,6 @@ extern "C" { } #endif // _di_f_utf_string_dynamic_prepend_nulless_ -#ifndef _di_f_utf_string_dynamic_resize_ - f_status_t f_utf_string_dynamic_resize(const f_number_unsigned_t length, f_utf_string_dynamic_t * const buffer) { - #ifndef _di_level_0_parameter_checking_ - if (!buffer) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_dynamic_resize(length, buffer); - } -#endif // _di_f_utf_string_dynamic_resize_ - #ifndef _di_f_utf_string_dynamic_seek_line_ f_status_t f_utf_string_dynamic_seek_line(const f_utf_string_static_t buffer, f_string_range_t * const range) { #ifndef _di_level_0_parameter_checking_ @@ -681,9 +601,7 @@ extern "C" { while (buffer.string[range->start] != f_utf_char_eol_s) { - if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) { - return F_status_set_error(F_utf_fragment); - } + if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) return F_status_set_error(F_utf_fragment); ++range->start; @@ -706,10 +624,7 @@ extern "C" { while (buffer.string[range->start] != seek_to_this) { - if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) { - return F_status_set_error(F_utf_fragment); - } - + if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) return F_status_set_error(F_utf_fragment); if (buffer.string[range->start] == f_utf_char_eol_s) return F_okay_eol; ++range->start; @@ -733,9 +648,7 @@ extern "C" { while (buffer.string[range->start] != seek_to_this) { - if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) { - return F_status_set_error(F_utf_fragment); - } + if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) return F_status_set_error(F_utf_fragment); ++range->start; @@ -753,16 +666,11 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (destination->used && !destination->string[destination->used - 1]) { - return F_okay; - } - - if (destination->used == F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } + if (destination->used && !destination->string[destination->used - 1]) return F_okay; + if (destination->used == F_string_t_size_d) return F_status_set_error(F_string_too_large); - if (destination->used + 1 > destination->size) { - const f_status_t status = private_f_utf_string_dynamic_resize(destination->used + (destination->used + 1 == F_string_t_size_d ? 1 : F_memory_default_allocation_small_d), destination); + { + const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } @@ -778,18 +686,11 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (destination->used < destination->size) { - if (!destination->string[destination->used]) { - return F_okay; - } - } - - if (destination->used == F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } + if (destination->used < destination->size && !destination->string[destination->used]) return F_okay; + if (destination->used == F_string_t_size_d) return F_status_set_error(F_string_too_large); - if (destination->used + 1 > destination->size) { - const f_status_t status = private_f_utf_string_dynamic_resize(destination->used + (destination->used + 1 == F_string_t_size_d ? 1 : F_memory_default_allocation_small_d), destination); + { + const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/dynamic.h b/level_0/f_utf/c/utf/dynamic.h index 732d9e9..70b1fd7 100644 --- a/level_0/f_utf/c/utf/dynamic.h +++ b/level_0/f_utf/c/utf/dynamic.h @@ -37,38 +37,9 @@ extern "C" { #define macro_f_utf_string_dynamic_t_initialize_2(array, length) { array, length, length } #define macro_f_utf_string_dynamic_t_clear(dynamic) macro_f_utf_string_static_t_clear(dynamic) - - #define macro_f_utf_string_dynamic_t_resize(status, dynamic, length) status = f_utf_string_dynamic_resize(length, &dynamic); - #define macro_f_utf_string_dynamic_t_adjust(status, dynamic, length) status = f_utf_string_dynamic_adjust(length, &dynamic); - - #define macro_f_utf_string_dynamic_t_delete_simple(dynamic) f_utf_string_dynamic_resize(0, &dynamic); - #define macro_f_utf_string_dynamic_t_destroy_simple(dynamic) f_utf_string_dynamic_adjust(0, &dynamic); - - #define macro_f_utf_string_dynamic_t_increase(status, step, dynamic) status = f_utf_string_dynamic_increase(step, &dynamic); - #define macro_f_utf_string_dynamic_t_increase_by(status, dynamic, amount) status = f_utf_string_dynamic_increase_by(amount, &dynamic); - #define macro_f_utf_string_dynamic_t_decrease_by(status, dynamic, amount) status = f_utf_string_dynamic_decrease_by(amount, &dynamic); - #define macro_f_utf_string_dynamic_t_decimate_by(status, dynamic, amount) status = f_utf_string_dynamic_decimate_by(amount, &dynamic); #endif // _di_f_utf_string_dynamic_t_ /** - * Resize the dynamic string. - * - * @param length - * The new size to use. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_utf_string_dynamic_adjust_ - extern f_status_t f_utf_string_dynamic_adjust(const f_number_unsigned_t length, f_utf_string_dynamic_t * const dynamic); -#endif // _di_f_utf_string_dynamic_adjust_ - -/** * Append the source string onto the destination. * * @param source @@ -157,107 +128,6 @@ extern "C" { #endif // _di_f_utf_string_dynamic_append_nulless_ /** - * Resize the dynamic string to a smaller size. - * - * This will resize making the string smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamic_decimate_by_ - extern f_status_t f_utf_string_dynamic_decimate_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic); -#endif // _di_f_utf_string_dynamic_decimate_by_ - -/** - * Resize the dynamic string to a smaller size. - * - * This will resize making the string smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamic_decrease_by_ - extern f_status_t f_utf_string_dynamic_decrease_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic); -#endif // _di_f_utf_string_dynamic_decrease_by_ - -/** - * Resize the dynamic string to a larger size. - * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size) (or step is 0). - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamic_increase_ - extern f_status_t f_utf_string_dynamic_increase(const f_number_unsigned_t step, f_utf_string_dynamic_t * const dynamic); -#endif // _di_f_utf_string_dynamic_increase_ - -/** - * Resize the dynamic string to a larger size. - * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param amount - * A positive number representing how much to increase the size by. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamic_increase_by_ - extern f_status_t f_utf_string_dynamic_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic); -#endif // _di_f_utf_string_dynamic_increase_by_ - -/** * Append the source string onto the destination with the glue in between. * * If the destination string is empty, then no glue is appended. @@ -794,25 +664,6 @@ extern "C" { #endif // _di_f_utf_string_dynamic_prepend_nulless_ /** - * Resize the dynamic string. - * - * @param length - * The new size to use. - * @param buffer - * The string to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamic_resize_ - extern f_status_t f_utf_string_dynamic_resize(const f_number_unsigned_t length, f_utf_string_dynamic_t * const buffer); -#endif // _di_f_utf_string_dynamic_resize_ - -/** * Seek the buffer location forward until EOL is reached. * * @param buffer @@ -908,7 +759,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if string is too large to fit into the buffer. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_increase(). + * + * @see f_memory_array_increase() */ #ifndef _di_f_utf_string_dynamic_terminate_ extern f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t * const destination); @@ -933,7 +786,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if string is too large to fit into the buffer. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_increase(). + * + * @see f_memory_array_increase() */ #ifndef _di_f_utf_string_dynamic_terminate_after_ extern f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t * const destination); diff --git a/level_0/f_utf/c/utf/dynamics.c b/level_0/f_utf/c/utf/dynamics.c index 71c489e..c001265 100644 --- a/level_0/f_utf/c/utf/dynamics.c +++ b/level_0/f_utf/c/utf/dynamics.c @@ -1,7 +1,6 @@ #include "../utf.h" #include "../private-utf.h" #include "static.h" -#include "private-dynamic.h" #include "private-dynamics.h" #include "private-string.h" @@ -9,16 +8,6 @@ extern "C" { #endif -#ifndef _di_f_utf_string_dynamics_adjust_ - f_status_t f_utf_string_dynamics_adjust(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_dynamics_adjust(length, structure); - } -#endif // _di_f_utf_string_dynamics_adjust_ - #ifndef _di_f_utf_string_dynamics_append_ f_status_t f_utf_string_dynamics_append(const f_utf_string_dynamic_t source, f_utf_string_dynamics_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -43,85 +32,45 @@ extern "C" { } #endif // _di_f_utf_string_dynamics_append_all_ -#ifndef _di_f_utf_string_dynamics_decimate_by_ - f_status_t f_utf_string_dynamics_decimate_by(const f_number_unsigned_t amount, f_utf_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_dynamics_delete_callback_ + f_status_t f_utf_string_dynamics_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_dynamic_t * const array = (f_utf_string_dynamic_t *) void_array; + f_status_t status = F_okay; - return private_f_utf_string_dynamics_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_dynamics_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_dynamics_decrease_by_ - f_status_t f_utf_string_dynamics_decrease_by(const f_number_unsigned_t amount, f_utf_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - return private_f_utf_string_dynamics_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_dynamics_decrease_by_ - -#ifndef _di_f_utf_string_dynamics_increase_ - f_status_t f_utf_string_dynamics_increase(const f_number_unsigned_t step, f_utf_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!step) return F_data_not; - - if (structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; - - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_utf_string_dynamics_resize(length, structure); + if (array[i].size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].string, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_dynamics_increase_ - -#ifndef _di_f_utf_string_dynamics_increase_by_ - f_status_t f_utf_string_dynamics_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#endif // _di_f_utf_string_dynamics_delete_callback_ - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); +#ifndef _di_f_utf_string_dynamics_destroy_callback_ + f_status_t f_utf_string_dynamics_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - const f_number_unsigned_t length = structure->used + amount; + { + f_utf_string_dynamic_t * const array = (f_utf_string_dynamic_t *) void_array; + f_status_t status = F_okay; - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + for (f_number_unsigned_t i = start; i < stop; ++i) { - return private_f_utf_string_dynamics_resize(structure->used + amount, structure); - } + if (array[i].size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].string, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; - } -#endif // _di_f_utf_string_dynamics_increase_by_ - -#ifndef _di_f_utf_string_dynamics_resize_ - f_status_t f_utf_string_dynamics_resize(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_dynamics_resize(length, structure); + return F_okay; } -#endif // _di_f_utf_string_dynamics_resize_ +#endif // _di_f_utf_string_dynamics_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/dynamics.h b/level_0/f_utf/c/utf/dynamics.h index 04a232c..387500e 100644 --- a/level_0/f_utf/c/utf/dynamics.h +++ b/level_0/f_utf/c/utf/dynamics.h @@ -32,39 +32,9 @@ extern "C" { #define macro_f_utf_string_dynamics_t_initialize_2(array, length) { array, length, length } #define macro_f_utf_string_dynamics_t_clear(dynamics) macro_f_utf_string_statics_t_clear(dynamics) - - #define macro_f_utf_string_dynamics_t_resize(status, dynamics, length) status = f_utf_string_dynamics_resize(length, &dynamics); - #define macro_f_utf_string_dynamics_t_adjust(status, dynamics, length) status = f_utf_string_dynamics_adjust(length, &dynamics); - - #define macro_f_utf_string_dynamics_t_delete_simple(dynamics) f_utf_string_dynamics_resize(0, &dynamics); - #define macro_f_utf_string_dynamics_t_destroy_simple(dynamics) f_utf_string_dynamics_adjust(0, &dynamics); - - #define macro_f_utf_string_dynamics_t_increase(status, step, dynamics) status = f_utf_string_dynamics_increase(step, &dynamics); - #define macro_f_utf_string_dynamics_t_increase_by(status, dynamics, amount) status = f_utf_string_dynamics_increase_by(amount, &dynamics); - #define macro_f_utf_string_dynamics_t_decrease_by(status, dynamics, amount) status = f_utf_string_dynamics_decrease_by(amount, &dynamics); - #define macro_f_utf_string_dynamics_t_decimate_by(status, dynamics, amount) status = f_utf_string_dynamics_decimate_by(amount, &dynamics); #endif // _di_f_utf_string_dynamics_t_ /** - * Resize the dynamic string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_adjust(). - */ -#ifndef _di_f_utf_string_dynamics_adjust_ - extern f_status_t f_utf_string_dynamics_adjust(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure); -#endif // _di_f_utf_string_dynamics_adjust_ - -/** * Append the single source string onto the destination. * * @param source @@ -107,121 +77,60 @@ extern "C" { #endif // _di_f_utf_string_dynamics_append_all_ /** - * Resize the dynamic string array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). + * A callback intended to be passed to f_memory_arrays_resize() for an f_utf_string_dynamics_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamics_decimate_by_ - extern f_status_t f_utf_string_dynamics_decimate_by(const f_number_unsigned_t amount, f_utf_string_dynamics_t * const structure); -#endif // _di_f_utf_string_dynamics_decimate_by_ - -/** - * Resize the dynamic string array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamics_decrease_by_ - extern f_status_t f_utf_string_dynamics_decrease_by(const f_number_unsigned_t amount, f_utf_string_dynamics_t * const structure); -#endif // _di_f_utf_string_dynamics_decrease_by_ - -/** - * Increase the size of the dynamic string array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_dynamics_increase_ - extern f_status_t f_utf_string_dynamics_increase(const f_number_unsigned_t step, f_utf_string_dynamics_t * const structure); -#endif // _di_f_utf_string_dynamics_increase_ +#ifndef _di_f_utf_string_dynamics_delete_callback_ + extern f_status_t f_utf_string_dynamics_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_dynamics_delete_callback_ /** - * Resize the dynamic string array to a larger size. + * A callback intended to be passed to f_memory_arrays_adjust() for an f_utf_string_dynamics_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamics_increase_by_ - extern f_status_t f_utf_string_dynamics_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamics_t * const structure); -#endif // _di_f_utf_string_dynamics_increase_by_ - -/** - * Resize the dynamic string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_dynamics_resize_ - extern f_status_t f_utf_string_dynamics_resize(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure); -#endif // _di_f_utf_string_dynamics_resize_ +#ifndef _di_f_utf_string_dynamics_destroy_callback_ + extern f_status_t f_utf_string_dynamics_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_dynamics_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/dynamicss.c b/level_0/f_utf/c/utf/dynamicss.c index 4866bcf..ba64bc8 100644 --- a/level_0/f_utf/c/utf/dynamicss.c +++ b/level_0/f_utf/c/utf/dynamicss.c @@ -1,25 +1,13 @@ #include "../utf.h" #include "../private-utf.h" #include "static.h" -#include "private-dynamic.h" #include "private-dynamics.h" -#include "private-dynamicss.h" #include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_f_utf_string_dynamicss_adjust_ - f_status_t f_utf_string_dynamicss_adjust(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_dynamicss_adjust(length, structure); - } -#endif // _di_f_utf_string_dynamicss_adjust_ - #ifndef _di_f_utf_string_dynamicss_append_ f_status_t f_utf_string_dynamicss_append(const f_utf_string_dynamics_t source, f_utf_string_dynamicss_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -28,18 +16,16 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_dynamicss_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_dynamics_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_utf_string_dynamics_append_all(source, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_utf_string_dynamics_append_all(source, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -56,106 +42,82 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_dynamicss_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_dynamics_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.array[i].used) { - status = private_f_utf_string_dynamics_append_all(source.array[i], &destination->array[destination->used]); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].used) { + status = private_f_utf_string_dynamics_append_all(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // _di_f_utf_string_dynamicss_append_all_ -#ifndef _di_f_utf_string_dynamicss_decimate_by_ - f_status_t f_utf_string_dynamicss_decimate_by(const f_number_unsigned_t amount, f_utf_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_dynamicss_delete_callback_ + f_status_t f_utf_string_dynamicss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_dynamics_t * const array = (f_utf_string_dynamics_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - return private_f_utf_string_dynamicss_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_dynamicss_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_dynamicss_decrease_by_ - f_status_t f_utf_string_dynamicss_decrease_by(const f_number_unsigned_t amount, f_utf_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - if (!amount) return F_data_not; + if (array[i].array[j].size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].string, &array[i].array[j].used, &array[i].array[j].size); + if (F_status_is_error(status)) return status; + } - return private_f_utf_string_dynamicss_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_dynamicss_decrease_by_ - -#ifndef _di_f_utf_string_dynamicss_increase_ - f_status_t f_utf_string_dynamicss_increase(const f_number_unsigned_t step, f_utf_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!step) return F_data_not; - - if (structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; - - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_utf_string_dynamicss_resize(length, structure); + status = f_memory_array_resize(0, sizeof(f_utf_string_dynamic_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } // for + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_dynamicss_increase_ +#endif // _di_f_utf_string_dynamicss_delete_callback_ -#ifndef _di_f_utf_string_dynamicss_increase_by_ - f_status_t f_utf_string_dynamicss_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); +#ifndef _di_f_utf_string_dynamicss_destroy_callback_ + f_status_t f_utf_string_dynamicss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - const f_number_unsigned_t length = structure->used + amount; + { + f_utf_string_dynamics_t * const array = (f_utf_string_dynamics_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + for (f_number_unsigned_t i = start; i < stop; ++i) { - return private_f_utf_string_dynamicss_resize(structure->used + amount, structure); - } - } + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - return F_data_not; - } -#endif // _di_f_utf_string_dynamicss_increase_by_ + if (array[i].array[j].size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].string, &array[i].array[j].used, &array[i].array[j].size); + if (F_status_is_error(status)) return status; + } -#ifndef _di_f_utf_string_dynamicss_resize_ - f_status_t f_utf_string_dynamicss_resize(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + status = f_memory_array_adjust(0, sizeof(f_utf_string_dynamic_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } // for + } + } // for + } - return private_f_utf_string_dynamicss_resize(length, structure); + return F_okay; } -#endif // _di_f_utf_string_dynamicss_resize_ +#endif // _di_f_utf_string_dynamicss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/dynamicss.h b/level_0/f_utf/c/utf/dynamicss.h index 7310e60..0fd5281 100644 --- a/level_0/f_utf/c/utf/dynamicss.h +++ b/level_0/f_utf/c/utf/dynamicss.h @@ -32,39 +32,9 @@ extern "C" { #define macro_f_utf_string_dynamicss_t_initialize_2(array, length) { array, length, length } #define macro_f_utf_string_dynamicss_t_clear(dynamicss) macro_f_utf_string_staticss_t_clear(dynamicss) - - #define macro_f_utf_string_dynamicss_t_resize(status, dynamicss, length) status = f_utf_string_dynamicss_resize(length, &dynamicss); - #define macro_f_utf_string_dynamicss_t_adjust(status, dynamicss, length) status = f_utf_string_dynamicss_adjust(length, &dynamicss); - - #define macro_f_utf_string_dynamicss_t_delete_simple(dynamicss) f_utf_string_dynamicss_resize(0, &dynamicss); - #define macro_f_utf_string_dynamicss_t_destroy_simple(dynamicss) f_utf_string_dynamicss_adjust(0, &dynamicss); - - #define macro_f_utf_string_dynamicss_t_increase(status, step, dynamicss) status = f_utf_string_dynamicss_increase(step, &dynamicss); - #define macro_f_utf_string_dynamicss_t_increase_by(status, dynamicss, amount) status = f_utf_string_dynamicss_increase_by(amount, &dynamicss); - #define macro_f_utf_string_dynamicss_t_decrease_by(status, dynamicss, amount) status = f_utf_string_dynamicss_decrease_by(amount, &dynamicss); - #define macro_f_utf_string_dynamicss_t_decimate_by(status, dynamicss, amount) status = f_utf_string_dynamicss_decimate_by(amount, &dynamicss); #endif // _di_f_utf_string_dynamicss_t_ /** - * Resize the dynamics string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_adjust(). - */ -#ifndef _di_f_utf_string_dynamicss_adjust_ - extern f_status_t f_utf_string_dynamicss_adjust(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure); -#endif // _di_f_utf_string_dynamicss_adjust_ - -/** * Append the single source string onto the destination. * * @param source @@ -107,121 +77,60 @@ extern "C" { #endif // _di_f_utf_string_dynamicss_append_all_ /** - * Resize the dynamics string array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The array to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). + * A callback intended to be passed to f_memory_arrayss_resize() for an f_utf_string_dynamicss_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamicss_decimate_by_ - extern f_status_t f_utf_string_dynamicss_decimate_by(const f_number_unsigned_t amount, f_utf_string_dynamicss_t * const structure); -#endif // _di_f_utf_string_dynamicss_decimate_by_ - -/** - * Resize the dynamics string array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0). * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamicss_decrease_by_ - extern f_status_t f_utf_string_dynamicss_decrease_by(const f_number_unsigned_t amount, f_utf_string_dynamicss_t * const structure); -#endif // _di_f_utf_string_dynamicss_decrease_by_ - -/** - * Increase the size of the dynamics string array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_dynamicss_increase_ - extern f_status_t f_utf_string_dynamicss_increase(const f_number_unsigned_t step, f_utf_string_dynamicss_t * const structure); -#endif // _di_f_utf_string_dynamicss_increase_ +#ifndef _di_f_utf_string_dynamicss_delete_callback_ + extern f_status_t f_utf_string_dynamicss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_dynamicss_delete_callback_ /** - * Resize the dynamics string array to a larger size. + * A callback intended to be passed to f_memory_arrayss_adjust() for an f_utf_string_dynamicss_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_dynamicss_increase_by_ - extern f_status_t f_utf_string_dynamicss_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamicss_t * const structure); -#endif // _di_f_utf_string_dynamicss_increase_by_ - -/** - * Resize the dynamics string array. - * - * @param length - * The new size to use. - * @param structure - * The array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_dynamicss_resize_ - extern f_status_t f_utf_string_dynamicss_resize(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure); -#endif // _di_f_utf_string_dynamicss_resize_ +#ifndef _di_f_utf_string_dynamicss_destroy_callback_ + extern f_status_t f_utf_string_dynamicss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_dynamicss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/map.h b/level_0/f_utf/c/utf/map.h index 5f37749..22b0e38 100644 --- a/level_0/f_utf/c/utf/map.h +++ b/level_0/f_utf/c/utf/map.h @@ -36,14 +36,6 @@ extern "C" { #define macro_f_utf_string_map_t_clear(map) \ macro_f_utf_string_dynamic_t_clear(map.name) \ macro_f_utf_string_dynamic_t_clear(map.value) - - #define macro_f_utf_string_map_t_delete_simple(map) \ - macro_f_utf_string_dynamic_t_delete_simple(map.name) \ - macro_f_utf_string_dynamic_t_delete_simple(map.value) - - #define macro_f_utf_string_map_t_destroy_simple(map) \ - macro_f_utf_string_dynamic_t_destroy_simple(map.name) \ - macro_f_utf_string_dynamic_t_destroy_simple(map.value) #endif // _di_f_utf_string_map_t_ #ifdef __cplusplus diff --git a/level_0/f_utf/c/utf/map_multi.h b/level_0/f_utf/c/utf/map_multi.h index d29e403..38e2b68 100644 --- a/level_0/f_utf/c/utf/map_multi.h +++ b/level_0/f_utf/c/utf/map_multi.h @@ -36,14 +36,6 @@ extern "C" { #define macro_f_utf_string_map_multi_t_clear(map) \ macro_f_utf_string_dynamic_t_clear(map.name) \ macro_f_utf_string_dynamics_t_clear(map.value) - - #define macro_f_utf_string_map_multi_t_delete_simple(map) \ - macro_f_utf_string_dynamic_t_delete_simple(map.name) \ - macro_f_utf_string_dynamics_t_delete_simple(map.value) - - #define macro_f_utf_string_map_multi_t_destroy_simple(map) \ - macro_f_utf_string_dynamic_t_destroy_simple(map.name) \ - macro_f_utf_string_dynamics_t_destroy_simple(map.value) #endif // _di_f_utf_string_map_multi_t_ #ifdef __cplusplus diff --git a/level_0/f_utf/c/utf/map_multis.c b/level_0/f_utf/c/utf/map_multis.c index ff86a66..822e566 100644 --- a/level_0/f_utf/c/utf/map_multis.c +++ b/level_0/f_utf/c/utf/map_multis.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-dynamics.h" #include "private-map_multis.h" #include "private-string.h" @@ -9,40 +8,28 @@ extern "C" { #endif -#ifndef _di_f_utf_string_map_multis_adjust_ - f_status_t f_utf_string_map_multis_adjust(const f_number_unsigned_t length, f_utf_string_map_multis_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_map_multis_adjust(length, structure); - } -#endif // _di_f_utf_string_map_multis_adjust_ - #ifndef _di_f_utf_string_map_multis_append_ f_status_t f_utf_string_map_multis_append(const f_utf_string_map_multi_t source, f_utf_string_map_multis_t * const destination) { #ifndef _di_level_0_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_map_multis_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_multi_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].name.used = 0; - destination->array[destination->used].value.used = 0; + destination->array[destination->used].name.used = 0; + destination->array[destination->used].value.used = 0; - if (source.name.used) { - status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); - if (F_status_is_error(status)) return status; - } + if (source.name.used) { + status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); + if (F_status_is_error(status)) return status; + } - if (source.value.used) { - status = private_f_utf_string_dynamics_append_all(source.value, &destination->array[destination->used].value); - if (F_status_is_error(status)) return status; + if (source.value.used) { + status = private_f_utf_string_dynamics_append_all(source.value, &destination->array[destination->used].value); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -63,83 +50,69 @@ extern "C" { } #endif // _di_f_utf_string_map_multis_append_all_ -#ifndef _di_f_utf_string_map_multis_decimate_by_ - f_status_t f_utf_string_map_multis_decimate_by(const f_number_unsigned_t amount, f_utf_string_map_multis_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_map_multis_delete_callback_ + f_status_t f_utf_string_map_multis_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_map_multi_t * const array = (f_utf_string_map_multi_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - return private_f_utf_string_map_multis_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_map_multis_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_map_multis_decrease_by_ - f_status_t f_utf_string_map_multis_decrease_by(const f_number_unsigned_t amount, f_utf_string_map_multis_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].name.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (F_status_is_error(status)) return status; + } - if (!amount) return F_data_not; + if (array[i].value.size) { + for (j = 0; j < array[i].value.size; ++j) { - return private_f_utf_string_map_multis_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_map_multis_decrease_by_ + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].value.array[j].string, &array[i].value.array[j].used, &array[i].value.array[j].size); + if (F_status_is_error(status)) return status; + } // for -#ifndef _di_f_utf_string_map_multis_increase_ - f_status_t f_utf_string_map_multis_increase(const f_number_unsigned_t step, f_utf_string_map_multis_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (step && structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; - - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_utf_string_map_multis_resize(length, structure); + status = f_memory_array_resize(0, sizeof(f_utf_string_dynamic_t), (void **) &array[i].value.array, &array[i].value.used, &array[i].value.size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_map_multis_increase_ +#endif // _di_f_utf_string_map_multis_delete_callback_ -#ifndef _di_f_utf_string_map_multis_increase_by_ - f_status_t f_utf_string_map_multis_increase_by(const f_number_unsigned_t amount, f_utf_string_map_multis_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_map_multis_destroy_callback_ + f_status_t f_utf_string_map_multis_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + { + f_utf_string_map_multi_t * const array = (f_utf_string_map_multi_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - const f_number_unsigned_t length = structure->used + amount; + for (f_number_unsigned_t i = start; i < stop; ++i) { - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + if (array[i].name.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (F_status_is_error(status)) return status; + } - return private_f_utf_string_map_multis_resize(length, structure); - } - } + if (array[i].value.size) { + for (j = 0; j < array[i].value.size; ++j) { - return F_data_not; - } -#endif // _di_f_utf_string_map_multis_increase_by_ + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].value.array[j].string, &array[i].value.array[j].used, &array[i].value.array[j].size); + if (F_status_is_error(status)) return status; + } // for -#ifndef _di_f_utf_string_map_multis_resize_ - f_status_t f_utf_string_map_multis_resize(const f_number_unsigned_t length, f_utf_string_map_multis_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + status = f_memory_array_adjust(0, sizeof(f_utf_string_dynamic_t), (void **) &array[i].value.array, &array[i].value.used, &array[i].value.size); + if (F_status_is_error(status)) return status; + } + } // for + } - return private_f_utf_string_map_multis_resize(length, structure); + return F_okay; } -#endif // _di_f_utf_string_map_multis_resize_ +#endif // _di_f_utf_string_map_multis_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/map_multis.h b/level_0/f_utf/c/utf/map_multis.h index e75bae0..768dc65 100644 --- a/level_0/f_utf/c/utf/map_multis.h +++ b/level_0/f_utf/c/utf/map_multis.h @@ -36,39 +36,9 @@ extern "C" { #define macro_f_utf_string_map_multis_t_initialize_1(array, size, used) { array, size, used } #define macro_f_utf_string_map_multis_t_initialize_2(array, length) { array, length, length } - - #define macro_f_utf_string_map_multis_t_resize(status, map_multis, length) status = f_utf_string_map_multis_resize(length, &map_multis); - #define macro_f_utf_string_map_multis_t_adjust(status, map_multis, length) status = f_utf_string_map_multis_adjust(length, &map_multis); - - #define macro_f_utf_string_map_multis_t_delete_simple(map_multis) f_utf_string_map_multis_resize(0, &map_multis); - #define macro_f_utf_string_map_multis_t_destroy_simple(map_multis) f_utf_string_map_multis_adjust(0, &map_multis); - - #define macro_f_utf_string_map_multis_t_increase(status, step, map_multis) status = f_utf_string_map_multis_increase(step, &map_multis); - #define macro_f_utf_string_map_multis_t_increase_by(status, map_multis, amount) status = f_utf_string_map_multis_increase_by(amount, &map_multis); - #define macro_f_utf_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_utf_string_map_multis_decrease_by(amount, &map_multis); - #define macro_f_utf_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_utf_string_map_multis_decimate_by(amount, &map_multis); #endif // _di_f_utf_string_map_multis_t_ /** - * Resize the map_multis array. - * - * @param length - * The new size to use. - * @param structure - * The map_multis array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multis_adjust_ - extern f_status_t f_utf_string_map_multis_adjust(const f_number_unsigned_t length, f_utf_string_map_multis_t * const structure); -#endif // _di_f_utf_string_map_multis_adjust_ - -/** * Append a single source map_multi onto the destination. * * @param source @@ -110,120 +80,60 @@ extern "C" { #endif // _di_f_utf_string_map_multis_append_all_ /** - * Resize the map_multis array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The map_multis array to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. + * A callback intended to be passed to f_memory_arrays_resize() for an f_utf_string_map_multis_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multis_decimate_by_ - extern f_status_t f_utf_string_map_multis_decimate_by(const f_number_unsigned_t amount, f_utf_string_map_multis_t * const structure); -#endif // _di_f_utf_string_map_multis_decimate_by_ - -/** - * Resize the map_multis array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The map_multis array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multis_decrease_by_ - extern f_status_t f_utf_string_map_multis_decrease_by(const f_number_unsigned_t amount, f_utf_string_map_multis_t * const structure); -#endif // _di_f_utf_string_map_multis_decrease_by_ - -/** - * Increase the size of the map_multis array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The map_multis array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_map_multis_increase_ - extern f_status_t f_utf_string_map_multis_increase(const f_number_unsigned_t step, f_utf_string_map_multis_t * const structure); -#endif // _di_f_utf_string_map_multis_increase_ +#ifndef _di_f_utf_string_map_multis_delete_callback_ + extern f_status_t f_utf_string_map_multis_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_map_multis_delete_callback_ /** - * Resize the map_multis array to a larger size. + * A callback intended to be passed to f_memory_arrays_adjust() for an f_utf_string_map_multis_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The map_multis array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multis_increase_by_ - extern f_status_t f_utf_string_map_multis_increase_by(const f_number_unsigned_t amount, f_utf_string_map_multis_t * const structure); -#endif // _di_f_utf_string_map_multis_increase_by_ - -/** - * Resize the map_multis array. - * - * @param length - * The new size to use. - * @param structure - * The map_multis array to adjust. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_map_multis_resize_ - extern f_status_t f_utf_string_map_multis_resize(const f_number_unsigned_t length, f_utf_string_map_multis_t * const structure); -#endif // _di_f_utf_string_map_multis_resize_ +#ifndef _di_f_utf_string_map_multis_destroy_callback_ + extern f_status_t f_utf_string_map_multis_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_map_multis_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/map_multiss.c b/level_0/f_utf/c/utf/map_multiss.c index fceab23..c1c396c 100644 --- a/level_0/f_utf/c/utf/map_multiss.c +++ b/level_0/f_utf/c/utf/map_multiss.c @@ -1,25 +1,13 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-dynamics.h" #include "private-map_multis.h" -#include "private-map_multiss.h" #include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_f_utf_string_map_multiss_adjust_ - f_status_t f_utf_string_map_multiss_adjust(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_map_multiss_adjust(length, structure); - } -#endif // _di_f_utf_string_map_multiss_adjust_ - #ifndef _di_f_utf_string_map_multiss_append_ f_status_t f_utf_string_map_multiss_append(const f_utf_string_map_multis_t source, f_utf_string_map_multiss_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -28,18 +16,16 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_map_multiss_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_multis_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_utf_string_map_multis_append_all(source, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_utf_string_map_multis_append_all(source, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -56,104 +42,99 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_map_multis_t), (void **) &destination->array, &destination->used, &destination->size); - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_map_multiss_resize(destination->used + source.used, destination); - if (F_status_is_error(status)) return status; - } + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + destination->array[destination->used].used = 0; - destination->array[destination->used].used = 0; - - if (source.array[i].used) { - status = private_f_utf_string_map_multis_append_all(source.array[i], &destination->array[destination->used]); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].used) { + status = private_f_utf_string_map_multis_append_all(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // _di_f_utf_string_map_multiss_append_all_ -#ifndef _di_f_utf_string_map_multiss_decimate_by_ - f_status_t f_utf_string_map_multiss_decimate_by(const f_number_unsigned_t amount, f_utf_string_map_multiss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_map_multiss_delete_callback_ + f_status_t f_utf_string_map_multiss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_map_multis_t * const array = (f_utf_string_map_multis_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; + f_number_unsigned_t k = 0; - return private_f_utf_string_map_multiss_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_map_multiss_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_map_multiss_decrease_by_ - f_status_t f_utf_string_map_multiss_decrease_by(const f_number_unsigned_t amount, f_utf_string_map_multiss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - return private_f_utf_string_map_multiss_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_map_multiss_decrease_by_ + if (array[i].size) { + if (array[i].array[j].name.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (F_status_is_error(status)) return status; + } -#ifndef _di_f_utf_string_map_multiss_increase_ - f_status_t f_utf_string_map_multiss_increase(const f_number_unsigned_t step, f_utf_string_map_multiss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].array[j].value.size) { + for (k = 0; k < array[i].array[j].value.size; ++k) { - if (step && structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].value.array[k].string, &array[i].array[j].value.array[k].used, &array[i].array[j].value.array[k].size); + if (F_status_is_error(status)) return status; + } // for - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + status = f_memory_array_resize(0, sizeof(f_utf_string_dynamic_t), (void **) &array[i].array[j].value.array, &array[i].array[j].value.used, &array[i].array[j].value.size); + if (F_status_is_error(status)) return status; + } - length = F_number_t_size_unsigned_d; - } - - return private_f_utf_string_map_multiss_resize(length, structure); + status = f_memory_array_resize(0, sizeof(f_utf_string_map_multi_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_map_multiss_increase_ +#endif // _di_f_utf_string_map_multiss_delete_callback_ -#ifndef _di_f_utf_string_map_multiss_increase_by_ - f_status_t f_utf_string_map_multiss_increase_by(const f_number_unsigned_t amount, f_utf_string_map_multiss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_map_multiss_destroy_callback_ + f_status_t f_utf_string_map_multiss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + { + f_utf_string_map_multis_t * const array = (f_utf_string_map_multis_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; + f_number_unsigned_t k = 0; - const f_number_unsigned_t length = structure->used + amount; + for (f_number_unsigned_t i = start; i < stop; ++i) { - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + if (array[i].size) { + if (array[i].array[j].name.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (F_status_is_error(status)) return status; + } - return private_f_utf_string_map_multiss_resize(length, structure); - } - } + if (array[i].array[j].value.size) { + for (k = 0; k < array[i].array[j].value.size; ++k) { - return F_data_not; - } -#endif // _di_f_utf_string_map_multiss_increase_by_ + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].value.array[k].string, &array[i].array[j].value.array[k].used, &array[i].array[j].value.array[k].size); + if (F_status_is_error(status)) return status; + } // for -#ifndef _di_f_utf_string_map_multiss_resize_ - f_status_t f_utf_string_map_multiss_resize(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + status = f_memory_array_adjust(0, sizeof(f_utf_string_dynamic_t), (void **) &array[i].array[j].value.array, &array[i].array[j].value.used, &array[i].array[j].value.size); + if (F_status_is_error(status)) return status; + } - return private_f_utf_string_map_multiss_resize(length, structure); + status = f_memory_array_adjust(0, sizeof(f_utf_string_map_multi_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for + } + + return F_okay; } -#endif // _di_f_utf_string_map_multiss_resize_ +#endif // _di_f_utf_string_map_multiss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/map_multiss.h b/level_0/f_utf/c/utf/map_multiss.h index 7f94472..8b777dc 100644 --- a/level_0/f_utf/c/utf/map_multiss.h +++ b/level_0/f_utf/c/utf/map_multiss.h @@ -36,39 +36,9 @@ extern "C" { #define macro_f_utf_string_map_multiss_t_initialize_1(array, size, used) { array, size, used } #define macro_f_utf_string_map_multiss_t_initialize_2(array, length) { array, length, length } - - #define macro_f_utf_string_map_multiss_t_resize(status, map_multis, length) status = f_utf_string_map_multiss_resize(length, &map_multis); - #define macro_f_utf_string_map_multiss_t_adjust(status, map_multis, length) status = f_utf_string_map_multiss_adjust(length, &map_multis); - - #define macro_f_utf_string_map_multiss_t_delete_simple(map_multis) f_utf_string_map_multiss_resize(0, &map_multis); - #define macro_f_utf_string_map_multiss_t_destroy_simple(map_multis) f_utf_string_map_multiss_adjust(0, &map_multis); - - #define macro_f_utf_string_map_multiss_t_increase(status, step, map_multis) status = f_utf_string_map_multiss_increase(step, &map_multis); - #define macro_f_utf_string_map_multiss_t_increase_by(status, map_multis, amount) status = f_utf_string_map_multiss_increase_by(amount, &map_multis); - #define macro_f_utf_string_map_multiss_t_decrease_by(status, map_multis, amount) status = f_utf_string_map_multiss_decrease_by(amount, &map_multis); - #define macro_f_utf_string_map_multiss_t_decimate_by(status, map_multis, amount) status = f_utf_string_map_multiss_decimate_by(amount, &map_multis); #endif // _di_f_utf_string_map_multiss_t_ /** - * Resize the map_multiss array. - * - * @param length - * The new size to use. - * @param structure - * The map_multiss array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multiss_adjust_ - extern f_status_t f_utf_string_map_multiss_adjust(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure); -#endif // _di_f_utf_string_map_multiss_adjust_ - -/** * Append a single source map_multis onto the destination. * * @param source @@ -110,120 +80,60 @@ extern "C" { #endif // _di_f_utf_string_map_multiss_append_all_ /** - * Resize the map_multiss array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The map_multiss array to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. + * A callback intended to be passed to f_memory_arrayss_resize() for an f_utf_string_map_multiss_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multiss_decimate_by_ - extern f_status_t f_utf_string_map_multiss_decimate_by(const f_number_unsigned_t amount, f_utf_string_map_multiss_t * const structure); -#endif // _di_f_utf_string_map_multiss_decimate_by_ - -/** - * Resize the map_multiss array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The map_multiss array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multiss_decrease_by_ - extern f_status_t f_utf_string_map_multiss_decrease_by(const f_number_unsigned_t amount, f_utf_string_map_multiss_t * const structure); -#endif // _di_f_utf_string_map_multiss_decrease_by_ - -/** - * Increase the size of the map_multiss array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The map_multiss array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_map_multiss_increase_ - extern f_status_t f_utf_string_map_multiss_increase(const f_number_unsigned_t step, f_utf_string_map_multiss_t * const structure); -#endif // _di_f_utf_string_map_multiss_increase_ +#ifndef _di_f_utf_string_map_multiss_delete_callback_ + extern f_status_t f_utf_string_map_multiss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_map_multiss_delete_callback_ /** - * Resize the map_multiss array to a larger size. + * A callback intended to be passed to f_memory_arrayss_adjust() for an f_utf_string_map_multiss_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The map_multiss array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_map_multiss_increase_by_ - extern f_status_t f_utf_string_map_multiss_increase_by(const f_number_unsigned_t amount, f_utf_string_map_multiss_t * const structure); -#endif // _di_f_utf_string_map_multiss_increase_by_ - -/** - * Resize the map_multiss array. - * - * @param length - * The new size to use. - * @param structure - * The map_multiss array to adjust. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_map_multiss_resize_ - extern f_status_t f_utf_string_map_multiss_resize(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure); -#endif // _di_f_utf_string_map_multiss_resize_ +#ifndef _di_f_utf_string_map_multiss_destroy_callback_ + extern f_status_t f_utf_string_map_multiss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_map_multiss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/maps.c b/level_0/f_utf/c/utf/maps.c index c556982..ba9a609 100644 --- a/level_0/f_utf/c/utf/maps.c +++ b/level_0/f_utf/c/utf/maps.c @@ -7,40 +7,27 @@ extern "C" { #endif -#ifndef _di_f_utf_string_maps_adjust_ - f_status_t f_utf_string_maps_adjust(const f_number_unsigned_t length, f_utf_string_maps_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_maps_adjust(length, structure); - } -#endif // _di_f_utf_string_maps_adjust_ - #ifndef _di_f_utf_string_maps_append_ f_status_t f_utf_string_maps_append(const f_utf_string_map_t source, f_utf_string_maps_t * const destination) { #ifndef _di_level_0_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status_t status = F_okay; + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_t), (void **) &destination->array, &destination->used, &destination->size); - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_maps_resize(destination->used + F_memory_default_allocation_small_d, destination); - if (F_status_is_error(status)) return status; - } - - destination->array[destination->used].name.used = 0; - destination->array[destination->used].value.used = 0; + destination->array[destination->used].name.used = 0; + destination->array[destination->used].value.used = 0; - if (source.name.used) { - status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); - if (F_status_is_error(status)) return status; - } + if (source.name.used) { + status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); + if (F_status_is_error(status)) return status; + } - if (source.value.used) { - status = private_f_utf_string_append(source.value.string, source.value.used, &destination->array[destination->used].value); - if (F_status_is_error(status)) return status; + if (source.value.used) { + status = private_f_utf_string_append(source.value.string, source.value.used, &destination->array[destination->used].value); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -61,83 +48,55 @@ extern "C" { } #endif // _di_f_utf_string_maps_append_all_ -#ifndef _di_f_utf_string_maps_decimate_by_ - f_status_t f_utf_string_maps_decimate_by(const f_number_unsigned_t amount, f_utf_string_maps_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_maps_delete_callback_ + f_status_t f_utf_string_maps_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_map_t * const array = (f_utf_string_map_t *) void_array; + f_status_t status = F_okay; - return private_f_utf_string_maps_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_maps_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_maps_decrease_by_ - f_status_t f_utf_string_maps_decrease_by(const f_number_unsigned_t amount, f_utf_string_maps_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - return private_f_utf_string_maps_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_maps_decrease_by_ + if (array[i].name.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (F_status_is_error(status)) return status; + } -#ifndef _di_f_utf_string_maps_increase_ - f_status_t f_utf_string_maps_increase(const f_number_unsigned_t step, f_utf_string_maps_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (step && structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; - - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_utf_string_maps_resize(length, structure); + if (array[i].value.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].value.string, &array[i].value.used, &array[i].value.size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_maps_increase_ +#endif // _di_f_utf_string_maps_delete_callback_ -#ifndef _di_f_utf_string_maps_increase_by_ - f_status_t f_utf_string_maps_increase_by(const f_number_unsigned_t amount, f_utf_string_maps_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_maps_destroy_callback_ + f_status_t f_utf_string_maps_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + { + f_utf_string_map_t * const array = (f_utf_string_map_t *) void_array; + f_status_t status = F_okay; - const f_number_unsigned_t length = structure->used + amount; + for (f_number_unsigned_t i = start; i < stop; ++i) { - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + if (array[i].name.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (F_status_is_error(status)) return status; + } - return private_f_utf_string_maps_resize(length, structure); - } + if (array[i].value.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].value.string, &array[i].value.used, &array[i].value.size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; - } -#endif // _di_f_utf_string_maps_increase_by_ - -#ifndef _di_f_utf_string_maps_resize_ - f_status_t f_utf_string_maps_resize(const f_number_unsigned_t length, f_utf_string_maps_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_maps_resize(length, structure); + return F_okay; } -#endif // _di_f_utf_string_maps_resize_ +#endif // _di_f_utf_string_maps_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/maps.h b/level_0/f_utf/c/utf/maps.h index 2f9416b..aed0b77 100644 --- a/level_0/f_utf/c/utf/maps.h +++ b/level_0/f_utf/c/utf/maps.h @@ -36,39 +36,9 @@ extern "C" { #define macro_f_utf_string_maps_t_initialize_1(array, size, used) { array, size, used } #define macro_f_utf_string_maps_t_initialize_2(array, length) { array, length, length } - - #define macro_f_utf_string_maps_t_resize(status, maps, length) status = f_utf_string_maps_resize(length, &maps); - #define macro_f_utf_string_maps_t_adjust(status, maps, length) status = f_utf_string_maps_adjust(length, &maps); - - #define macro_f_utf_string_maps_t_delete_simple(maps) f_utf_string_maps_resize(0, &maps); - #define macro_f_utf_string_maps_t_destroy_simple(maps) f_utf_string_maps_adjust(0, &maps); - - #define macro_f_utf_string_maps_t_increase(status, step, maps) status = f_utf_string_maps_increase(step, maps); - #define macro_f_utf_string_maps_t_increase_by(status, maps, amount) status = f_utf_string_maps_increase_by(amount, maps); - #define macro_f_utf_string_maps_t_decrease_by(status, maps, amount) status = f_utf_string_maps_decrease_by(amount, maps); - #define macro_f_utf_string_maps_t_decimate_by(status, maps, amount) status = f_utf_string_maps_decimate_by(amount, maps); #endif // _di_f_utf_string_maps_t_ /** - * Resize the string maps array. - * - * @param length - * The new size to use. - * @param structure - * The string maps array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_maps_adjust_ - extern f_status_t f_utf_string_maps_adjust(const f_number_unsigned_t length, f_utf_string_maps_t * const structure); -#endif // _di_f_utf_string_maps_adjust_ - -/** * Append a single source map onto the destination. * * @param source @@ -110,120 +80,60 @@ extern "C" { #endif // _di_f_utf_string_maps_append_all_ /** - * Resize the string maps array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The string maps array to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. + * A callback intended to be passed to f_memory_arrays_resize() for an f_utf_string_maps_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_maps_decimate_by_ - extern f_status_t f_utf_string_maps_decimate_by(const f_number_unsigned_t amount, f_utf_string_maps_t * const structure); -#endif // _di_f_utf_string_maps_decimate_by_ - -/** - * Resize the string maps array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The string maps array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_maps_decrease_by_ - extern f_status_t f_utf_string_maps_decrease_by(const f_number_unsigned_t amount, f_utf_string_maps_t * const structure); -#endif // _di_f_utf_string_maps_decrease_by_ - -/** - * Increase the size of the string maps array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The string maps array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_maps_increase_ - extern f_status_t f_utf_string_maps_increase(const f_number_unsigned_t step, f_utf_string_maps_t * const structure); -#endif // _di_f_utf_string_maps_increase_ +#ifndef _di_f_utf_string_maps_delete_callback_ + extern f_status_t f_utf_string_maps_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_maps_delete_callback_ /** - * Resize the string maps array to a larger size. + * A callback intended to be passed to f_memory_arrays_adjust() for an f_utf_string_maps_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The string maps array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_maps_increase_by_ - extern f_status_t f_utf_string_maps_increase_by(const f_number_unsigned_t amount, f_utf_string_maps_t * const structure); -#endif // _di_f_utf_string_maps_increase_by_ - -/** - * Resize the string maps array. - * - * @param length - * The new size to use. - * @param structure - * The string maps array to adjust. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_maps_resize_ - extern f_status_t f_utf_string_maps_resize(const f_number_unsigned_t length, f_utf_string_maps_t * const structure); -#endif // _di_f_utf_string_maps_resize_ +#ifndef _di_f_utf_string_maps_destroy_callback_ + extern f_status_t f_utf_string_maps_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_maps_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/mapss.c b/level_0/f_utf/c/utf/mapss.c index b4eb6c1..febf112 100644 --- a/level_0/f_utf/c/utf/mapss.c +++ b/level_0/f_utf/c/utf/mapss.c @@ -1,23 +1,12 @@ #include "../utf.h" #include "../private-utf.h" #include "private-maps.h" -#include "private-mapss.h" #include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_f_utf_string_mapss_adjust_ - f_status_t f_utf_string_mapss_adjust(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_mapss_adjust(length, structure); - } -#endif // _di_f_utf_string_mapss_adjust_ - #ifndef _di_f_utf_string_mapss_append_ f_status_t f_utf_string_mapss_append(const f_utf_string_maps_t source, f_utf_string_mapss_t * const destination) { #ifndef _di_level_0_parameter_checking_ @@ -26,18 +15,16 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_mapss_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_maps_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_utf_string_maps_append_all(source, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_utf_string_maps_append_all(source, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -54,104 +41,92 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_mapss_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_maps_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.array[i].used) { - status = private_f_utf_string_maps_append_all(source.array[i], &destination->array[destination->used]); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].used) { + status = private_f_utf_string_maps_append_all(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // _di_f_utf_string_mapss_append_all_ -#ifndef _di_f_utf_string_mapss_decimate_by_ - f_status_t f_utf_string_mapss_decimate_by(const f_number_unsigned_t amount, f_utf_string_mapss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; +#ifndef _di_f_utf_string_mapss_delete_callback_ + f_status_t f_utf_string_mapss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - return private_f_utf_string_mapss_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_mapss_decimate_by_ - -#ifndef _di_f_utf_string_mapss_decrease_by_ - f_status_t f_utf_string_mapss_decrease_by(const f_number_unsigned_t amount, f_utf_string_mapss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; + { + f_utf_string_maps_t * const array = (f_utf_string_maps_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - return private_f_utf_string_mapss_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_mapss_decrease_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_mapss_increase_ - f_status_t f_utf_string_mapss_increase(const f_number_unsigned_t step, f_utf_string_mapss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - if (step && structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; + if (array[i].array[j].name.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (F_status_is_error(status)) return status; + } - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } + if (array[i].array[j].value.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].value.string, &array[i].array[j].value.used, &array[i].array[j].value.size); + if (F_status_is_error(status)) return status; + } + } // for - return private_f_utf_string_mapss_resize(length, structure); + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_mapss_increase_ +#endif // _di_f_utf_string_mapss_delete_callback_ -#ifndef _di_f_utf_string_mapss_increase_by_ - f_status_t f_utf_string_mapss_increase_by(const f_number_unsigned_t amount, f_utf_string_mapss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_mapss_destroy_callback_ + f_status_t f_utf_string_mapss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + { + f_utf_string_maps_t * const array = (f_utf_string_maps_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - const f_number_unsigned_t length = structure->used + amount; + for (f_number_unsigned_t i = start; i < stop; ++i) { - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - return private_f_utf_string_mapss_resize(length, structure); - } - } + if (array[i].array[j].name.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (F_status_is_error(status)) return status; + } - return F_data_not; - } -#endif // _di_f_utf_string_mapss_increase_by_ + if (array[i].array[j].value.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].value.string, &array[i].array[j].value.used, &array[i].array[j].value.size); + if (F_status_is_error(status)) return status; + } + } // for -#ifndef _di_f_utf_string_mapss_resize_ - f_status_t f_utf_string_mapss_resize(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for + } - return private_f_utf_string_mapss_resize(length, structure); + return F_okay; } -#endif // _di_f_utf_string_mapss_resize_ +#endif // _di_f_utf_string_mapss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/mapss.h b/level_0/f_utf/c/utf/mapss.h index d05cd5f..be52715 100644 --- a/level_0/f_utf/c/utf/mapss.h +++ b/level_0/f_utf/c/utf/mapss.h @@ -36,39 +36,9 @@ extern "C" { #define macro_f_utf_string_mapss_t_initialize_1(array, size, used) { array, size, used } #define macro_f_utf_string_mapss_t_initialize_2(array, length) { array, length, length } - - #define macro_f_utf_string_mapss_t_resize(status, maps, length) status = f_utf_string_mapss_resize(length, &maps); - #define macro_f_utf_string_mapss_t_adjust(status, maps, length) status = f_utf_string_mapss_adjust(length, &maps); - - #define macro_f_utf_string_mapss_t_delete_simple(maps) f_utf_string_mapss_resize(0, &maps); - #define macro_f_utf_string_mapss_t_destroy_simple(maps) f_utf_string_mapss_adjust(0, &maps); - - #define macro_f_utf_string_mapss_t_increase(status, step, maps) status = f_utf_string_mapss_increase(step, maps); - #define macro_f_utf_string_mapss_t_increase_by(status, maps, amount) status = f_utf_string_mapss_increase_by(amount, maps); - #define macro_f_utf_string_mapss_t_decrease_by(status, maps, amount) status = f_utf_string_mapss_decrease_by(amount, maps); - #define macro_f_utf_string_mapss_t_decimate_by(status, maps, amount) status = f_utf_string_mapss_decimate_by(amount, maps); #endif // _di_f_utf_string_mapss_t_ /** - * Resize the string mapss array. - * - * @param length - * The new size to use. - * @param structure - * The string mapss array to resize. - * - * @return - * F_okay on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_mapss_adjust_ - extern f_status_t f_utf_string_mapss_adjust(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure); -#endif // _di_f_utf_string_mapss_adjust_ - -/** * Append a single source maps onto the destination. * * @param source @@ -110,121 +80,60 @@ extern "C" { #endif // _di_f_utf_string_mapss_append_all_ /** - * Resize the string mapss array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The string mapss array to resize. - * - * @return - * F_okay on success. - * F_data_not if amount is 0. + * A callback intended to be passed to f_memory_arrayss_resize() for an f_utf_string_mapss_t structure. * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_mapss_decimate_by_ - extern f_status_t f_utf_string_mapss_decimate_by(const f_number_unsigned_t amount, f_utf_string_mapss_t * const structure); -#endif // _di_f_utf_string_mapss_decimate_by_ - -/** - * Resize the string mapss array to a smaller size. + * This is only called when shrinking the array and generally should perform deallocations. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This does not do parameter checking. * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The string mapss array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not if amount is 0. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_mapss_decrease_by_ - extern f_status_t f_utf_string_mapss_decrease_by(const f_number_unsigned_t amount, f_utf_string_mapss_t * const structure); -#endif // _di_f_utf_string_mapss_decrease_by_ - -/** - * Increase the size of the string mapss array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The string mapss array to resize. + * Errors (with error bit) from: f_memory_array_resize(). * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size) (or step is 0). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_mapss_increase_ - extern f_status_t f_utf_string_mapss_increase(const f_number_unsigned_t step, f_utf_string_mapss_t * const structure); -#endif // _di_f_utf_string_mapss_increase_ +#ifndef _di_f_utf_string_mapss_delete_callback_ + extern f_status_t f_utf_string_mapss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_mapss_delete_callback_ /** - * Resize the string mapss array to a larger size. + * A callback intended to be passed to f_memory_arrayss_adjust() for an f_utf_string_mapss_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The string mapss array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_mapss_increase_by_ - extern f_status_t f_utf_string_mapss_increase_by(const f_number_unsigned_t amount, f_utf_string_mapss_t * const structure); -#endif // _di_f_utf_string_mapss_increase_by_ - -/** - * Resize the string mapss array. - * - * @param length - * The new size to use. - * @param structure - * The string mapss array to adjust. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_mapss_resize_ - extern f_status_t f_utf_string_mapss_resize(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure); -#endif // _di_f_utf_string_mapss_resize_ +#ifndef _di_f_utf_string_mapss_destroy_callback_ + extern f_status_t f_utf_string_mapss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_mapss_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/private-dynamic.c b/level_0/f_utf/c/utf/private-dynamic.c index afa354b..707d910 100644 --- a/level_0/f_utf/c/utf/private-dynamic.c +++ b/level_0/f_utf/c/utf/private-dynamic.c @@ -1,59 +1,11 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - f_status_t private_f_utf_string_dynamic_adjust(const f_number_unsigned_t length, f_utf_string_dynamic_t * const dynamic) { - - const f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_utf_char_t), (void **) & dynamic->string); - if (F_status_is_error(status)) return status; - - dynamic->size = length; - - if (dynamic->used > dynamic->size) { - dynamic->used = length; - } - - return F_okay; - } -#endif // !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - -#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) || !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) - f_status_t private_f_utf_string_dynamic_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic) { - - const f_number_unsigned_t length = dynamic->used + amount; - - if (length > dynamic->size) { - if (length > F_string_t_size_d) return F_status_set_error(F_string_too_large); - - return private_f_utf_string_dynamic_resize(length, dynamic); - } - - return F_data_not; - } -#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) || !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) - -#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decrease_by) || !defined(_di_f_utf_string_dynamics_increase) || !defined(_di_f_utf_string_dynamics_increase_by) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_decrease_by) || !defined(_di_f_utf_string_map_multis_increase) || !defined(_di_f_utf_string_map_multis_increase_by) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) - f_status_t private_f_utf_string_dynamic_resize(const f_number_unsigned_t length, f_utf_string_dynamic_t * const dynamic) { - - const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_utf_char_t), (void **) & dynamic->string); - if (F_status_is_error(status)) return status; - - dynamic->size = length; - - if (dynamic->used > dynamic->size) { - dynamic->used = length; - } - - return F_okay; - } -#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decrease_by) || !defined(_di_f_utf_string_dynamics_increase) || !defined(_di_f_utf_string_dynamics_increase_by) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_decrease_by) || !defined(_di_f_utf_string_map_multis_increase) || !defined(_di_f_utf_string_map_multis_increase_by) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-dynamic.h b/level_0/f_utf/c/utf/private-dynamic.h index 142ec1f..5cd0bc5 100644 --- a/level_0/f_utf/c/utf/private-dynamic.h +++ b/level_0/f_utf/c/utf/private-dynamic.h @@ -15,168 +15,6 @@ extern "C" { #endif -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param dynamic - * The string to adjust. - * - * @return - * F_okay on success. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * @see f_utf_string_dynamic_adjust() - * @see f_utf_string_dynamic_decimate_by() - * @see f_utf_string_dynamics_adjust() - * @see f_utf_string_dynamics_append() - * @see f_utf_string_dynamics_decimate_by() - * @see f_utf_string_map_multis_adjust() - * @see f_utf_string_map_multis_append() - * @see f_utf_string_triples_adjust() - * @see f_utf_string_triples_decimate_by() - */ -#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - extern f_status_t private_f_utf_string_dynamic_adjust(const f_number_unsigned_t length, f_utf_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - -/** - * Private implementation of f_utf_string_dynamic_increase_by(). - * - * Intended to be shared to each of the different implementation variations. - * - * @param amount - * A positive number representing how much to increase the size by. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_string_too_large (with error bit) if the combined string is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see memcpy() - * - * @see f_memory_resize() - * @see f_utf_string_append() - * @see f_utf_string_append_assure() - * @see f_utf_string_append_assure_nulless() - * @see f_utf_string_append_nulless() - * @see f_utf_string_dynamic_append() - * @see f_utf_string_dynamic_append_assure() - * @see f_utf_string_dynamic_append_assure_nulless() - * @see f_utf_string_dynamic_append_nulless() - * @see f_utf_string_dynamic_increase_by() - * @see f_utf_string_dynamic_mash() - * @see f_utf_string_dynamic_mash_nulless() - * @see f_utf_string_dynamic_mish() - * @see f_utf_string_dynamic_mish_nulless() - * @see f_utf_string_dynamic_partial_append() - * @see f_utf_string_dynamic_partial_append_assure() - * @see f_utf_string_dynamic_partial_append_assure_nulless() - * @see f_utf_string_dynamic_partial_append_nulless() - * @see f_utf_string_dynamic_partial_mash() - * @see f_utf_string_dynamic_partial_mash_nulless() - * @see f_utf_string_dynamic_partial_mish() - * @see f_utf_string_dynamic_partial_mish_nulless() - * @see f_utf_string_dynamic_partial_prepend() - * @see f_utf_string_dynamic_partial_prepend_assure() - * @see f_utf_string_dynamic_partial_prepend_assure_nulless() - * @see f_utf_string_dynamic_partial_prepend_nulless() - * @see f_utf_string_dynamic_prepend() - * @see f_utf_string_dynamic_prepend_assure() - * @see f_utf_string_dynamic_prepend_assure_nulless() - * @see f_utf_string_dynamic_prepend_nulless() - * @see f_utf_string_dynamics_append() - * @see f_utf_string_dynamics_append_all() - * @see f_utf_string_map_multis_append() - * @see f_utf_string_map_multis_append_all() - * @see f_utf_string_map_multiss_append() - * @see f_utf_string_map_multiss_append_all() - * @see f_utf_string_maps_append() - * @see f_utf_string_maps_append_all() - * @see f_utf_string_mapss_append() - * @see f_utf_string_mapss_append_all() - * @see f_utf_string_mash() - * @see f_utf_string_mash_nulless() - * @see f_utf_string_mish() - * @see f_utf_string_mish_nulless() - * @see f_utf_string_prepend() - * @see f_utf_string_prepend_assure() - * @see f_utf_string_prepend_assure_nulless() - * @see f_utf_string_prepend_nulless() - * @see f_utf_string_triples_append() - * @see f_utf_string_triples_append_all() - * @see f_utf_string_tripless_append() - * @see f_utf_string_tripless_append_all() - */ -#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) || !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) - extern f_status_t private_f_utf_string_dynamic_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) || !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param dynamic - * The string to resize. - * - * @return - * F_okay on success. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_utf_string_append() - * @see f_utf_string_append_assure() - * @see f_utf_string_append_mash() - * @see f_utf_string_append_nulless() - * @see f_utf_string_dynamic_append() - * @see f_utf_string_dynamic_append_assure() - * @see f_utf_string_dynamic_append_nulless() - * @see f_utf_string_dynamic_decrease_by() - * @see f_utf_string_dynamic_increase() - * @see f_utf_string_dynamic_increase_by() - * @see f_utf_string_dynamic_mash() - * @see f_utf_string_dynamic_mash_nulless() - * @see f_utf_string_dynamic_partial_append_) - * @see f_utf_string_dynamic_partial_append_assure() - * @see f_utf_string_dynamic_partial_mash() - * @see f_utf_string_dynamic_prepend() - * @see f_utf_string_dynamic_prepend_nulless() - * @see f_utf_string_dynamic_terminate() - * @see f_utf_string_dynamic_terminate_after() - * @see f_utf_string_dynamics_append() - * @see f_utf_string_dynamics_decrease_by() - * @see f_utf_string_dynamics_increase() - * @see f_utf_string_dynamics_increase_by() - * @see f_utf_string_map_multis_append() - * @see f_utf_string_map_multis_decrease_by() - * @see f_utf_string_map_multis_increase() - * @see f_utf_string_map_multis_increase_by() - * @see f_utf_string_mash_nulless() - * @see f_utf_string_mash() - * @see f_utf_string_maps_append() - * @see f_utf_string_prepend() - * @see f_utf_string_prepend_nulless() - * @see f_utf_string_triples_append() - */ -#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decrease_by) || !defined(_di_f_utf_string_dynamics_increase) || !defined(_di_f_utf_string_dynamics_increase_by) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_decrease_by) || !defined(_di_f_utf_string_map_multis_increase) || !defined(_di_f_utf_string_map_multis_increase_by) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) - extern f_status_t private_f_utf_string_dynamic_resize(const f_number_unsigned_t length, f_utf_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decrease_by) || !defined(_di_f_utf_string_dynamics_increase) || !defined(_di_f_utf_string_dynamics_increase_by) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_decrease_by) || !defined(_di_f_utf_string_map_multis_increase) || !defined(_di_f_utf_string_map_multis_increase_by) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-dynamics.c b/level_0/f_utf/c/utf/private-dynamics.c index 22eecde..9e8c92a 100644 --- a/level_0/f_utf/c/utf/private-dynamics.c +++ b/level_0/f_utf/c/utf/private-dynamics.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-dynamics.h" #include "private-string.h" @@ -8,36 +7,19 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - f_status_t private_f_utf_string_dynamics_adjust(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_adjust(0, sizeof(f_utf_string_t), (void **) &structure->array[i].string, &structure->array[i].used, &structure->array[i].size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_dynamic_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - #if !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) f_status_t private_f_utf_string_dynamics_append(const f_utf_string_dynamic_t source, f_utf_string_dynamics_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_dynamics_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_utf_string_append(source.string, source.used, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_utf_string_append(source.string, source.used, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -49,42 +31,25 @@ extern "C" { #if !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) f_status_t private_f_utf_string_dynamics_append_all(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_dynamics_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_dynamic_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.array[i].used) { - status = private_f_utf_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].used) { + status = private_f_utf_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) -#if !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_) || !defined(f_utf_string_dynamics_resize) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - f_status_t private_f_utf_string_dynamics_resize(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_resize(0, sizeof(f_utf_string_t), (void **) &structure->array[i].string, &structure->array[i].used, &structure->array[i].size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_dynamic_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_) || !defined(f_utf_string_dynamics_resize) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-dynamics.h b/level_0/f_utf/c/utf/private-dynamics.h index 03cf259..598792f 100644 --- a/level_0/f_utf/c/utf/private-dynamics.h +++ b/level_0/f_utf/c/utf/private-dynamics.h @@ -16,35 +16,6 @@ extern "C" { #endif /** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamics to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_utf_string_dynamics_adjust() - * @see f_utf_string_dynamics_append() - * @see f_utf_string_dynamics_decimate_by() - * @see f_utf_string_map_multis_adjust() - * @see f_utf_string_map_multis_append() - */ -#if !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - extern f_status_t private_f_utf_string_dynamics_adjust(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - -/** * Private implementation for appending. * * Intended to be shared to each of the different implementation variations. @@ -98,45 +69,6 @@ extern "C" { extern f_status_t private_f_utf_string_dynamics_append_all(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamics to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_utf_string_dynamics_decrease_by() - * @see f_utf_string_dynamics_increase() - * @see f_utf_string_dynamics_increase_by() - * @see f_utf_string_dynamics_resize() - * @see f_utf_string_map_multis_append() - * @see f_utf_string_map_multis_append_all() - * @see f_utf_string_map_multis_decrease_by() - * @see f_utf_string_map_multis_increase() - * @see f_utf_string_map_multis_increase_by() - * @see f_utf_string_map_multis_resize() - * @see f_utf_string_map_multiss_append() - * @see f_utf_string_map_multiss_append_all() - * @see f_utf_string_map_multiss_decrease_by() - * @see f_utf_string_map_multiss_increase() - * @see f_utf_string_map_multiss_increase_by() - */ -#if !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_) || !defined(f_utf_string_dynamics_resize) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - extern f_status_t private_f_utf_string_dynamics_resize(const f_number_unsigned_t length, f_utf_string_dynamics_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_) || !defined(f_utf_string_dynamics_resize) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-dynamicss.c b/level_0/f_utf/c/utf/private-dynamicss.c index 0ce0ffd..0a473ed 100644 --- a/level_0/f_utf/c/utf/private-dynamicss.c +++ b/level_0/f_utf/c/utf/private-dynamicss.c @@ -1,44 +1,12 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-dynamics.h" -#include "private-dynamicss.h" #include "private-string.h" #ifdef __cplusplus extern "C" { #endif -#if !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - f_status_t private_f_utf_string_dynamicss_adjust(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_dynamics_adjust(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_dynamics_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - -#if !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_) - f_status_t private_f_utf_string_dynamicss_resize(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_dynamics_resize(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_dynamics_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-dynamicss.h b/level_0/f_utf/c/utf/private-dynamicss.h index 8977d6f..49ff01d 100644 --- a/level_0/f_utf/c/utf/private-dynamicss.h +++ b/level_0/f_utf/c/utf/private-dynamicss.h @@ -15,64 +15,6 @@ extern "C" { #endif -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamicss to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_utf_string_dynamicss_adjust() - * @see f_utf_string_dynamicss_append() - * @see f_utf_string_dynamicss_decimate_by() - * @see f_utf_string_map_multis_adjust() - * @see f_utf_string_map_multis_append() - */ -#if !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - extern f_status_t private_f_utf_string_dynamicss_adjust(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The dynamicss to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_utf_string_dynamicss_append_all() - * @see f_utf_string_dynamicss_decrease_by() - * @see f_utf_string_dynamicss_increase() - * @see f_utf_string_dynamicss_increase_by() - * @see f_utf_string_map_multis_append_all() - */ -#if !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_) - extern f_status_t private_f_utf_string_dynamicss_resize(const f_number_unsigned_t length, f_utf_string_dynamicss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-map_multis.c b/level_0/f_utf/c/utf/private-map_multis.c index 9455a35..10dcb71 100644 --- a/level_0/f_utf/c/utf/private-map_multis.c +++ b/level_0/f_utf/c/utf/private-map_multis.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-dynamics.h" #include "private-map_multis.h" #include "private-string.h" @@ -9,72 +8,34 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_) - f_status_t private_f_utf_string_map_multis_adjust(const f_number_unsigned_t length, f_utf_string_map_multis_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_adjust(0, sizeof(f_utf_string_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); - if (F_status_is_error(status)) return status; - - status = private_f_utf_string_dynamics_adjust(0, &structure->array[i].value); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_map_multi_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_) - #if !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) f_status_t private_f_utf_string_map_multis_append_all(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_map_multis_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_map_multi_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].name.used = 0; - destination->array[destination->used].value.used = 0; + destination->array[destination->used].name.used = 0; + destination->array[destination->used].value.used = 0; - if (source.array[i].name.used) { - status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name); - if (F_status_is_error(status)) return status; - } + if (source.array[i].name.used) { + status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name); + if (F_status_is_error(status)) return status; + } - if (source.array[i].value.used) { - status = private_f_utf_string_dynamics_append_all(source.array[i].value, &destination->array[destination->used].value); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].value.used) { + status = private_f_utf_string_dynamics_append_all(source.array[i].value, &destination->array[destination->used].value); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) -#if !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - f_status_t private_f_utf_string_map_multis_resize(const f_number_unsigned_t length, f_utf_string_map_multis_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_resize(0, sizeof(f_utf_string_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); - if (F_status_is_error(status)) return status; - - status = private_f_utf_string_dynamics_resize(0, &structure->array[i].value); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-map_multis.h b/level_0/f_utf/c/utf/private-map_multis.h index be99985..f4d0599 100644 --- a/level_0/f_utf/c/utf/private-map_multis.h +++ b/level_0/f_utf/c/utf/private-map_multis.h @@ -16,31 +16,6 @@ extern "C" { #endif /** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param map_multis - * The map_multis to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_utf_string_map_multis_adjust() - */ -#if !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_) - extern f_status_t private_f_utf_string_map_multis_adjust(const f_number_unsigned_t length, f_utf_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_) - -/** * Private implementation for appending. * * Intended to be shared to each of the different implementation variations. @@ -67,41 +42,6 @@ extern "C" { extern f_status_t private_f_utf_string_map_multis_append_all(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param map_multis - * The map_multis to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_utf_string_map_multis_append() - * @see f_utf_string_map_multis_append_all() - * @see f_utf_string_map_multis_decrease_by() - * @see f_utf_string_map_multis_increase() - * @see f_utf_string_map_multis_increase_by() - * @see f_utf_string_map_multis_resize() - * @see f_utf_string_map_multiss_append() - * @see f_utf_string_map_multiss_append_all() - * @see f_utf_string_map_multiss_decrease_by() - * @see f_utf_string_map_multiss_increase() - * @see f_utf_string_map_multiss_increase_by() - */ -#if !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - extern f_status_t private_f_utf_string_map_multis_resize(const f_number_unsigned_t length, f_utf_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_resize_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-map_multiss.c b/level_0/f_utf/c/utf/private-map_multiss.c index 0472874..5660140 100644 --- a/level_0/f_utf/c/utf/private-map_multiss.c +++ b/level_0/f_utf/c/utf/private-map_multiss.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-dynamics.h" #include "private-map_multis.h" #include "private-map_multiss.h" @@ -10,36 +9,6 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_) - f_status_t private_f_utf_string_map_multiss_adjust(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_map_multis_adjust(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_map_multis_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_) - -#if !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - f_status_t private_f_utf_string_map_multiss_resize(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_map_multis_resize(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_map_multis_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-map_multiss.h b/level_0/f_utf/c/utf/private-map_multiss.h index 6bcbcf3..ed96f68 100644 --- a/level_0/f_utf/c/utf/private-map_multiss.h +++ b/level_0/f_utf/c/utf/private-map_multiss.h @@ -13,60 +13,6 @@ #ifdef __cplusplus extern "C" { -#endif - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The map_multiss to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_utf_string_map_multiss_adjust() - */ -#if !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_) - extern f_status_t private_f_utf_string_map_multiss_adjust(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The map_multiss to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_utf_string_map_multiss_decrease_by() - * @see f_utf_string_map_multiss_increase() - * @see f_utf_string_map_multiss_increase_by() - */ -#if !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - extern f_status_t private_f_utf_string_map_multiss_resize(const f_number_unsigned_t length, f_utf_string_map_multiss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-maps.c b/level_0/f_utf/c/utf/private-maps.c index 6f087bd..f5e5175 100644 --- a/level_0/f_utf/c/utf/private-maps.c +++ b/level_0/f_utf/c/utf/private-maps.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-maps.h" #include "private-string.h" @@ -8,72 +7,34 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_) - f_status_t private_f_utf_string_maps_adjust(const f_number_unsigned_t length, f_utf_string_maps_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_adjust(0, sizeof(f_utf_string_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); - if (F_status_is_error(status)) return status; - - status = f_memory_array_adjust(0, sizeof(f_utf_string_t), (void **) &structure->array[i].value.string, &structure->array[i].value.used, &structure->array[i].value.size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_map_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_) - #if !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) f_status_t private_f_utf_string_maps_append_all(const f_utf_string_maps_t source, f_utf_string_maps_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_maps_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_map_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].name.used = 0; - destination->array[destination->used].value.used = 0; + destination->array[destination->used].name.used = 0; + destination->array[destination->used].value.used = 0; - if (source.array[i].name.used) { - status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name); - if (F_status_is_error(status)) return status; - } + if (source.array[i].name.used) { + status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name); + if (F_status_is_error(status)) return status; + } - if (source.array[i].value.used) { - status = private_f_utf_string_append(source.array[i].value.string, source.array[i].value.used, &destination->array[destination->used].value); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].value.used) { + status = private_f_utf_string_append(source.array[i].value.string, source.array[i].value.used, &destination->array[destination->used].value); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) -#if !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_resize_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - f_status_t private_f_utf_string_maps_resize(const f_number_unsigned_t length, f_utf_string_maps_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_resize(0, sizeof(f_utf_string_t), (void **) &structure->array[i].name.string, &structure->array[i].name.used, &structure->array[i].name.size); - if (F_status_is_error(status)) return status; - - status = f_memory_array_resize(0, sizeof(f_utf_string_t), (void **) &structure->array[i].value.string, &structure->array[i].value.used, &structure->array[i].value.size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_resize_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-maps.h b/level_0/f_utf/c/utf/private-maps.h index 9e92670..74017a0 100644 --- a/level_0/f_utf/c/utf/private-maps.h +++ b/level_0/f_utf/c/utf/private-maps.h @@ -16,31 +16,6 @@ extern "C" { #endif /** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The maps to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_utf_string_maps_adjust() - */ -#if !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_) - extern f_status_t private_f_utf_string_maps_adjust(const f_number_unsigned_t length, f_utf_string_maps_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_) - -/** * Private implementation for appending. * * Intended to be shared to each of the different implementation variations. @@ -67,40 +42,6 @@ extern "C" { extern f_status_t private_f_utf_string_maps_append_all(const f_utf_string_maps_t source, f_utf_string_maps_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The maps to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * @see f_utf_string_maps_append() - * @see f_utf_string_maps_append_all() - * @see f_utf_string_maps_decrease_by() - * @see f_utf_string_maps_increase() - * @see f_utf_string_maps_increase_by() - * @see f_utf_string_maps_resize() - * @see f_utf_string_mapss_append() - * @see f_utf_string_mapss_append_all() - * @see f_utf_string_mapss_decrease_by() - * @see f_utf_string_mapss_increase() - * @see f_utf_string_mapss_increase_by() - */ -#if !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_resize_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - extern f_status_t private_f_utf_string_maps_resize(const f_number_unsigned_t length, f_utf_string_maps_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_resize_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-mapss.c b/level_0/f_utf/c/utf/private-mapss.c index 0673eac..73fc4c9 100644 --- a/level_0/f_utf/c/utf/private-mapss.c +++ b/level_0/f_utf/c/utf/private-mapss.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-maps.h" #include "private-mapss.h" #include "private-string.h" @@ -9,36 +8,6 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_) - f_status_t private_f_utf_string_mapss_adjust(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_maps_adjust(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_maps_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_) - -#if !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - f_status_t private_f_utf_string_mapss_resize(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_maps_resize(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_maps_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-mapss.h b/level_0/f_utf/c/utf/private-mapss.h index 21cdcae..b6ae83d 100644 --- a/level_0/f_utf/c/utf/private-mapss.h +++ b/level_0/f_utf/c/utf/private-mapss.h @@ -15,58 +15,6 @@ extern "C" { #endif -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The structure to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * - * @see f_utf_string_mapss_adjust() - */ -#if !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_) - extern f_status_t private_f_utf_string_mapss_adjust(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The structure to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * - * @see f_utf_string_mapss_decrease_by() - * @see f_utf_string_mapss_increase() - * @see f_utf_string_mapss_increase_by() - */ -#if !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - extern f_status_t private_f_utf_string_mapss_resize(const f_number_unsigned_t length, f_utf_string_mapss_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-string.c b/level_0/f_utf/c/utf/private-string.c index 2994c3d..c3bc3a8 100644 --- a/level_0/f_utf/c/utf/private-string.c +++ b/level_0/f_utf/c/utf/private-string.c @@ -1,5 +1,4 @@ #include "../utf.h" -#include "private-dynamic.h" #include "private-string.h" #ifdef __cplusplus @@ -9,8 +8,8 @@ extern "C" { #if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_) f_status_t private_f_utf_string_append(const f_utf_string_t source, const f_number_unsigned_t length, f_utf_string_dynamic_t * const destination) { - if (destination->used + length + 1 > destination->size) { - const f_status_t status = private_f_utf_string_dynamic_increase_by(length + 1, destination); + { + const f_status_t status = f_memory_array_increase_by(length + 1, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } @@ -25,46 +24,46 @@ extern "C" { #if !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_) f_status_t private_f_utf_string_append_nulless(const f_utf_string_t source, const f_number_unsigned_t length, f_utf_string_dynamic_t * const destination) { - f_status_t status = F_okay; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t size = 0; - f_number_unsigned_t i = 0; - f_number_unsigned_t size = 0; + // Count all of the NULLs and subtract them from the total size. + for (; i < length; ++i) { + if (source[i]) ++size; + } // for - // Count all of the NULLs and subtract them from the total size. - for (; i < length; ++i) { - if (source[i]) ++size; - } // for + { + const f_status_t status = f_memory_array_increase_by(size + 1, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(status)) return status; + } - if (destination->used + size + 1 > destination->size) { - status = private_f_utf_string_dynamic_increase_by(size + 1, destination); - if (F_status_is_error(status)) return status; - } + f_number_unsigned_t first = 0; + + for (i = 0, size = 0; i < length; ++i) { + + if (source[i]) continue; + + if (i && i > first) { + size = i - first; - f_number_unsigned_t first = 0; + memcpy(destination->string + destination->used, source + first, sizeof(f_utf_char_t) * size); + destination->used += size; + } - for (i = 0, size = 0; i < length; ++i) { + while (i + 1 < length && !source[i + 1]) { + ++i; + } // while - if (source[i]) continue; + first = i + 1; + } // for - if (i && i > first) { + if (i > first) { size = i - first; memcpy(destination->string + destination->used, source + first, sizeof(f_utf_char_t) * size); destination->used += size; } - - while (i + 1 < length && !source[i + 1]) { - ++i; - } // while - - first = i + 1; - } // for - - if (i > first) { - size = i - first; - - memcpy(destination->string + destination->used, source + first, sizeof(f_utf_char_t) * size); - destination->used += size; } destination->string[destination->used] = 0; @@ -76,12 +75,10 @@ extern "C" { #if !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_) f_status_t private_f_utf_string_prepend(const f_utf_string_t source, const f_number_unsigned_t length, f_utf_string_dynamic_t * const destination) { - if (destination->used + length > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } + if (destination->used + length > F_string_t_size_d) return F_status_set_error(F_string_too_large); - if (destination->used + length > destination->size) { - const f_status_t status = private_f_utf_string_dynamic_increase_by(length, destination); + { + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } @@ -102,47 +99,24 @@ extern "C" { #if !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_) f_status_t private_f_utf_string_prepend_nulless(const f_utf_string_t source, const f_number_unsigned_t length, f_utf_string_dynamic_t * const destination) { - if (destination->used + length > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - f_status_t status = F_okay; - - f_number_unsigned_t first = 0; - f_number_unsigned_t offset = 0; - - f_number_unsigned_t size = 0; - - for (f_number_unsigned_t i = 0; i <= length; ++i) { - - if (i == length) { - if (i > first) { - size = i - first; + if (destination->used + length > F_string_t_size_d) return F_status_set_error(F_string_too_large); - if (destination->used + size > destination->size) { - status = private_f_utf_string_dynamic_increase_by(size, destination); - if (F_status_is_error(status)) return status; - } + { + f_status_t status = F_okay; - memmove(destination->string + offset + size, destination->string + offset, sizeof(f_utf_char_t) * (destination->used - offset)); - memcpy(destination->string + offset, source + first, sizeof(f_utf_char_t) * size); + f_number_unsigned_t first = 0; + f_number_unsigned_t offset = 0; - destination->used += size; - offset += size; - } + f_number_unsigned_t size = 0; - break; - } + for (f_number_unsigned_t i = 0; i <= length; ++i) { - if (!source[i]) { - if (i > 0) { + if (i == length) { if (i > first) { size = i - first; - if (destination->used + size > destination->size) { - status = private_f_utf_string_dynamic_increase_by(size, destination); - if (F_status_is_error(status)) return status; - } + status = f_memory_array_increase_by(length, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(status)) return status; memmove(destination->string + offset + size, destination->string + offset, sizeof(f_utf_char_t) * (destination->used - offset)); memcpy(destination->string + offset, source + first, sizeof(f_utf_char_t) * size); @@ -150,17 +124,36 @@ extern "C" { destination->used += size; offset += size; } + + break; } - while (i + 1 < length && !source[i + 1]) { - ++i; - } // while + if (!source[i]) { + if (i > 0) { + if (i > first) { + size = i - first; - first = i + 1; + status = f_memory_array_increase_by(size, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(status)) return status; - continue; - } - } // for + memmove(destination->string + offset + size, destination->string + offset, sizeof(f_utf_char_t) * (destination->used - offset)); + memcpy(destination->string + offset, source + first, sizeof(f_utf_char_t) * size); + + destination->used += size; + offset += size; + } + } + + while (i + 1 < length && !source[i + 1]) { + ++i; + } // while + + first = i + 1; + + continue; + } + } // for + } return F_okay; } diff --git a/level_0/f_utf/c/utf/private-triples.c b/level_0/f_utf/c/utf/private-triples.c index c0cecad..3b70b6f 100644 --- a/level_0/f_utf/c/utf/private-triples.c +++ b/level_0/f_utf/c/utf/private-triples.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-triples.h" #include "private-string.h" @@ -8,84 +7,40 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - f_status_t private_f_utf_string_triples_adjust(const f_number_unsigned_t length, f_utf_string_triples_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_adjust(0, sizeof(f_utf_string_triple_t), (void **) &structure->array[i].a.string, &structure->array[i].a.used, &structure->array[i].a.size); - if (F_status_is_error(status)) return status; - - status = f_memory_array_adjust(0, sizeof(f_utf_string_triple_t), (void **) &structure->array[i].b.string, &structure->array[i].b.used, &structure->array[i].b.size); - if (F_status_is_error(status)) return status; - - status = f_memory_array_adjust(0, sizeof(f_utf_string_triple_t), (void **) &structure->array[i].c.string, &structure->array[i].c.used, &structure->array[i].c.size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_triple_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - #if !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) f_status_t private_f_utf_string_triples_append_all(const f_utf_string_triples_t source, f_utf_string_triples_t * const destination) { - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_triples_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_triple_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].a.used = 0; - destination->array[destination->used].b.used = 0; - destination->array[destination->used].c.used = 0; + destination->array[destination->used].a.used = 0; + destination->array[destination->used].b.used = 0; + destination->array[destination->used].c.used = 0; - if (source.array[i].a.used) { - status = private_f_utf_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a); - if (F_status_is_error(status)) return status; - } + if (source.array[i].a.used) { + status = private_f_utf_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a); + if (F_status_is_error(status)) return status; + } - if (source.array[i].b.used) { - status = private_f_utf_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b); - if (F_status_is_error(status)) return status; - } + if (source.array[i].b.used) { + status = private_f_utf_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b); + if (F_status_is_error(status)) return status; + } - if (source.array[i].c.used) { - status = private_f_utf_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].c.used) { + status = private_f_utf_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) -#if !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) - f_status_t private_f_utf_string_triples_resize(const f_number_unsigned_t length, f_utf_string_triples_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = f_memory_array_resize(0, sizeof(f_utf_string_triple_t), (void **) &structure->array[i].a.string, &structure->array[i].a.used, &structure->array[i].a.size); - if (F_status_is_error(status)) return status; - - status = f_memory_array_resize(0, sizeof(f_utf_string_triple_t), (void **) &structure->array[i].b.string, &structure->array[i].b.used, &structure->array[i].b.size); - if (F_status_is_error(status)) return status; - - status = f_memory_array_resize(0, sizeof(f_utf_string_triple_t), (void **) &structure->array[i].c.string, &structure->array[i].c.used, &structure->array[i].c.size); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_triple_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-triples.h b/level_0/f_utf/c/utf/private-triples.h index dc15a1f..25ab73d 100644 --- a/level_0/f_utf/c/utf/private-triples.h +++ b/level_0/f_utf/c/utf/private-triples.h @@ -8,38 +8,14 @@ * These are provided for internal reduction in redundant code. * These should not be exposed/used outside of this project. */ -#ifndef _PRIVATE_F_utf_triple_h -#define _PRIVATE_F_utf_triple_h +#ifndef _PRIVATE_F_utf_triples_h +#define _PRIVATE_F_utf_triples_h #ifdef __cplusplus extern "C" { #endif /** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The triples to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * @see f_utf_string_triples_adjust() - */ -#if !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - extern f_status_t private_f_utf_string_triples_adjust(const f_number_unsigned_t length, f_utf_string_triples_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_) - -/** * Private implementation for appending. * * Intended to be shared to each of the different implementation variations. @@ -65,82 +41,6 @@ extern "C" { extern f_status_t private_f_utf_string_triples_append_all(const f_utf_string_triples_t source, f_utf_string_triples_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_) -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The triples to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * @see f_utf_string_triples_decrease_by() - * @see f_utf_string_triples_increase() - * @see f_utf_string_triples_increase_by() - */ -#if !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) - extern f_status_t private_f_utf_string_triples_resize(const f_number_unsigned_t length, f_utf_string_triples_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The tripless to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * @see f_utf_string_tripless_adjust() - */ -#if !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_) - extern f_status_t private_f_utf_string_tripless_adjust(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The tripless to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * @see f_utf_string_tripless_decrease_by() - * @see f_utf_string_tripless_increase() - * @see f_utf_string_tripless_increase_by() - */ -#if !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) - extern f_status_t private_f_utf_string_tripless_resize(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-tripless.c b/level_0/f_utf/c/utf/private-tripless.c index d451279..d611a6f 100644 --- a/level_0/f_utf/c/utf/private-tripless.c +++ b/level_0/f_utf/c/utf/private-tripless.c @@ -1,6 +1,5 @@ #include "../utf.h" #include "../private-utf.h" -#include "private-dynamic.h" #include "private-triples.h" #include "private-tripless.h" #include "private-string.h" @@ -9,36 +8,6 @@ extern "C" { #endif -#if !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_) - f_status_t private_f_utf_string_tripless_adjust(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_triples_adjust(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_adjust(length, sizeof(f_utf_string_triples_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_) - -#if !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) - f_status_t private_f_utf_string_tripless_resize(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) { - - f_status_t status = F_okay; - - for (f_number_unsigned_t i = length; i < structure->size; ++i) { - - status = private_f_utf_string_triples_resize(0, &structure->array[i]); - if (F_status_is_error(status)) return status; - } // for - - return f_memory_array_resize(length, sizeof(f_utf_string_triples_t), (void **) &structure->array, &structure->used, &structure->size); - } -#endif // !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/private-tripless.h b/level_0/f_utf/c/utf/private-tripless.h index c399d49..adae6ec 100644 --- a/level_0/f_utf/c/utf/private-tripless.h +++ b/level_0/f_utf/c/utf/private-tripless.h @@ -15,56 +15,6 @@ extern "C" { #endif -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The tripless to adjust. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_adjust(). - * - * @see f_memory_adjust() - * @see f_utf_string_tripless_adjust() - */ -#if !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_) - extern f_status_t private_f_utf_string_tripless_adjust(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_) - -/** - * Private implementation for resizing. - * - * Intended to be shared to each of the different implementation variations. - * - * @param length - * The new size to use. - * @param structure - * The tripless to resize. - * - * @return - * F_okay on success. - * - * F_array_too_large (with error bit) if the combined array is too large. - * - * Errors (with error bit) from: f_memory_resize(). - * - * @see f_memory_resize() - * @see f_utf_string_tripless_decrease_by() - * @see f_utf_string_tripless_increase() - * @see f_utf_string_tripless_increase_by() - */ -#if !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) - extern f_status_t private_f_utf_string_tripless_resize(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_utf/c/utf/string.c b/level_0/f_utf/c/utf/string.c index 065be85..dd27b33 100644 --- a/level_0/f_utf/c/utf/string.c +++ b/level_0/f_utf/c/utf/string.c @@ -1,5 +1,4 @@ #include "../utf.h" -#include "private-dynamic.h" #include "private-string.h" #ifdef __cplusplus @@ -30,30 +29,32 @@ extern "C" { return private_f_utf_string_append(source, length, destination); } - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source[length - i]) { - ++i; + if (!source[length - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source[length - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append(source, length, destination); - } + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -71,30 +72,32 @@ extern "C" { return private_f_utf_string_append_nulless(source, length, destination); } - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source[length - i]) { - ++i; + if (!source[length - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source[length - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append_nulless(source, length, destination); - } + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append_nulless(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -118,12 +121,10 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!length) { - return F_data_not; - } + if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_append(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -140,7 +141,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -157,7 +158,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -174,7 +175,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -206,30 +207,32 @@ extern "C" { return private_f_utf_string_prepend(source, length, destination); } - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source[i]) { - ++i; + if (!source[i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source[i] != destination->string[j]) { - return private_f_utf_string_prepend(source, length, destination); - } + if (source[i] != destination->string[j]) { + return private_f_utf_string_prepend(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -247,30 +250,32 @@ extern "C" { return private_f_utf_string_prepend_nulless(source, length, destination); } - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source[i]) { - ++i; + if (!source[i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source[i] != destination->string[j]) { - return private_f_utf_string_prepend_nulless(source, length, destination); - } + if (source[i] != destination->string[j]) { + return private_f_utf_string_prepend_nulless(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -294,21 +299,15 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; while (string[range->start] != f_utf_char_eol_s) { - if (macro_f_utf_char_t_width_is(string[range->start]) == 1) { - return F_status_set_error(F_utf_fragment); - } + if (macro_f_utf_char_t_width_is(string[range->start]) == 1) return F_status_set_error(F_utf_fragment); ++range->start; - if (range->start > range->stop) { - return F_okay_stop; - } + if (range->start > range->stop) return F_okay_stop; } // while return F_okay; @@ -321,21 +320,15 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; while (string[range->start] != seek_to) { - if (string[range->start] == f_utf_char_eol_s) { - return F_okay_eol; - } + if (string[range->start] == f_utf_char_eol_s) return F_okay_eol; ++range->start; - if (range->start > range->stop) { - return F_okay_stop; - } + if (range->start > range->stop) return F_okay_stop; } // while return F_okay; @@ -348,17 +341,13 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; while (string[range->start] != seek_to) { ++range->start; - if (range->start > range->stop) { - return F_okay_stop; - } + if (range->start > range->stop) return F_okay_stop; } // while return F_okay; diff --git a/level_0/f_utf/c/utf/strings.c b/level_0/f_utf/c/utf/strings.c index 2961727..c19989f 100644 --- a/level_0/f_utf/c/utf/strings.c +++ b/level_0/f_utf/c/utf/strings.c @@ -1,5 +1,4 @@ #include "../utf.h" -#include "private-dynamic.h" #include "private-string.h" #ifdef __cplusplus @@ -27,30 +26,32 @@ extern "C" { if (!length) return F_data_not; if (destination->used < length) return private_f_utf_string_append(source, length, destination); - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source[length - i]) { - ++i; + if (!source[length - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source[length - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append(source, length, destination); - } + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -65,30 +66,32 @@ extern "C" { if (!length) return F_data_not; if (!destination->used) return private_f_utf_string_append_nulless(source, length, destination); - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source[length - i]) { - ++i; + if (!source[length - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source[length - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append_nulless(source, length, destination); - } + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append_nulless(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -115,7 +118,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_append(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -132,7 +135,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -149,7 +152,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -166,7 +169,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -195,30 +198,32 @@ extern "C" { if (!length) return F_data_not; if (destination->used < length) return private_f_utf_string_prepend(source, length, destination); - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source[i]) { - ++i; + if (!source[i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source[i] != destination->string[j]) { - return private_f_utf_string_prepend(source, length, destination); - } + if (source[i] != destination->string[j]) { + return private_f_utf_string_prepend(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -233,30 +238,32 @@ extern "C" { if (!length) return F_data_not; if (!destination->used) return private_f_utf_string_prepend_nulless(source, length, destination); - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source[i]) { - ++i; + if (!source[i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source[i] != destination->string[j]) { - return private_f_utf_string_prepend_nulless(source, length, destination); - } + if (source[i] != destination->string[j]) { + return private_f_utf_string_prepend_nulless(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } diff --git a/level_0/f_utf/c/utf/stringss.c b/level_0/f_utf/c/utf/stringss.c index 2961727..a342e13 100644 --- a/level_0/f_utf/c/utf/stringss.c +++ b/level_0/f_utf/c/utf/stringss.c @@ -1,5 +1,4 @@ #include "../utf.h" -#include "private-dynamic.h" #include "private-string.h" #ifdef __cplusplus @@ -27,30 +26,32 @@ extern "C" { if (!length) return F_data_not; if (destination->used < length) return private_f_utf_string_append(source, length, destination); - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source[length - i]) { - ++i; + if (!source[length - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source[length - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append(source, length, destination); - } + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -65,30 +66,32 @@ extern "C" { if (!length) return F_data_not; if (!destination->used) return private_f_utf_string_append_nulless(source, length, destination); - f_number_unsigned_t i = 1; - f_number_unsigned_t j = 1; + { + f_number_unsigned_t i = 1; + f_number_unsigned_t j = 1; - while (i <= length && j <= destination->used) { + while (i <= length && j <= destination->used) { - if (!source[length - i]) { - ++i; + if (!source[length - i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[destination->used - j]) { - ++j; + if (!destination->string[destination->used - j]) { + ++j; - continue; - } + continue; + } - if (source[length - i] != destination->string[destination->used - j]) { - return private_f_utf_string_append_nulless(source, length, destination); - } + if (source[length - i] != destination->string[destination->used - j]) { + return private_f_utf_string_append_nulless(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -115,7 +118,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_append(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -132,7 +135,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -149,7 +152,7 @@ extern "C" { if (!length) return F_data_not; if (glue_length && destination->used) { - f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination); + const f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -195,30 +198,32 @@ extern "C" { if (!length) return F_data_not; if (destination->used < length) return private_f_utf_string_prepend(source, length, destination); - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source[i]) { - ++i; + if (!source[i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source[i] != destination->string[j]) { - return private_f_utf_string_prepend(source, length, destination); - } + if (source[i] != destination->string[j]) { + return private_f_utf_string_prepend(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } @@ -233,30 +238,32 @@ extern "C" { if (!length) return F_data_not; if (!destination->used) return private_f_utf_string_prepend_nulless(source, length, destination); - f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + { + f_number_unsigned_t i = 0; + f_number_unsigned_t j = 0; - while (i < length && j < destination->used) { + while (i < length && j < destination->used) { - if (!source[i]) { - ++i; + if (!source[i]) { + ++i; - continue; - } + continue; + } - if (!destination->string[j]) { - ++j; + if (!destination->string[j]) { + ++j; - continue; - } + continue; + } - if (source[i] != destination->string[j]) { - return private_f_utf_string_prepend_nulless(source, length, destination); - } + if (source[i] != destination->string[j]) { + return private_f_utf_string_prepend_nulless(source, length, destination); + } - ++i; - ++j; - } // while + ++i; + ++j; + } // while + } return F_okay; } diff --git a/level_0/f_utf/c/utf/triple.h b/level_0/f_utf/c/utf/triple.h index f73d348..aaeff39 100644 --- a/level_0/f_utf/c/utf/triple.h +++ b/level_0/f_utf/c/utf/triple.h @@ -45,16 +45,6 @@ extern "C" { triple.c.used = 0; #define macro_f_utf_string_triple_t_initialize_1(a, b, c) { a, b, c } - - #define macro_f_utf_string_triple_t_delete_simple(triple) \ - macro_f_utf_string_dynamic_t_delete_simple(triple.a) \ - macro_f_utf_string_dynamic_t_delete_simple(triple.b) \ - macro_f_utf_string_dynamic_t_delete_simple(triple.c) - - #define macro_f_utf_string_triple_t_destroy_simple(triple) \ - macro_f_utf_string_dynamic_t_destroy_simple(triple.a) \ - macro_f_utf_string_dynamic_t_destroy_simple(triple.b) \ - macro_f_utf_string_dynamic_t_destroy_simple(triple.c) #endif // _di_f_utf_string_triple_t_ #ifdef __cplusplus diff --git a/level_0/f_utf/c/utf/triples.c b/level_0/f_utf/c/utf/triples.c index 0703369..c312cc5 100644 --- a/level_0/f_utf/c/utf/triples.c +++ b/level_0/f_utf/c/utf/triples.c @@ -7,46 +7,34 @@ extern "C" { #endif -#ifndef _di_f_utf_string_triples_adjust_ - f_status_t f_utf_string_triples_adjust(const f_number_unsigned_t length, f_utf_string_triples_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - return private_f_utf_string_triples_adjust(length, structure); - } -#endif // _di_f_utf_string_triples_adjust_ - #ifndef _di_f_utf_string_triples_append_ f_status_t f_utf_string_triples_append(const f_utf_string_triple_t source, f_utf_string_triples_t * const destination) { #ifndef _di_level_0_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_triples_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_triple_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].a.used = 0; - destination->array[destination->used].b.used = 0; - destination->array[destination->used].c.used = 0; + destination->array[destination->used].a.used = 0; + destination->array[destination->used].b.used = 0; + destination->array[destination->used].c.used = 0; - if (source.a.used) { - status = private_f_utf_string_append(source.a.string, source.a.used, &destination->array[destination->used].a); - if (F_status_is_error(status)) return status; - } + if (source.a.used) { + status = private_f_utf_string_append(source.a.string, source.a.used, &destination->array[destination->used].a); + if (F_status_is_error(status)) return status; + } - if (source.b.used) { - status = private_f_utf_string_append(source.b.string, source.b.used, &destination->array[destination->used].b); - if (F_status_is_error(status)) return status; - } + if (source.b.used) { + status = private_f_utf_string_append(source.b.string, source.b.used, &destination->array[destination->used].b); + if (F_status_is_error(status)) return status; + } - if (source.c.used) { - status = private_f_utf_string_append(source.c.string, source.c.used, &destination->array[destination->used].c); - if (F_status_is_error(status)) return status; + if (source.c.used) { + status = private_f_utf_string_append(source.c.string, source.c.used, &destination->array[destination->used].c); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -63,116 +51,96 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_triples_resize(destination->used + source.used, destination); + { + f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_triple_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].a.used = 0; - destination->array[destination->used].b.used = 0; - destination->array[destination->used].c.used = 0; + destination->array[destination->used].a.used = 0; + destination->array[destination->used].b.used = 0; + destination->array[destination->used].c.used = 0; - if (source.array[i].a.used) { - status = private_f_utf_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a); - if (F_status_is_error(status)) return status; - } + if (source.array[i].a.used) { + status = private_f_utf_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a); + if (F_status_is_error(status)) return status; + } - if (source.array[i].b.used) { - status = private_f_utf_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b); - if (F_status_is_error(status)) return status; - } + if (source.array[i].b.used) { + status = private_f_utf_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b); + if (F_status_is_error(status)) return status; + } - if (source.array[i].c.used) { - status = private_f_utf_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c); - if (F_status_is_error(status)) return status; - } - } // for + if (source.array[i].c.used) { + status = private_f_utf_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c); + if (F_status_is_error(status)) return status; + } + } // for + } return F_okay; } #endif // _di_f_utf_string_triples_append_all_ -#ifndef _di_f_utf_string_triples_decimate_by_ - f_status_t f_utf_string_triples_decimate_by(const f_number_unsigned_t amount, f_utf_string_triples_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_triples_delete_callback_ + f_status_t f_utf_string_triples_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_triple_t * const array = (f_utf_string_triple_t *) void_array; + f_status_t status = F_okay; - return private_f_utf_string_triples_adjust((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_triples_decimate_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_triples_decrease_by_ - f_status_t f_utf_string_triples_decrease_by(const f_number_unsigned_t amount, f_utf_string_triples_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ - - if (!amount) return F_data_not; - - return private_f_utf_string_triples_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_triples_decrease_by_ - -#ifndef _di_f_utf_string_triples_increase_ - f_status_t f_utf_string_triples_increase(const f_number_unsigned_t step, f_utf_string_triples_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].a.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].a.string, &array[i].a.used, &array[i].a.size); + if (F_status_is_error(status)) return status; + } - if (step && structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + F_memory_default_allocation_small_d; + if (array[i].b.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].b.string, &array[i].b.used, &array[i].b.size); + if (F_status_is_error(status)) return status; + } - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); - - length = F_number_t_size_unsigned_d; - } - - return private_f_utf_string_triples_resize(length, structure); + if (array[i].c.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].c.string, &array[i].c.used, &array[i].c.size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_triples_increase_ - -#ifndef _di_f_utf_string_triples_increase_by_ - f_status_t f_utf_string_triples_increase_by(const f_number_unsigned_t amount, f_utf_string_triples_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#endif // _di_f_utf_string_triples_delete_callback_ - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); +#ifndef _di_f_utf_string_triples_destroy_callback_ + f_status_t f_utf_string_triples_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - const f_number_unsigned_t length = structure->used + amount; + { + f_utf_string_triple_t * const array = (f_utf_string_triple_t *) void_array; + f_status_t status = F_okay; - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + for (f_number_unsigned_t i = start; i < stop; ++i) { - return private_f_utf_string_triples_resize(length, structure); - } - } + if (array[i].a.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].a.string, &array[i].a.used, &array[i].a.size); + if (F_status_is_error(status)) return status; + } - return F_data_not; - } -#endif // _di_f_utf_string_triples_increase_by_ + if (array[i].b.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].b.string, &array[i].b.used, &array[i].b.size); + if (F_status_is_error(status)) return status; + } -#ifndef _di_f_utf_string_triples_resize_ - f_status_t f_utf_string_triples_resize(const f_number_unsigned_t length, f_utf_string_triples_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].c.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].c.string, &array[i].c.used, &array[i].c.size); + if (F_status_is_error(status)) return status; + } + } // for + } - return private_f_utf_string_triples_resize(length, structure); + return F_okay; } -#endif // _di_f_utf_string_triples_resize_ +#endif // _di_f_utf_string_triples_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/triples.h b/level_0/f_utf/c/utf/triples.h index 0eb7bfb..42676d6 100644 --- a/level_0/f_utf/c/utf/triples.h +++ b/level_0/f_utf/c/utf/triples.h @@ -36,38 +36,9 @@ extern "C" { #define macro_f_utf_string_triples_t_initialize_1(array, size, used) { array, size, used } #define macro_f_utf_string_triples_t_initialize_2(array, length) { array, length, length } - - #define macro_f_utf_string_triples_t_resize(status, triples, length) status = f_utf_string_triples_resize(length, &triples); - #define macro_f_utf_string_triples_t_adjust(status, triples, length) status = f_utf_string_triples_adjust(length, &triples); - - #define macro_f_utf_string_triples_t_delete_simple(triples) f_utf_string_triples_resize(0, &triples); - #define macro_f_utf_string_triples_t_destroy_simple(triples) f_utf_string_triples_adjust(0, &triples); - - #define macro_f_utf_string_triples_t_increase(status, step, triples) status = f_utf_string_triples_increase(step, triples); - #define macro_f_utf_string_triples_t_increase_by(status, triples, amount) status = f_utf_string_triples_increase_by(amount, triples); - #define macro_f_utf_string_triples_t_decrease_by(status, triples, amount) status = f_utf_string_triples_decrease_by(amount, triples); - #define macro_f_utf_string_triples_t_decimate_by(status, triples, amount) status = f_utf_string_triples_decimate_by(amount, triples); #endif // _di_f_utf_string_triples_t_ /** - * Resize the string triples array. - * - * @param length - * The new size to use. - * @param structure - * The string triples array to resize. - * - * @return - * F_okay on success. - * - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_utf_string_triples_adjust_ - extern f_status_t f_utf_string_triples_adjust(const f_number_unsigned_t length, f_utf_string_triples_t * const structure); -#endif // _di_f_utf_string_triples_adjust_ - -/** * Append the single source triples onto the destination. * * @param source @@ -110,121 +81,60 @@ extern "C" { #endif // _di_f_utf_string_triples_append_all_ /** - * Resize the string triples array to a smaller size. + * A callback intended to be passed to f_memory_arrays_resize() for an f_utf_string_triples_t structure. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The string triples array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not if amount is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_triples_decimate_by_ - extern f_status_t f_utf_string_triples_decimate_by(const f_number_unsigned_t amount, f_utf_string_triples_t * const structure); -#endif // _di_f_utf_string_triples_decimate_by_ - -/** - * Resize the string triples array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The string triples array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not if amount is 0. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_triples_decrease_by_ - extern f_status_t f_utf_string_triples_decrease_by(const f_number_unsigned_t amount, f_utf_string_triples_t * const structure); -#endif // _di_f_utf_string_triples_decrease_by_ - -/** - * Increase the size of the string triples array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The string triples array to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. + * Errors (with error bit) from: f_memory_array_resize(). * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_triples_increase_ - extern f_status_t f_utf_string_triples_increase(const f_number_unsigned_t step, f_utf_string_triples_t * const structure); -#endif // _di_f_utf_string_triples_increase_ +#ifndef _di_f_utf_string_triples_delete_callback_ + extern f_status_t f_utf_string_triples_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_triples_delete_callback_ /** - * Resize the string triples array to a larger size. + * A callback intended to be passed to f_memory_arrays_adjust() for an f_utf_string_triples_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The string triples array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_triples_increase_by_ - extern f_status_t f_utf_string_triples_increase_by(const f_number_unsigned_t amount, f_utf_string_triples_t * const structure); -#endif // _di_f_utf_string_triples_increase_by_ - -/** - * Resize the string triples array. - * - * @param length - * The new size to use. - * @param structure - * The string triples array to adjust. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_triples_resize_ - extern f_status_t f_utf_string_triples_resize(const f_number_unsigned_t length, f_utf_string_triples_t * const structure); -#endif // _di_f_utf_string_triples_resize_ +#ifndef _di_f_utf_string_triples_destroy_callback_ + extern f_status_t f_utf_string_triples_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_triples_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/tripless.c b/level_0/f_utf/c/utf/tripless.c index ea21ca1..9701859 100644 --- a/level_0/f_utf/c/utf/tripless.c +++ b/level_0/f_utf/c/utf/tripless.c @@ -2,7 +2,6 @@ #include "../private-utf.h" #include "private-string.h" #include "private-triples.h" -#include "private-tripless.h" #ifdef __cplusplus extern "C" { @@ -16,18 +15,16 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; - - if (destination->used + 1 > destination->size) { - status = private_f_utf_string_tripless_resize(destination->used + F_memory_default_allocation_small_d, destination); + { + f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_triples_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - destination->array[destination->used].used = 0; + destination->array[destination->used].used = 0; - if (source.used) { - status = private_f_utf_string_triples_append_all(source, &destination->array[destination->used]); - if (F_status_is_error(status)) return status; + if (source.used) { + status = private_f_utf_string_triples_append_all(source, &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } } ++destination->used; @@ -44,114 +41,106 @@ extern "C" { if (!source.used) return F_data_not; - f_status_t status = F_okay; + { + f_status_t status = F_okay; - if (destination->used + source.used > destination->size) { - status = private_f_utf_string_tripless_resize(destination->used + source.used, destination); - if (F_status_is_error(status)) return status; - } - - for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - - destination->array[destination->used].used = 0; - - if (source.array[i].used) { - status = private_f_utf_string_triples_append_all(source.array[i], &destination->array[destination->used]); + { + status = f_memory_array_increase_by(source.used, sizeof(f_utf_string_triples_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; } - } // for - - return F_okay; - } -#endif // _di_f_utf_string_tripless_append_all_ -#ifndef _di_f_utf_string_tripless_adjust_ - f_status_t f_utf_string_tripless_adjust(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - return private_f_utf_string_tripless_adjust(length, structure); - } -#endif // _di_f_utf_string_tripless_adjust_ - -#ifndef _di_f_utf_string_tripless_decimate_by_ - f_status_t f_utf_string_tripless_decimate_by(const f_number_unsigned_t amount, f_utf_string_tripless_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + destination->array[destination->used].used = 0; - if (!amount) return F_data_not; + if (source.array[i].used) { + status = private_f_utf_string_triples_append_all(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } + } // for + } - return private_f_utf_string_tripless_adjust((structure->size > amount) ? structure->size - amount : 0, structure); + return F_okay; } -#endif // _di_f_utf_string_tripless_decimate_by_ +#endif // _di_f_utf_string_tripless_append_all_ -#ifndef _di_f_utf_string_tripless_decrease_by_ - f_status_t f_utf_string_tripless_decrease_by(const f_number_unsigned_t amount, f_utf_string_tripless_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_tripless_delete_callback_ + f_status_t f_utf_string_tripless_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (!amount) return F_data_not; + { + f_utf_string_triples_t * const array = (f_utf_string_triples_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - return private_f_utf_string_tripless_resize((structure->size > amount) ? structure->size - amount : 0, structure); - } -#endif // _di_f_utf_string_tripless_decrease_by_ + for (f_number_unsigned_t i = start; i < stop; ++i) { -#ifndef _di_f_utf_string_tripless_increase_ - f_status_t f_utf_string_tripless_increase(const f_number_unsigned_t step, f_utf_string_tripless_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - if (step && structure->used + 1 > structure->size) { - f_number_unsigned_t length = structure->used + step; + if (array[i].array[j].a.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].a.string, &array[i].array[j].a.used, &array[i].array[j].a.size); + if (F_status_is_error(status)) return status; + } - if (length > F_number_t_size_unsigned_d) { - if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + if (array[i].array[j].b.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].b.string, &array[i].array[j].b.used, &array[i].array[j].b.size); + if (F_status_is_error(status)) return status; + } - length = F_number_t_size_unsigned_d; - } + if (array[i].array[j].c.size) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].c.string, &array[i].array[j].c.used, &array[i].array[j].c.size); + if (F_status_is_error(status)) return status; + } + } // for - return private_f_utf_string_tripless_resize(length, structure); + status = f_memory_array_resize(0, sizeof(f_utf_string_triple_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for } - return F_data_not; + return F_okay; } -#endif // _di_f_utf_string_tripless_increase_ +#endif // _di_f_utf_string_tripless_delete_callback_ -#ifndef _di_f_utf_string_tripless_increase_by_ - f_status_t f_utf_string_tripless_increase_by(const f_number_unsigned_t amount, f_utf_string_tripless_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ +#ifndef _di_f_utf_string_tripless_destroy_callback_ + f_status_t f_utf_string_tripless_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) { - if (amount) { - if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + { + f_utf_string_triples_t * const array = (f_utf_string_triples_t *) void_array; + f_status_t status = F_okay; + f_number_unsigned_t j = 0; - const f_number_unsigned_t length = structure->used + amount; + for (f_number_unsigned_t i = start; i < stop; ++i) { - if (length > structure->size) { - if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large); + if (array[i].size) { + for (j = 0; j < array[i].size; ++j) { - return private_f_utf_string_tripless_resize(length, structure); - } - } + if (array[i].array[j].a.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].a.string, &array[i].array[j].a.used, &array[i].array[j].a.size); + if (F_status_is_error(status)) return status; + } - return F_data_not; - } -#endif // _di_f_utf_string_tripless_increase_by_ + if (array[i].array[j].b.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].b.string, &array[i].array[j].b.used, &array[i].array[j].b.size); + if (F_status_is_error(status)) return status; + } -#ifndef _di_f_utf_string_tripless_resize_ - f_status_t f_utf_string_tripless_resize(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure) { - #ifndef _di_level_0_parameter_checking_ - if (!structure) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + if (array[i].array[j].c.size) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].c.string, &array[i].array[j].c.used, &array[i].array[j].c.size); + if (F_status_is_error(status)) return status; + } + } // for - return private_f_utf_string_tripless_resize(length, structure); + status = f_memory_array_adjust(0, sizeof(f_utf_string_triple_t), (void **) &array[i].array, &array[i].used, &array[i].size); + if (F_status_is_error(status)) return status; + } + } // for + } + + return F_okay; } -#endif // _di_f_utf_string_tripless_resize_ +#endif // _di_f_utf_string_tripless_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/utf/tripless.h b/level_0/f_utf/c/utf/tripless.h index b74b4b6..96dd836 100644 --- a/level_0/f_utf/c/utf/tripless.h +++ b/level_0/f_utf/c/utf/tripless.h @@ -36,38 +36,9 @@ extern "C" { #define macro_f_utf_string_tripless_t_initialize_1(array, size, used) { array, size, used } #define macro_f_utf_string_tripless_t_initialize_2(array, length) { array, length, length } - - #define macro_f_utf_string_tripless_t_resize(status, tripless, length) status = f_utf_string_tripless_resize(length, &tripless); - #define macro_f_utf_string_tripless_t_adjust(status, tripless, length) status = f_utf_string_tripless_adjust(length, &tripless); - - #define macro_f_utf_string_tripless_t_delete_simple(tripless) f_utf_string_tripless_resize(0, &tripless); - #define macro_f_utf_string_tripless_t_destroy_simple(tripless) f_utf_string_tripless_adjust(0, &tripless); - - #define macro_f_utf_string_tripless_t_increase(status, step, tripless) status = f_utf_string_tripless_increase(step, tripless); - #define macro_f_utf_string_tripless_t_increase_by(status, tripless, amount) status = f_utf_string_tripless_increase_by(amount, tripless); - #define macro_f_utf_string_tripless_t_decrease_by(status, tripless, amount) status = f_utf_string_tripless_decrease_by(amount, tripless); - #define macro_f_utf_string_tripless_t_decimate_by(status, tripless, amount) status = f_utf_string_tripless_decimate_by(amount, tripless); #endif // _di_f_utf_string_tripless_t_ /** - * Resize the string tripless array. - * - * @param length - * The new size to use. - * @param structure - * The string tripless array to resize. - * - * @return - * F_okay on success. - * - * F_memory_not (with error bit) on out of memory. - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_f_utf_string_tripless_adjust_ - extern f_status_t f_utf_string_tripless_adjust(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure); -#endif // _di_f_utf_string_tripless_adjust_ - -/** * Append the single source triples onto the destination. * * @param source @@ -110,121 +81,60 @@ extern "C" { #endif // _di_f_utf_string_tripless_append_all_ /** - * Resize the string tripless array to a smaller size. + * A callback intended to be passed to f_memory_arrayss_resize() for an f_utf_string_tripless_t structure. * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to decimate the size by. - * @param structure - * The string tripless array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not if amount is 0. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_tripless_decimate_by_ - extern f_status_t f_utf_string_tripless_decimate_by(const f_number_unsigned_t amount, f_utf_string_tripless_t * const structure); -#endif // _di_f_utf_string_tripless_decimate_by_ - -/** - * Resize the string tripless array to a smaller size. - * - * This will resize making the array smaller based on (size - given length). - * If the given length is too small, then the resize will fail. - * This will not shrink the size to less than 0. - * - * @param amount - * A positive number representing how much to decrease the size by. - * @param structure - * The string tripless array to resize. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. - * F_data_not if amount is 0. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_tripless_decrease_by_ - extern f_status_t f_utf_string_tripless_decrease_by(const f_number_unsigned_t amount, f_utf_string_tripless_t * const structure); -#endif // _di_f_utf_string_tripless_decrease_by_ - -/** - * Increase the size of the string tripless array, but only if necessary. - * - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. - * - * @param step - * The allocation step to use. - * Must be greater than 0. - * @param structure - * The string tripless array to resize. - * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + 1 <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. + * Errors (with error bit) from: f_memory_array_resize(). * - * Errors (with error bit) from: f_memory_resize(). + * @see f_memory_array_resize() */ -#ifndef _di_f_utf_string_tripless_increase_ - extern f_status_t f_utf_string_tripless_increase(const f_number_unsigned_t step, f_utf_string_tripless_t * const structure); -#endif // _di_f_utf_string_tripless_increase_ +#ifndef _di_f_utf_string_tripless_delete_callback_ + extern f_status_t f_utf_string_tripless_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_tripless_delete_callback_ /** - * Resize the string tripless array to a larger size. + * A callback intended to be passed to f_memory_arrayss_adjust() for an f_utf_string_tripless_t structure. * - * This will resize making the array larger based on the given length. - * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d). - * If already set to the maximum buffer size, then the resize will fail. + * This is only called when shrinking the array and generally should perform deallocations. * - * @param amount - * A positive number representing how much to increase the size by. - * @param structure - * The string tripless array to resize. + * This does not do parameter checking. * - * @return - * F_okay on success. - * F_data_not on success, but there is no reason to increase size (used + amount <= size). - * - * F_array_too_large (with error bit) if the new array length is too large. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: f_memory_resize(). - */ -#ifndef _di_f_utf_string_tripless_increase_by_ - extern f_status_t f_utf_string_tripless_increase_by(const f_number_unsigned_t amount, f_utf_string_tripless_t * const structure); -#endif // _di_f_utf_string_tripless_increase_by_ - -/** - * Resize the string tripless array. - * - * @param length - * The new size to use. - * @param structure - * The string tripless array to adjust. + * @param start + * The inclusive start position in the array to start deleting. + * @param stop + * The exclusive stop position in the array to stop deleting. + * @param array + * The array structure to delete all values of. + * Must not be NULL. * * @return * F_okay on success. * * F_parameter (with error bit) if a parameter is invalid. * - * Errors (with error bit) from: f_memory_resize(). + * Errors (with error bit) from: f_memory_array_adjust(). + * + * @see f_memory_array_adjust() */ -#ifndef _di_f_utf_string_tripless_resize_ - extern f_status_t f_utf_string_tripless_resize(const f_number_unsigned_t length, f_utf_string_tripless_t * const structure); -#endif // _di_f_utf_string_tripless_resize_ +#ifndef _di_f_utf_string_tripless_destroy_callback_ + extern f_status_t f_utf_string_tripless_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array); +#endif // _di_f_utf_string_tripless_destroy_callback_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/data/build/settings b/level_0/f_utf/data/build/settings index 202aff5..d9a63b0 100644 --- a/level_0/f_utf/data/build/settings +++ b/level_0/f_utf/data/build/settings @@ -34,7 +34,7 @@ build_libraries-individual -lf_memory -lf_string 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 utf/dynamic.c utf/dynamics.c utf/dynamicss.c utf/is.c utf/is_character.c utf/map.c utf/maps.c utf/mapss.c utf/map_multi.c utf/map_multis.c utf/map_multiss.c utf/static.c utf/statics.c utf/staticss.c utf/string.c utf/triple.c utf/triples.c utf/tripless.c -build_sources_library utf/private-dynamic.c utf/private-dynamics.c utf/private-dynamicss.c utf/private-maps.c utf/private-mapss.c utf/private-map_multis.c utf/private-map_multiss.c utf/private-string.c utf/private-triples.c utf/private-tripless.c +build_sources_library utf/private-dynamics.c utf/private-maps.c utf/private-map_multis.c utf/private-string.c utf/private-triples.c 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 diff --git a/level_0/f_utf/data/build/settings-mocks b/level_0/f_utf/data/build/settings-mocks new file mode 100644 index 0000000..04eafb1 --- /dev/null +++ b/level_0/f_utf/data/build/settings-mocks @@ -0,0 +1,68 @@ +# fss-0001 +# +# Build the project with appropriate mocks linked in via the dynamic linker's "--wrap" functionality. +# +# The -Wl,--wrap does not work across shared files. +# Therefore, this file is a work-around to inject the mocks into the library for testing purposes. +# This should exactly match the "settings" file, except for the additional "-Wl,--wrap" parts and the additional mock source file. +# +# The flags -o0 must be passed to prevent the compiler from optimizing away any functions being mocked (which results in the mock not happening and a real function being called). +# Alternatively, figure out which optimization that is disabled by -o0 and have that specific optimization disabled. +# + +build_name f_utf + +version_major 0 +version_minor 7 +version_micro 0 +version_file micro +version_target minor + +modes individual clang test coverage +modes_default individual test + +build_compiler gcc +build_compiler-clang clang +build_indexer ar +build_indexer_arguments rcs +build_language c + +build_libraries -lc +build_libraries-individual -lf_memory -lf_string + +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 utf/dynamic.c utf/dynamics.c utf/dynamicss.c utf/is.c utf/is_character.c utf/map.c utf/maps.c utf/mapss.c utf/map_multi.c utf/map_multis.c utf/map_multiss.c utf/static.c utf/statics.c utf/staticss.c utf/string.c utf/triple.c utf/triples.c utf/tripless.c +build_sources_library utf/private-dynamics.c utf/private-maps.c utf/private-map_multis.c utf/private-string.c utf/private-triples.c +build_sources_library ../../tests/unit/c/mock-utf.c + +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_script yes +build_shared yes +build_static no + +path_headers fll/level_0 +path_library_script script +path_library_shared shared +path_library_static static + +has_path_standard yes +preserve_path_headers yes + +search_exclusive yes +search_shared yes +search_static yes + +environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH + +flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-clang -Wno-logical-op-parentheses +flags-test -O0 -fstack-protector -Wall +flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ + +flags_library -fPIC + +# Inject mocks. +flags -Wl,--wrap=f_memory_array_adjust +flags -Wl,--wrap=f_memory_array_resize diff --git a/level_0/f_utf/data/build/settings-tests b/level_0/f_utf/data/build/settings-tests index b24f61e..21ae898 100644 --- a/level_0/f_utf/data/build/settings-tests +++ b/level_0/f_utf/data/build/settings-tests @@ -50,8 +50,7 @@ build_sources_program test-utf-character_is_word.c test-utf-is_word.c build_sources_program test-utf-character_is_word_dash.c test-utf-is_word_dash.c build_sources_program test-utf-character_is_word_dash_plus.c test-utf-is_word_dash_plus.c build_sources_program test-utf-character_is_zero_width.c test-utf-is_zero_width.c -build_sources_program test-utf-dynamic_adjust.c test-utf-dynamic_append.c test-utf-dynamic_append_assure.c test-utf-dynamic_append_assure_nulless.c test-utf-dynamic_append_nulless.c -build_sources_program test-utf-dynamic_decimate_by.c test-utf-dynamic_decrease_by.c test-utf-dynamic_increase.c test-utf-dynamic_increase_by.c +build_sources_program test-utf-dynamic_append.c test-utf-dynamic_append_assure.c test-utf-dynamic_append_assure_nulless.c test-utf-dynamic_append_nulless.c build_sources_program test-utf-dynamic_mash.c test-utf-dynamic_mash_nulless.c build_sources_program test-utf-dynamic_mish.c test-utf-dynamic_mish_nulless.c build_sources_program test-utf-dynamic_partial_append.c test-utf-dynamic_partial_append_assure.c test-utf-dynamic_partial_append_assure_nulless.c test-utf-dynamic_partial_append_nulless.c @@ -59,17 +58,23 @@ build_sources_program test-utf-dynamic_partial_mash.c test-utf-dynamic_partial_m build_sources_program test-utf-dynamic_partial_mish.c test-utf-dynamic_partial_mish_nulless.c build_sources_program test-utf-dynamic_partial_prepend.c test-utf-dynamic_partial_prepend_assure.c test-utf-dynamic_partial_prepend_assure_nulless.c test-utf-dynamic_partial_prepend_nulless.c build_sources_program test-utf-dynamic_prepend.c test-utf-dynamic_prepend_assure.c test-utf-dynamic_prepend_assure_nulless.c test-utf-dynamic_prepend_nulless.c -build_sources_program test-utf-dynamic_resize.c build_sources_program test-utf-dynamic_seek_line.c test-utf-dynamic_seek_line_to.c test-utf-dynamic_seek_to.c build_sources_program test-utf-dynamic_terminate.c test-utf-dynamic_terminate_after.c -build_sources_program test-utf-dynamics_adjust.c test-utf-dynamics_append.c test-utf-dynamics_append_all.c test-utf-dynamics_decimate_by.c test-utf-dynamics_decrease_by.c test-utf-dynamics_increase.c test-utf-dynamics_increase_by.c test-utf-dynamics_resize.c test-utf-dynamicss_adjust.c test-utf-dynamicss_append.c test-utf-dynamicss_append_all.c test-utf-dynamicss_decimate_by.c test-utf-dynamicss_decrease_by.c test-utf-dynamicss_increase.c test-utf-dynamicss_increase_by.c test-utf-dynamicss_resize.c -build_sources_program test-utf-map_multis_adjust.c test-utf-map_multis_append.c test-utf-map_multis_append_all.c test-utf-map_multis_decimate_by.c test-utf-map_multis_decrease_by.c test-utf-map_multis_increase.c test-utf-map_multis_increase_by.c test-utf-map_multis_resize.c test-utf-map_multiss_adjust.c test-utf-map_multiss_append.c test-utf-map_multiss_append_all.c test-utf-map_multiss_decimate_by.c test-utf-map_multiss_decrease_by.c test-utf-map_multiss_increase.c test-utf-map_multiss_increase_by.c test-utf-map_multiss_resize.c -build_sources_program test-utf-maps_adjust.c test-utf-maps_append.c test-utf-maps_append_all.c test-utf-maps_decimate_by.c test-utf-maps_decrease_by.c test-utf-maps_increase.c test-utf-maps_increase_by.c test-utf-maps_resize.c test-utf-mapss_adjust.c test-utf-mapss_append.c test-utf-mapss_append_all.c test-utf-mapss_decimate_by.c test-utf-mapss_decrease_by.c test-utf-mapss_increase.c test-utf-mapss_increase_by.c test-utf-mapss_resize.c +build_sources_program test-utf-dynamics_append.c test-utf-dynamics_append_all.c test-utf-dynamicss_append.c test-utf-dynamicss_append_all.c +build_sources_program test-utf-dynamicss_delete_callback.c test-utf-dynamicss_destroy_callback.c +build_sources_program test-utf-maps_append.c test-utf-maps_append_all.c test-utf-mapss_append.c test-utf-mapss_append_all.c +build_sources_program test-utf-maps_delete_callback.c test-utf-maps_destroy_callback.c +build_sources_program test-utf-mapss_delete_callback.c test-utf-mapss_destroy_callback.c +build_sources_program test-utf-map_multis_append.c test-utf-map_multis_append_all.c test-utf-map_multiss_append.c test-utf-map_multiss_append_all.c +build_sources_program test-utf-map_multis_delete_callback.c test-utf-map_multis_destroy_callback.c +build_sources_program test-utf-map_multiss_delete_callback.c test-utf-map_multiss_destroy_callback.c build_sources_program test-utf-mash.c test-utf-mash_nulless.c build_sources_program test-utf-mish.c test-utf-mish_nulless.c build_sources_program test-utf-prepend.c test-utf-prepend_assure.c test-utf-prepend_assure_nulless.c test-utf-prepend_nulless.c build_sources_program test-utf-seek_line.c test-utf-seek_line_to.c test-utf-seek_to.c -build_sources_program test-utf-triples_adjust.c test-utf-triples_append.c test-utf-triples_append_all.c test-utf-triples_decimate_by.c test-utf-triples_decrease_by.c test-utf-triples_increase.c test-utf-triples_increase_by.c test-utf-triples_resize.c test-utf-tripless_adjust.c test-utf-tripless_append.c test-utf-tripless_append_all.c test-utf-tripless_decimate_by.c test-utf-tripless_decrease_by.c test-utf-tripless_increase.c test-utf-tripless_increase_by.c test-utf-tripless_resize.c +build_sources_program test-utf-triples_append.c test-utf-triples_append_all.c test-utf-tripless_append.c test-utf-tripless_append_all.c +build_sources_program test-utf-triples_delete_callback.c test-utf-triples_destroy_callback.c +build_sources_program test-utf-tripless_delete_callback.c test-utf-tripless_destroy_callback.c build_sources_program test-utf.c data-utf.c build_script no diff --git a/level_0/f_utf/data/build/testfile b/level_0/f_utf/data/build/testfile index 2fc47dc..57f5923 100644 --- a/level_0/f_utf/data/build/testfile +++ b/level_0/f_utf/data/build/testfile @@ -18,7 +18,7 @@ settings: #define CMOCKA_XML_FILE ./out.xml main: - build settings individual test + build settings-mocks individual test build settings-tests individual test operate build_path diff --git a/level_0/f_utf/tests/unit/c/mock-utf.c b/level_0/f_utf/tests/unit/c/mock-utf.c new file mode 100644 index 0000000..78c8f92 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/mock-utf.c @@ -0,0 +1,46 @@ +#include "mock-utf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int mock_unwrap = 0; +int mock_unwrap_f_memory = 1; + +f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) { + + if (mock_unwrap_f_memory) { + return __real_f_memory_array_adjust(length, width, array, used, size); + } + + if (!array || !used || !size) return F_status_set_error(F_parameter_not); + + const bool failure = mock_type(bool); + + if (failure) return mock_type(f_status_t); + + *size = length; + + return mock_type(f_status_t); +} + +f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) { + + if (mock_unwrap_f_memory) { + return __real_f_memory_array_resize(length, width, array, used, size); + } + + if (!array || !used || !size) return F_status_set_error(F_parameter_not); + + const bool failure = mock_type(bool); + + if (failure) return mock_type(f_status_t); + + *size = length; + + return mock_type(f_status_t); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/mock-utf.h b/level_0/f_utf/tests/unit/c/mock-utf.h new file mode 100644 index 0000000..7317bb5 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/mock-utf.h @@ -0,0 +1,46 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the fss project. + */ +#ifndef _MOCK__utf_h +#define _MOCK__utf_h + +// Libc includes. +#include +#include +#include +#include + +// cmocka includes. +#include + +// FLL-0 includes. +#include + +#ifdef __cplusplus +extern "C" { +#endif + +const static int mock_errno_generic = 32767; + +extern int mock_unwrap; +extern int mock_unwrap_f_memory; + +extern f_status_t __real_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size); +extern f_status_t __real_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size); + +extern f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size); +extern f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** const array, f_number_unsigned_t * const used, f_number_unsigned_t * const size); + +//extern long __wrap_sysconf(int name); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _MOCK__utf_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_adjust.c deleted file mode 100644 index c63ebf9..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamic_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamic_adjust__works(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.string); -} - -void test__f_utf_dynamic_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_adjust.h deleted file mode 100644 index ef2b176..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf__string_dynamic_adjust -#define _TEST__F_utf__string_dynamic_adjust - -/** - * Test that the function works. - * - * @see f_utf_string_dynamic_adjust() - */ -extern void test__f_utf_dynamic_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamic_adjust() - */ -extern void test__f_utf_dynamic_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf__string_dynamic_adjust diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.c index 20a62ac..b2bac76 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_append__works(void **state) { +void test__f_utf_string_dynamic_append__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize; @@ -24,7 +24,7 @@ void test__f_utf_dynamic_append__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_append__parameter_checking(void **state) { +void test__f_utf_string_dynamic_append__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.h index ca404af..1ab6c91 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_append() */ -extern void test__f_utf_dynamic_append__works(void **state); +extern void test__f_utf_string_dynamic_append__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_append() */ -extern void test__f_utf_dynamic_append__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_append__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.c index 1b0ea98..bea2752 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_append_assure__works(void **state) { +void test__f_utf_string_dynamic_append_assure__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize; @@ -36,7 +36,7 @@ void test__f_utf_dynamic_append_assure__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_append_assure__parameter_checking(void **state) { +void test__f_utf_string_dynamic_append_assure__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.h index 74da768..811cffe 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_append_assure() */ -extern void test__f_utf_dynamic_append_assure__works(void **state); +extern void test__f_utf_string_dynamic_append_assure__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_append_assure() */ -extern void test__f_utf_dynamic_append_assure__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_append_assure__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_append_assure_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.c index 13d66e4..eeb44c0 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_append_assure_nulless__works(void **state) { +void test__f_utf_string_dynamic_append_assure_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -37,7 +37,7 @@ void test__f_utf_dynamic_append_assure_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_append_assure_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_append_assure_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.h index c220016..0ab23a1 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_assure_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_append_assure_nulless() */ -extern void test__f_utf_dynamic_append_assure_nulless__works(void **state); +extern void test__f_utf_string_dynamic_append_assure_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_append_assure_nulless() */ -extern void test__f_utf_dynamic_append_assure_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_append_assure_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_append_assure_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.c index cae6527..9807175 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_append_nulless__works(void **state) { +void test__f_utf_string_dynamic_append_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -25,7 +25,7 @@ void test__f_utf_dynamic_append_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_append_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_append_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.h index dc8e99f..1c502ad 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_append_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_append_nulless() */ -extern void test__f_utf_dynamic_append_nulless__works(void **state); +extern void test__f_utf_string_dynamic_append_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_append_nulless() */ -extern void test__f_utf_dynamic_append_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_append_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_append_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_decimate_by.c deleted file mode 100644 index 0f226ec..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamic_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamic_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamic_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -void test__f_utf_dynamic_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_decimate_by.h deleted file mode 100644 index b2419ca..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_dynamic_decimate_by_h -#define _TEST__F_dynamic_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamic_decimate_by() - */ -extern void test__f_utf_dynamic_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamic_decimate_by() - */ -extern void test__f_utf_dynamic_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_dynamic_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_decrease_by.c deleted file mode 100644 index 1e7a728..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamic_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamic_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamic_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -void test__f_utf_dynamic_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_decrease_by.h deleted file mode 100644 index ba29203..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamic_decrease_by_h -#define _TEST__F_utf_dynamic_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamic_decrease_by() - */ -extern void test__f_utf_dynamic_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamic_decrease_by() - */ -extern void test__f_utf_dynamic_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamic_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase.c deleted file mode 100644 index 996511d..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamic_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamic_increase__works(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_dynamic_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.string); -} - -void test__f_utf_dynamic_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamic_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.string); -} - -void test__f_utf_dynamic_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.string); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase.h deleted file mode 100644 index 7cb7dbc..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamic_increase_h -#define _TEST__F_utf_dynamic_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamic_increase() - */ -extern void test__f_utf_dynamic_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_dynamic_increase() - */ -extern void test__f_utf_dynamic_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamic_increase() - */ -extern void test__f_utf_dynamic_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamic_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase_by.c deleted file mode 100644 index 98ebd1e..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamic_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamic_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_dynamic_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.string); -} - -void test__f_utf_dynamic_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase_by.h deleted file mode 100644 index 3a21691..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamic_increase_by_h -#define _TEST__F_utf_dynamic_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamic_increase_by() - */ -extern void test__f_utf_dynamic_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamic_increase_by() - */ -extern void test__f_utf_dynamic_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamic_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.c index 76b1a88..226ecbc 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_mash__works(void **state) { +void test__f_utf_string_dynamic_mash__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -38,7 +38,7 @@ void test__f_utf_dynamic_mash__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_mash__parameter_checking(void **state) { +void test__f_utf_string_dynamic_mash__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.h index 01b35b1..ba93412 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_mash() */ -extern void test__f_utf_dynamic_mash__works(void **state); +extern void test__f_utf_string_dynamic_mash__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_mash() */ -extern void test__f_utf_dynamic_mash__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_mash__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_mash_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.c index f3c70bf..2d7dd4d 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_mash_nulless__works(void **state) { +void test__f_utf_string_dynamic_mash_nulless__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -39,7 +39,7 @@ void test__f_utf_dynamic_mash_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_mash_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_mash_nulless__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.h index 1958311..f8eac83 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mash_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_mash_nulless() */ -extern void test__f_utf_dynamic_mash_nulless__works(void **state); +extern void test__f_utf_string_dynamic_mash_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_mash_nulless() */ -extern void test__f_utf_dynamic_mash_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_mash_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_mash_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.c index 44570a3..fd4adac 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_mish__works(void **state) { +void test__f_utf_string_dynamic_mish__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -38,7 +38,7 @@ void test__f_utf_dynamic_mish__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_mish__parameter_checking(void **state) { +void test__f_utf_string_dynamic_mish__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.h index cb5605d..2155c64 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_mish() */ -extern void test__f_utf_dynamic_mish__works(void **state); +extern void test__f_utf_string_dynamic_mish__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_mish() */ -extern void test__f_utf_dynamic_mish__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_mish__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_mish_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.c index d9cf1c0..9bf6523 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_mish_nulless__works(void **state) { +void test__f_utf_string_dynamic_mish_nulless__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -39,7 +39,7 @@ void test__f_utf_dynamic_mish_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_mish_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_mish_nulless__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.h index 9ea2f2d..3be4e73 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_mish_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_mish_nulless() */ -extern void test__f_utf_dynamic_mish_nulless__works(void **state); +extern void test__f_utf_string_dynamic_mish_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_mish_nulless() */ -extern void test__f_utf_dynamic_mish_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_mish_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_mish_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.c index 31ef176..64ab999 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_append__works(void **state) { +void test__f_utf_string_dynamic_partial_append__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -26,7 +26,7 @@ void test__f_utf_dynamic_partial_append__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_append__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_append__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.h index e3f669a..6873b41 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_append() */ -extern void test__f_utf_dynamic_partial_append__works(void **state); +extern void test__f_utf_string_dynamic_partial_append__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_append() */ -extern void test__f_utf_dynamic_partial_append__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_append__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.c index b9835d6..660ab23 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_append_assure__works(void **state) { +void test__f_utf_string_dynamic_partial_append_assure__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -38,7 +38,7 @@ void test__f_utf_dynamic_partial_append_assure__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_append_assure__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_append_assure__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.h index 8121a94..d334362 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_append_assure() */ -extern void test__f_utf_dynamic_partial_append_assure__works(void **state); +extern void test__f_utf_string_dynamic_partial_append_assure__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_append_assure() */ -extern void test__f_utf_dynamic_partial_append_assure__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_append_assure__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_append_assure_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.c index 31b0289..f47ed30 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state) { +void test__f_utf_string_dynamic_partial_append_assure_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -38,7 +38,7 @@ void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_append_assure_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.h index 2125c7a..9ce437e 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_assure_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_append_assure_nulless() */ -extern void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state); +extern void test__f_utf_string_dynamic_partial_append_assure_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_append_assure_nulless() */ -extern void test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_append_assure_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_append_assure_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.c index b2eaf05..44a5915 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_append_nulless__works(void **state) { +void test__f_utf_string_dynamic_partial_append_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -26,7 +26,7 @@ void test__f_utf_dynamic_partial_append_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_append_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_append_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.h index ac2178d..67c8f62 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_append_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_append_nulless() */ -extern void test__f_utf_dynamic_partial_append_nulless__works(void **state); +extern void test__f_utf_string_dynamic_partial_append_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_append_nulless() */ -extern void test__f_utf_dynamic_partial_append_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_append_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_append_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.c index 2a7d924..5894129 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_mash__works(void **state) { +void test__f_utf_string_dynamic_partial_mash__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); @@ -40,7 +40,7 @@ void test__f_utf_dynamic_partial_mash__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_mash__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_mash__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.h index 1e85751..17c519d 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_mash() */ -extern void test__f_utf_dynamic_partial_mash__works(void **state); +extern void test__f_utf_string_dynamic_partial_mash__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_mash() */ -extern void test__f_utf_dynamic_partial_mash__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_mash__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_mash_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.c index e3a346d..afca92c 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_mash_nulless__works(void **state) { +void test__f_utf_string_dynamic_partial_mash_nulless__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); @@ -40,7 +40,7 @@ void test__f_utf_dynamic_partial_mash_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_mash_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_mash_nulless__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.h index c10ae63..450b651 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mash_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_mash_nulless() */ -extern void test__f_utf_dynamic_partial_mash_nulless__works(void **state); +extern void test__f_utf_string_dynamic_partial_mash_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_mash_nulless() */ -extern void test__f_utf_dynamic_partial_mash_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_mash_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_mash_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.c index 7ebdaf4..df3c052 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_mish__works(void **state) { +void test__f_utf_string_dynamic_partial_mish__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); @@ -40,7 +40,7 @@ void test__f_utf_dynamic_partial_mish__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_mish__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_mish__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.h index cedf945..09375f7 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish.h @@ -15,12 +15,12 @@ * * @see f_utf_string_dynamic_partial_mish() */ -extern void test__f_utf_dynamic_partial_mish__works(void **state); +extern void test__f_utf_string_dynamic_partial_mish__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_mish() */ -extern void test__f_utf_dynamic_partial_mish__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_mish__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_mish_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.c index e73cab5..e9c2059 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_mish_nulless__works(void **state) { +void test__f_utf_string_dynamic_partial_mish_nulless__works(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); @@ -40,7 +40,7 @@ void test__f_utf_dynamic_partial_mish_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_mish_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_mish_nulless__parameter_checking(void **state) { const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0:", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.h index 73155de..d5fc7ad 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_mish_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_mish_nulless() */ -extern void test__f_utf_dynamic_partial_mish_nulless__works(void **state); +extern void test__f_utf_string_dynamic_partial_mish_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_mish_nulless() */ -extern void test__f_utf_dynamic_partial_mish_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_mish_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_mish_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.c index 9194931..2993200 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_prepend__works(void **state) { +void test__f_utf_string_dynamic_partial_prepend__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -26,7 +26,7 @@ void test__f_utf_dynamic_partial_prepend__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_prepend__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_prepend__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.h index b2ced10..2de8bd9 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_prepend() */ -extern void test__f_utf_dynamic_partial_prepend__works(void **state); +extern void test__f_utf_string_dynamic_partial_prepend__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_prepend() */ -extern void test__f_utf_dynamic_partial_prepend__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_prepend__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_prepend_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.c index e4d2168..383f4fc 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_prepend_assure__works(void **state) { +void test__f_utf_string_dynamic_partial_prepend_assure__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); @@ -38,7 +38,7 @@ void test__f_utf_dynamic_partial_prepend_assure__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_prepend_assure__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_prepend_assure__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.h index d7fe96d..0bd72de 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_prepend_assure() */ -extern void test__f_utf_dynamic_partial_prepend_assure__works(void **state); +extern void test__f_utf_string_dynamic_partial_prepend_assure__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_prepend_assure() */ -extern void test__f_utf_dynamic_partial_prepend_assure__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_prepend_assure__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_prepend_assure_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.c index 43673e0..011fc75 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state) { +void test__f_utf_string_dynamic_partial_prepend_assure_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -38,7 +38,7 @@ void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.h index 2ebd4e0..597b4bb 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_assure_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_prepend_assure_nulless() */ -extern void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state); +extern void test__f_utf_string_dynamic_partial_prepend_assure_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_prepend_assure_nulless() */ -extern void test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_prepend_assure_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.c index 1106f16..1ea0361 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_partial_prepend_nulless__works(void **state) { +void test__f_utf_string_dynamic_partial_prepend_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -26,7 +26,7 @@ void test__f_utf_dynamic_partial_prepend_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_partial_prepend_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_partial_prepend_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; const f_string_range_t partial = f_string_range_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.h index f9cc6c9..84cb7ed 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_partial_prepend_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_partial_prepend_nulless() */ -extern void test__f_utf_dynamic_partial_prepend_nulless__works(void **state); +extern void test__f_utf_string_dynamic_partial_prepend_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_partial_prepend_nulless() */ -extern void test__f_utf_dynamic_partial_prepend_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_partial_prepend_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_partial_prepend_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.c index 8314bc3..ae21b4f 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_prepend__works(void **state) { +void test__f_utf_string_dynamic_prepend__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize; @@ -24,7 +24,7 @@ void test__f_utf_dynamic_prepend__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_prepend__parameter_checking(void **state) { +void test__f_utf_string_dynamic_prepend__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.h index d2a1825..5177ef9 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_prepend() */ -extern void test__f_utf_dynamic_prepend__works(void **state); +extern void test__f_utf_string_dynamic_prepend__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_prepend() */ -extern void test__f_utf_dynamic_prepend__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_prepend__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_prepend_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.c index 6179313..7d4b1d8 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_prepend_assure__works(void **state) { +void test__f_utf_string_dynamic_prepend_assure__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize; @@ -36,7 +36,7 @@ void test__f_utf_dynamic_prepend_assure__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_prepend_assure__parameter_checking(void **state) { +void test__f_utf_string_dynamic_prepend_assure__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.h index d8e0b5b..040e96b 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_prepend_assure() */ -extern void test__f_utf_dynamic_prepend_assure__works(void **state); +extern void test__f_utf_string_dynamic_prepend_assure__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_prepend_assure() */ -extern void test__f_utf_dynamic_prepend_assure__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_prepend_assure__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_prepend_assure_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.c index 4223479..cdbd627 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_prepend_assure_nulless__works(void **state) { +void test__f_utf_string_dynamic_prepend_assure_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -37,7 +37,7 @@ void test__f_utf_dynamic_prepend_assure_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_prepend_assure_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_prepend_assure_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.h index 9f0c492..63eea96 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_assure_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_prepend_assure_nulless() */ -extern void test__f_utf_dynamic_prepend_assure_nulless__works(void **state); +extern void test__f_utf_string_dynamic_prepend_assure_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_prepend_assure_nulless() */ -extern void test__f_utf_dynamic_prepend_assure_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_prepend_assure_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_prepend_assure_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.c index 9dc16ad..706b76e 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_prepend_nulless__works(void **state) { +void test__f_utf_string_dynamic_prepend_nulless__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -25,7 +25,7 @@ void test__f_utf_dynamic_prepend_nulless__works(void **state) { free((void *) destination.string); } -void test__f_utf_dynamic_prepend_nulless__parameter_checking(void **state) { +void test__f_utf_string_dynamic_prepend_nulless__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.h index daff337..c970a2b 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_prepend_nulless.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamic_prepend_nulless() */ -extern void test__f_utf_dynamic_prepend_nulless__works(void **state); +extern void test__f_utf_string_dynamic_prepend_nulless__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_prepend_nulless() */ -extern void test__f_utf_dynamic_prepend_nulless__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_prepend_nulless__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_prepend_nulless_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_resize.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_resize.c deleted file mode 100644 index 092cec8..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamic_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamic_resize__works(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.string); -} - -void test__f_utf_dynamic_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; - - { - const f_status_t status = f_utf_string_dynamic_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.string); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_resize.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_resize.h deleted file mode 100644 index a86b960..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamic_resize_h -#define _TEST__F_utf_dynamic_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamic_resize() - */ -extern void test__f_utf_dynamic_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamic_resize() - */ -extern void test__f_utf_dynamic_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamic_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.c index b0f09f3..802896d 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state) { +void test__f_utf_string_dynamic_seek_line__returns_data_not_stop(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10); @@ -18,7 +18,7 @@ void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state) { } } -void test__f_utf_dynamic_seek_line__returns_none_eos(void **state) { +void test__f_utf_string_dynamic_seek_line__returns_none_eos(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -34,7 +34,7 @@ void test__f_utf_dynamic_seek_line__returns_none_eos(void **state) { } } -void test__f_utf_dynamic_seek_line__returns_none_stop(void **state) { +void test__f_utf_string_dynamic_seek_line__returns_none_stop(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -50,7 +50,7 @@ void test__f_utf_dynamic_seek_line__returns_none_stop(void **state) { } } -void test__f_utf_dynamic_seek_line__works(void **state) { +void test__f_utf_string_dynamic_seek_line__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10); @@ -66,7 +66,7 @@ void test__f_utf_dynamic_seek_line__works(void **state) { } } -void test__f_utf_dynamic_seek_line__parameter_checking(void **state) { +void test__f_utf_string_dynamic_seek_line__parameter_checking(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.h index 494f443..37242b5 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line.h @@ -15,34 +15,34 @@ * * @see f_utf_string_dynamic_seek_line() */ -extern void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state); +extern void test__f_utf_string_dynamic_seek_line__returns_data_not_stop(void **state); /** * Test that the function returns F_okay_eos stopped after end of string because no newline is found. * * @see f_utf_string_dynamic_seek_line() */ -extern void test__f_utf_dynamic_seek_line__returns_none_eos(void **state); +extern void test__f_utf_string_dynamic_seek_line__returns_none_eos(void **state); /** * Test that the function returns F_okay_stop stopped after end of range because no newline is found. * * @see f_utf_string_dynamic_seek_line() */ -extern void test__f_utf_dynamic_seek_line__returns_none_stop(void **state); +extern void test__f_utf_string_dynamic_seek_line__returns_none_stop(void **state); /** * Test that the function works. * * @see f_utf_string_dynamic_seek_line() */ -extern void test__f_utf_dynamic_seek_line__works(void **state); +extern void test__f_utf_string_dynamic_seek_line__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_seek_line() */ -extern void test__f_utf_dynamic_seek_line__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_seek_line__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_seek_line_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.c index 96a42f2..2da2fcf 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_seek_line_to__after_newline(void **state) { +void test__f_utf_string_dynamic_seek_line_to__after_newline(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6); @@ -22,7 +22,7 @@ void test__f_utf_dynamic_seek_line_to__after_newline(void **state) { } } -void test__f_utf_dynamic_seek_line_to__before_newline(void **state) { +void test__f_utf_string_dynamic_seek_line_to__before_newline(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6); @@ -39,7 +39,7 @@ void test__f_utf_dynamic_seek_line_to__before_newline(void **state) { } } -void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state) { +void test__f_utf_string_dynamic_seek_line_to__returns_data_not_stop(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10); @@ -53,7 +53,7 @@ void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state) { } } -void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state) { +void test__f_utf_string_dynamic_seek_line_to__returns_none_eos(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -70,7 +70,7 @@ void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state) { } } -void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state) { +void test__f_utf_string_dynamic_seek_line_to__returns_none_stop(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4); @@ -87,7 +87,7 @@ void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state) { } } -void test__f_utf_dynamic_seek_line_to__parameter_checking(void **state) { +void test__f_utf_string_dynamic_seek_line_to__parameter_checking(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.h index 3cce704..1da9414 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_line_to.h @@ -15,41 +15,41 @@ * * @see f_utf_string_dynamic_seek_line_to() */ -extern void test__f_utf_dynamic_seek_line_to__after_newline(void **state); +extern void test__f_utf_string_dynamic_seek_line_to__after_newline(void **state); /** * Test that the function works where seek target is before a newline. * * @see f_utf_string_dynamic_seek_line_to() */ -extern void test__f_utf_dynamic_seek_line_to__before_newline(void **state); +extern void test__f_utf_string_dynamic_seek_line_to__before_newline(void **state); /** * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop). * * @see f_utf_string_dynamic_seek_line_to() */ -extern void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state); +extern void test__f_utf_string_dynamic_seek_line_to__returns_data_not_stop(void **state); /** * Test that the function returns F_okay_eos stopped after end of string because no newline is found. * * @see f_utf_string_dynamic_seek_line_to() */ -extern void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state); +extern void test__f_utf_string_dynamic_seek_line_to__returns_none_eos(void **state); /** * Test that the function returns F_okay_stop stopped after end of range because no newline is found. * * @see f_utf_string_dynamic_seek_line_to() */ -extern void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state); +extern void test__f_utf_string_dynamic_seek_line_to__returns_none_stop(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_seek_line_to() */ -extern void test__f_utf_dynamic_seek_line_to__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_seek_line_to__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_seek_line_to_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.c index 7183831..22701b5 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamic_seek_to__after_newline(void **state) { +void test__f_utf_string_dynamic_seek_to__after_newline(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6); @@ -22,7 +22,7 @@ void test__f_utf_dynamic_seek_to__after_newline(void **state) { } } -void test__f_utf_dynamic_seek_to__before_newline(void **state) { +void test__f_utf_string_dynamic_seek_to__before_newline(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6); @@ -39,7 +39,7 @@ void test__f_utf_dynamic_seek_to__before_newline(void **state) { } } -void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state) { +void test__f_utf_string_dynamic_seek_to__returns_data_not_stop(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10); @@ -53,7 +53,7 @@ void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state) { } } -void test__f_utf_dynamic_seek_to__returns_none_eos(void **state) { +void test__f_utf_string_dynamic_seek_to__returns_none_eos(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10); @@ -70,7 +70,7 @@ void test__f_utf_dynamic_seek_to__returns_none_eos(void **state) { } } -void test__f_utf_dynamic_seek_to__returns_none_stop(void **state) { +void test__f_utf_string_dynamic_seek_to__returns_none_stop(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10); @@ -87,7 +87,7 @@ void test__f_utf_dynamic_seek_to__returns_none_stop(void **state) { } } -void test__f_utf_dynamic_seek_to__works(void **state) { +void test__f_utf_string_dynamic_seek_to__works(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); @@ -118,7 +118,7 @@ void test__f_utf_dynamic_seek_to__works(void **state) { } } -void test__f_utf_dynamic_seek_to__parameter_checking(void **state) { +void test__f_utf_string_dynamic_seek_to__parameter_checking(void **state) { const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0X", 0, 1); const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.h index b0fa763..bd008b7 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_seek_to.h @@ -15,41 +15,41 @@ * * @see f_utf_string_dynamic_seek_to() */ -extern void test__f_utf_dynamic_seek_to__after_newline(void **state); +extern void test__f_utf_string_dynamic_seek_to__after_newline(void **state); /** * Test that the function works where seek target is before a newline. * * @see f_utf_string_dynamic_seek_to() */ -extern void test__f_utf_dynamic_seek_to__before_newline(void **state); +extern void test__f_utf_string_dynamic_seek_to__before_newline(void **state); /** * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop). * * @see f_utf_string_dynamic_seek_to() */ -extern void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state); +extern void test__f_utf_string_dynamic_seek_to__returns_data_not_stop(void **state); /** * Test that the function returns F_okay_eos stopped after end of string because no newline is found. * * @see f_utf_string_dynamic_seek_to() */ -extern void test__f_utf_dynamic_seek_to__returns_none_eos(void **state); +extern void test__f_utf_string_dynamic_seek_to__returns_none_eos(void **state); /** * Test that the function returns F_okay_stop stopped after end of range because no newline is found. * * @see f_utf_string_dynamic_seek_to() */ -extern void test__f_utf_dynamic_seek_to__returns_none_stop(void **state); +extern void test__f_utf_string_dynamic_seek_to__returns_none_stop(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_seek_to() */ -extern void test__f_utf_dynamic_seek_to__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_seek_to__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_seek_to_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.c index 3112981..31b46e4 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.c @@ -5,14 +5,14 @@ extern "C" { #endif -void test__f_utf_dynamic_terminate__appends_null(void **state) { +void test__f_utf_string_dynamic_terminate__appends_null(void **state) { const f_number_unsigned_t length = 2; f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; // Put some value in the unused section at the end so that it gets overridden. { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_char_t), (void **) &data.string, &data.used, &data.size); assert_int_equal(status, F_okay); @@ -30,14 +30,14 @@ void test__f_utf_dynamic_terminate__appends_null(void **state) { free((void *) data.string); } -void test__f_utf_dynamic_terminate__doesnt_append_null(void **state) { +void test__f_utf_string_dynamic_terminate__doesnt_append_null(void **state) { const f_number_unsigned_t length = 2; f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; // Ensure a NULL already exists so that the test can confirm that another NULL is not appended. { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_char_t), (void **) &data.string, &data.used, &data.size); assert_int_equal(status, F_okay); @@ -55,7 +55,7 @@ void test__f_utf_dynamic_terminate__doesnt_append_null(void **state) { free((void *) data.string); } -void test__f_utf_dynamic_terminate__parameter_checking(void **state) { +void test__f_utf_string_dynamic_terminate__parameter_checking(void **state) { { const f_status_t status = f_utf_string_dynamic_terminate(0); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.h index 8421fb3..4aebb95 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate.h @@ -15,20 +15,20 @@ * * @see f_utf_string_dynamic_terminate() */ -extern void test__f_utf_dynamic_terminate__appends_null(void **state); +extern void test__f_utf_string_dynamic_terminate__appends_null(void **state); /** * Test that the function does not append a NULL. * * @see f_utf_string_dynamic_terminate() */ -extern void test__f_utf_dynamic_terminate__doesnt_append_null(void **state); +extern void test__f_utf_string_dynamic_terminate__doesnt_append_null(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_terminate() */ -extern void test__f_utf_dynamic_terminate__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_terminate__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_terminate_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.c b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.c index 337e686..bba4f9f 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.c @@ -4,14 +4,14 @@ #ifdef __cplusplus extern "C" { #endif -void test__f_utf_dynamic_terminate_after__appends_null(void **state) { +void test__f_utf_string_dynamic_terminate_after__appends_null(void **state) { const f_number_unsigned_t length = 2; f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; // Put some value in the unused section at the end so that it gets overridden. { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_char_t), (void **) &data.string, &data.used, &data.size); assert_int_equal(status, F_okay); @@ -31,14 +31,14 @@ void test__f_utf_dynamic_terminate_after__appends_null(void **state) { free((void *) data.string); } -void test__f_utf_dynamic_terminate_after__doesnt_append_null(void **state) { +void test__f_utf_string_dynamic_terminate_after__doesnt_append_null(void **state) { const f_number_unsigned_t length = 2; f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; // Ensure a NULL already exists so that the test can confirm that another NULL is not appended. { - const f_status_t status = f_utf_string_dynamic_resize(length, &data); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_char_t), (void **) &data.string, &data.used, &data.size); assert_int_equal(status, F_okay); assert_in_range(data.size, length, length + F_memory_default_allocation_small_d); @@ -59,7 +59,7 @@ void test__f_utf_dynamic_terminate_after__doesnt_append_null(void **state) { free((void *) data.string); } -void test__f_utf_dynamic_terminate_after__parameter_checking(void **state) { +void test__f_utf_string_dynamic_terminate_after__parameter_checking(void **state) { { const f_status_t status = f_utf_string_dynamic_terminate_after(0); diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.h b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.h index 050e1cc..edc2ee5 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamic_terminate_after.h @@ -15,20 +15,20 @@ * * @see f_utf_string_dynamic_terminate_after() */ -extern void test__f_utf_dynamic_terminate_after__appends_null(void **state); +extern void test__f_utf_string_dynamic_terminate_after__appends_null(void **state); /** * Test that the function does not append a new line. * * @see f_utf_string_dynamic_terminate_after() */ -extern void test__f_utf_dynamic_terminate_after__doesnt_append_null(void **state); +extern void test__f_utf_string_dynamic_terminate_after__doesnt_append_null(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamic_terminate_after() */ -extern void test__f_utf_dynamic_terminate_after__parameter_checking(void **state); +extern void test__f_utf_string_dynamic_terminate_after__parameter_checking(void **state); #endif // _TEST__F_utf_dynamic_terminate_after_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_adjust.c deleted file mode 100644 index ace8059..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamics_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamics_adjust__works(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_dynamics_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_adjust.h deleted file mode 100644 index 23fadce..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf__string_dynamics_adjust -#define _TEST__F_utf__string_dynamics_adjust - -/** - * Test that the function works. - * - * @see f_utf_string_dynamics_adjust() - */ -extern void test__f_utf_dynamics_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamics_adjust() - */ -extern void test__f_utf_dynamics_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf__string_dynamics_adjust diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.c index 7b1d7ca..f2b3037 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamics_append__works(void **state) { +void test__f_utf_string_dynamics_append__works(void **state) { const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5); f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize; @@ -26,7 +26,7 @@ void test__f_utf_dynamics_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_dynamics_append__parameter_checking(void **state) { +void test__f_utf_string_dynamics_append__parameter_checking(void **state) { const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.h index 0cd557f..02e32a6 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append.h @@ -15,13 +15,13 @@ * * @see f_utf_string_dynamics_append() */ -extern void test__f_utf_dynamics_append__works(void **state); +extern void test__f_utf_string_dynamics_append__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamics_append() */ -extern void test__f_utf_dynamics_append__parameter_checking(void **state); +extern void test__f_utf_string_dynamics_append__parameter_checking(void **state); #endif // _TEST__F_utf_dynamics_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.c index d494a83..d067777 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamics_append_all__works(void **state) { +void test__f_utf_string_dynamics_append_all__works(void **state) { const int length_inner = 2; f_utf_string_dynamics_t source = f_utf_string_dynamics_t_initialize; @@ -17,7 +17,7 @@ void test__f_utf_dynamics_append_all__works(void **state) { }; { - f_status_t status = f_utf_string_dynamics_resize(length_inner, &source); + f_status_t status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_dynamic_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.size, length_inner); @@ -64,14 +64,14 @@ void test__f_utf_dynamics_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_dynamics_append_all__returns_data_not(void **state) { +void test__f_utf_string_dynamics_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_dynamics_t source = f_utf_string_dynamics_t_initialize; f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize; { - const f_status_t status = f_utf_string_dynamics_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_dynamic_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -90,7 +90,7 @@ void test__f_utf_dynamics_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_dynamics_append_all__parameter_checking(void **state) { +void test__f_utf_string_dynamics_append_all__parameter_checking(void **state) { const f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.h index 21ef67d..6e7e29f 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_dynamics_append_all() */ -extern void test__f_utf_dynamics_append_all__works(void **state); +extern void test__f_utf_string_dynamics_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_dynamics_append_all() */ -extern void test__f_utf_dynamics_append_all__returns_data_not(void **state); +extern void test__f_utf_string_dynamics_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamics_append_all() */ -extern void test__f_utf_dynamics_append_all__parameter_checking(void **state); +extern void test__f_utf_string_dynamics_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_dynamics_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_decimate_by.c deleted file mode 100644 index c789ec8..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamics_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamics_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamics_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_dynamics_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_decimate_by.h deleted file mode 100644 index 0d597de..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_dynamics_decimate_by_h -#define _TEST__F_dynamics_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamics_decimate_by() - */ -extern void test__f_utf_dynamics_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamics_decimate_by() - */ -extern void test__f_utf_dynamics_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_dynamics_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_decrease_by.c deleted file mode 100644 index 0e6d5ab..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamics_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamics_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamics_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_dynamics_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_decrease_by.h deleted file mode 100644 index 007b927..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamics_decrease_by_h -#define _TEST__F_utf_dynamics_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamics_decrease_by() - */ -extern void test__f_utf_dynamics_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamics_decrease_by() - */ -extern void test__f_utf_dynamics_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamics_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_delete_callback.c new file mode 100644 index 0000000..7e9c9dc --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_delete_callback.c @@ -0,0 +1,52 @@ +#include "test-utf.h" +#include "test-utf-dynamics_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_dynamics_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_dynamic_t data = { .string = "", .used = 0, .size = 1 }; + f_utf_string_dynamic_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_dynamics_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_dynamics_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_dynamics_t datas = f_utf_string_dynamics_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_dynamic_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_dynamics_delete_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.size, 0); + } + + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_delete_callback.h new file mode 100644 index 0000000..41d17c1 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__dynamics_delete_callback +#define _TEST__F_utf__dynamics_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_dynamics_delete_callback() + */ +extern void test__f_utf_string_dynamics_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_dynamics_delete_callback() + */ +extern void test__f_utf_string_dynamics_delete_callback__works(void **state); + +#endif // _TEST__F_utf__dynamics_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_destroy_callback.c new file mode 100644 index 0000000..c228045 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_destroy_callback.c @@ -0,0 +1,52 @@ +#include "test-utf.h" +#include "test-utf-dynamics_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_dynamics_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_dynamic_t data = { .string = "", .used = 0, .size = 1 }; + f_utf_string_dynamic_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_dynamics_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_dynamics_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_dynamics_t datas = f_utf_string_dynamics_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_dynamic_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_dynamics_destroy_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.size, 0); + } + + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_destroy_callback.h new file mode 100644 index 0000000..694afc7 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamics_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__dynamicss_destroy_callback +#define _TEST__F_utf__dynamicss_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_dynamicss_destroy_callback() + */ +extern void test__f_utf_string_dynamicss_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_dynamicss_destroy_callback() + */ +extern void test__f_utf_string_dynamicss_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__dynamicss_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase.c deleted file mode 100644 index 13edd06..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamics_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamics_increase__works(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_dynamics_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_dynamics_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamics_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_dynamics_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase.h deleted file mode 100644 index 86db0d0..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamics_increase_h -#define _TEST__F_utf_dynamics_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamics_increase() - */ -extern void test__f_utf_dynamics_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_dynamics_increase() - */ -extern void test__f_utf_dynamics_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamics_increase() - */ -extern void test__f_utf_dynamics_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamics_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase_by.c deleted file mode 100644 index ecf50be..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamics_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamics_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_dynamics_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_dynamics_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase_by.h deleted file mode 100644 index 02d0295..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamics_increase_by_h -#define _TEST__F_utf_dynamics_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamics_increase_by() - */ -extern void test__f_utf_dynamics_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamics_increase_by() - */ -extern void test__f_utf_dynamics_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamics_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_resize.c b/level_0/f_utf/tests/unit/c/test-utf-dynamics_resize.c deleted file mode 100644 index b0cc03b..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamics_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamics_resize__works(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_dynamics_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamics_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamics_resize.h b/level_0/f_utf/tests/unit/c/test-utf-dynamics_resize.h deleted file mode 100644 index eaf88c5..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamics_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamics_resize_h -#define _TEST__F_utf_dynamics_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamics_resize() - */ -extern void test__f_utf_dynamics_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamics_resize() - */ -extern void test__f_utf_dynamics_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamics_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_adjust.c deleted file mode 100644 index 0de0484..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamicss_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamicss_adjust__works(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_dynamicss_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_adjust.h deleted file mode 100644 index 9bd1b8a..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamicss_adjust_h -#define _TEST__F_utf_dynamicss_adjust_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamicss_adjust() - */ -extern void test__f_utf_dynamicss_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamicss_adjust() - */ -extern void test__f_utf_dynamicss_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamicss_adjust_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.c index fb7f065..9cfe570 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamicss_append__works(void **state) { +void test__f_utf_string_dynamicss_append__works(void **state) { const int length_inner = 2; f_utf_string_dynamics_t source = f_utf_string_dynamics_t_initialize; @@ -17,7 +17,7 @@ void test__f_utf_dynamicss_append__works(void **state) { }; { - f_status_t status = f_utf_string_dynamics_resize(length_inner, &source); + f_status_t status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_dynamic_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.size, length_inner); @@ -65,14 +65,14 @@ void test__f_utf_dynamicss_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_dynamicss_append__returns_data_not(void **state) { +void test__f_utf_string_dynamicss_append__returns_data_not(void **state) { const int length = 5; f_utf_string_dynamics_t source = f_utf_string_dynamicss_t_initialize; f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize; { - const f_status_t status = f_utf_string_dynamics_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_dynamic_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -91,7 +91,7 @@ void test__f_utf_dynamicss_append__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_dynamicss_append__parameter_checking(void **state) { +void test__f_utf_string_dynamicss_append__parameter_checking(void **state) { f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.h index 43169fe..2c8e28c 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append.h @@ -15,20 +15,20 @@ * * @see f_utf_string_dynamicss_append() */ -extern void test__f_utf_dynamicss_append__works(void **state); +extern void test__f_utf_string_dynamicss_append__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_dynamicss_append() */ -extern void test__f_utf_dynamicss_append__returns_data_not(void **state); +extern void test__f_utf_string_dynamicss_append__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamicss_append() */ -extern void test__f_utf_dynamicss_append__parameter_checking(void **state); +extern void test__f_utf_string_dynamicss_append__parameter_checking(void **state); #endif // _TEST__F_utf_dynamicss_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c index f88639a..1e06942 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_dynamicss_append_all__works(void **state) { +void test__f_utf_string_dynamicss_append_all__works(void **state) { const int length_inner = 2; const int length_outer = 2; @@ -18,7 +18,7 @@ void test__f_utf_dynamicss_append_all__works(void **state) { }; { - f_status_t status = f_utf_string_dynamicss_resize(length_outer, &source); + f_status_t status = f_memory_array_increase_by(length_outer, sizeof(f_utf_string_dynamics_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -28,7 +28,7 @@ void test__f_utf_dynamicss_append_all__works(void **state) { for (; source.used < length_outer; ++source.used) { - status = f_utf_string_dynamics_resize(length_inner, &source.array[source.used]); + status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_dynamic_t), (void **) &source.array[source.used].array, &source.array[source.used].used, &source.array[source.used].size); assert_int_equal(status, F_okay); assert_int_equal(source.array[source.used].used, 0); @@ -91,14 +91,14 @@ void test__f_utf_dynamicss_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_dynamicss_append_all__returns_data_not(void **state) { +void test__f_utf_string_dynamicss_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_dynamicss_t source = f_utf_string_dynamicss_t_initialize; f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize; { - const f_status_t status = f_utf_string_dynamicss_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_dynamics_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -117,7 +117,7 @@ void test__f_utf_dynamicss_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_dynamicss_append_all__parameter_checking(void **state) { +void test__f_utf_string_dynamicss_append_all__parameter_checking(void **state) { const f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.h index ab686a6..6242f3e 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_dynamicss_append_all() */ -extern void test__f_utf_dynamicss_append_all__works(void **state); +extern void test__f_utf_string_dynamicss_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_dynamicss_append_all() */ -extern void test__f_utf_dynamicss_append_all__returns_data_not(void **state); +extern void test__f_utf_string_dynamicss_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_dynamicss_append_all() */ -extern void test__f_utf_dynamicss_append_all__parameter_checking(void **state); +extern void test__f_utf_string_dynamicss_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_dynamicss_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decimate_by.c deleted file mode 100644 index 2451956..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamicss_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamicss_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamicss_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_dynamicss_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decimate_by.h deleted file mode 100644 index 412c16f..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamicss_decimate_by_h -#define _TEST__F_utf_dynamicss_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamicss_decimate_by() - */ -extern void test__f_utf_dynamicss_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamicss_decimate_by() - */ -extern void test__f_utf_dynamicss_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamicss_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decrease_by.c deleted file mode 100644 index d8bf98e..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamicss_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamicss_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamicss_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_dynamicss_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decrease_by.h deleted file mode 100644 index 367f373..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamicss_decrease_by_h -#define _TEST__F_utf_dynamicss_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_utf_string_dynamicss_decrease_by() - */ -extern void test__f_utf_dynamicss_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_utf_string_dynamicss_decrease_by() - */ -extern void test__f_utf_dynamicss_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamicss_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_delete_callback.c new file mode 100644 index 0000000..3f6fb58 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_delete_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-dynamicss_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_dynamicss_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; + f_utf_string_dynamic_t data_array[] = { data }; + f_utf_string_dynamics_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_dynamics_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_dynamicss_delete_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_dynamicss_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_dynamicss_t datass = f_utf_string_dynamicss_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_dynamics_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_dynamicss_delete_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_delete_callback.h new file mode 100644 index 0000000..7a141cf --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__dynamicss_delete_callback +#define _TEST__F_utf__dynamicss_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_dynamicss_delete_callback() + */ +extern void test__f_utf_string_dynamicss_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_dynamicss_delete_callback() + */ +extern void test__f_utf_string_dynamicss_delete_callback__works(void **state); + +#endif // _TEST__F_utf__dynamicss_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_destroy_callback.c new file mode 100644 index 0000000..66e37d2 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_destroy_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-dynamicss_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_dynamicss_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize; + f_utf_string_dynamic_t data_array[] = { data }; + f_utf_string_dynamics_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_dynamics_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_dynamicss_destroy_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_dynamicss_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_dynamicss_t datass = f_utf_string_dynamicss_t_initialize; + + { + f_status_t status = f_memory_array_adjust(length, sizeof(f_utf_string_dynamics_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_adjust(1, sizeof(f_utf_string_dynamic_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_dynamicss_destroy_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_destroy_callback.h new file mode 100644 index 0000000..0d45560 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__dynamicss_destroy_callback +#define _TEST__F_utf__dynamicss_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_dynamicss_destroy_callback() + */ +extern void test__f_utf_string_dynamicss_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_dynamicss_destroy_callback() + */ +extern void test__f_utf_string_dynamicss_destroy_callback__works(void **state); + +#endif // _TEST__F_string__dynamicss_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase.c deleted file mode 100644 index 9b84d8a..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamicss_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamicss_increase__works(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_dynamicss_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_dynamicss_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_dynamicss_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_dynamicss_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase.h deleted file mode 100644 index feb8fee..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamicss_increase_h -#define _TEST__F_utf_dynamicss_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamicss_increase() - */ -extern void test__f_utf_dynamicss_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_dynamicss_increase() - */ -extern void test__f_utf_dynamicss_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamicss_increase() - */ -extern void test__f_utf_dynamicss_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamicss_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase_by.c deleted file mode 100644 index c9690c4..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamicss_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamicss_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_dynamicss_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_dynamicss_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase_by.h deleted file mode 100644 index f472d3d..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamicss_increase_by_h -#define _TEST__F_utf_dynamicss_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamicss_increase_by() - */ -extern void test__f_utf_dynamicss_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamicss_increase_by() - */ -extern void test__f_utf_dynamicss_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamicss_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_resize.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_resize.c deleted file mode 100644 index b6b53e4..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-dynamicss_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_dynamicss_resize__works(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_dynamicss_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize; - - { - const f_status_t status = f_utf_string_dynamicss_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_resize.h b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_resize.h deleted file mode 100644 index 6032e7b..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_dynamicss_resize_h -#define _TEST__F_utf_dynamicss_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_dynamicss_resize() - */ -extern void test__f_utf_dynamicss_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_dynamicss_resize() - */ -extern void test__f_utf_dynamicss_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_dynamicss_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_adjust.c deleted file mode 100644 index 6cca3e2..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multis_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multis_adjust__works(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_map_multis_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_adjust.h deleted file mode 100644 index f33867e..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf__string_map_multis_adjust -#define _TEST__F_utf__string_map_multis_adjust - -/** - * Test that the function works. - * - * @see f_utf_string_map_multis_adjust() - */ -extern void test__f_utf_map_multis_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multis_adjust() - */ -extern void test__f_utf_map_multis_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf__string_map_multis_adjust diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c index 09bfd49..2216dc2 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_map_multis_append__works(void **state) { +void test__f_utf_string_map_multis_append__works(void **state) { const int length_values = 2; f_utf_string_map_multi_t source = f_utf_string_map_multi_t_initialize; @@ -85,7 +85,7 @@ void test__f_utf_map_multis_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_map_multis_append__parameter_checking(void **state) { +void test__f_utf_string_map_multis_append__parameter_checking(void **state) { const f_utf_string_map_multi_t data = f_utf_string_map_multi_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.h index 500ac5a..9099a23 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.h @@ -15,13 +15,13 @@ * * @see f_utf_string_map_multis_append() */ -extern void test__f_utf_map_multis_append__works(void **state); +extern void test__f_utf_string_map_multis_append__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_map_multis_append() */ -extern void test__f_utf_map_multis_append__parameter_checking(void **state); +extern void test__f_utf_string_map_multis_append__parameter_checking(void **state); #endif // _TEST__F_utf_map_multis_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c index 3c5a8ba..99608d1 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_map_multis_append_all__works(void **state) { +void test__f_utf_string_map_multis_append_all__works(void **state) { const int length_values = 2; const int length_inner = 2; @@ -21,7 +21,7 @@ void test__f_utf_map_multis_append_all__works(void **state) { const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize_1(test_value_array, 0, length_values); { - f_status_t status = f_utf_string_map_multis_resize(length_inner, &source); + f_status_t status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_map_multi_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.size, length_inner); @@ -84,14 +84,14 @@ void test__f_utf_map_multis_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_map_multis_append_all__returns_data_not(void **state) { +void test__f_utf_string_map_multis_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_map_multis_t source = f_utf_string_map_multis_t_initialize; f_utf_string_map_multis_t destination = f_utf_string_map_multis_t_initialize; { - const f_status_t status = f_utf_string_map_multis_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_map_multis_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -110,7 +110,7 @@ void test__f_utf_map_multis_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_map_multis_append_all__parameter_checking(void **state) { +void test__f_utf_string_map_multis_append_all__parameter_checking(void **state) { const f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.h index 2a49f1a..bdfadee 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_map_multis_append_all() */ -extern void test__f_utf_map_multis_append_all__works(void **state); +extern void test__f_utf_string_map_multis_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_map_multis_append_all() */ -extern void test__f_utf_map_multis_append_all__returns_data_not(void **state); +extern void test__f_utf_string_map_multis_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_map_multis_append_all() */ -extern void test__f_utf_map_multis_append_all__parameter_checking(void **state); +extern void test__f_utf_string_map_multis_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_map_multis_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_decimate_by.c deleted file mode 100644 index c14f523..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multis_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multis_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_map_multis_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_map_multis_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_decimate_by.h deleted file mode 100644 index ec89563..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_map_multis_decimate_by_h -#define _TEST__F_map_multis_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multis_decimate_by() - */ -extern void test__f_utf_map_multis_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multis_decimate_by() - */ -extern void test__f_utf_map_multis_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_map_multis_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_decrease_by.c deleted file mode 100644 index 1a6a937..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multis_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multis_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_map_multis_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_map_multis_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_decrease_by.h deleted file mode 100644 index 8a1c80d..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multis_decrease_by_h -#define _TEST__F_utf_map_multis_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multis_decrease_by() - */ -extern void test__f_utf_map_multis_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multis_decrease_by() - */ -extern void test__f_utf_map_multis_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multis_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c new file mode 100644 index 0000000..4e4f210 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c @@ -0,0 +1,107 @@ +#include "test-utf.h" +#include "test-utf-map_multis_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_map_multis_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t value_string[] = { 'v', 0 }; + + f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value_array[] = { value }; + f_utf_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 }; + + f_utf_string_map_multi_t data = { .name = name, .value = values }; + f_utf_string_map_multi_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multis_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + data_array[0].value.array[0].size = 1; + + { + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multis_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + data_array[0].value.array[0].size = 1; + + { + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multis_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_map_multis_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_map_multis_t datas = f_utf_string_map_multis_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.array[0].string, &datas.array[0].value.array[0].used, &datas.array[0].value.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_map_multis_delete_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); + } + + free((void *) datas.array[0].name.string); + free((void *) datas.array[0].value.array); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.h new file mode 100644 index 0000000..c01e41f --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_string__map_multis_delete_callback +#define _TEST__F_string__map_multis_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_map_multis_delete_callback() + */ +extern void test__f_utf_string_map_multis_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_map_multis_delete_callback() + */ +extern void test__f_utf_string_map_multis_delete_callback__works(void **state); + +#endif // _TEST__F_string__map_multis_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c new file mode 100644 index 0000000..91ab559 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c @@ -0,0 +1,107 @@ +#include "test-utf.h" +#include "test-utf-map_multis_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_map_multis_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t value_string[] = { 'v', 0 }; + + f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value_array[] = { value }; + f_utf_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 }; + + f_utf_string_map_multi_t data = { .name = name, .value = values }; + f_utf_string_map_multi_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multis_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + data_array[0].value.array[0].size = 1; + + { + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multis_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + data_array[0].value.array[0].size = 1; + + { + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multis_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_map_multis_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_map_multis_t datas = f_utf_string_map_multis_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.array[0].string, &datas.array[0].value.array[0].used, &datas.array[0].value.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_map_multis_destroy_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); + } + + free((void *) datas.array[0].name.string); + free((void *) datas.array[0].value.array); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.h new file mode 100644 index 0000000..f27bdc3 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__map_multis_destroy_callback +#define _TEST__F_utf__map_multis_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_map_multis_destroy_callback() + */ +extern void test__f_utf_string_map_multis_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_map_multis_destroy_callback() + */ +extern void test__f_utf_string_map_multis_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__map_multis_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase.c deleted file mode 100644 index 912668b..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multis_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multis_increase__works(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_map_multis_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_map_multis_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_map_multis_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_map_multis_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase.h deleted file mode 100644 index 37c87d0..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multis_increase_h -#define _TEST__F_utf_map_multis_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multis_increase() - */ -extern void test__f_utf_map_multis_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_map_multis_increase() - */ -extern void test__f_utf_map_multis_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multis_increase() - */ -extern void test__f_utf_map_multis_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multis_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase_by.c deleted file mode 100644 index 6828872..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multis_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multis_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_map_multis_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_map_multis_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase_by.h deleted file mode 100644 index 4f50ba2..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multis_increase_by_h -#define _TEST__F_utf_map_multis_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multis_increase_by() - */ -extern void test__f_utf_map_multis_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multis_increase_by() - */ -extern void test__f_utf_map_multis_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multis_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_resize.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_resize.c deleted file mode 100644 index e7dfad1..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multis_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multis_resize__works(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_map_multis_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multis_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_resize.h b/level_0/f_utf/tests/unit/c/test-utf-map_multis_resize.h deleted file mode 100644 index 6f7be0d..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multis_resize_h -#define _TEST__F_utf_map_multis_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multis_resize() - */ -extern void test__f_utf_map_multis_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multis_resize() - */ -extern void test__f_utf_map_multis_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multis_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_adjust.c deleted file mode 100644 index 3be8e47..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multiss_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multiss_adjust__works(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_map_multiss_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_adjust.h deleted file mode 100644 index 76637a4..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multiss_adjust_h -#define _TEST__F_utf_map_multiss_adjust_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multiss_adjust() - */ -extern void test__f_utf_map_multiss_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multiss_adjust() - */ -extern void test__f_utf_map_multiss_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multiss_adjust_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c index 9970268..9ce16b5 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_map_multiss_append__works(void **state) { +void test__f_utf_string_map_multiss_append__works(void **state) { const int length_values = 2; const int length_inner = 2; @@ -33,7 +33,7 @@ void test__f_utf_map_multiss_append__works(void **state) { }; { - f_status_t status = f_utf_string_map_multis_resize(length_inner, &source); + f_status_t status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_map_multi_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.size, length_inner); @@ -99,14 +99,14 @@ void test__f_utf_map_multiss_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_map_multiss_append__returns_data_not(void **state) { +void test__f_utf_string_map_multiss_append__returns_data_not(void **state) { const int length = 5; f_utf_string_map_multis_t source = f_utf_string_map_multiss_t_initialize; f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize; { - const f_status_t status = f_utf_string_map_multis_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_map_multis_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -125,7 +125,7 @@ void test__f_utf_map_multiss_append__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_map_multiss_append__parameter_checking(void **state) { +void test__f_utf_string_map_multiss_append__parameter_checking(void **state) { f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.h index 2dfd21f..2885f9d 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.h @@ -15,20 +15,20 @@ * * @see f_utf_string_map_multiss_append() */ -extern void test__f_utf_map_multiss_append__works(void **state); +extern void test__f_utf_string_map_multiss_append__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_map_multiss_append() */ -extern void test__f_utf_map_multiss_append__returns_data_not(void **state); +extern void test__f_utf_string_map_multiss_append__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_map_multiss_append() */ -extern void test__f_utf_map_multiss_append__parameter_checking(void **state); +extern void test__f_utf_string_map_multiss_append__parameter_checking(void **state); #endif // _TEST__F_utf_map_multiss_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c index e386879..00b4cdc 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_map_multiss_append_all__works(void **state) { +void test__f_utf_string_map_multiss_append_all__works(void **state) { const int length_values = 2; const int length_inner = 2; @@ -34,7 +34,7 @@ void test__f_utf_map_multiss_append_all__works(void **state) { }; { - f_status_t status = f_utf_string_map_multiss_resize(length_outer, &source); + f_status_t status = f_memory_array_increase_by(length_outer, sizeof(f_utf_string_map_multis_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -44,7 +44,7 @@ void test__f_utf_map_multiss_append_all__works(void **state) { for (; source.used < length_outer; ++source.used) { - status = f_utf_string_map_multis_resize(length_inner, &source.array[source.used]); + status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_map_multi_t), (void **) &source.array[source.used].array, &source.array[source.used].used, &source.array[source.used].size); assert_int_equal(status, F_okay); assert_int_equal(source.array[source.used].used, 0); @@ -125,14 +125,14 @@ void test__f_utf_map_multiss_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_map_multiss_append_all__returns_data_not(void **state) { +void test__f_utf_string_map_multiss_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_map_multiss_t source = f_utf_string_map_multiss_t_initialize; f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize; { - const f_status_t status = f_utf_string_map_multiss_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_map_multis_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -151,7 +151,7 @@ void test__f_utf_map_multiss_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_map_multiss_append_all__parameter_checking(void **state) { +void test__f_utf_string_map_multiss_append_all__parameter_checking(void **state) { const f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.h index 5f82886..75fbd98 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_map_multiss_append_all() */ -extern void test__f_utf_map_multiss_append_all__works(void **state); +extern void test__f_utf_string_map_multiss_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_map_multiss_append_all() */ -extern void test__f_utf_map_multiss_append_all__returns_data_not(void **state); +extern void test__f_utf_string_map_multiss_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_map_multiss_append_all() */ -extern void test__f_utf_map_multiss_append_all__parameter_checking(void **state); +extern void test__f_utf_string_map_multiss_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_map_multiss_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decimate_by.c deleted file mode 100644 index a16bf00..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multiss_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multiss_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_map_multiss_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_map_multiss_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decimate_by.h deleted file mode 100644 index 7ae5757..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multiss_decimate_by_h -#define _TEST__F_utf_map_multiss_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multiss_decimate_by() - */ -extern void test__f_utf_map_multiss_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multiss_decimate_by() - */ -extern void test__f_utf_map_multiss_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multiss_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decrease_by.c deleted file mode 100644 index 710be02..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multiss_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multiss_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_map_multiss_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_map_multiss_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decrease_by.h deleted file mode 100644 index ccb0fec..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multiss_decrease_by_h -#define _TEST__F_utf_map_multiss_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multiss_decrease_by() - */ -extern void test__f_utf_map_multiss_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multiss_decrease_by() - */ -extern void test__f_utf_map_multiss_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multiss_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_delete_callback.c new file mode 100644 index 0000000..430e5a7 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_delete_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-map_multiss_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_map_multiss_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_map_multi_t data = f_utf_string_map_multi_t_initialize; + f_utf_string_map_multi_t data_array[] = { data }; + f_utf_string_map_multis_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_map_multis_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multiss_delete_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_map_multiss_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_map_multiss_t datass = f_utf_string_map_multiss_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multis_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_utf_string_map_multi_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_map_multiss_delete_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_delete_callback.h new file mode 100644 index 0000000..cbe9266 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__map_multiss_delete_callback +#define _TEST__F_utf__map_multiss_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_map_multiss_delete_callback() + */ +extern void test__f_utf_string_map_multiss_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_map_multiss_delete_callback() + */ +extern void test__f_utf_string_map_multiss_delete_callback__works(void **state); + +#endif // _TEST__F_utf__map_multiss_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_destroy_callback.c new file mode 100644 index 0000000..91fc0ea --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_destroy_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-map_multiss_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_map_multiss_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_map_multi_t data = f_utf_string_map_multi_t_initialize; + f_utf_string_map_multi_t data_array[] = { data }; + f_utf_string_map_multis_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_map_multis_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_map_multiss_destroy_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_map_multiss_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_map_multiss_t datass = f_utf_string_map_multiss_t_initialize; + + { + f_status_t status = f_memory_array_adjust(length, sizeof(f_utf_string_map_multis_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_adjust(1, sizeof(f_utf_string_map_multi_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_map_multiss_destroy_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_destroy_callback.h new file mode 100644 index 0000000..a482a5e --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__map_multiss_destroy_callback +#define _TEST__F_utf__map_multiss_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_map_multiss_destroy_callback() + */ +extern void test__f_utf_string_map_multiss_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_map_multiss_destroy_callback() + */ +extern void test__f_utf_string_map_multiss_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__map_multiss_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase.c deleted file mode 100644 index bcd82d0..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multiss_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multiss_increase__works(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_map_multiss_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_map_multiss_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_map_multiss_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_map_multiss_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase.h deleted file mode 100644 index aa8b0b2..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multiss_increase_h -#define _TEST__F_utf_map_multiss_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multiss_increase() - */ -extern void test__f_utf_map_multiss_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_map_multiss_increase() - */ -extern void test__f_utf_map_multiss_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multiss_increase() - */ -extern void test__f_utf_map_multiss_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multiss_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase_by.c deleted file mode 100644 index 0d10bb3..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multiss_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multiss_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_map_multiss_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_map_multiss_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase_by.h deleted file mode 100644 index 515b503..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multiss_increase_by_h -#define _TEST__F_utf_map_multiss_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multiss_increase_by() - */ -extern void test__f_utf_map_multiss_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multiss_increase_by() - */ -extern void test__f_utf_map_multiss_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multiss_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_resize.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_resize.c deleted file mode 100644 index 56ec209..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-map_multiss_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_map_multiss_resize__works(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_map_multiss_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize; - - { - const f_status_t status = f_utf_string_map_multiss_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_resize.h b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_resize.h deleted file mode 100644 index 1df14ef..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_map_multiss_resize_h -#define _TEST__F_utf_map_multiss_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_map_multiss_resize() - */ -extern void test__f_utf_map_multiss_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_map_multiss_resize() - */ -extern void test__f_utf_map_multiss_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_map_multiss_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-maps_adjust.c deleted file mode 100644 index 8209721..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-maps_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_maps_adjust__works(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_maps_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-maps_adjust.h deleted file mode 100644 index fdaf3ad..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf__string_maps_adjust -#define _TEST__F_utf__string_maps_adjust - -/** - * Test that the function works. - * - * @see f_utf_string_maps_adjust() - */ -extern void test__f_utf_maps_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_maps_adjust() - */ -extern void test__f_utf_maps_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf__string_maps_adjust diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append.c b/level_0/f_utf/tests/unit/c/test-utf-maps_append.c index 43296eb..639117a 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_maps_append__works(void **state) { +void test__f_utf_string_maps_append__works(void **state) { f_utf_string_map_t source = f_utf_string_map_t_initialize; f_utf_string_maps_t destination = f_utf_string_maps_t_initialize; @@ -47,7 +47,7 @@ void test__f_utf_maps_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_maps_append__parameter_checking(void **state) { +void test__f_utf_string_maps_append__parameter_checking(void **state) { const f_utf_string_map_t data = f_utf_string_map_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append.h b/level_0/f_utf/tests/unit/c/test-utf-maps_append.h index a5e1adf..f647075 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append.h @@ -15,13 +15,13 @@ * * @see f_utf_string_maps_append() */ -extern void test__f_utf_maps_append__works(void **state); +extern void test__f_utf_string_maps_append__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_maps_append() */ -extern void test__f_utf_maps_append__parameter_checking(void **state); +extern void test__f_utf_string_maps_append__parameter_checking(void **state); #endif // _TEST__F_utf_maps_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c index a29d102..5380eda 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_maps_append_all__works(void **state) { +void test__f_utf_string_maps_append_all__works(void **state) { const int length_inner = 2; f_utf_string_maps_t source = f_utf_string_maps_t_initialize; @@ -15,7 +15,7 @@ void test__f_utf_maps_append_all__works(void **state) { const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10); { - f_status_t status = f_utf_string_maps_resize(length_inner, &source); + f_status_t status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_map_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.size, length_inner); @@ -69,14 +69,14 @@ void test__f_utf_maps_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_maps_append_all__returns_data_not(void **state) { +void test__f_utf_string_maps_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_maps_t source = f_utf_string_maps_t_initialize; f_utf_string_maps_t destination = f_utf_string_maps_t_initialize; { - const f_status_t status = f_utf_string_maps_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_map_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -95,7 +95,7 @@ void test__f_utf_maps_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_maps_append_all__parameter_checking(void **state) { +void test__f_utf_string_maps_append_all__parameter_checking(void **state) { const f_utf_string_maps_t data = f_utf_string_maps_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.h index 804784d..c373085 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_maps_append_all() */ -extern void test__f_utf_maps_append_all__works(void **state); +extern void test__f_utf_string_maps_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_maps_append_all() */ -extern void test__f_utf_maps_append_all__returns_data_not(void **state); +extern void test__f_utf_string_maps_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_maps_append_all() */ -extern void test__f_utf_maps_append_all__parameter_checking(void **state); +extern void test__f_utf_string_maps_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_maps_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-maps_decimate_by.c deleted file mode 100644 index 492c43d..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-maps_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_maps_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_maps_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_maps_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-maps_decimate_by.h deleted file mode 100644 index 5c2aada..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_maps_decimate_by_h -#define _TEST__F_maps_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_maps_decimate_by() - */ -extern void test__f_utf_maps_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_maps_decimate_by() - */ -extern void test__f_utf_maps_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_maps_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-maps_decrease_by.c deleted file mode 100644 index f195894..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-maps_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_maps_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_maps_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_maps_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-maps_decrease_by.h deleted file mode 100644 index da6fe7f..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_maps_decrease_by_h -#define _TEST__F_utf_maps_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_maps_decrease_by() - */ -extern void test__f_utf_maps_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_maps_decrease_by() - */ -extern void test__f_utf_maps_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_maps_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c new file mode 100644 index 0000000..fb89c62 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c @@ -0,0 +1,81 @@ +#include "test-utf.h" +#include "test-utf-maps_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_maps_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t value_string[] = { 'v', 0 }; + + f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; + + f_utf_string_map_t data = { .name = name, .value = value }; + f_utf_string_map_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_maps_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + + { + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_maps_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_maps_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_maps_t datas = f_utf_string_maps_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_maps_delete_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.size, 0); + } + + free((void *) datas.array[0].name.string); + free((void *) datas.array[0].value.string); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..h b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..h new file mode 100644 index 0000000..fa0c875 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__map_delete_callback +#define _TEST__F_utf__map_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_maps_delete_callback() + */ +extern void test__f_utf_string_maps_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_maps_delete_callback() + */ +extern void test__f_utf_string_maps_delete_callback__works(void **state); + +#endif // _TEST__F_utf__map_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c new file mode 100644 index 0000000..5f86862 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c @@ -0,0 +1,82 @@ +#include "test-utf.h" +#include "test-utf-maps_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_maps_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t value_string[] = { 'v', 0 }; + + f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; + + f_utf_string_map_t data = { .name = name, .value = value }; + f_utf_string_map_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_maps_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + + { + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_maps_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_maps_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_maps_t datas = f_utf_string_maps_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_maps_delete_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); + } + + free((void *) datas.array[0].name.string); + free((void *) datas.array[0].value.string); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.h new file mode 100644 index 0000000..fa0c875 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__map_delete_callback +#define _TEST__F_utf__map_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_maps_delete_callback() + */ +extern void test__f_utf_string_maps_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_maps_delete_callback() + */ +extern void test__f_utf_string_maps_delete_callback__works(void **state); + +#endif // _TEST__F_utf__map_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c new file mode 100644 index 0000000..921b15e --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c @@ -0,0 +1,82 @@ +#include "test-utf.h" +#include "test-utf-maps_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_maps_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t value_string[] = { 'v', 0 }; + + f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; + + f_utf_string_map_t data = { .name = name, .value = value }; + f_utf_string_map_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_maps_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].name.size = 1; + data_array[0].value.size = 1; + + { + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_maps_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_maps_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_maps_t datas = f_utf_string_maps_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_maps_destroy_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].value.size, 0); + } + + free((void *) datas.array[0].name.string); + free((void *) datas.array[0].value.string); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.h new file mode 100644 index 0000000..5237d96 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__map_destroy_callback +#define _TEST__F_utf__map_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_maps_destroy_callback() + */ +extern void test__f_utf_string_maps_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_maps_destroy_callback() + */ +extern void test__f_utf_string_maps_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__map_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_increase.c b/level_0/f_utf/tests/unit/c/test-utf-maps_increase.c deleted file mode 100644 index 852fbeb..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-maps_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_maps_increase__works(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_maps_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_maps_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_maps_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_maps_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_increase.h b/level_0/f_utf/tests/unit/c/test-utf-maps_increase.h deleted file mode 100644 index 6aeac96..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_maps_increase_h -#define _TEST__F_utf_maps_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_maps_increase() - */ -extern void test__f_utf_maps_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_maps_increase() - */ -extern void test__f_utf_maps_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_maps_increase() - */ -extern void test__f_utf_maps_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_maps_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-maps_increase_by.c deleted file mode 100644 index 3ebb7e1..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-maps_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_maps_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_maps_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_maps_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-maps_increase_by.h deleted file mode 100644 index 8a35105..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_maps_increase_by_h -#define _TEST__F_utf_maps_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_maps_increase_by() - */ -extern void test__f_utf_maps_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_maps_increase_by() - */ -extern void test__f_utf_maps_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_maps_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_resize.c b/level_0/f_utf/tests/unit/c/test-utf-maps_resize.c deleted file mode 100644 index 79e3ec7..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-maps_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_maps_resize__works(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_maps_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_maps_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_maps_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_resize.h b/level_0/f_utf/tests/unit/c/test-utf-maps_resize.h deleted file mode 100644 index bff0f8b..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_maps_resize_h -#define _TEST__F_utf_maps_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_maps_resize() - */ -extern void test__f_utf_maps_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_maps_resize() - */ -extern void test__f_utf_maps_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_maps_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_adjust.c deleted file mode 100644 index 98b6889..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-mapss_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_mapss_adjust__works(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_mapss_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_adjust.h deleted file mode 100644 index 7e12c8e..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_mapss_adjust_h -#define _TEST__F_utf_mapss_adjust_h - -/** - * Test that the function works. - * - * @see f_utf_string_mapss_adjust() - */ -extern void test__f_utf_mapss_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_mapss_adjust() - */ -extern void test__f_utf_mapss_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf_mapss_adjust_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c index f578837..aa09f3c 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_mapss_append__works(void **state) { +void test__f_utf_string_mapss_append__works(void **state) { const int length_inner = 2; f_utf_string_maps_t source = f_utf_string_maps_t_initialize; @@ -22,7 +22,7 @@ void test__f_utf_mapss_append__works(void **state) { }; { - f_status_t status = f_utf_string_maps_resize(length_inner, &source); + f_status_t status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_map_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.size, length_inner); @@ -78,14 +78,14 @@ void test__f_utf_mapss_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_mapss_append__returns_data_not(void **state) { +void test__f_utf_string_mapss_append__returns_data_not(void **state) { const int length = 5; f_utf_string_maps_t source = f_utf_string_mapss_t_initialize; f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize; { - const f_status_t status = f_utf_string_maps_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_maps_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -104,7 +104,7 @@ void test__f_utf_mapss_append__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_mapss_append__parameter_checking(void **state) { +void test__f_utf_string_mapss_append__parameter_checking(void **state) { f_utf_string_maps_t data = f_utf_string_maps_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.h index bf38a88..d95640d 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.h @@ -15,20 +15,20 @@ * * @see f_utf_string_mapss_append() */ -extern void test__f_utf_mapss_append__works(void **state); +extern void test__f_utf_string_mapss_append__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_mapss_append() */ -extern void test__f_utf_mapss_append__returns_data_not(void **state); +extern void test__f_utf_string_mapss_append__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_mapss_append() */ -extern void test__f_utf_mapss_append__parameter_checking(void **state); +extern void test__f_utf_string_mapss_append__parameter_checking(void **state); #endif // _TEST__F_utf_mapss_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c index 05996bd..21c4346 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_mapss_append_all__works(void **state) { +void test__f_utf_string_mapss_append_all__works(void **state) { const int length_inner = 2; const int length_outer = 2; @@ -23,7 +23,7 @@ void test__f_utf_mapss_append_all__works(void **state) { }; { - f_status_t status = f_utf_string_mapss_resize(length_outer, &source); + f_status_t status = f_memory_array_increase_by(length_outer, sizeof(f_utf_string_maps_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -33,7 +33,7 @@ void test__f_utf_mapss_append_all__works(void **state) { for (; source.used < length_outer; ++source.used) { - status = f_utf_string_maps_resize(length_inner, &source.array[source.used]); + status = f_memory_array_increase_by(length_inner, sizeof(f_utf_string_map_t), (void **) &source.array[source.used].array, &source.array[source.used].used, &source.array[source.used].size); assert_int_equal(status, F_okay); assert_int_equal(source.array[source.used].used, 0); @@ -103,14 +103,14 @@ void test__f_utf_mapss_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_mapss_append_all__returns_data_not(void **state) { +void test__f_utf_string_mapss_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_mapss_t source = f_utf_string_mapss_t_initialize; f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize; { - const f_status_t status = f_utf_string_mapss_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_maps_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -129,7 +129,7 @@ void test__f_utf_mapss_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_mapss_append_all__parameter_checking(void **state) { +void test__f_utf_string_mapss_append_all__parameter_checking(void **state) { const f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.h index f02aa1c..8d14688 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_mapss_append_all() */ -extern void test__f_utf_mapss_append_all__works(void **state); +extern void test__f_utf_string_mapss_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_mapss_append_all() */ -extern void test__f_utf_mapss_append_all__returns_data_not(void **state); +extern void test__f_utf_string_mapss_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_mapss_append_all() */ -extern void test__f_utf_mapss_append_all__parameter_checking(void **state); +extern void test__f_utf_string_mapss_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_mapss_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_decimate_by.c deleted file mode 100644 index 0b988c6..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-mapss_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_mapss_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_mapss_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_mapss_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_decimate_by.h deleted file mode 100644 index 307faeb..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_mapss_decimate_by_h -#define _TEST__F_utf_mapss_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_mapss_decimate_by() - */ -extern void test__f_utf_mapss_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_mapss_decimate_by() - */ -extern void test__f_utf_mapss_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_mapss_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_decrease_by.c deleted file mode 100644 index 693a4ae..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-mapss_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_mapss_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_mapss_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_mapss_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_decrease_by.h deleted file mode 100644 index 4247774..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_mapss_decrease_by_h -#define _TEST__F_utf_mapss_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_mapss_decrease_by() - */ -extern void test__f_utf_mapss_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_mapss_decrease_by() - */ -extern void test__f_utf_mapss_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_mapss_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_delete_callback.c new file mode 100644 index 0000000..b56acd1 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_delete_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-mapss_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_mapss_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_map_t data = f_utf_string_map_t_initialize; + f_utf_string_map_t data_array[] = { data }; + f_utf_string_maps_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_maps_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_mapss_delete_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_mapss_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_mapss_t datass = f_utf_string_mapss_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_maps_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_utf_string_map_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_mapss_delete_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_delete_callback.h new file mode 100644 index 0000000..f0442ea --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__mapss_delete_callback +#define _TEST__F_utf__mapss_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_mapss_delete_callback() + */ +extern void test__f_utf_string_mapss_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_mapss_delete_callback() + */ +extern void test__f_utf_string_mapss_delete_callback__works(void **state); + +#endif // _TEST__F_utf__mapss_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_destroy_callback.c new file mode 100644 index 0000000..56f25af --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_destroy_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-mapss_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_mapss_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_map_t data = f_utf_string_map_t_initialize; + f_utf_string_map_t data_array[] = { data }; + f_utf_string_maps_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_maps_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_mapss_destroy_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_mapss_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_mapss_t datass = f_utf_string_mapss_t_initialize; + + { + f_status_t status = f_memory_array_adjust(length, sizeof(f_utf_string_maps_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_adjust(1, sizeof(f_utf_string_map_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_mapss_destroy_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_destroy_callback.h new file mode 100644 index 0000000..2b80da1 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__mapss_destroy_callback +#define _TEST__F_utf__mapss_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_mapss_destroy_callback() + */ +extern void test__f_utf_string_mapss_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_mapss_destroy_callback() + */ +extern void test__f_utf_string_mapss_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__mapss_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_increase.c deleted file mode 100644 index 45d046a..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-mapss_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_mapss_increase__works(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_mapss_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_mapss_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_mapss_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_mapss_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_increase.h deleted file mode 100644 index fb5e8fb..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_mapss_increase_h -#define _TEST__F_utf_mapss_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_mapss_increase() - */ -extern void test__f_utf_mapss_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_mapss_increase() - */ -extern void test__f_utf_mapss_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_mapss_increase() - */ -extern void test__f_utf_mapss_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_mapss_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_increase_by.c deleted file mode 100644 index cbb4c10..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-mapss_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_mapss_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_mapss_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_mapss_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_maps_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_increase_by.h deleted file mode 100644 index 34a7a1a..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_mapss_increase_by_h -#define _TEST__F_utf_mapss_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_mapss_increase_by() - */ -extern void test__f_utf_mapss_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_mapss_increase_by() - */ -extern void test__f_utf_mapss_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_mapss_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_resize.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_resize.c deleted file mode 100644 index e715c82..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-mapss_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_mapss_resize__works(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_mapss_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize; - - { - const f_status_t status = f_utf_string_mapss_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_resize.h b/level_0/f_utf/tests/unit/c/test-utf-mapss_resize.h deleted file mode 100644 index 2bf34f3..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_mapss_resize_h -#define _TEST__F_utf_mapss_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_mapss_resize() - */ -extern void test__f_utf_mapss_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_mapss_resize() - */ -extern void test__f_utf_mapss_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_mapss_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-triples_adjust.c deleted file mode 100644 index 6981363..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-triples_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_triples_adjust__works(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_triples_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-triples_adjust.h deleted file mode 100644 index a3245d1..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf__string_triples_adjust -#define _TEST__F_utf__string_triples_adjust - -/** - * Test that the function works. - * - * @see f_utf_string_triples_adjust() - */ -extern void test__f_utf_triples_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_triples_adjust() - */ -extern void test__f_utf_triples_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf__string_triples_adjust diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_append.c b/level_0/f_utf/tests/unit/c/test-utf-triples_append.c index 20c3fe8..ccc1129 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_triples_append__works(void **state) { +void test__f_utf_string_triples_append__works(void **state) { const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0a", 0, 1); const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0b", 0, 1); @@ -34,7 +34,7 @@ void test__f_utf_triples_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_triples_append__parameter_checking(void **state) { +void test__f_utf_string_triples_append__parameter_checking(void **state) { const f_utf_string_triple_t data = f_utf_string_triple_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_append.h b/level_0/f_utf/tests/unit/c/test-utf-triples_append.h index 4180bdd..0bd3465 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_append.h @@ -15,13 +15,13 @@ * * @see f_utf_string_triples_append() */ -extern void test__f_utf_triples_append__works(void **state); +extern void test__f_utf_string_triples_append__works(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_triples_append() */ -extern void test__f_utf_triples_append__parameter_checking(void **state); +extern void test__f_utf_string_triples_append__parameter_checking(void **state); #endif // _TEST__F_utf_triples_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c index 8c1c415..84da244 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_triples_append_all__works(void **state) { +void test__f_utf_string_triples_append_all__works(void **state) { const int length_sources = 2; @@ -54,14 +54,14 @@ void test__f_utf_triples_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_triples_append_all__returns_data_not(void **state) { +void test__f_utf_string_triples_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_triples_t source = f_utf_string_triples_t_initialize; f_utf_string_triples_t destination = f_utf_string_triples_t_initialize; { - const f_status_t status = f_utf_string_triples_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_triple_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -80,7 +80,7 @@ void test__f_utf_triples_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_triples_append_all__parameter_checking(void **state) { +void test__f_utf_string_triples_append_all__parameter_checking(void **state) { const f_utf_string_triples_t data = f_utf_string_triples_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.h index 11ef1e4..5fe8678 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_triples_append_all() */ -extern void test__f_utf_triples_append_all__works(void **state); +extern void test__f_utf_string_triples_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_triples_append_all() */ -extern void test__f_utf_triples_append_all__returns_data_not(void **state); +extern void test__f_utf_string_triples_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_triples_append_all() */ -extern void test__f_utf_triples_append_all__parameter_checking(void **state); +extern void test__f_utf_string_triples_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_triples_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-triples_decimate_by.c deleted file mode 100644 index 06e9eef..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-triples_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_triples_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_triples_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_triples_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-triples_decimate_by.h deleted file mode 100644 index 27cc222..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_triples_decimate_by_h -#define _TEST__F_triples_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_triples_decimate_by() - */ -extern void test__f_utf_triples_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_triples_decimate_by() - */ -extern void test__f_utf_triples_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_triples_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-triples_decrease_by.c deleted file mode 100644 index 3667ef7..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-triples_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_triples_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_triples_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_triples_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-triples_decrease_by.h deleted file mode 100644 index df42dfb..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_triples_decrease_by_h -#define _TEST__F_utf_triples_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_triples_decrease_by() - */ -extern void test__f_utf_triples_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_triples_decrease_by() - */ -extern void test__f_utf_triples_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_triples_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-triples_delete_callback.c new file mode 100644 index 0000000..299a024 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_delete_callback.c @@ -0,0 +1,113 @@ +#include "test-utf.h" +#include "test-utf-triples_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_triples_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t a_char = 'a'; + f_utf_char_t b_char = 'b'; + f_utf_char_t c_char = 'c'; + + f_utf_char_t a_string[2] = { a_char, 0 }; + f_utf_char_t b_string[2] = { b_char, 0 }; + f_utf_char_t c_string[2] = { c_char, 0 }; + + f_utf_string_dynamic_t a = { .string = a_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t b = { .string = b_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t c = { .string = c_string, .used = 0, .size = 1 }; + + f_utf_string_triple_t data = { .a = a, .b = b, .c = c }; + f_utf_string_triple_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_triples_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].a.size = 1; + data_array[0].b.size = 1; + data_array[0].c.size = 1; + + { + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_triples_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].a.size = 1; + data_array[0].b.size = 1; + data_array[0].c.size = 1; + + { + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, false); + will_return(__wrap_f_memory_array_resize, F_okay); + + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_triples_delete_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_triples_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_triples_t datas = f_utf_string_triples_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_triple_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].a.string, &datas.array[0].a.used, &datas.array[0].a.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].b.string, &datas.array[0].b.used, &datas.array[0].b.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].c.string, &datas.array[0].c.used, &datas.array[0].c.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_triples_delete_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.array[0].a.size, 0); + assert_int_equal(datas.array[0].b.size, 0); + assert_int_equal(datas.array[0].c.size, 0); + } + + free((void *) datas.array[0].a.string); + free((void *) datas.array[0].b.string); + free((void *) datas.array[0].c.string); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-triples_delete_callback.h new file mode 100644 index 0000000..7c145c0 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__triples_delete_callback +#define _TEST__F_utf__triples_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_triples_delete_callback() + */ +extern void test__f_utf_string_triples_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_triples_delete_callback() + */ +extern void test__f_utf_string_triples_delete_callback__works(void **state); + +#endif // _TEST__F_utf__triples_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-triples_destroy_callback.c new file mode 100644 index 0000000..8f8e247 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_destroy_callback.c @@ -0,0 +1,113 @@ +#include "test-utf.h" +#include "test-utf-triples_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_triples_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_char_t a_char = 'a'; + f_utf_char_t b_char = 'b'; + f_utf_char_t c_char = 'c'; + + f_utf_char_t a_string[2] = { a_char, 0 }; + f_utf_char_t b_string[2] = { b_char, 0 }; + f_utf_char_t c_string[2] = { c_char, 0 }; + + f_utf_string_dynamic_t a = { .string = a_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t b = { .string = b_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t c = { .string = c_string, .used = 0, .size = 1 }; + + f_utf_string_triple_t data = { .a = a, .b = b, .c = c }; + f_utf_string_triple_t data_array[] = { data }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_triples_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].a.size = 1; + data_array[0].b.size = 1; + data_array[0].c.size = 1; + + { + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_triples_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } + + data_array[0].a.size = 1; + data_array[0].b.size = 1; + data_array[0].c.size = 1; + + { + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, false); + will_return(__wrap_f_memory_array_adjust, F_okay); + + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_triples_destroy_callback(0, 1, (void *) data_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_triples_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_triples_t datas = f_utf_string_triples_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_triple_t), (void **) &datas.array, &datas.used, &datas.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].a.string, &datas.array[0].a.used, &datas.array[0].a.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].b.string, &datas.array[0].b.used, &datas.array[0].b.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].c.string, &datas.array[0].c.used, &datas.array[0].c.size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_triples_destroy_callback(0, length, (void *) datas.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datas.array[0].a.size, 0); + assert_int_equal(datas.array[0].b.size, 0); + assert_int_equal(datas.array[0].c.size, 0); + } + + free((void *) datas.array[0].a.string); + free((void *) datas.array[0].b.string); + free((void *) datas.array[0].c.string); + free((void *) datas.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-triples_destroy_callback.h new file mode 100644 index 0000000..4270758 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__triples_destroy_callback +#define _TEST__F_utf__triples_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_triples_destroy_callback() + */ +extern void test__f_utf_string_triples_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_triples_destroy_callback() + */ +extern void test__f_utf_string_triples_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__triples_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_increase.c b/level_0/f_utf/tests/unit/c/test-utf-triples_increase.c deleted file mode 100644 index 144bf17..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-triples_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_triples_increase__works(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_triples_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_triples_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_triples_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_triples_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_increase.h b/level_0/f_utf/tests/unit/c/test-utf-triples_increase.h deleted file mode 100644 index 937d48f..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_triples_increase_h -#define _TEST__F_utf_triples_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_triples_increase() - */ -extern void test__f_utf_triples_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_triples_increase() - */ -extern void test__f_utf_triples_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_triples_increase() - */ -extern void test__f_utf_triples_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_triples_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-triples_increase_by.c deleted file mode 100644 index f6312af..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-triples_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_triples_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_triples_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_triples_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-triples_increase_by.h deleted file mode 100644 index a9f241b..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_triples_increase_by_h -#define _TEST__F_utf_triples_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_triples_increase_by() - */ -extern void test__f_utf_triples_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_triples_increase_by() - */ -extern void test__f_utf_triples_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_triples_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_resize.c b/level_0/f_utf/tests/unit/c/test-utf-triples_resize.c deleted file mode 100644 index c88ccf1..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-triples_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_triples_resize__works(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_triples_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_triples_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_triples_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_resize.h b/level_0/f_utf/tests/unit/c/test-utf-triples_resize.h deleted file mode 100644 index 632af7c..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_triples_resize_h -#define _TEST__F_utf_triples_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_triples_resize() - */ -extern void test__f_utf_triples_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_triples_resize() - */ -extern void test__f_utf_triples_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_triples_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_adjust.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_adjust.c deleted file mode 100644 index 3806a70..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_adjust.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-tripless_adjust.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_tripless_adjust__works(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_adjust(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_tripless_adjust__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_adjust(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_adjust.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_adjust.h deleted file mode 100644 index d9ed500..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_adjust.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_tripless_adjust_h -#define _TEST__F_utf_tripless_adjust_h - -/** - * Test that the function works. - * - * @see f_utf_string_tripless_adjust() - */ -extern void test__f_utf_tripless_adjust__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_tripless_adjust() - */ -extern void test__f_utf_tripless_adjust__parameter_checking(void **state); - -#endif // _TEST__F_utf_tripless_adjust_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c index 4a678b2..7606394 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_tripless_append__works(void **state) { +void test__f_utf_string_tripless_append__works(void **state) { const int length_sources = 2; @@ -54,14 +54,14 @@ void test__f_utf_tripless_append__works(void **state) { free((void *) destination.array); } -void test__f_utf_tripless_append__returns_data_not(void **state) { +void test__f_utf_string_tripless_append__returns_data_not(void **state) { const int length = 5; f_utf_string_triples_t source = f_utf_string_tripless_t_initialize; f_utf_string_tripless_t destination = f_utf_string_tripless_t_initialize; { - const f_status_t status = f_utf_string_triples_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_triples_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -80,7 +80,7 @@ void test__f_utf_tripless_append__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_tripless_append__parameter_checking(void **state) { +void test__f_utf_string_tripless_append__parameter_checking(void **state) { f_utf_string_triples_t data = f_utf_string_triples_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_append.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_append.h index 7360040..ded84de 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_append.h +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_append.h @@ -15,20 +15,20 @@ * * @see f_utf_string_tripless_append() */ -extern void test__f_utf_tripless_append__works(void **state); +extern void test__f_utf_string_tripless_append__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_tripless_append() */ -extern void test__f_utf_tripless_append__returns_data_not(void **state); +extern void test__f_utf_string_tripless_append__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_tripless_append() */ -extern void test__f_utf_tripless_append__parameter_checking(void **state); +extern void test__f_utf_string_tripless_append__parameter_checking(void **state); #endif // _TEST__F_utf_tripless_append_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c index b840ebb..8b42071 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__f_utf_tripless_append_all__works(void **state) { +void test__f_utf_string_tripless_append_all__works(void **state) { const int length_sources = 2; const int length_sources_set = 2; @@ -80,14 +80,14 @@ void test__f_utf_tripless_append_all__works(void **state) { free((void *) destination.array); } -void test__f_utf_tripless_append_all__returns_data_not(void **state) { +void test__f_utf_string_tripless_append_all__returns_data_not(void **state) { const int length = 5; f_utf_string_tripless_t source = f_utf_string_tripless_t_initialize; f_utf_string_tripless_t destination = f_utf_string_tripless_t_initialize; { - const f_status_t status = f_utf_string_tripless_resize(length, &source); + const f_status_t status = f_memory_array_increase_by(length, sizeof(f_utf_string_triples_t), (void **) &source.array, &source.used, &source.size); assert_int_equal(status, F_okay); assert_int_equal(source.used, 0); @@ -106,7 +106,7 @@ void test__f_utf_tripless_append_all__returns_data_not(void **state) { free((void *) source.array); } -void test__f_utf_tripless_append_all__parameter_checking(void **state) { +void test__f_utf_string_tripless_append_all__parameter_checking(void **state) { const f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize; diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.h index f63192c..22d30de 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.h +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.h @@ -15,20 +15,20 @@ * * @see f_utf_string_tripless_append_all() */ -extern void test__f_utf_tripless_append_all__works(void **state); +extern void test__f_utf_string_tripless_append_all__works(void **state); /** * Test that the function returns F_data_not when asked to copy an empty structure. * * @see f_utf_string_tripless_append_all() */ -extern void test__f_utf_tripless_append_all__returns_data_not(void **state); +extern void test__f_utf_string_tripless_append_all__returns_data_not(void **state); /** * Test that the function correctly fails on invalid parameter. * * @see f_utf_string_tripless_append_all() */ -extern void test__f_utf_tripless_append_all__parameter_checking(void **state); +extern void test__f_utf_string_tripless_append_all__parameter_checking(void **state); #endif // _TEST__F_utf_tripless_append_all_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_decimate_by.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_decimate_by.c deleted file mode 100644 index 211f672..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_decimate_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-tripless_decimate_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_tripless_decimate_by__works(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_tripless_decimate_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_tripless_decimate_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_decimate_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_decimate_by.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_decimate_by.h deleted file mode 100644 index 4bd26db..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_decimate_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_tripless_decimate_by_h -#define _TEST__F_utf_tripless_decimate_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_tripless_decimate_by() - */ -extern void test__f_utf_tripless_decimate_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_tripless_decimate_by() - */ -extern void test__f_utf_tripless_decimate_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_tripless_decimate_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_decrease_by.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_decrease_by.c deleted file mode 100644 index 6470082..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_decrease_by.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "test-utf.h" -#include "test-utf-tripless_decrease_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_tripless_decrease_by__works(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_tripless_decrease_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -void test__f_utf_tripless_decrease_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_decrease_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_decrease_by.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_decrease_by.h deleted file mode 100644 index 2fae35a..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_decrease_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_tripless_decrease_by_h -#define _TEST__F_utf_tripless_decrease_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_tripless_decrease_by() - */ -extern void test__f_utf_tripless_decrease_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_tripless_decrease_by() - */ -extern void test__f_utf_tripless_decrease_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_tripless_decrease_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_delete_callback.c new file mode 100644 index 0000000..361837e --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_delete_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-tripless_delete_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_tripless_delete_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_triple_t data = f_utf_string_triple_t_initialize; + f_utf_string_triple_t data_array[] = { data }; + f_utf_string_triples_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_triples_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_resize, true); + will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_tripless_delete_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_tripless_delete_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_tripless_t datass = f_utf_string_tripless_t_initialize; + + { + f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_triples_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_resize(1, sizeof(f_utf_string_triple_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_tripless_delete_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_delete_callback.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_delete_callback.h new file mode 100644 index 0000000..19c8080 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_delete_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__tripless_delete_callback +#define _TEST__F_utf__tripless_delete_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_tripless_delete_callback() + */ +extern void test__f_utf_string_tripless_delete_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_tripless_delete_callback() + */ +extern void test__f_utf_string_tripless_delete_callback__works(void **state); + +#endif // _TEST__F_utf__tripless_delete_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_destroy_callback.c new file mode 100644 index 0000000..9ffbf9d --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_destroy_callback.c @@ -0,0 +1,57 @@ +#include "test-utf.h" +#include "test-utf-tripless_destroy_callback.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_string_tripless_destroy_callback__fails(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 0; + + f_utf_string_triple_t data = f_utf_string_triple_t_initialize; + f_utf_string_triple_t data_array[] = { data }; + f_utf_string_triples_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_utf_string_triples_t datas_array[] = { datas }; + + { + will_return(__wrap_f_memory_array_adjust, true); + will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); + + const f_status_t status = f_utf_string_tripless_destroy_callback(0, 1, (void *) datas_array); + + assert_int_equal(status, F_status_set_error(F_failure)); + } +} + +void test__f_utf_string_tripless_destroy_callback__works(void **state) { + + mock_unwrap = 0; + mock_unwrap_f_memory = 1; + + const f_number_unsigned_t length = 1; + + f_utf_string_tripless_t datass = f_utf_string_tripless_t_initialize; + + { + f_status_t status = f_memory_array_adjust(length, sizeof(f_utf_string_triples_t), (void **) &datass.array, &datass.used, &datass.size); + assert_int_equal(status, F_okay); + + status = f_memory_array_adjust(1, sizeof(f_utf_string_triple_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size); + assert_int_equal(status, F_okay); + } + + { + const f_status_t status = f_utf_string_tripless_destroy_callback(0, length, (void *) datass.array); + + assert_int_equal(status, F_okay); + assert_int_equal(datass.array[0].size, 0); + } + + free((void *) datass.array); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_destroy_callback.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_destroy_callback.h new file mode 100644 index 0000000..9bb61bc --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_destroy_callback.h @@ -0,0 +1,27 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the array types in the type project. + */ +#ifndef _TEST__F_utf__tripless_destroy_callback +#define _TEST__F_utf__tripless_destroy_callback + +/** + * Test that the function fails. + * + * @see f_utf_string_tripless_destroy_callback() + */ +extern void test__f_utf_string_tripless_destroy_callback__fails(void **state); + +/** + * Test that the function works. + * + * @see f_utf_string_tripless_destroy_callback() + */ +extern void test__f_utf_string_tripless_destroy_callback__works(void **state); + +#endif // _TEST__F_utf__tripless_destroy_callback diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_increase.c deleted file mode 100644 index 326e2d1..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "test-utf.h" -#include "test-utf-tripless_increase.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_tripless_increase__works(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_tripless_increase(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d); - } - - free((void *) data.array); -} - -void test__f_utf_tripless_increase__returns_data_not(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - const f_status_t status = f_utf_string_tripless_increase(length, &data); - - assert_int_equal(status, F_data_not); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_tripless_increase__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_increase(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - free((void *) data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_increase.h deleted file mode 100644 index 5ef208d..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_tripless_increase_h -#define _TEST__F_utf_tripless_increase_h - -/** - * Test that the function works. - * - * @see f_utf_string_tripless_increase() - */ -extern void test__f_utf_tripless_increase__works(void **state); - -/** - * Test that the function returns F_data_not when asked to copy an empty structure. - * - * @see f_utf_string_tripless_increase() - */ -extern void test__f_utf_tripless_increase__returns_data_not(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_tripless_increase() - */ -extern void test__f_utf_tripless_increase__parameter_checking(void **state); - -#endif // _TEST__F_utf_tripless_increase_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase_by.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_increase_by.c deleted file mode 100644 index c9f0b37..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase_by.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "test-utf.h" -#include "test-utf-tripless_increase_by.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_tripless_increase_by__works(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - { - data.used = length; - - const f_status_t status = f_utf_string_tripless_increase_by(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, length); - assert_int_equal(data.size, length * 2); - } - - free((void *) data.array); -} - -void test__f_utf_tripless_increase_by__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_triples_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_increase_by(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase_by.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_increase_by.h deleted file mode 100644 index 946aaf9..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_increase_by.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_tripless_increase_by_h -#define _TEST__F_utf_tripless_increase_by_h - -/** - * Test that the function works. - * - * @see f_utf_string_tripless_increase_by() - */ -extern void test__f_utf_tripless_increase_by__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_tripless_increase_by() - */ -extern void test__f_utf_tripless_increase_by__parameter_checking(void **state); - -#endif // _TEST__F_utf_tripless_increase_by_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_resize.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_resize.c deleted file mode 100644 index b417239..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_resize.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "test-utf.h" -#include "test-utf-tripless_resize.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_utf_tripless_resize__works(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, &data); - - assert_int_equal(status, F_okay); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, length); - } - - free((void *) data.array); -} - -void test__f_utf_tripless_resize__parameter_checking(void **state) { - - const int length = 5; - f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize; - - { - const f_status_t status = f_utf_string_tripless_resize(length, 0); - - assert_int_equal(status, F_status_set_error(F_parameter)); - assert_int_equal(data.used, 0); - assert_int_equal(data.size, 0); - } - - assert_null(data.array); -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_resize.h b/level_0/f_utf/tests/unit/c/test-utf-tripless_resize.h deleted file mode 100644 index 11f726b..0000000 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_resize.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the data types in the utf project. - */ -#ifndef _TEST__F_utf_tripless_resize_h -#define _TEST__F_utf_tripless_resize_h - -/** - * Test that the function works. - * - * @see f_utf_string_tripless_resize() - */ -extern void test__f_utf_tripless_resize__works(void **state); - -/** - * Test that the function correctly fails on invalid parameter. - * - * @see f_utf_string_tripless_resize() - */ -extern void test__f_utf_tripless_resize__parameter_checking(void **state); - -#endif // _TEST__F_utf_tripless_resize_h diff --git a/level_0/f_utf/tests/unit/c/test-utf.c b/level_0/f_utf/tests/unit/c/test-utf.c index 0401e56..3b969f9 100644 --- a/level_0/f_utf/tests/unit/c/test-utf.c +++ b/level_0/f_utf/tests/unit/c/test-utf.c @@ -23,7 +23,7 @@ int main(void) { cmocka_unit_test(test__f_utf_append_assure__works), cmocka_unit_test(test__f_utf_append_assure_nulless__works), cmocka_unit_test(test__f_utf_append_nulless__works), - +/* cmocka_unit_test(test__f_utf_character_is_alphabetic__works), cmocka_unit_test(test__f_utf_character_is_alphabetic_digit__works), cmocka_unit_test(test__f_utf_character_is_alphabetic_numeric__works), @@ -54,95 +54,71 @@ int main(void) { cmocka_unit_test(test__f_utf_character_is_word_dash_plus__strict_is_false), cmocka_unit_test(test__f_utf_character_is_word_dash_plus__strict_is_true), - - cmocka_unit_test(test__f_utf_dynamic_adjust__works), - - cmocka_unit_test(test__f_utf_dynamic_append__works), - cmocka_unit_test(test__f_utf_dynamic_append_assure__works), - cmocka_unit_test(test__f_utf_dynamic_append_assure_nulless__works), - cmocka_unit_test(test__f_utf_dynamic_append_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_decimate_by__works), - cmocka_unit_test(test__f_utf_dynamic_decrease_by__works), - cmocka_unit_test(test__f_utf_dynamic_increase__works), - cmocka_unit_test(test__f_utf_dynamic_increase__returns_data_not), - cmocka_unit_test(test__f_utf_dynamic_increase_by__works), - - cmocka_unit_test(test__f_utf_dynamic_mash__works), - cmocka_unit_test(test__f_utf_dynamic_mash_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_mish__works), - cmocka_unit_test(test__f_utf_dynamic_mish_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_partial_append__works), - cmocka_unit_test(test__f_utf_dynamic_partial_append_assure__works), - cmocka_unit_test(test__f_utf_dynamic_partial_append_assure_nulless__works), - cmocka_unit_test(test__f_utf_dynamic_partial_append_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_partial_mash__works), - cmocka_unit_test(test__f_utf_dynamic_partial_mash_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_partial_mish__works), - cmocka_unit_test(test__f_utf_dynamic_partial_mish_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_partial_prepend__works), - cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure__works), - cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure_nulless__works), - cmocka_unit_test(test__f_utf_dynamic_partial_prepend_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_prepend__works), - cmocka_unit_test(test__f_utf_dynamic_prepend_assure__works), - cmocka_unit_test(test__f_utf_dynamic_prepend_assure_nulless__works), - cmocka_unit_test(test__f_utf_dynamic_prepend_nulless__works), - - cmocka_unit_test(test__f_utf_dynamic_resize__works), - - cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_data_not_stop), - cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_none_eos), - cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_none_stop), - cmocka_unit_test(test__f_utf_dynamic_seek_line__works), - - cmocka_unit_test(test__f_utf_dynamic_seek_line_to__after_newline), - cmocka_unit_test(test__f_utf_dynamic_seek_line_to__before_newline), - cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_data_not_stop), - cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_none_eos), - cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_none_stop), - - cmocka_unit_test(test__f_utf_dynamic_seek_to__after_newline), - cmocka_unit_test(test__f_utf_dynamic_seek_to__before_newline), - cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_data_not_stop), - cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_none_eos), - cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_none_stop), - - cmocka_unit_test(test__f_utf_dynamic_terminate__appends_null), - cmocka_unit_test(test__f_utf_dynamic_terminate__doesnt_append_null), - - cmocka_unit_test(test__f_utf_dynamic_terminate_after__appends_null), - cmocka_unit_test(test__f_utf_dynamic_terminate_after__doesnt_append_null), - - cmocka_unit_test(test__f_utf_dynamics_adjust__works), - cmocka_unit_test(test__f_utf_dynamics_append__works), - cmocka_unit_test(test__f_utf_dynamics_append_all__works), - cmocka_unit_test(test__f_utf_dynamics_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_dynamics_decimate_by__works), - cmocka_unit_test(test__f_utf_dynamics_decrease_by__works), - cmocka_unit_test(test__f_utf_dynamics_increase__works), - cmocka_unit_test(test__f_utf_dynamics_increase__returns_data_not), - cmocka_unit_test(test__f_utf_dynamics_increase_by__works), - cmocka_unit_test(test__f_utf_dynamics_resize__works), - - cmocka_unit_test(test__f_utf_dynamicss_adjust__works), - cmocka_unit_test(test__f_utf_dynamicss_append__works), - cmocka_unit_test(test__f_utf_dynamicss_append__returns_data_not), - cmocka_unit_test(test__f_utf_dynamicss_append_all__works), - cmocka_unit_test(test__f_utf_dynamicss_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_dynamicss_decimate_by__works), - cmocka_unit_test(test__f_utf_dynamicss_decrease_by__works), - cmocka_unit_test(test__f_utf_dynamicss_increase__works), - cmocka_unit_test(test__f_utf_dynamicss_increase__returns_data_not), - cmocka_unit_test(test__f_utf_dynamicss_increase_by__works), - cmocka_unit_test(test__f_utf_dynamicss_resize__works), - +*/ + cmocka_unit_test(test__f_utf_string_dynamic_append__works), + cmocka_unit_test(test__f_utf_string_dynamic_append_assure__works), + cmocka_unit_test(test__f_utf_string_dynamic_append_assure_nulless__works), + cmocka_unit_test(test__f_utf_string_dynamic_append_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_mash__works), + cmocka_unit_test(test__f_utf_string_dynamic_mash_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_mish__works), + cmocka_unit_test(test__f_utf_string_dynamic_mish_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_append__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_append_assure__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_append_assure_nulless__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_append_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_mash__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_mash_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_mish__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_mish_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend_assure__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend_assure_nulless__works), + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_prepend__works), + cmocka_unit_test(test__f_utf_string_dynamic_prepend_assure__works), + cmocka_unit_test(test__f_utf_string_dynamic_prepend_assure_nulless__works), + cmocka_unit_test(test__f_utf_string_dynamic_prepend_nulless__works), + + cmocka_unit_test(test__f_utf_string_dynamic_seek_line__returns_data_not_stop), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line__returns_none_eos), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line__returns_none_stop), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line__works), + + cmocka_unit_test(test__f_utf_string_dynamic_seek_line_to__after_newline), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line_to__before_newline), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line_to__returns_data_not_stop), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line_to__returns_none_eos), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line_to__returns_none_stop), + + cmocka_unit_test(test__f_utf_string_dynamic_seek_to__after_newline), + cmocka_unit_test(test__f_utf_string_dynamic_seek_to__before_newline), + cmocka_unit_test(test__f_utf_string_dynamic_seek_to__returns_data_not_stop), + cmocka_unit_test(test__f_utf_string_dynamic_seek_to__returns_none_eos), + cmocka_unit_test(test__f_utf_string_dynamic_seek_to__returns_none_stop), + + cmocka_unit_test(test__f_utf_string_dynamic_terminate__appends_null), + cmocka_unit_test(test__f_utf_string_dynamic_terminate__doesnt_append_null), + + cmocka_unit_test(test__f_utf_string_dynamic_terminate_after__appends_null), + cmocka_unit_test(test__f_utf_string_dynamic_terminate_after__doesnt_append_null), + + cmocka_unit_test(test__f_utf_string_dynamics_append__works), + cmocka_unit_test(test__f_utf_string_dynamics_append_all__works), + cmocka_unit_test(test__f_utf_string_dynamics_append_all__returns_data_not), + + cmocka_unit_test(test__f_utf_string_dynamicss_append__works), + cmocka_unit_test(test__f_utf_string_dynamicss_append__returns_data_not), + cmocka_unit_test(test__f_utf_string_dynamicss_append_all__works), + cmocka_unit_test(test__f_utf_string_dynamicss_append_all__returns_data_not), +/* cmocka_unit_test(test__f_utf_is_alphabetic__works), cmocka_unit_test(test__f_utf_is_alphabetic_digit__works), cmocka_unit_test(test__f_utf_is_alphabetic_numeric__works), @@ -173,52 +149,24 @@ int main(void) { cmocka_unit_test(test__f_utf_is_word_dash_plus__strict_is_false), cmocka_unit_test(test__f_utf_is_word_dash_plus__strict_is_true), +*/ + cmocka_unit_test(test__f_utf_string_map_multis_append__works), + cmocka_unit_test(test__f_utf_string_map_multis_append_all__works), + cmocka_unit_test(test__f_utf_string_map_multis_append_all__returns_data_not), + + cmocka_unit_test(test__f_utf_string_map_multiss_append__works), + cmocka_unit_test(test__f_utf_string_map_multiss_append__returns_data_not), + cmocka_unit_test(test__f_utf_string_map_multiss_append_all__works), + cmocka_unit_test(test__f_utf_string_map_multiss_append_all__returns_data_not), + + cmocka_unit_test(test__f_utf_string_maps_append__works), + cmocka_unit_test(test__f_utf_string_maps_append_all__works), + cmocka_unit_test(test__f_utf_string_maps_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_map_multis_adjust__works), - cmocka_unit_test(test__f_utf_map_multis_append__works), - cmocka_unit_test(test__f_utf_map_multis_append_all__works), - cmocka_unit_test(test__f_utf_map_multis_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_map_multis_decimate_by__works), - cmocka_unit_test(test__f_utf_map_multis_decrease_by__works), - cmocka_unit_test(test__f_utf_map_multis_increase__works), - cmocka_unit_test(test__f_utf_map_multis_increase__returns_data_not), - cmocka_unit_test(test__f_utf_map_multis_increase_by__works), - cmocka_unit_test(test__f_utf_map_multis_resize__works), - - cmocka_unit_test(test__f_utf_map_multiss_adjust__works), - cmocka_unit_test(test__f_utf_map_multiss_append__works), - cmocka_unit_test(test__f_utf_map_multiss_append__returns_data_not), - cmocka_unit_test(test__f_utf_map_multiss_append_all__works), - cmocka_unit_test(test__f_utf_map_multiss_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_map_multiss_decimate_by__works), - cmocka_unit_test(test__f_utf_map_multiss_decrease_by__works), - cmocka_unit_test(test__f_utf_map_multiss_increase__works), - cmocka_unit_test(test__f_utf_map_multiss_increase__returns_data_not), - cmocka_unit_test(test__f_utf_map_multiss_increase_by__works), - cmocka_unit_test(test__f_utf_map_multiss_resize__works), - - cmocka_unit_test(test__f_utf_maps_adjust__works), - cmocka_unit_test(test__f_utf_maps_append__works), - cmocka_unit_test(test__f_utf_maps_append_all__works), - cmocka_unit_test(test__f_utf_maps_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_maps_decimate_by__works), - cmocka_unit_test(test__f_utf_maps_decrease_by__works), - cmocka_unit_test(test__f_utf_maps_increase__works), - cmocka_unit_test(test__f_utf_maps_increase__returns_data_not), - cmocka_unit_test(test__f_utf_maps_increase_by__works), - cmocka_unit_test(test__f_utf_maps_resize__works), - - cmocka_unit_test(test__f_utf_mapss_adjust__works), - cmocka_unit_test(test__f_utf_mapss_append__works), - cmocka_unit_test(test__f_utf_mapss_append__returns_data_not), - cmocka_unit_test(test__f_utf_mapss_append_all__works), - cmocka_unit_test(test__f_utf_mapss_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_mapss_decimate_by__works), - cmocka_unit_test(test__f_utf_mapss_decrease_by__works), - cmocka_unit_test(test__f_utf_mapss_increase__works), - cmocka_unit_test(test__f_utf_mapss_increase__returns_data_not), - cmocka_unit_test(test__f_utf_mapss_increase_by__works), - cmocka_unit_test(test__f_utf_mapss_resize__works), + cmocka_unit_test(test__f_utf_string_mapss_append__works), + cmocka_unit_test(test__f_utf_string_mapss_append__returns_data_not), + cmocka_unit_test(test__f_utf_string_mapss_append_all__works), + cmocka_unit_test(test__f_utf_string_mapss_append_all__returns_data_not), cmocka_unit_test(test__f_utf_mash__works), cmocka_unit_test(test__f_utf_mash_nulless__works), @@ -231,28 +179,14 @@ int main(void) { cmocka_unit_test(test__f_utf_prepend_assure_nulless__works), cmocka_unit_test(test__f_utf_prepend_nulless__works), - cmocka_unit_test(test__f_utf_triples_adjust__works), - cmocka_unit_test(test__f_utf_triples_append__works), - cmocka_unit_test(test__f_utf_triples_append_all__works), - cmocka_unit_test(test__f_utf_triples_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_triples_decimate_by__works), - cmocka_unit_test(test__f_utf_triples_decrease_by__works), - cmocka_unit_test(test__f_utf_triples_increase__works), - cmocka_unit_test(test__f_utf_triples_increase__returns_data_not), - cmocka_unit_test(test__f_utf_triples_increase_by__works), - cmocka_unit_test(test__f_utf_triples_resize__works), - - cmocka_unit_test(test__f_utf_tripless_adjust__works), - cmocka_unit_test(test__f_utf_tripless_append__works), - cmocka_unit_test(test__f_utf_tripless_append__returns_data_not), - cmocka_unit_test(test__f_utf_tripless_append_all__works), - cmocka_unit_test(test__f_utf_tripless_append_all__returns_data_not), - cmocka_unit_test(test__f_utf_tripless_decimate_by__works), - cmocka_unit_test(test__f_utf_tripless_decrease_by__works), - cmocka_unit_test(test__f_utf_tripless_increase__works), - cmocka_unit_test(test__f_utf_tripless_increase__returns_data_not), - cmocka_unit_test(test__f_utf_tripless_increase_by__works), - cmocka_unit_test(test__f_utf_tripless_resize__works), + cmocka_unit_test(test__f_utf_string_triples_append__works), + cmocka_unit_test(test__f_utf_string_triples_append_all__works), + cmocka_unit_test(test__f_utf_string_triples_append_all__returns_data_not), + + cmocka_unit_test(test__f_utf_string_tripless_append__works), + cmocka_unit_test(test__f_utf_string_tripless_append__returns_data_not), + cmocka_unit_test(test__f_utf_string_tripless_append_all__works), + cmocka_unit_test(test__f_utf_string_tripless_append_all__returns_data_not), cmocka_unit_test(test__f_utf_seek_line__returns_data_not_stop), cmocka_unit_test(test__f_utf_seek_line__returns_none_stop), @@ -268,114 +202,89 @@ int main(void) { cmocka_unit_test(test__f_utf_seek_to__returns_data_not_stop), cmocka_unit_test(test__f_utf_seek_to__returns_none_stop), + cmocka_unit_test(test__f_utf_string_dynamicss_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_dynamicss_destroy_callback__fails), + + cmocka_unit_test(test__f_utf_string_map_multis_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_map_multis_destroy_callback__fails), + + cmocka_unit_test(test__f_utf_string_map_multiss_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_map_multiss_destroy_callback__fails), + + cmocka_unit_test(test__f_utf_string_maps_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_maps_destroy_callback__fails), + + cmocka_unit_test(test__f_utf_string_mapss_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_mapss_destroy_callback__fails), + + cmocka_unit_test(test__f_utf_string_triples_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_triples_destroy_callback__fails), + + cmocka_unit_test(test__f_utf_string_tripless_delete_callback__fails), + cmocka_unit_test(test__f_utf_string_tripless_destroy_callback__fails), + #ifndef _di_level_0_parameter_checking_ cmocka_unit_test(test__f_utf_append__parameter_checking), cmocka_unit_test(test__f_utf_append_assure__parameter_checking), cmocka_unit_test(test__f_utf_append_assure_nulless__parameter_checking), cmocka_unit_test(test__f_utf_append_nulless__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_adjust__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_append__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_append_assure__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_append_assure_nulless__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_append_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_increase__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_increase__returns_data_not), - cmocka_unit_test(test__f_utf_dynamic_increase_by__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_mash__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_mash_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_mish__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_mish_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_partial_append__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_append_assure__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_append_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_partial_mash__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_mash_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_partial_mish__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_mish_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_partial_prepend__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_partial_prepend_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_prepend__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_prepend_assure__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_prepend_assure_nulless__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_prepend_nulless__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_seek_line__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_seek_line_to__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_seek_to__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamic_terminate__parameter_checking), - cmocka_unit_test(test__f_utf_dynamic_terminate_after__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamics_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_append__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_increase__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamics_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_dynamicss_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_append__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_increase__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_dynamicss_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_map_multis_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_append__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_increase__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_map_multis_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_map_multiss_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_append__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_increase__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_map_multiss_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_maps_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_maps_append__parameter_checking), - cmocka_unit_test(test__f_utf_maps_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_maps_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_maps_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_maps_increase__parameter_checking), - cmocka_unit_test(test__f_utf_maps_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_maps_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_mapss_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_append__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_increase__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_mapss_resize__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_append_assure__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_append_assure_nulless__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_append_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_mash__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_mash_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_mish__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_mish_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_append_assure__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_append_assure_nulless__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_append_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_mash__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_mash_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_mish__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_mish_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend_assure__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend_assure_nulless__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_partial_prepend_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_prepend__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_prepend_assure__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_prepend_assure_nulless__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_prepend_nulless__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_seek_line__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_seek_line_to__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_seek_to__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamic_terminate__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamic_terminate_after__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamics_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamics_append_all__parameter_checking), + + cmocka_unit_test(test__f_utf_string_dynamicss_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_dynamicss_append_all__parameter_checking), + + cmocka_unit_test(test__f_utf_string_map_multis_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_map_multis_append_all__parameter_checking), + + cmocka_unit_test(test__f_utf_string_map_multiss_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_map_multiss_append_all__parameter_checking), + + cmocka_unit_test(test__f_utf_string_maps_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_maps_append_all__parameter_checking), + + cmocka_unit_test(test__f_utf_string_mapss_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_mapss_append_all__parameter_checking), cmocka_unit_test(test__f_utf_mash__parameter_checking), cmocka_unit_test(test__f_utf_mash_nulless__parameter_checking), @@ -388,29 +297,41 @@ int main(void) { cmocka_unit_test(test__f_utf_prepend_assure_nulless__parameter_checking), cmocka_unit_test(test__f_utf_prepend_nulless__parameter_checking), - cmocka_unit_test(test__f_utf_triples_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_triples_append__parameter_checking), - cmocka_unit_test(test__f_utf_triples_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_triples_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_triples_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_triples_increase__parameter_checking), - cmocka_unit_test(test__f_utf_triples_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_triples_resize__parameter_checking), - - cmocka_unit_test(test__f_utf_tripless_adjust__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_append__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_append_all__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_decimate_by__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_decrease_by__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_increase__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_increase_by__parameter_checking), - cmocka_unit_test(test__f_utf_tripless_resize__parameter_checking), + cmocka_unit_test(test__f_utf_string_triples_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_triples_append_all__parameter_checking), + + cmocka_unit_test(test__f_utf_string_tripless_append__parameter_checking), + cmocka_unit_test(test__f_utf_string_tripless_append_all__parameter_checking), cmocka_unit_test(test__f_utf_seek_line__parameter_checking), cmocka_unit_test(test__f_utf_seek_line_to__parameter_checking), cmocka_unit_test(test__f_utf_seek_to__parameter_checking), + + // f_utf_string_dynamicss_delete_callback() doesn't use parameter checking. + // f_utf_string_dynamicss_destroy_callback() doesn't use parameter checking. + + // f_utf_string_map_multis_delete_callback() doesn't use parameter checking. + // f_utf_string_map_multis_destroy_callback() doesn't use parameter checking. + + // f_utf_string_map_multiss_delete_callback() doesn't use parameter checking. + // f_utf_string_map_multiss_destroy_callback() doesn't use parameter checking. + + // f_utf_string_maps_delete_callback() doesn't use parameter checking. + // f_utf_string_maps_destroy_callback() doesn't use parameter checking. + + // f_utf_string_mapss_delete_callback() doesn't use parameter checking. + // f_utf_string_mapss_destroy_callback() doesn't use parameter checking. + + // f_utf_string_triples_delete_callback() doesn't use parameter checking. + // f_utf_string_triples_destroy_callback() doesn't use parameter checking. + + // f_utf_string_triples_delete_callback() doesn't use parameter checking. + // f_utf_string_triples_destroy_callback() doesn't use parameter checking. + + // f_utf_string_tripless_delete_callback() doesn't use parameter checking. + // f_utf_string_tripless_destroy_callback() doesn't use parameter checking. #endif // _di_level_0_parameter_checking_ }; diff --git a/level_0/f_utf/tests/unit/c/test-utf.h b/level_0/f_utf/tests/unit/c/test-utf.h index 717b92b..a5ecd13 100644 --- a/level_0/f_utf/tests/unit/c/test-utf.h +++ b/level_0/f_utf/tests/unit/c/test-utf.h @@ -23,7 +23,7 @@ #include // Mock includes. -//#include "mock-utf.h" +#include "mock-utf.h" // Data includes. #include "data-utf.h" @@ -58,15 +58,10 @@ #include "test-utf-character_is_word_dash.h" #include "test-utf-character_is_word_dash_plus.h" #include "test-utf-character_is_zero_width.h" -#include "test-utf-dynamic_adjust.h" #include "test-utf-dynamic_append.h" #include "test-utf-dynamic_append_assure.h" #include "test-utf-dynamic_append_assure_nulless.h" #include "test-utf-dynamic_append_nulless.h" -#include "test-utf-dynamic_decimate_by.h" -#include "test-utf-dynamic_decrease_by.h" -#include "test-utf-dynamic_increase.h" -#include "test-utf-dynamic_increase_by.h" #include "test-utf-dynamic_mash.h" #include "test-utf-dynamic_mash_nulless.h" #include "test-utf-dynamic_mish.h" @@ -87,28 +82,19 @@ #include "test-utf-dynamic_prepend_assure.h" #include "test-utf-dynamic_prepend_assure_nulless.h" #include "test-utf-dynamic_prepend_nulless.h" -#include "test-utf-dynamic_resize.h" #include "test-utf-dynamic_seek_line.h" #include "test-utf-dynamic_seek_line_to.h" #include "test-utf-dynamic_seek_to.h" #include "test-utf-dynamic_terminate.h" #include "test-utf-dynamic_terminate_after.h" -#include "test-utf-dynamics_adjust.h" #include "test-utf-dynamics_append.h" #include "test-utf-dynamics_append_all.h" -#include "test-utf-dynamics_decimate_by.h" -#include "test-utf-dynamics_decrease_by.h" -#include "test-utf-dynamics_increase.h" -#include "test-utf-dynamics_increase_by.h" -#include "test-utf-dynamics_resize.h" -#include "test-utf-dynamicss_adjust.h" +#include "test-utf-dynamics_delete_callback.h" +#include "test-utf-dynamics_destroy_callback.h" #include "test-utf-dynamicss_append.h" #include "test-utf-dynamicss_append_all.h" -#include "test-utf-dynamicss_decimate_by.h" -#include "test-utf-dynamicss_decrease_by.h" -#include "test-utf-dynamicss_increase.h" -#include "test-utf-dynamicss_increase_by.h" -#include "test-utf-dynamicss_resize.h" +#include "test-utf-dynamicss_delete_callback.h" +#include "test-utf-dynamicss_destroy_callback.h" #include "test-utf-is_alphabetic.h" #include "test-utf-is_alphabetic_digit.h" #include "test-utf-is_alphabetic_numeric.h" @@ -134,38 +120,22 @@ #include "test-utf-is_word_dash.h" #include "test-utf-is_word_dash_plus.h" #include "test-utf-is_zero_width.h" -#include "test-utf-map_multis_adjust.h" #include "test-utf-map_multis_append.h" #include "test-utf-map_multis_append_all.h" -#include "test-utf-map_multis_decimate_by.h" -#include "test-utf-map_multis_decrease_by.h" -#include "test-utf-map_multis_increase.h" -#include "test-utf-map_multis_increase_by.h" -#include "test-utf-map_multis_resize.h" -#include "test-utf-map_multiss_adjust.h" +#include "test-utf-map_multis_delete_callback.h" +#include "test-utf-map_multis_destroy_callback.h" #include "test-utf-map_multiss_append.h" #include "test-utf-map_multiss_append_all.h" -#include "test-utf-map_multiss_decimate_by.h" -#include "test-utf-map_multiss_decrease_by.h" -#include "test-utf-map_multiss_increase.h" -#include "test-utf-map_multiss_increase_by.h" -#include "test-utf-map_multiss_resize.h" -#include "test-utf-maps_adjust.h" +#include "test-utf-map_multiss_delete_callback.h" +#include "test-utf-map_multiss_destroy_callback.h" #include "test-utf-maps_append.h" #include "test-utf-maps_append_all.h" -#include "test-utf-maps_decimate_by.h" -#include "test-utf-maps_decrease_by.h" -#include "test-utf-maps_increase.h" -#include "test-utf-maps_increase_by.h" -#include "test-utf-maps_resize.h" -#include "test-utf-mapss_adjust.h" +#include "test-utf-maps_delete_callback.h" +#include "test-utf-maps_destroy_callback.h" #include "test-utf-mapss_append.h" #include "test-utf-mapss_append_all.h" -#include "test-utf-mapss_decimate_by.h" -#include "test-utf-mapss_decrease_by.h" -#include "test-utf-mapss_increase.h" -#include "test-utf-mapss_increase_by.h" -#include "test-utf-mapss_resize.h" +#include "test-utf-mapss_delete_callback.h" +#include "test-utf-mapss_destroy_callback.h" #include "test-utf-mash.h" #include "test-utf-mash_nulless.h" #include "test-utf-mish.h" @@ -177,22 +147,14 @@ #include "test-utf-seek_line.h" #include "test-utf-seek_line_to.h" #include "test-utf-seek_to.h" -#include "test-utf-triples_adjust.h" #include "test-utf-triples_append.h" #include "test-utf-triples_append_all.h" -#include "test-utf-triples_decimate_by.h" -#include "test-utf-triples_decrease_by.h" -#include "test-utf-triples_increase.h" -#include "test-utf-triples_increase_by.h" -#include "test-utf-triples_resize.h" -#include "test-utf-tripless_adjust.h" +#include "test-utf-triples_delete_callback.h" +#include "test-utf-triples_destroy_callback.h" #include "test-utf-tripless_append.h" #include "test-utf-tripless_append_all.h" -#include "test-utf-tripless_decimate_by.h" -#include "test-utf-tripless_decrease_by.h" -#include "test-utf-tripless_increase.h" -#include "test-utf-tripless_increase_by.h" -#include "test-utf-tripless_resize.h" +#include "test-utf-tripless_delete_callback.h" +#include "test-utf-tripless_destroy_callback.h" #ifdef __cplusplus extern "C" { diff --git a/level_1/fl_utf_file/c/private-utf_file.c b/level_1/fl_utf_file/c/private-utf_file.c index 5f8b63f..73fc93c 100644 --- a/level_1/fl_utf_file/c/private-utf_file.c +++ b/level_1/fl_utf_file/c/private-utf_file.c @@ -122,9 +122,7 @@ extern "C" { width = macro_f_utf_char_t_width(string[*written + i]); width_written = width; - if (*written + width > write_max) { - return F_complete_not_utf_stop; - } + if (*written + width > write_max) return F_complete_not_utf_stop; buffer_write[used] = macro_f_utf_char_t_to_char_1(string[*written + i]); @@ -132,6 +130,7 @@ extern "C" { if (used == write_size) { width_written = 1; used += 1; + break; } @@ -141,6 +140,7 @@ extern "C" { if (used + 2 > write_size) { width_written = 2; used += 2; + break; } @@ -150,6 +150,7 @@ extern "C" { if (used + 3 > write_size) { width_written = 3; used += 3; + break; } @@ -161,10 +162,7 @@ extern "C" { } // for size_write = write(file.id, buffer_write, used); - - if (!size_write) { - return F_okay_stop; - } + if (!size_write) return F_okay_stop; if (size_write < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); diff --git a/level_1/fl_utf_file/c/utf_file.c b/level_1/fl_utf_file/c/utf_file.c index f4c215c..cc72e25 100644 --- a/level_1/fl_utf_file/c/utf_file.c +++ b/level_1/fl_utf_file/c/utf_file.c @@ -11,47 +11,37 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (file.id < 0) { - return F_status_set_error(F_file); - } - - if (!file.id) { - return F_status_set_error(F_file_closed); - } - - f_status_t status = F_okay; + if (file.id < 0) return F_status_set_error(F_file); + if (!file.id) return F_status_set_error(F_file_closed); ssize_t size_read = 0; uint8_t width = 0; - int8_t width_last = -1; - f_char_t buffer_read[file.size_read]; - f_char_t buffer_char[4] = { 0, 0, 0, 0 }; + { + int8_t width_last = -1; + f_status_t status = F_okay; - memset(&buffer_read, 0, sizeof(file.size_read)); + f_char_t buffer_read[file.size_read]; + f_char_t buffer_char[4] = { 0, 0, 0, 0 }; - while ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { + memset(&buffer_read, 0, sizeof(file.size_read)); - if (destination->used + size_read > destination->size) { - if (destination->size + size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } + while ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { - macro_f_utf_string_dynamic_t_resize(status, (*destination), destination->size + size_read); + status = f_memory_array_increase_by(size_read, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - } - private_fl_utf_file_process_read_buffer(buffer_read, size_read, destination, buffer_char, &width, &width_last); - } // while + private_fl_utf_file_process_read_buffer(buffer_read, size_read, destination, buffer_char, &width, &width_last); + } // while + } if (!size_read) { - if (width != 0) { - return F_status_set_error(F_complete_not_utf_eof); - } + if (width != 0) return F_status_set_error(F_complete_not_utf_eof); return F_okay_eof; } - else if (size_read < 0) { + + if (size_read < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); if (errno == EBADF) return F_status_set_error(F_file_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -62,9 +52,8 @@ extern "C" { return F_status_set_error(F_failure); } - else if (width != 0) { - return F_status_set_error(F_complete_not_utf_stop); - } + + if (width != 0) return F_status_set_error(F_complete_not_utf_stop); return F_okay; } @@ -91,26 +80,19 @@ extern "C" { memset(&buffer_read, 0, sizeof(file.size_read)); if ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { - if (destination->used + size_read > destination->size) { - if (destination->size + size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_utf_string_dynamic_t_resize(status, (*destination), destination->size + size_read); - if (F_status_is_error(status)) return status; - } + status = f_memory_array_increase_by(size_read, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(status)) return status; private_fl_utf_file_process_read_buffer(buffer_read, size_read, destination, buffer_char, &width, &width_last); } if (!size_read) { - if (width) { - return F_status_set_error(F_complete_not_utf_eof); - } + if (width) return F_status_set_error(F_complete_not_utf_eof); return F_okay_eof; } - else if (size_read < 0) { + + if (size_read < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); if (errno == EBADF) return F_status_set_error(F_file_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -121,9 +103,8 @@ extern "C" { return F_status_set_error(F_failure); } - else if (width != 0) { - return F_status_set_error(F_complete_not_utf_stop); - } + + if (width != 0) return F_status_set_error(F_complete_not_utf_stop); return F_okay; } @@ -135,13 +116,8 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (file.id < 0) { - return F_status_set_error(F_file); - } - - if (!file.id) { - return F_status_set_error(F_file_closed); - } + if (file.id < 0) return F_status_set_error(F_file); + if (!file.id) return F_status_set_error(F_file_closed); f_status_t status = F_okay; @@ -163,26 +139,19 @@ extern "C" { while (buffer_count < total && (size_read = read(file.id, buffer_read, buffer_size)) > 0) { - if (destination->used + size_read > destination->size) { - if (destination->size + size_read > F_string_t_size_d) { - return F_status_set_error(F_string_too_large); - } - - macro_f_utf_string_dynamic_t_resize(status, (*destination), destination->size + size_read); - if (F_status_is_error(status)) return status; - } + status = f_memory_array_increase_by(size_read, sizeof(f_utf_char_t), (void **) &destination->string, &destination->used, &destination->size); + if (F_status_is_error(status)) return status; private_fl_utf_file_process_read_buffer(buffer_read, size_read, destination, buffer_char, &width, &width_last); } // while if (!size_read) { - if (width != 0) { - return F_status_set_error(F_complete_not_utf_eof); - } + if (width != 0) return F_status_set_error(F_complete_not_utf_eof); return F_okay_eof; } - else if (size_read < 0) { + + if (size_read < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); if (errno == EBADF) return F_status_set_error(F_file_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); @@ -193,9 +162,8 @@ extern "C" { return F_status_set_error(F_failure); } - else if (width != 0) { - return F_status_set_error(F_complete_not_utf_stop); - } + + if (width != 0) return F_status_set_error(F_complete_not_utf_stop); return F_okay; } @@ -207,13 +175,8 @@ extern "C" { if (!file.size_write) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id < 0) { - return F_status_set_error(F_file); - } - - if (!file.id) { - return F_status_set_error(F_file_closed); - } + if (file.id < 0) return F_status_set_error(F_file); + if (!file.id) return F_status_set_error(F_file_closed); if (!destination.used) { *written = 0; @@ -224,9 +187,7 @@ extern "C" { const f_status_t status = private_fl_utf_file_write_until(file, destination.string, destination.used, written); if (F_status_is_error(status)) return status; - if (status == F_okay && *written == destination.used) { - return F_okay_eos; - } + if (status == F_okay && *written == destination.used) return F_okay_eos; return status; } @@ -238,13 +199,8 @@ extern "C" { if (!file.size_write) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id < 0) { - return F_status_set_error(F_file); - } - - if (!file.id) { - return F_status_set_error(F_file_closed); - } + if (file.id < 0) return F_status_set_error(F_file); + if (!file.id) return F_status_set_error(F_file_closed); if (!destination.used) { *written = 0; @@ -261,9 +217,7 @@ extern "C" { const f_status_t status = private_fl_utf_file_write_until(file, destination.string, write_max, written); if (F_status_is_error(status)) return status; - if (status == F_okay && *written == destination.used) { - return F_okay_eos; - } + if (status == F_okay && *written == destination.used) return F_okay_eos; return status; } @@ -275,13 +229,8 @@ extern "C" { if (!file.size_write) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id < 0) { - return F_status_set_error(F_file); - } - - if (!file.id) { - return F_status_set_error(F_file_closed); - } + if (file.id < 0) return F_status_set_error(F_file); + if (!file.id) return F_status_set_error(F_file_closed); if (!destination.used || !total) { *written = 0; @@ -298,9 +247,7 @@ extern "C" { const f_status_t status = private_fl_utf_file_write_until(file, destination.string, write_max, written); if (F_status_is_error(status)) return status; - if (status == F_okay && *written == destination.used) { - return F_okay_eos; - } + if (status == F_okay && *written == destination.used) return F_okay_eos; return status; } @@ -313,13 +260,8 @@ extern "C" { if (range.start >= destination.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id < 0) { - return F_status_set_error(F_file); - } - - if (!file.id) { - return F_status_set_error(F_file_closed); - } + if (file.id < 0) return F_status_set_error(F_file); + if (!file.id) return F_status_set_error(F_file_closed); if (!destination.used) { *written = 0;