The FSS Extended should support one or more Content per Object.
All others support the same number of Objects as Content (not referring to nested Content).
The error and error message when this is and is not correctly being handled.
The correct detection needs to count based on sub locations rather than locations.
Remove now pointless and misleading checks.
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used || main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used) {
if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_object_e].values.used) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_content_e].values.used) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_list_write_parameter_partial_e].result == f_console_result_none_e) {
+ if (main->parameters.array[fss_basic_list_write_parameter_object_e].locations_sub.used != main->parameters.array[fss_basic_list_write_parameter_content_e].locations_sub.used && main->parameters.array[fss_basic_list_write_parameter_partial_e].result == f_console_result_none_e) {
fss_basic_list_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
}
}
else if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_basic_list_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_list_write_parameter_content_e].values.used) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_basic_list_write_parameter_partial_e].locations.used) {
+ if (!main->parameters.array[fss_basic_list_write_parameter_partial_e].locations.used) {
fss_basic_list_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used || main->parameters.array[fss_basic_write_parameter_content_e].locations.used) {
if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_write_parameter_object_e].values.used) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_write_parameter_content_e].values.used) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_basic_write_parameter_object_e].locations.used != main->parameters.array[fss_basic_write_parameter_content_e].locations.used && main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_none_e) {
+ if (main->parameters.array[fss_basic_write_parameter_object_e].locations_sub.used != main->parameters.array[fss_basic_write_parameter_content_e].locations_sub.used && main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_none_e) {
fss_basic_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
}
}
else if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_basic_write_parameter_content_e].locations.used != main->parameters.array[fss_basic_write_parameter_content_e].values.used) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_basic_write_parameter_partial_e].locations.used) {
+ if (!main->parameters.array[fss_basic_write_parameter_partial_e].locations.used) {
fss_basic_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used || main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used) {
if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters.array[fss_embedded_list_write_parameter_partial_e].result == f_console_result_none_e) {
+ if (main->parameters.array[fss_embedded_list_write_parameter_object_e].locations_sub.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].locations_sub.used && main->parameters.array[fss_embedded_list_write_parameter_partial_e].result == f_console_result_none_e) {
fss_embedded_list_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
}
}
else if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_embedded_list_write_parameter_partial_e].locations.used) {
+ if (!main->parameters.array[fss_embedded_list_write_parameter_partial_e].locations.used) {
fss_embedded_list_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used || main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used) {
if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_object_e].values.used) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_content_e].values.used) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_list_write_parameter_partial_e].result == f_console_result_none_e) {
+ if (main->parameters.array[fss_extended_list_write_parameter_object_e].locations_sub.used != main->parameters.array[fss_extended_list_write_parameter_content_e].locations_sub.used && main->parameters.array[fss_extended_list_write_parameter_partial_e].result == f_console_result_none_e) {
fss_extended_list_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
}
}
else if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_extended_list_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_list_write_parameter_content_e].values.used) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_extended_list_write_parameter_partial_e].locations.used) {
+ if (!main->parameters.array[fss_extended_list_write_parameter_partial_e].locations.used) {
fss_extended_list_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_extended_write_parameter_object_e].locations.used || main->parameters.array[fss_extended_write_parameter_content_e].locations.used) {
if (main->parameters.array[fss_extended_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_extended_write_parameter_object_e].locations.used != main->parameters.array[fss_extended_write_parameter_object_e].values.used) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_write_parameter_content_e].values.used) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_extended_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_none_e) {
- fss_extended_write_error_parameter_at_least_once(main);
+ if (main->parameters.array[fss_extended_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_extended_write_parameter_content_e].locations_sub.used && main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_none_e) {
+ fss_extended_write_error_parameter_same_times_at_least_print(main);
status = F_status_set_error(F_parameter);
}
else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used && main->parameters.array[fss_extended_write_parameter_partial_e].locations.used) {
}
}
else if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_extended_write_parameter_content_e].locations.used != main->parameters.array[fss_extended_write_parameter_content_e].values.used) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_extended_write_parameter_partial_e].locations.used) {
- fss_extended_write_error_parameter_at_least_once(main);
+ if (!main->parameters.array[fss_extended_write_parameter_partial_e].locations.used) {
+ fss_extended_write_error_parameter_same_times_at_least_print(main);
status = F_status_set_error(F_parameter);
}
}
extern "C" {
#endif
-#ifndef _di_fss_extended_write_error_parameter_at_least_once_print_
- void fss_extended_write_error_parameter_at_least_once(fll_program_data_t * const main) {
+#ifndef _di_fss_extended_write_error_parameter_same_times_at_least_print_
+ void fss_extended_write_error_parameter_same_times_at_least_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
flockfile(main->error.to.stream);
fl_print_format("%r%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[' parameter at least the same number of times as the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
-#endif // _di_fss_extended_write_error_parameter_at_least_once_print_
+#endif // _di_fss_extended_write_error_parameter_same_times_at_least_print_
#ifndef _di_fss_extended_write_error_parameter_value_missing_print_
void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
#endif
/**
- * Print an message about the object and content parameters not being specified the correct number of times.
+ * Print an error message about the object and content parameters not being specified at least the same number of times when partial is not requested.
*
* @param main
* The main program data.
* F_none on success.
* F_failure (with error bit) for any other failure.
*/
-#ifndef _di_fss_extended_write_error_parameter_at_least_once_print_
- void fss_extended_write_error_parameter_at_least_once(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_write_error_parameter_at_least_once_print_
+#ifndef _di_fss_extended_write_error_parameter_same_times_at_least_print_
+ void fss_extended_write_error_parameter_same_times_at_least_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
+#endif // _di_fss_extended_write_error_parameter_same_times_at_least_print_
/**
* Print an message about a parameter missing a value.
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used || main->parameters.array[fss_payload_write_parameter_content_e].locations.used) {
if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) {
+ if (main->parameters.array[fss_payload_write_parameter_object_e].locations_sub.used != main->parameters.array[fss_payload_write_parameter_content_e].locations_sub.used && main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) {
fss_payload_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}
}
}
else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) {
+ if (!main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) {
fss_payload_write_error_parameter_same_times_print(main);
status = F_status_set_error(F_parameter);
}