The interrupt function behavior changed and the ampersand should not be passed now.
This is causing a double reference bug.
Explicitly allocate a small amount of memory for console parameters for the default allocation step.
Rename fll_program_standard_signal_state() to fll_program_standard_signal_handle().
Update fll_program_standard_signal_handle() to follow the new handle structure.
Reduce the first and last line functions and function calls.
I've decided to make some more initial assumptions to simplify the code.
Always print the first and last line to message.
This is a behavioral change.
I do not think the first and last line should be printed to error anymore.
This change simplifies the logic significantly.
Add the first printed check flag.
Update print functions.
Update file structure.
Update file documentation comments.
The iki_read and fss_write have more work to do.
Once that is done I need to resume working on Featureless Make.
* For a UTF-8 friendly allocation step, set to at least 4.
*
* F_iki_default_allocation_*:
- * - large: The large allocation size.
- * - small: The small allocation size, in particular used for allocation iki strings.
+ * - console: An allocation step used for small buffers specifically for console parameter.
+ * - large: The large allocation size.
+ * - small: The small allocation size, in particular used for allocation iki strings.
*/
#ifndef _di_f_iki_default_d_
- #define F_iki_default_allocation_large_d F_memory_default_allocation_large_d
- #define F_iki_default_allocation_small_d 8
+ #define F_iki_default_allocation_console_d 8
+ #define F_iki_default_allocation_large_d F_memory_default_allocation_large_d
+ #define F_iki_default_allocation_small_d 8
#endif // _di_f_iki_default_d_
/**
for (;; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (; range->start <= range->stop && range->start < content.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < content.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < object.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < object.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < content.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = destination_used;
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < object.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < object.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = destination_used;
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < content.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = destination_used;
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < object.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
while (range->start <= range->stop && range->start < object.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = destination_used;
for (; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
for (; destination_range.start < destination->used; ++destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
for (destination_range.start = destination->used - 1; destination_range.start > 0; --destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (buffer.string[range->start] == f_fss_placeholder_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (; range->start <= range->stop && range->start < object.used; ) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (; range->start <= range->stop && range->start < object.used; ++range->start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) break;
}
for (i = input_start + 1; i <= range->stop && i < object.used; ++i) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = used_start;
for (; destination_range.start < destination->used; ++destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = used_start;
for (++destination_range.start; destination_range.start < destination->used; ++destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = used_start;
for (destination_range.start = destination->used - 1; destination_range.start > front; --destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = used_start;
for (; destination_range.start > front; --destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = used_start;
for (destination_range.start = front; destination_range.start < rear; ++destination_range.start) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) {
destination->used = used_start;
for (; i < content.used && i + F_fss_default_block_size_normal_d < content.used; i += F_fss_default_block_size_normal_d) {
if (state->interrupt) {
- state->interrupt((void *) &state, 0);
+ state->interrupt((void *) state, 0);
if (F_status_set_fine(state->status) == F_interrupt) return;
}
}
#endif // !defined(_di_fll_program_print_help_option_) || !defined(_di_fll_program_print_help_option_standard_)
-#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const main) {
if (!main || main->signal.id == -1) return 0;
return 0;
}
-#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
#if !defined(_di_fll_program_parameter_process_context_) || !defined(_di_fll_program_parameter_process_empty_)
void private_fll_program_parameter_process_empty(f_color_context_t * const context, f_color_set_t * const sets[]) {
* @see f_signal_read()
*
* @see fll_program_standard_signal_received()
- * @see fll_program_standard_signal_state()
+ * @see fll_program_standard_signal_handle()
*/
-#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
/**
* Private implementation of fll_program_parameter_process_empty().
}
#endif // _di_fll_program_standard_signal_received_
-#ifndef _di_fll_program_standard_signal_state_
- f_status_t fll_program_standard_signal_state(void * const state, void * const internal) {
+#ifndef _di_fll_program_standard_signal_handle_
+ void fll_program_standard_signal_handle(void * const void_state, void * const internal) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!void_state) return;
+ #endif // _di_level_2_parameter_checking_
- if (!state) return F_interrupt_not;
+ f_state_t * const state = (f_state_t *) void_state;
- f_state_t *state_ptr = (f_state_t *) state;
- if (!state_ptr->custom) return F_interrupt_not;
+ if (!state->custom) {
+ state->status = F_interrupt_not;
- fll_program_data_t *custom = (fll_program_data_t *) state_ptr->custom;
+ return;
+ }
- custom->signal_received = private_fll_program_standard_signal_received(custom);
+ fll_program_data_t * const main = (fll_program_data_t *) state->custom;
- if (custom->signal_received == F_signal_abort || custom->signal_received == F_signal_broken_pipe || custom->signal_received == F_signal_hangup || custom->signal_received == F_signal_interrupt || custom->signal_received == F_signal_quit || custom->signal_received == F_signal_termination) {
- return F_status_set_error(F_interrupt);
- }
+ main->signal_received = private_fll_program_standard_signal_received(main);
- return F_interrupt_not;
+ if (main->signal_received == F_signal_abort || main->signal_received == F_signal_broken_pipe || main->signal_received == F_signal_hangup || main->signal_received == F_signal_interrupt || main->signal_received == F_signal_quit || main->signal_received == F_signal_termination) {
+ state->status = F_status_set_error(F_interrupt);
+ }
+ else {
+ state->status = F_interrupt_not;
+ }
}
-#endif // _di_fll_program_standard_signal_state_
+#endif // _di_fll_program_standard_signal_handle_
#ifdef __cplusplus
} // extern "C"
*
* When constructing the f_state_t variable, a fll_program_data_t pointer must be passed into the f_state_t.custom variable.
* This requires the state.custom variable to be of type (fll_program_data_t *).
- * @param internal
- * Not used.
+ * This must not be NULL.
*
- * @return
- * F_interrupt_not if not interrupted.
+ * This alters state.status:
+ * F_interrupt_not if not interrupted.
*
- * F_interrupt (with error bit) if interrupted.
+ * F_interrupt (with error bit) if interrupted.
+ * @param internal
+ * Not used.
*
* @see fll_program_standard_signal_received()
*/
-#ifndef _di_fll_program_standard_signal_state_
- extern f_status_t fll_program_standard_signal_state(void * const state, void * const internal);
-#endif // _di_fll_program_standard_signal_state_
+#ifndef _di_fll_program_standard_signal_handle_
+ extern void fll_program_standard_signal_handle(void * const state, void * const internal);
+#endif // _di_fll_program_standard_signal_handle_
#ifdef __cplusplus
} // extern "C"
#ifndef _di_fll_program_print_error_missing_file_
f_status_t fll_program_print_error_missing_file(const fl_print_t print) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_missing_variable_not_zero_
f_status_t fll_program_print_error_missing_variable_not_zero(const fl_print_t print, const f_string_static_t variable) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_
f_status_t fll_program_print_error_parameter_both_specified_same_amount(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t name_1, const f_string_static_t name_2) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_without_
f_status_t fll_program_print_error_parameter_both_specified_same_amount_without(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t symbol_3, const f_string_static_t name_1, const f_string_static_t name_2, const f_string_static_t name_3) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_
f_status_t fll_program_print_error_parameter_cannot_use_with(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t name_1, const f_string_static_t name_2) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_without_
f_status_t fll_program_print_error_parameter_cannot_use_with_without(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t symbol_3, const f_string_static_t name_1, const f_string_static_t name_2, const f_string_static_t name_3) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_xor_
f_status_t fll_program_print_error_parameter_cannot_use_with_xor(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t symbol_3, const f_string_static_t name_1, const f_string_static_t name_2, const f_string_static_t name_3) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_integer_not_
f_status_t fll_program_print_error_parameter_integer_not(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_integer_not_negative_
f_status_t fll_program_print_error_parameter_integer_not_negative(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_integer_not_positive_
f_status_t fll_program_print_error_parameter_integer_not_positive(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_missing_value_
f_status_t fll_program_print_error_parameter_missing_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_missing_value_requires_amount_
f_status_t fll_program_print_error_parameter_missing_value_requires_amount(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t amount) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_must_specify_once_
f_status_t fll_program_print_error_parameter_must_specify_once(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_must_specify_once_value_
f_status_t fll_program_print_error_parameter_must_specify_once_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_process_
f_status_t fll_program_print_error_parameter_process(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_range_start_before_stop_
f_status_t fll_program_print_error_parameter_range_start_before_stop(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value_start, const f_string_static_t value_stop) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_parameter_value_too_long_
f_status_t fll_program_print_error_parameter_value_too_long(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_pipe_invalid_form_feed_
f_status_t fll_program_print_error_pipe_invalid_form_feed(const fl_print_t print) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_pipe_missing_content_
f_status_t fll_program_print_error_pipe_missing_content(const fl_print_t print) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fll_program_print_error_pipe_object_without_content_
f_status_t fll_program_print_error_pipe_object_without_content(const fl_print_t print) {
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
f_file_stream_lock(print.to);
f_status_t status = F_none;
+ setting->state.step_small = byte_dump_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = byte_dump_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = byte_dump_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = byte_dump_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
#endif // _di_byte_dump_program_name_s_
/**
+ * The program defines.
+ *
+ * byte_dump_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
+ */
+#ifndef _di_byte_dump_d_
+ #define byte_dump_allocation_console_d 4
+ #define byte_dump_allocation_large_d 256
+ #define byte_dump_allocation_small_d 16
+ #define byte_dump_signal_check_d 20000
+#endif // _di_byte_dump_d_
+
+/**
* The program strings for printing.
*/
#ifndef _di_byte_dump_print_s_
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = control_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = control_write_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
#endif // _di_control_program_name_s_
/**
+ * The program defines.
+ *
+ * control_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
+ */
+#ifndef _di_control_d_
+ #define control_allocation_console_d 4
+ #define control_allocation_large_d 256
+ #define control_allocation_small_d 16
+ #define control_signal_check_d 20000
+#endif // _di_control_d_
+
+/**
* The main program parameters.
*/
#ifndef _di_control_parameter_d_
f_status_t status = F_none;
+ setting->state.step_small = control_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = control_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
if (F_status_is_error(status)) return status;
}
- const f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ const f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_static_t contents_array[main->parameters.remaining.used];
f_string_statics_t contents = macro_f_string_statics_t_initialize(contents_array, 0, main->parameters.remaining.used);
}
{
- f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_range_t range_packet = macro_f_string_range_t_initialize2(data->cache.large.used);
status = fll_fss_basic_list_read(data->cache.large, state, &range_packet, &data->cache.packet_objects, &data->cache.packet_contents, &data->cache.delimits, 0, 0);
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = controller_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = controller_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
#endif // _di_controller_program_version_s_
/**
+ * The program defines.
+ *
+ * controller_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
+ */
+#ifndef _di_controller_d_
+ #define controller_allocation_console_d 4
+ #define controller_allocation_large_d 256
+ #define controller_allocation_small_d 16
+ #define controller_signal_check_d 20000
+#endif // _di_controller_d_
+
+/**
* The main program parameters.
*/
#ifndef _di_controller_parameter_d_
f_status_t status = F_none;
+ setting->state.step_small = controller_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = controller_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
{
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
f_string_range_t range = content_range;
status = fll_fss_extended_read(cache->buffer_file, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
if (F_status_is_error_not(status)) {
if (cache->buffer_file.used) {
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
{
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
f_string_range_t range = content_range;
status = fll_fss_extended_read(cache->buffer_file, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
f_status_t status = F_none;
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
f_array_length_t i = 0;
f_status_t status = F_none;
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_item.used);
f_array_length_t last = 0;
if (cache->buffer_file.used) {
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
f_string_range_t range2 = f_string_range_t_initialize;
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
- f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
status = fll_fss_extended_read(cache->buffer_item, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
if (F_status_is_error_not(*status)) {
f_string_range_t range = macro_f_string_range_t_initialize2(buffer.used);
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
*status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0);
data.main = main;
data.setting = setting;
- f_console_parameter_process(arguments, &main->parameters, &setting->state, (void *) &data);
+ f_console_parameter_process(arguments, &main->parameters, &setting->state.status, (void *) &data);
}
if (F_status_is_error(setting->state.status)) {
extern "C" {
#endif
-/***
- * Default allocations.
- *
- * Set to at least 4 to provide a UTF-8 friendly allocation step.
+/**
+ * The program defines.
*
- * fake_default_allocation_*_d:
- * - large: A buffer size used for large allocations.
- * - pipe: A buffer size used for processing piped data.
- * - small: A buffer size used for small allocations.
+ * fake_*_d:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_pipe: A buffer size used for processing piped data.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
-#ifndef _di_fake_default_d_
- #define fake_default_allocation_large_d 64
- #define fake_default_allocation_pipe_d 16384
- #define fake_default_allocation_small_d 8
-#endif // _di_fake_default_d_
+#ifndef _di_fake_d_
+ #define fake_allocation_console_d 4
+ #define fake_allocation_large_d 256
+ #define fake_allocation_pipe_d 16384
+ #define fake_allocation_small_d 16
+ #define fake_signal_check_d 20000
+#endif // _di_fake_d_
/**
* The program defines.
exit(data.child);
}
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
{
f_string_range_t range = macro_f_string_range_t_initialize2(data_make->buffer.used);
f_fss_comments_t comments = f_fss_comments_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0);
*status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments);
bool missing_settings = F_true;
f_fss_set_t settings = f_fss_set_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0);
if (list_objects.used > data_make->fakefile.size) {
macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used);
f_iki_data_t *iki_data = &data_make->cache_iki;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0);
f_string_range_t range = f_string_range_t_initialize;
f_string_map_multis_t *parameter = &data_make->setting_make.parameter;
* Designates the how and where to print.
* @param status
* The status to use.
- * This is provided, ignoring data.setting->status, for thread-safety reasons.
+ * This is provided, ignoring setting->state.status, for thread-safety reasons.
* @param function
* The name of the function where the error happened.
* @param operation
#ifndef _di_fake_print_help_
f_status_t fake_print_help(fake_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
f_file_stream_lock(print.to);
#ifndef _di_fake_print_line_first_locked_
f_status_t fake_print_line_first_locked(fake_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
if (setting->flag & fake_main_flag_print_first_e) {
fll_print_dynamic_raw(setting->line_first, print.to);
#ifndef _di_fake_print_line_first_unlocked_
f_status_t fake_print_line_first_unlocked(fake_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
if (setting->flag & fake_main_flag_print_first_e) {
fll_print_dynamic_raw(setting->line_first, print.to);
#ifndef _di_fake_print_line_last_locked_
f_status_t fake_print_line_last_locked(fake_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
fll_print_dynamic_raw(setting->line_last, print.to);
#ifndef _di_fake_print_line_last_unlocked_
f_status_t fake_print_line_last_unlocked(fake_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
f_print_dynamic_raw(setting->line_last, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_help_
extern f_status_t fake_print_help(fake_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_line_first_locked_
extern f_status_t fake_print_line_first_locked(fake_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_line_first_unlocked_
extern f_status_t fake_print_line_first_unlocked(fake_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_line_last_locked_
extern f_status_t fake_print_line_last_locked(fake_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_line_last_unlocked_
extern f_status_t fake_print_line_last_unlocked(fake_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_operation_all_complete_
extern f_status_t fake_print_operation_all_complete(fake_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fake_print_operation_cancelled_
extern f_status_t fake_print_operation_cancelled(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation);
#endif // _di_firewall_path_s_
/**
- * Default allocations.
- */
-#ifndef _di_firewall_default_d_
- #define firewall_default_allocation_step_d F_memory_default_allocation_small_d
-#endif // _di_firewall_default_d_
-
-/**
* The program defines.
+ *
+ * firewall_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_firewall_d_
- #define firewall_signal_check_d 20000
+ #define firewall_allocation_console_d 4
+ #define firewall_allocation_large_d 256
+ #define firewall_allocation_small_d 16
+ #define firewall_signal_check_d 20000
#endif // _di_firewall_d_
/**
f_status_t status = F_none;
- main->child = 0;
+ setting->state.step_small = firewall_allocation_console_d;
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = firewall_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_basic_list_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_basic_list_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
#endif // _di_fss_basic_list_read_program_name_s_
/**
- * The program signal defines.
+ * The program defines.
+ *
+ * fss_basic_list_read_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_fss_basic_list_read_d_
- #define fss_basic_list_read_signal_check_d 20000
+ #define fss_basic_list_read_allocation_console_d 4
+ #define fss_basic_list_read_allocation_large_d 256
+ #define fss_basic_list_read_allocation_small_d 16
+ #define fss_basic_list_read_signal_check_d 20000
#endif // _di_fss_basic_list_read_d_
/**
f_status_t status = F_none;
+ setting->state.step_small = fss_basic_list_read_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_basic_list_read_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
#ifndef _di_fss_basic_list_read_load_
f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_basic_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_basic_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
/**
* The program defines.
+ *
+ * fss_basic_read_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_fss_basic_read_d_
- #define fss_basic_read_signal_check_d 20000
+ #define fss_basic_read_allocation_console_d 4
+ #define fss_basic_read_allocation_large_d 256
+ #define fss_basic_read_allocation_small_d 16
+ #define fss_basic_read_signal_check_d 20000
#endif // _di_fss_basic_read_d_
/**
f_status_t status = F_none;
+ setting->state.step_small = fss_basic_read_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_basic_read_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
#ifndef _di_fss_basic_read_load_
f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits.used = 0;
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_embedded_list_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_embedded_list_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
/**
* The program defines.
+ *
+ * fss_embedded_list_read_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_fss_embedded_list_read_d_
- #define fss_embedded_list_read_signal_check_d 20000
+ #define fss_embedded_list_read_allocation_console_d 4
+ #define fss_embedded_list_read_allocation_large_d 256
+ #define fss_embedded_list_read_allocation_small_d 16
+ #define fss_embedded_list_read_signal_check_d 20000
#endif // _di_fss_embedded_list_read_d_
/**
f_status_t status = F_none;
+ setting->state.step_small = fss_embedded_list_read_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_embedded_list_read_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
f_status_t status = F_none;
{
- f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
objects_delimits->used = 0;
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_extended_list_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_extended_list_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
/**
* The program defines.
+ *
+ * fss_extended_list_read_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_fss_extended_list_read_d_
- #define fss_extended_list_read_signal_check_d 20000
+ #define fss_extended_list_read_allocation_console_d 4
+ #define fss_extended_list_read_allocation_large_d 256
+ #define fss_extended_list_read_allocation_small_d 16
+ #define fss_extended_list_read_signal_check_d 20000
#endif // _di_fss_extended_list_read_d_
/**
f_status_t status = F_none;
+ setting->state.step_small = fss_extended_list_read_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_extended_list_read_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
#ifndef _di_fss_extended_list_read_load_
f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_extended_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_extended_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
/**
* The program defines.
+ *
+ * fss_extended_read_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_fss_extended_read_d_
- #define fss_extended_read_signal_check_d 20000
+ #define fss_extended_read_allocation_console_d 4
+ #define fss_extended_read_allocation_large_d 256
+ #define fss_extended_read_allocation_small_d 16
+ #define fss_extended_read_signal_check_d 20000
#endif // _di_fss_extended_read_d_
/**
f_status_t status = F_none;
+ setting->state.step_small = fss_extended_read_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_extended_read_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
#ifndef _di_fss_extended_read_load_
f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_identify_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_identify_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
/**
* The program defines.
+ *
+ * fss_identify_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_fss_identify_d_
- #define fss_identify_signal_check_d 20000
+ #define fss_identify_allocation_console_d 4
+ #define fss_identify_allocation_large_d 256
+ #define fss_identify_allocation_small_d 16
+ #define fss_identify_signal_check_d 20000
#endif // _di_fss_identify_d_
/**
f_status_t status = F_none;
+ setting->state.step_small = fss_identify_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_identify_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = fss_payload_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_payload_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
f_status_t status = F_none;
+ setting->state.step_small = fss_payload_read_allocation_console_d;
+
status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+ setting->state.step_small = fss_payload_read_allocation_small_d;
+
if (F_status_is_error(status)) return;
{
#ifndef _di_fss_payload_read_load_
f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize_1(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_first(setting, main->message);
+ }
+
if (setting->content) {
- setting->state.status = fl_fss_basic_content_write(
+ fl_fss_basic_content_write(
*setting->content,
- (setting->flag & fss_write_flag_partial_e)
+ (setting->flag & fss_write_main_flag_partial_e)
? f_fss_complete_partial_e
: f_fss_complete_full_e,
&setting->range,
&setting->buffer,
- setting->state
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_content_end_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_content_end_e) {
setting->state.status = f_string_dynamic_append(f_fss_basic_close_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
}
}
}
+
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_last(setting, main->message);
+ }
}
#endif // _di_fss_write_basic_process_content_
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
if (setting->object) {
- setting->state.status = fl_fss_basic_object_write(
+ fl_fss_basic_object_write(
*setting->object,
setting->quote.used
? setting->quote.string[0]
: f_fss_quote_double_s.string[0],
- (setting->flag & fss_write_flag_partial_e)
- ? (setting->flag & fss_write_flag_trim_e)
+ (setting->flag & fss_write_main_flag_partial_e)
+ ? (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_trim_e
: f_fss_complete_none_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_object_open_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_object_open_e) {
setting->state.status = f_string_dynamic_append(f_fss_basic_open_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
setting.standard = fss_write_basic_standard_s;
setting.process_content = &fss_write_basic_process_content;
setting.process_help = &fss_write_basic_process_help;
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_fss_write_basic_print_help_
f_status_t fss_write_basic_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fss_write_basic_print_help_
extern f_status_t fss_write_basic_print_help(fss_write_setting_t * const setting, const fl_print_t print);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_first(setting, main->message);
+ }
+
if (setting->content) {
- setting->state.status = fl_fss_basic_list_content_write(
+ fl_fss_basic_list_content_write(
*setting->content,
- (setting->flag & fss_write_flag_partial_e)
+ (setting->flag & fss_write_main_flag_partial_e)
? f_fss_complete_partial_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
&setting->prepend,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_content_end_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_content_end_e) {
setting->state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
}
}
}
+
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_last(setting, main->message);
+ }
}
#endif // _di_fss_write_basic_list_process_content_
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
if (setting->object) {
- setting->state.status = fl_fss_basic_list_object_write(
+ fl_fss_basic_list_object_write(
*setting->object,
- (setting->flag & fss_write_flag_partial_e)
- ? (setting->flag & fss_write_flag_trim_e)
+ (setting->flag & fss_write_main_flag_partial_e)
+ ? (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_trim_e
: f_fss_complete_none_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_object_open_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_object_open_e) {
setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
if (F_status_is_error_not(setting->state.status)) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
setting.standard = fss_write_basic_list_standard_s;
setting.process_content = &fss_write_basic_list_process_content;
setting.process_help = &fss_write_basic_list_process_help;
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, state, &data, &setting, 0);
+ fss_write_setting_load(arguments, &data, &setting, 0);
}
fss_write_main(&data, &setting);
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_fss_write_basic_list_print_help_
f_status_t fss_write_basic_list_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fss_write_basic_list_print_help_
extern f_status_t fss_write_basic_list_print_help(fss_write_setting_t * const setting, const fl_print_t print);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_first(setting, main->message);
+ }
+
if (setting->content) {
- setting->state.status = fl_fss_embedded_list_content_write(
+ fl_fss_embedded_list_content_write(
*setting->content,
- (setting->flag & fss_write_flag_partial_e)
+ (setting->flag & fss_write_main_flag_partial_e)
? f_fss_complete_partial_e
: last
? f_fss_complete_end_e
: f_fss_complete_next_e,
&setting->prepend,
setting->ignores,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_content_end_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_content_end_e) {
setting->state.status = f_string_dynamic_append(f_fss_embedded_list_close_s, &setting->buffer);
if (F_status_is_error_not(setting->state.status)) {
}
}
}
+
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_last(setting, main->message);
+ }
}
#endif // _di_fss_write_embedded_list_process_content_
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
if (setting->object) {
- setting->state.status = fl_fss_embedded_list_object_write(
+ fl_fss_embedded_list_object_write(
*setting->object,
- (setting->flag & fss_write_flag_partial_e)
- ? (setting->flag & fss_write_flag_trim_e)
+ (setting->flag & fss_write_main_flag_partial_e)
+ ? (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_trim_e
: f_fss_complete_none_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_object_open_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_object_open_e) {
setting->state.status = f_string_dynamic_append(f_fss_embedded_list_open_s, &setting->buffer);
if (F_status_is_error_not(setting->state.status)) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
setting.standard = fss_write_embedded_list_standard_s;
setting.process_content = &fss_write_embedded_list_process_content;
setting.process_help = &fss_write_embedded_list_process_help;
setting.process_object = &fss_write_embedded_list_process_object;
setting.process_pipe = &fss_write_process_pipe;
setting.process_set = &fss_write_process_set;
- setting.flag |= fss_write_flag_ignore_e;
- setting.flag |= fss_write_flag_content_multiple_e;
+ setting.flag |= fss_write_main_flag_ignore_e;
+ setting.flag |= fss_write_main_flag_content_multiple_e;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, state, &data, &setting, 0);
+ fss_write_setting_load(arguments, &data, &setting, 0);
}
fss_write_main(&data, &setting);
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_fss_write_embedded_list_print_help_
f_status_t fss_write_embedded_list_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fss_write_embedded_list_print_help_
extern f_status_t fss_write_embedded_list_print_help(fss_write_setting_t * const setting, const fl_print_t print);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_first(setting, main->message);
+ }
+
if (setting->content) {
- setting->state.status = fl_fss_extended_content_write(
+ fl_fss_extended_content_write(
*setting->content,
setting->quote.used
? setting->quote.string[0]
: f_fss_quote_double_s.string[0],
- (setting->flag & fss_write_flag_partial_e)
+ (setting->flag & fss_write_main_flag_partial_e)
? f_fss_complete_partial_e
: last
? f_fss_complete_end_e
: f_fss_complete_next_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_content_end_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_content_end_e) {
setting->state.status = f_string_dynamic_append(f_fss_extended_close_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
}
}
- else if (setting->flag & fss_write_flag_content_next_e) {
+ else if (setting->flag & fss_write_main_flag_content_next_e) {
setting->state.status = f_string_dynamic_append(f_fss_extended_next_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
}
}
}
+
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_last(setting, main->message);
+ }
}
#endif // _di_fss_write_extended_process_content_
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
if (setting->object) {
- setting->state.status = fl_fss_extended_object_write(
+ fl_fss_extended_object_write(
*setting->object,
setting->quote.used
? setting->quote.string[0]
: f_fss_quote_double_s.string[0],
- (setting->flag & fss_write_flag_partial_e)
- ? (setting->flag & fss_write_flag_trim_e)
+ (setting->flag & fss_write_main_flag_partial_e)
+ ? (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_trim_e
: f_fss_complete_none_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_object_open_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_object_open_e) {
setting->state.status = f_string_dynamic_append(f_fss_extended_open_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
setting.standard = fss_write_extended_standard_s;
setting.process_content = &fss_write_extended_process_content;
setting.process_help = &fss_write_extended_process_help;
setting.process_object = &fss_write_extended_process_object;
setting.process_pipe = &fss_write_process_pipe;
setting.process_set = &fss_write_process_set;
- setting.flag |= fss_write_flag_content_multiple_e;
+ setting.flag |= fss_write_main_flag_content_multiple_e;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, state, &data, &setting, 0);
+ fss_write_setting_load(arguments, &data, &setting, 0);
}
fss_write_main(&data, &setting);
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_fss_write_extended_print_help_
f_status_t fss_write_extended_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fss_write_extended_print_help_
extern f_status_t fss_write_extended_print_help(fss_write_setting_t * const setting, const fl_print_t print);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_first(setting, main->message);
+ }
+
if (setting->content) {
- setting->state.status = fl_fss_extended_list_content_write(
+ fl_fss_extended_list_content_write(
*setting->content,
- (setting->flag & fss_write_flag_partial_e)
+ (setting->flag & fss_write_main_flag_partial_e)
? last
? f_fss_complete_none_e
: f_fss_complete_partial_e
: f_fss_complete_full_e,
&setting->prepend,
setting->ignores,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_content_end_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_content_end_e) {
setting->state.status = f_string_dynamic_append(f_fss_extended_list_close_s, &setting->buffer);
if (F_status_is_error_not(setting->state.status)) {
}
}
}
+
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_last(setting, main->message);
+ }
}
#endif // _di_fss_write_extended_list_process_content_
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
if (setting->object) {
- setting->state.status = fl_fss_extended_list_object_write(
+ fl_fss_extended_list_object_write(
*setting->object,
- (setting->flag & fss_write_flag_partial_e)
- ? (setting->flag & fss_write_flag_trim_e)
+ (setting->flag & fss_write_main_flag_partial_e)
+ ? (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_trim_e
: f_fss_complete_none_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
+ if (F_status_set_fine(macro_fss_write_setting(setting)->state.status) == F_none_eol) {
+ macro_fss_write_setting(setting)->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+ if (F_status_is_error(macro_fss_write_setting(setting)->state.status)) {
fss_write_print_error(macro_fss_write_setting(setting), main->error, macro_fss_write_f(fl_fss_extended_list_object_write));
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_object_open_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_object_open_e) {
setting->state.status = f_string_dynamic_append(f_fss_extended_list_open_s, &setting->buffer);
if (F_status_is_error_not(setting->state.status)) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
setting.standard = fss_write_extended_list_standard_s;
setting.process_content = &fss_write_extended_list_process_content;
setting.process_help = &fss_write_extended_list_process_help;
setting.process_object = &fss_write_extended_list_process_object;
setting.process_pipe = &fss_write_process_pipe;
setting.process_set = &fss_write_process_set;
- setting.flag |= fss_write_flag_ignore_e;
+ setting.flag |= fss_write_main_flag_ignore_e;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, state, &data, &setting, 0);
+ fss_write_setting_load(arguments, &data, &setting, 0);
}
fss_write_main(&data, &setting);
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_fss_write_extended_list_print_help_
f_status_t fss_write_extended_list_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fss_write_extended_list_print_help_
extern f_status_t fss_write_extended_list_print_help(fss_write_setting_t * const setting, const fl_print_t print);
/**
* The program default defines.
*
- * fss_write_default_allocation_*:
- * - large: An allocation step used for buffers that are anticipated to have large buffers.
- * - small: An allocation step used for buffers that are anticipated to have small buffers.
+ * fss_write_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
-#ifndef _di_fss_write_default_d_
- #define fss_write_default_allocation_large_d 2048
- #define fss_write_default_allocation_small_d 128
-#endif // _di_fss_write_default_d_
+#ifndef _di_fss_write_d_
+ #define fss_write_allocation_console_d 4
+ #define fss_write_allocation_large_d 2048
+ #define fss_write_allocation_small_d 128
+ #define iki_write_signal_check_d 20000
+#endif // _di_fss_write_d_
/**
* The program defines.
/**
* Flags passed to the main function or program.
*
- * fss_write_flag_*_e:
+ * fss_write_main_flag_*_e:
* - none: No flags set.
* - content: The Content being written is specified.
* - content_end: The Content end characters are to be printed.
* - object: The Object being written is specified.
* - object_open: The Object open characters are to be printed.
* - partial: Do not write end of Object/Content character.
- * - prepend: Prepend the given white space characters to the start of each multi-line Content.
+ * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
* - trim: Trim Object names.
* - version: Print version.
*/
-#ifndef _di_fss_write_flag_e_
+#ifndef _di_fss_write_main_flag_e_
enum {
- fss_write_flag_none_e = 0x0,
- fss_write_flag_content_e = 0x1,
- fss_write_flag_content_end_e = 0x2,
- fss_write_flag_content_multiple_e = 0x4,
- fss_write_flag_content_next_e = 0x8,
- fss_write_flag_copyright_e = 0x10,
- fss_write_flag_file_to_e = 0x20,
- fss_write_flag_help_e = 0x40,
- fss_write_flag_ignore_e = 0x80,
- fss_write_flag_object_e = 0x100,
- fss_write_flag_object_open_e = 0x200,
- fss_write_flag_partial_e = 0x400,
- fss_write_flag_prepend_e = 0x800,
- fss_write_flag_trim_e = 0x1000,
- fss_write_flag_version_e = 0x2000,
+ fss_write_main_flag_none_e = 0x0,
+ fss_write_main_flag_content_e = 0x1,
+ fss_write_main_flag_content_end_e = 0x2,
+ fss_write_main_flag_content_multiple_e = 0x4,
+ fss_write_main_flag_content_next_e = 0x8,
+ fss_write_main_flag_copyright_e = 0x10,
+ fss_write_main_flag_file_to_e = 0x20,
+ fss_write_main_flag_help_e = 0x40,
+ fss_write_main_flag_ignore_e = 0x80,
+ fss_write_main_flag_object_e = 0x100,
+ fss_write_main_flag_object_open_e = 0x200,
+ fss_write_main_flag_partial_e = 0x400,
+ fss_write_main_flag_prepend_e = 0x800,
+ fss_write_main_flag_print_first_e = 0x1000,
+ fss_write_main_flag_trim_e = 0x2000,
+ fss_write_main_flag_version_e = 0x4000,
}; // enum
-#endif // _di_fss_write_flag_e_
+#endif // _di_fss_write_main_flag_e_
/**
* The main program parameters.
#define fss_write_setting_t_initialize \
{ \
- fss_write_flag_none_e, \
- macro_f_state_t_initialize(fss_write_default_allocation_large_d, fss_write_default_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, 0, 0), \
+ fss_write_main_flag_none_e, \
+ macro_f_state_t_initialize_1(fss_write_allocation_large_d, fss_write_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0), \
f_string_range_t_initialize, \
f_string_static_t_initialize, \
f_string_static_t_initialize, \
if (!main || !setting) return;
+ setting->state.step_small = fss_write_allocation_console_d;
+
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = fss_write_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
fss_write_print_error(setting, main->error, macro_fss_write_f(f_console_parameter_process));
main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) {
- setting->flag |= fss_write_flag_help_e;
+ setting->flag |= fss_write_main_flag_help_e;
}
if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) {
- setting->flag |= fss_write_flag_version_e;
+ setting->flag |= fss_write_main_flag_version_e;
}
if (main->parameters.array[fss_write_parameter_copyright_e].result & f_console_result_found_e) {
- setting->flag |= fss_write_flag_copyright_e;
+ setting->flag |= fss_write_main_flag_copyright_e;
}
if (callback) {
if (main->parameters.array[fss_write_parameter_file_e].values.used > 1) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
return;
}
- setting->flag |= fss_write_flag_file_to_e;
+ setting->flag |= fss_write_main_flag_file_to_e;
}
else if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
setting->objects.array[setting->objects.used++].size = 0;
} // for
- setting->flag |= fss_write_flag_object_e;
+ setting->flag |= fss_write_main_flag_object_e;
}
else if (main->parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_object_s);
return;
if ((main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_content_e].values.used) {
- if (setting->flag & fss_write_flag_object_e) {
- if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+ if (setting->flag & fss_write_main_flag_object_e) {
+ if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
setting->state.status = F_status_set_error(F_support_not);
+ fss_write_print_line_first(setting, main->message);
fss_write_print_error_one_content_only(setting, main->error);
return;
++setting->contentss.used;
}
- setting->flag |= fss_write_flag_content_e;
+ setting->flag |= fss_write_main_flag_content_e;
}
else if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_content_s);
return;
if (main->parameters.arguments.array[index].used) {
f_string_range_t range = macro_f_string_range_t_initialize2(main->parameters.arguments.array[index].used);
- f_state_t state = f_state_t_initialize;
for (; range.start < main->parameters.arguments.array[index].used; range.start++) {
- setting->state.status = f_fss_is_space(main->parameters.arguments.array[index], range, state);
-
- if (F_status_is_error(setting->state.status)) {
- fss_write_print_error(setting, main->error, macro_fss_write_f(f_fss_is_space));
-
- return;
- }
-
- if (setting->state.status == F_false) {
- setting->state.status = F_status_set_error(F_parameter);
+ if (f_fss_is_space(main->parameters.arguments.array[index], range, &setting->state) == F_false) {
+ if (F_status_is_error(setting->state.status)) {
+ fss_write_print_error(setting, main->error, macro_fss_write_f(f_fss_is_space));
+ }
+ else {
+ setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_error_prepend_only_whitespace(setting, main->error);
+ fss_write_print_error_prepend_only_whitespace(setting, main->error);
+ }
return;
}
} // for
}
- setting->flag |= fss_write_flag_prepend_e;
+ setting->flag |= fss_write_main_flag_prepend_e;
}
else if (main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
return;
if (main->parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, fss_write_string_two_s);
return;
}
// Only process if the standard designates that the ingore is supported.
- if (setting->flag & fss_write_flag_ignore_e) {
+ if (setting->flag & fss_write_main_flag_ignore_e) {
f_array_length_t stub_data_array[1] = { 0 };
f_array_lengths_t stub_data = macro_f_array_lengths_t_initialize(stub_data_array, 0, 1);
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].start);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
if (setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop > setting->ignoress.array[j].array[setting->ignoress.array[j].used].start) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_range_start_before_stop(
main->error,
f_console_symbol_long_normal_s,
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.start);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.stop);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
if (number.start > number.stop) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_range_start_before_stop(
main->error,
f_console_symbol_long_normal_s,
else if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s);
return;
else {
// There is no Object or Content, so remove ignores if set.
- if (setting->flag & fss_write_flag_ignore_e) {
- setting->flag -= fss_write_flag_ignore_e;
+ if (setting->flag & fss_write_main_flag_ignore_e) {
+ setting->flag -= fss_write_main_flag_ignore_e;
}
}
if (main->parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
- setting->flag |= fss_write_flag_partial_e;
+ setting->flag |= fss_write_main_flag_partial_e;
}
{
};
const uint16_t has_flag[] = {
- fss_write_flag_content_end_e,
- fss_write_flag_content_next_e,
- fss_write_flag_object_open_e,
+ fss_write_main_flag_content_end_e,
+ fss_write_main_flag_content_next_e,
+ fss_write_main_flag_object_open_e,
};
const f_string_static_t has_string[] = {
for (uint8_t i = 0; i < 3; ++i) {
if (main->parameters.array[has[i]].result & f_console_result_found_e) {
- if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
- if (!(setting->flag & fss_write_flag_partial_e)) {
+ if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) {
+ if (!(setting->flag & fss_write_main_flag_partial_e)) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_cannot_use_with_without(
main->error,
f_console_symbol_long_normal_s,
f_console_symbol_long_normal_s,
has_string[i],
- (setting->flag & fss_write_flag_object_e)
+ (setting->flag & fss_write_main_flag_object_e)
? fss_write_long_object_s
: fss_write_long_content_s,
fss_write_long_partial_s
if (main->parameters.array[has_cannots[i][0]].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][0]);
return;
if (main->parameters.array[has_cannots[i][1]].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][1]);
return;
} // for
}
- if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
- if (setting->flag & fss_write_flag_object_e) {
- if (setting->flag & fss_write_flag_content_multiple_e) {
- if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_flag_partial_e)) {
+ if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) {
+ if (setting->flag & fss_write_main_flag_object_e) {
+ if (setting->flag & fss_write_main_flag_content_multiple_e) {
+ if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_main_flag_partial_e)) {
setting->state.status = F_status_set_error(F_parameter);
+ fss_write_print_line_first(setting, main->message);
fss_write_print_error_parameter_same_times_at_least(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_content_e) && (setting->flag & fss_write_flag_partial_e)) {
+ if ((setting->flag & fss_write_main_flag_content_e) && (setting->flag & fss_write_main_flag_partial_e)) {
if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_cannot_use_with_xor(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_write_long_partial_s, fss_write_long_object_s, fss_write_long_content_s);
return;
}
if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
- setting->flag |= fss_write_flag_trim_e;
+ setting->flag |= fss_write_main_flag_trim_e;
}
- if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_flag_content_e | fss_write_parameter_object_e))) {
+ if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_main_flag_content_e | fss_write_parameter_object_e))) {
setting->state.status = F_data_not;
}
}
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_last_locked(setting, main->error);
+ fss_write_print_line_last(setting, main->error);
return;
}
setting->state.status = F_none;
- if (setting->flag & fss_write_flag_help_e) {
+ if (setting->flag & fss_write_main_flag_help_e) {
if (setting->process_help) {
setting->process_help(main, (void *) setting);
}
return;
}
- if (setting->flag & fss_write_flag_version_e) {
+ if (setting->flag & fss_write_main_flag_version_e) {
fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_write_program_version_s);
return;
}
- if (setting->flag & fss_write_flag_copyright_e) {
+ if (setting->flag & fss_write_main_flag_copyright_e) {
fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
return;
}
if (F_status_is_error_not(setting->state.status)) {
- if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e | fss_write_flag_object_open_e | fss_write_flag_content_next_e | fss_write_flag_content_end_e)) {
+ if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e | fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e)) {
if (setting->process_normal) {
setting->process_normal(main, (void *) setting);
}
}
}
-
- if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
- }
}
#endif // _di_fss_write_main_
#ifndef _di_fss_write_process_normal_
void fss_write_process_normal(fll_program_data_t * const main, void * const void_setting) {
+ if (!main || !void_setting) return;
+
fss_write_process_normal_data(
main,
macro_fss_write_setting(void_setting),
- (macro_fss_write_setting(void_setting)->flag & fss_write_flag_object_e)
+ (macro_fss_write_setting(void_setting)->flag & fss_write_main_flag_object_e)
? macro_fss_write_setting(void_setting)->objects.used
: macro_fss_write_setting(void_setting)->contentss.used
);
#ifndef _di_fss_write_process_normal_data_
void fss_write_process_normal_data(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_array_length_t length) {
- if (!setting->process_set) return;
+ if (!main || !setting || !setting->process_set) return;
setting->ignores = 0;
setting->object = 0;
} // for
}
else {
- if (setting->flag & (fss_write_flag_object_open_e | fss_write_flag_content_next_e | fss_write_flag_content_end_e)) {
+ if (setting->flag & (fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e)) {
setting->object = 0;
setting->contents = 0;
setting->ignores = 0;
#ifndef _di_fss_write_process_pipe_
void fss_write_process_pipe(fll_program_data_t * const main, void * const void_setting) {
+ if (!main || !void_setting) return;
+
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
if (!setting->process_set) return;
- f_status_t status_pipe = F_none;
- f_file_t input = f_file_t_initialize;
- input.id = F_type_descriptor_input_d;
- input.size_read = setting->state.step_large;
-
- f_array_length_t total = 0;
- f_array_length_t ignore = 0;
- f_string_range_t range = f_string_range_t_initialize;
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_first(setting, main->message);
+ }
const f_array_length_t used_objects = setting->objects.used;
const f_array_length_t used_contentss = setting->contentss.used;
return;
}
+ f_status_t status_pipe = F_none;
+
+ f_file_t input = f_file_t_initialize;
+ input.id = F_type_descriptor_input_d;
+ input.size_read = setting->state.step_large;
+
+ f_array_length_t total = 0;
+ f_array_length_t ignore = 0;
+ f_string_range_t range = f_string_range_t_initialize;
+
// Reset all of the used data before starting the loop.
setting->object->used = 0;
setting->contents->used = 0;
// Check to see if the Content supports multiple Content per Object.
if (flag & 0x4) {
- if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+ if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
setting->state.status = F_status_set_error(F_support_not);
fss_write_print_error_one_content_only(setting, main->error);
// Do not handle start/end while inside an ignore set.
if (!(flag & 0x2)) {
if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
- if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+ if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
setting->state.status = F_status_set_error(F_support_not);
fss_write_print_error_one_content_only(setting, main->error);
if (F_status_is_error_not(setting->state.status)) {
setting->state.status = (flag & 0x1) ? F_none : F_data_not;
}
+
+ if (F_status_is_error(setting->state.status)) {
+ fss_write_print_line_last(setting, main->message);
+ }
+ else if (!(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e | fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e))) {
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ fss_write_print_line_last(setting, main->message);
+ }
+ }
}
#endif // _di_fss_write_process_pipe_
#ifndef _di_fss_write_process_set_
void fss_write_process_set(fll_program_data_t * const main, void * const void_setting) {
+ if (!main || !void_setting) return;
+
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
setting->buffer.used = 0;
- if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e)) && setting->object || (setting->flag & fss_write_flag_object_open_e)) {
+ if ((!(setting->flag & fss_write_main_flag_partial_e) || (setting->flag & fss_write_main_flag_partial_e) && (setting->flag & fss_write_main_flag_object_e)) && setting->object || (setting->flag & fss_write_main_flag_object_open_e)) {
if (setting->object) {
if (setting->object->used) {
}
}
- if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_content_e)) && setting->contents || (setting->flag & (fss_write_flag_content_next_e | fss_write_flag_content_end_e))) {
+ if ((!(setting->flag & fss_write_main_flag_partial_e) || (setting->flag & fss_write_main_flag_partial_e) && (setting->flag & fss_write_main_flag_content_e)) && setting->contents || (setting->flag & (fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e))) {
if (setting->process_content) {
if (setting->contents && setting->contents->used) {
#ifndef _di_fss_write_main_print_help_
f_status_t fss_write_main_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, state, &data, &setting, &fss_write_main_setting_load_as);
+ fss_write_setting_load(arguments, &data, &setting, &fss_write_main_setting_load_as);
}
fss_write_main(&data, &setting);
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_fss_write_main_process_help_
#endif // _di_fss_write_main_process_help_
#ifndef _di_fss_write_main_setting_load_as_
- void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state) {
+ void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
- if (!main || !setting || F_status_is_error(setting->state.status) || (setting->flag & fss_write_flag_version_e)) return;
+ if (!main || !setting || F_status_is_error(setting->state.status) || (setting->flag & fss_write_main_flag_version_e)) return;
setting->standard = fss_write_basic_standard_s;
setting->process_content = &fss_write_basic_process_content;
setting->process_pipe = &fss_write_process_pipe;
setting->process_normal = &fss_write_process_normal;
setting->process_set = &fss_write_process_set;
- setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by basic.
- setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by basic.
+ setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by basic.
+ setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by basic.
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
setting->process_pipe = &fss_write_process_pipe;
setting->process_normal = &fss_write_process_normal;
setting->process_set = &fss_write_process_set;
- setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by extended.
- setting->flag |= fss_write_flag_content_multiple_e;
+ setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by extended.
+ setting->flag |= fss_write_main_flag_content_multiple_e;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
setting->process_pipe = &fss_write_process_pipe;
setting->process_normal = &fss_write_process_normal;
setting->process_set = &fss_write_process_set;
- setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by basic list.
- setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by basic list.
+ setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by basic list.
+ setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by basic list.
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
setting->process_pipe = &fss_write_process_pipe;
setting->process_normal = &fss_write_process_normal;
setting->process_set = &fss_write_process_set;
- setting->flag |= fss_write_flag_ignore_e;
- setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by extended list.
+ setting->flag |= fss_write_main_flag_ignore_e;
+ setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by extended list.
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
setting->process_pipe = &fss_write_process_pipe;
setting->process_normal = &fss_write_process_normal;
setting->process_set = &fss_write_process_set;
- setting->flag |= fss_write_flag_ignore_e;
- setting->flag |= fss_write_flag_content_multiple_e;
+ setting->flag |= fss_write_main_flag_ignore_e;
+ setting->flag |= fss_write_main_flag_content_multiple_e;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
setting->process_object = 0; // Not used by payload.
setting->process_pipe = &fss_write_payload_process_pipe;
setting->process_set = &fss_write_payload_process_set;
- setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by payload.
- setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by payload.
+ setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by payload.
+ setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by payload.
}
else {
- if (setting->flag & fss_write_flag_help_e) {
+ if (setting->flag & fss_write_main_flag_help_e) {
setting->state.status = F_status_set_error(F_parameter);
break;
}
if (setting->state.status != F_status_set_error(F_parameter)) {
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
}
setting->state.status = F_status_set_error(F_parameter);
} // for
if (F_status_is_error(setting->state.status)) {
- if (setting->flag & fss_write_flag_help_e) {
+ if (setting->flag & fss_write_main_flag_help_e) {
fss_write_main_process_help(main, setting);
}
else if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- if (setting->flag & fss_write_flag_help_e) {
+ if (setting->flag & fss_write_main_flag_help_e) {
fss_write_main_process_help(main, setting);
return;
}
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_as_s);
return;
#ifndef _di_fss_write_print_error_
f_status_t fss_write_print_error(fss_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
- fss_write_print_line_first_locked(setting, print);
fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
return F_none;
#ifndef _di_fss_write_print_error_file_
f_status_t fss_write_print_error_file(fss_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
- fss_write_print_line_first_locked(setting, print);
fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
return F_none;
#ifndef _di_fss_write_print_error_parameter_same_times_at_least_
f_status_t fss_write_print_error_parameter_same_times_at_least(fss_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
f_file_stream_lock(print.to);
- fss_write_print_line_first_unlocked(setting, print);
fl_print_format("%[%QMust specify the '%]", print.to, print.context, print.prefix, print.context);
fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.notable);
fl_print_format("%[' parameter at least the same number of times as the '%]", print.to, print.context, print.context);
#ifndef _di_fss_write_print_error_one_content_only_
f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
f_file_stream_lock(print.to);
- fss_write_print_line_first_unlocked(setting, print);
fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
fl_print_format(" %[standard only supports one Content per Object.%]%r", print.to, print.context, print.context, f_string_eol_s);
#ifndef _fss_write_print_error_prepend_only_whitespace_
f_status_t fss_write_print_error_prepend_only_whitespace(fss_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
f_file_stream_lock(print.to);
#ifndef _di_fss_write_print_error_unsupported_eol_
f_status_t fss_write_print_error_unsupported_eol(fss_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
f_file_stream_lock(print.to);
- fss_write_print_line_first_unlocked(setting, print);
fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
fl_print_format(" %[standard does not support end of line character '%]", print.to, print.context, print.context);
#ifndef _di_fss_write_print_help_
void fss_write_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return;
+
fll_program_print_help_option_standard(print);
f_print_dynamic_raw(f_string_eol_s, print.to);
#ifndef _di_fss_write_print_help_end_next_
void fss_write_print_help_end_next(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting);
+
fl_print_format("%r The '%[%r%r%]',", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_object_open_s, print.set->notable);
fl_print_format(" '%[%r%r%]', and", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_next_s, print.set->notable);
fl_print_format(" '%[%r%r%]' help facilitate writing the designated data for when using", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_end_s, print.set->notable);
#ifndef _di_fss_write_print_help_pipe_
void fss_write_print_help_pipe(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return;
+
fl_print_format("%r The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%r", print.to, f_string_eol_s, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
}
#endif // _di_fss_write_print_help_pipe_
-#ifndef _di_fss_write_print_line_first_locked_
- f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_fss_write_print_line_first_
+ f_status_t fss_write_print_line_first(fss_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
if (F_status_is_error_not(setting->state.status)) {
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
+ if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
}
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_write_print_line_first_locked_
+ if (setting->flag & fss_write_main_flag_print_first_e) {
+ fll_print_dynamic_raw(setting->line_first, print.to);
-#ifndef _di_fss_write_print_line_first_unlocked_
- f_status_t fss_write_print_line_first_unlocked(fss_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
+ setting->flag -= fss_write_main_flag_print_first_e;
}
- fll_print_dynamic_raw(setting->line_first, print.to);
-
return F_none;
}
-#endif // _di_fss_write_print_line_first_unlocked_
+#endif // _di_fss_write_print_line_first_
-#ifndef _di_fss_write_print_line_last_locked_
- f_status_t fss_write_print_line_last_locked(fss_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_fss_write_print_line_last_
+ f_status_t fss_write_print_line_last(fss_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
if (F_status_is_error_not(setting->state.status)) {
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
+ if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
}
fll_print_dynamic_raw(setting->line_last, print.to);
return F_none;
}
-#endif // _di_fss_write_print_line_last_locked_
-
-#ifndef _di_fss_write_print_line_last_unlocked_
- f_status_t fss_write_print_line_last_unlocked(fss_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_write_print_line_last_unlocked_
+#endif // _di_fss_write_print_line_last_
#ifdef __cplusplus
} // extern "C"
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_fss_write_print_line_first_locked_
- extern f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- */
-#ifndef _di_fss_write_print_line_first_unlocked_
- extern f_status_t fss_write_print_line_first_unlocked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_first_unlocked_
+#ifndef _di_fss_write_print_line_first_
+ extern f_status_t fss_write_print_line_first(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_line_first_
/**
* Print last new line when the main is complete, unless verbosity says otherwise.
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_fss_write_print_line_last_locked_
- extern f_status_t fss_write_print_line_last_locked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- */
-#ifndef _di_fss_write_print_line_last_unlocked_
- extern f_status_t fss_write_print_line_last_unlocked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_last_unlocked_
+#ifndef _di_fss_write_print_line_last_
+ extern f_status_t fss_write_print_line_last(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_line_last_
#ifdef __cplusplus
} // extern "C"
f_status_t status_pipe = F_none;
f_file_t input = f_file_t_initialize;
input.id = F_type_descriptor_input_d;
- input.size_read = fss_write_default_allocation_large_d;
+ input.size_read = fss_write_allocation_large_d;
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
// Check to see if the Content supports multiple Content per Object.
if (flag & 0x4) {
- if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+ if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
setting->state.status = F_status_set_error(F_support_not);
+ fss_write_print_line_first(setting, main->message);
fss_write_print_error_one_content_only(setting, main->error);
break;
if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
setting->state.status = F_status_set_error(F_support_not);
+ fss_write_print_line_first(setting, main->message);
fss_write_print_error_one_content_only(setting, main->error);
break;
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e))) {
- if (setting->object && !(setting->flag & fss_write_flag_partial_e) && setting->contents && setting->contents->used) {
+ if ((!(setting->flag & fss_write_main_flag_partial_e) || (setting->flag & fss_write_main_flag_partial_e) && (setting->flag & fss_write_main_flag_object_e))) {
+ if (setting->object && !(setting->flag & fss_write_main_flag_partial_e) && setting->contents && setting->contents->used) {
if (setting->object->used) {
setting->range.start = 0;
setting->range.stop = setting->object->used - 1;
setting->range.stop = 0;
}
- setting->state.status = fll_fss_payload_write(
+ fll_fss_payload_write(
*setting->object,
setting->contents->array[0],
- (setting->flag & fss_write_flag_trim_e),
- (setting->flag & fss_write_flag_prepend_e)
+ (setting->flag & fss_write_main_flag_trim_e),
+ (setting->flag & fss_write_main_flag_prepend_e)
? &setting->prepend
: 0,
- setting->state,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
setting->range.stop = 0;
}
- setting->state.status = fl_fss_basic_list_object_write(
+ fl_fss_basic_list_object_write(
*setting->object,
- (setting->flag & fss_write_flag_partial_e)
- ? (setting->flag & fss_write_flag_trim_e)
+ (setting->flag & fss_write_main_flag_partial_e)
+ ? (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_trim_e
: f_fss_complete_none_e
- : (setting->flag & fss_write_flag_trim_e)
+ : (setting->flag & fss_write_main_flag_trim_e)
? f_fss_complete_full_trim_e
: f_fss_complete_full_e,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_line_first(setting, main->message);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_object_open_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_object_open_e) {
setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
if (F_status_is_error_not(setting->state.status)) {
const f_string_static_t *prepend = 0;
- if (setting->flag & fss_write_flag_prepend_e) {
+ if (setting->flag & fss_write_main_flag_prepend_e) {
const f_array_length_t index = main->parameters.array[fss_write_parameter_prepend_e].values.array[main->parameters.array[fss_write_parameter_prepend_e].values.used - 1];
prepend = &main->parameters.arguments.array[index];
}
- setting->state.status = fl_fss_basic_list_content_write(
+ fl_fss_basic_list_content_write(
setting->contents->array[0],
setting->object
? f_fss_complete_full_e
: f_fss_complete_none_e,
prepend,
- setting->state,
&setting->range,
- &setting->buffer
+ &setting->buffer,
+ &setting->state
);
if (F_status_is_error(setting->state.status)) {
}
}
- if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
- if (setting->flag & fss_write_flag_content_end_e) {
+ if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+ if (setting->flag & fss_write_main_flag_content_end_e) {
setting->state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
if (F_status_is_error(setting->state.status)) {
#endif // _di_fss_write_payload_process_set_
#ifndef _di_fss_write_payload_setting_load_
- void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state) {
+ void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
if (!main || !setting) return;
if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
setting->state.status = F_status_set_error(F_parameter);
+ fss_write_print_line_first(setting, main->message);
fss_write_payload_print_error_payload_not_last(setting, main->error);
return;
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
- setting.state.data = (void *) &data;
+ setting.state.custom = (void *) &data;
setting.standard = fss_write_payload_standard_s;
setting.process_content = 0; // Not used by payload.
setting.process_help = &fss_write_payload_process_help;
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, state, &data, &setting, &fss_write_payload_setting_load);
+ fss_write_setting_load(arguments, &data, &setting, &fss_write_payload_setting_load);
}
fss_write_main(&data, &setting);
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
f_file_stream_lock(print.to);
- fss_write_print_line_first_unlocked(setting, print);
fl_print_format("%[%QThe payload may only be specified last.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
f_file_stream_unlock(print.to);
#ifndef _di_fss_write_payload_print_help_
f_status_t fss_write_payload_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_fss_write_payload_print_help_
extern f_status_t fss_write_payload_print_help(fss_write_setting_t * const setting, const fl_print_t print);
/**
* The program defines.
+ *
+ * iki_read_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_iki_read_d_
- #define iki_read_signal_check_d 20000
+ #define iki_read_allocation_console_d 4
+ #define iki_read_allocation_large_d 256
+ #define iki_read_allocation_small_d 16
+ #define iki_read_signal_check_d 20000
#endif // _di_iki_read_d_
/**
#define iki_read_setting_t_initialize \
{ \
iki_read_main_flag_none_e, \
- f_state_t_initialize, \
+ macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_none, 0, 0, 0, 0, 0, 0), \
0, \
0, \
f_string_static_t_initialize, \
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = iki_read_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = iki_read_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
iki_read_print_error(setting, main->error, macro_iki_read_f(f_console_parameter_process));
fll_program_data_t data = fll_program_data_t_initialize;
iki_read_setting_t setting = iki_read_setting_t_initialize;
+ setting.state.custom = (void *) &data;
+ setting.state.handle = &fll_program_standard_signal_handle;
f_console_parameter_t parameters[] = iki_read_console_parameter_t_initialize;
data.parameters.array = parameters;
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
#ifndef _di_iki_read_process_buffer_ranges_
void iki_read_process_buffer_ranges(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *buffer_range) {
- {
- const f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
-
- setting->state.status = fl_iki_read(&setting->buffer, buffer_range, &setting->data, state);
- }
+ fl_iki_read(&setting->buffer, buffer_range, &setting->data, &setting->state);
if (F_status_is_error(setting->state.status)) {
iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
f_string_range_t range = buffer_range;
- {
- const f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
-
- setting->state.status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
- }
+ fl_iki_read(&setting->buffer, &range, &setting->data, &setting->state);
if (F_status_is_error(setting->state.status)) {
iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
return;
}
- {
- f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
-
- setting->state.status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
- }
+ fl_iki_read(&setting->buffer, &range, &setting->data, &setting->state);
if (F_status_is_error(setting->state.status)) {
iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
if (!main || !setting) return;
- setting->flag = 0;
+ setting->state.step_small = iki_write_allocation_console_d;
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = iki_write_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(f_console_parameter_process));
return;
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_context));
return;
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_verbosity));
return;
if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
+ iki_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
return;
setting->state.status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first_locked(setting, main->error);
+ iki_write_print_line_first(setting, main->message);
fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_stream_open", fll_error_file_flag_fallback_e, main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
return;
else if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
+ iki_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
return;
setting->state.status = f_string_dynamics_resize(values->used, &setting->objects);
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
return;
else if (main->parameters.array[iki_write_parameter_object_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
+ iki_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_object_s);
return;
setting->state.status = f_string_dynamics_resize(values->used, &setting->contents);
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
return;
else if (main->parameters.array[iki_write_parameter_content_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
+ iki_write_print_line_first(setting, main->message);
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_content_s);
return;
if (!(main->pipe & fll_program_data_pipe_input_e) && !(setting->flag & (iki_write_main_flag_content_e | iki_write_parameter_object_e))) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error_main_missing(setting, main->error);
return;
-#include "iki_write.h"
+#include "../iki_write.h"
#ifdef __cplusplus
extern "C" {
-#include "iki_write.h"
+#include "../iki_write.h"
#ifdef __cplusplus
extern "C" {
-#include "iki_write.h"
+#include "../iki_write.h"
#ifdef __cplusplus
extern "C" {
/**
* The program defines.
+ *
+ * iki_write_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_iki_write_d_
- #define iki_write_signal_check_d 20000
+ #define iki_write_allocation_console_d 4
+ #define iki_write_allocation_large_d 256
+ #define iki_write_allocation_small_d 16
+ #define iki_write_signal_check_d 20000
#endif // _di_iki_write_d_
/**
* Flags passed to the main function or program.
*
* iki_write_main_flag_*_e:
- * - none: No flags set.
- * - content: The Content being written is specified.
- * - copyright: Print copyright.
- * - file_to: Using a specified destination file.
- * - help: Print help.
- * - object: The Object being written is specified.
- * - version: Print version.
+ * - none: No flags set.
+ * - content: The Content being written is specified.
+ * - copyright: Print copyright.
+ * - file_to: Using a specified destination file.
+ * - help: Print help.
+ * - object: The Object being written is specified.
+ * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ * - version: Print version.
*/
#ifndef _di_iki_write_main_flag_e_
enum {
- iki_write_main_flag_none_e = 0x0,
- iki_write_main_flag_content_e = 0x1,
- iki_write_main_flag_copyright_e = 0x2,
- iki_write_main_flag_file_to_e = 0x4,
- iki_write_main_flag_help_e = 0x8,
- iki_write_main_flag_object_e = 0x10,
- iki_write_main_flag_version_e = 0x20,
- };
+ iki_write_main_flag_none_e = 0x0,
+ iki_write_main_flag_content_e = 0x1,
+ iki_write_main_flag_copyright_e = 0x2,
+ iki_write_main_flag_file_to_e = 0x4,
+ iki_write_main_flag_help_e = 0x8,
+ iki_write_main_flag_object_e = 0x10,
+ iki_write_main_flag_print_first_e = 0x20,
+ iki_write_main_flag_version_e = 0x40,
+ }; // enum
#endif // _di_iki_write_main_flag_e_
/**
#define iki_write_setting_t_initialize \
{ \
- iki_write_main_flag_none_e, \
+ iki_write_main_flag_print_first_e, \
f_state_t_initialize, \
f_string_static_t_initialize, \
f_string_static_t_initialize, \
#include "iki_write.h"
-#include "private-common.h"
-#include "private-write.h"
#ifdef __cplusplus
extern "C" {
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_line_last(setting, main->message);
return;
}
return;
}
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ iki_write_print_line_first(setting, main->message);
+ }
+
setting->escaped.used = 0;
if (main->pipe & fll_program_data_pipe_input_e) {
setting->state.status = F_status_set_error(F_pipe);
iki_write_print_error_file(setting, main->error, macro_iki_write_f(f_file_read), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+ iki_write_print_line_last(setting, main->message);
return;
}
if (!setting->buffer.used) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
fll_program_print_error_pipe_missing_content(main->error);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_line_last(setting, main->message);
return;
}
if (object_ended && previous == range.start) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
fll_program_print_error_pipe_invalid_form_feed(main->error);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_line_last(setting, main->message);
return;
}
if (object_ended) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first_locked(setting, main->error);
fll_program_print_error_pipe_object_without_content(main->error);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_line_last(setting, main->message);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->output.to);
} // for
- if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ iki_write_print_line_last(setting, main->message);
}
}
#endif // _di_iki_write_main_
#include <fll/level_2/program.h>
// IKI Write includes.
-#include <program/iki_write/main/common-print.h>
-#include <program/iki_write/main/common-string.h>
-#include <program/iki_write/main/common-type.h>
+#include <program/iki_write/main/common/print.h>
+#include <program/iki_write/main/common/string.h>
+#include <program/iki_write/main/common/type.h>
#include <program/iki_write/main/common.h>
#include <program/iki_write/main/print.h>
+#include <program/iki_write/main/print-error.h>
+#include <program/iki_write/main/process.h>
#ifdef __cplusplus
extern "C" {
fll_program_standard_set_down(&data);
- return F_status_is_error(setting.status) ? 1 : 0;
+ return F_status_is_error(setting.state.status) ? 1 : 0;
}
--- /dev/null
+#include "iki_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_iki_write_print_error_
+ f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_
+
+#ifndef _di_iki_write_print_error_file_
+ f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ iki_write_print_line_first(setting, print);
+ fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_file_
+
+#ifndef _di_iki_write_print_error_main_missing_
+ f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_object_s, print.set->notable);
+ fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
+ fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_content_s, print.set->notable);
+ fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_main_missing_
+
+#ifndef _di_iki_write_print_error_object_not_valid_
+ f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
+ fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_object_not_valid_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: UTF8
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_print_error_h
+#define _iki_write_print_error_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_iki_write_print_error_
+ extern f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_iki_write_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates how printing is to be performed.
+ * @param function
+ * The name of the function where the error happened.
+ * Set to 0 to disable.
+ * @param name
+ * The name of the file or directory.
+ * @param operation
+ * The operation that fails, such as 'create' or 'access'.
+ * @param type
+ * A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_iki_write_print_error_file_
+ extern f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+#endif // _di_iki_write_print_error_file_
+
+/**
+ * Print error message about "main" Object being missing.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ */
+#ifndef _di_iki_write_print_error_main_missing_
+ extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_error_main_missing_
+
+/**
+ * Print error message about an Object not being valid.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param object
+ * The a string representing the object that is missing.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ */
+#ifndef _di_iki_write_print_error_object_not_valid_
+ extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
+#endif // _di_iki_write_print_error_object_not_valid_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_print_error_h
#include "iki_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_iki_write_print_error_
- f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
-
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- iki_write_print_line_first_locked(setting, print);
- fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
-
- return F_none;
- }
-#endif // _di_iki_write_print_error_
-
-#ifndef _di_iki_write_print_error_file_
- f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
-
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- iki_write_print_line_first_locked(setting, print);
- fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
-
- return F_none;
- }
-#endif // _di_iki_write_print_error_file_
-
-#ifndef _di_iki_write_print_error_main_missing_
- f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
-
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- f_file_stream_lock(print.to);
-
- fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_object_s, print.set->notable);
- fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_content_s, print.set->notable);
- fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_error_main_missing_
-
-#ifndef _di_iki_write_print_error_object_not_valid_
- f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
-
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- f_file_stream_lock(print.to);
-
- iki_write_print_line_first_unlocked(setting, print);
-
- fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
- fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_error_object_not_valid_
-
#ifndef _di_iki_write_print_help_
f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print) {
+ if (!setting) return F_status_set_error(F_output_not);
+
f_file_stream_lock(print.to);
f_print_dynamic_raw(setting->line_first, print.to);
}
#endif // _di_iki_write_print_help_
-#ifndef _di_iki_write_print_line_first_locked_
- f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_iki_write_print_line_first_
+ f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
if (F_status_is_error_not(setting->state.status)) {
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
}
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_line_first_locked_
-
-#ifndef _di_iki_write_print_line_first_unlocked_
- f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (setting->flag & iki_write_main_flag_print_first_e) {
+ fll_print_dynamic_raw(setting->line_first, print.to);
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ setting->flag -= iki_write_main_flag_print_first_e;
}
- fll_print_dynamic_raw(setting->line_first, print.to);
-
return F_none;
}
-#endif // _di_iki_write_print_line_first_unlocked_
+#endif // _di_iki_write_print_line_first_
-#ifndef _di_iki_write_print_line_last_locked_
- f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_iki_write_print_line_last_
+ f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print) {
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
if (F_status_is_error_not(setting->state.status)) {
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
return F_none;
}
-#endif // _di_iki_write_print_line_last_locked_
-
-#ifndef _di_iki_write_print_line_last_unlocked_
- f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_line_last_unlocked_
+#endif // _di_iki_write_print_line_last_
#ifdef __cplusplus
} // extern "C"
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _iki_write_print_h
#define _iki_write_print_h
#endif
/**
- * Print generic error message regarding a function failing in some way.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * @see fll_error_print()
- */
-#ifndef _di_iki_write_print_error_
- extern f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
-#endif // _di_iki_write_print_error_
-
-/**
- * Print file related error or warning messages.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates how printing is to be performed.
- * @param function
- * The name of the function where the error happened.
- * Set to 0 to disable.
- * @param name
- * The name of the file or directory.
- * @param operation
- * The operation that fails, such as 'create' or 'access'.
- * @param type
- * A valid file type code from the fll_error_file_type enum.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * @see fll_error_file_print()
- */
-#ifndef _di_iki_write_print_error_file_
- extern f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
-#endif // _di_iki_write_print_error_file_
-
-/**
- * Print error message about "main" Object being missing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_error_main_missing_
- extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_error_main_missing_
-
-/**
- * Print error message about an Object not being valid.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- * @param object
- * The a string representing the object that is missing.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_error_object_not_valid_
- extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
-#endif // _di_iki_write_print_error_object_not_valid_
-
-/**
* Print help.
*
* @param setting
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
*/
#ifndef _di_iki_write_print_help_
extern f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print);
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_line_first_locked_
- extern f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
*
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
+ * F_output_not (with error bit) if setting is NULL.
*/
-#ifndef _di_iki_write_print_line_first_unlocked_
- extern f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_unlocked_
+#ifndef _di_iki_write_print_line_first_
+ extern f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_first_
/**
* Print last new line when the main is complete, unless verbosity says otherwise.
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_line_last_locked_
- extern f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
*
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
+ * F_output_not (with error bit) if setting is NULL.
*/
-#ifndef _di_iki_write_print_line_last_unlocked_
- extern f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_unlocked_
+#ifndef _di_iki_write_print_line_last_
+ extern f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_last_
#ifdef __cplusplus
} // extern "C"
+++ /dev/null
-#include "iki_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: IKI Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_common_h
-#define _PRIVATE_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Provide common/generic definitions.
- *
- * iki_write_common_allocation_*:
- * - large: An allocation step used for buffers that are anticipated to have large buffers.
- * - small: An allocation step used for buffers that are anticipated to have small buffers.
- */
-#ifndef _di_iki_write_common_
- #define iki_write_common_allocation_large_d 256
- #define iki_write_common_allocation_small_d 16
-#endif // _di_iki_write_common_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_common_h
#include "iki_write.h"
-#include "private-common.h"
-#include "private-write.h"
#ifdef __cplusplus
extern "C" {
if (!object.used) {
setting->state.status = F_status_set_error(F_failure);
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
- }
+ fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
return;
}
if (setting->state.status == F_false) {
setting->state.status = F_status_set_error(F_failure);
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error_object_not_valid(setting, main->error, object);
return;
}
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(f_iki_object_is));
return;
setting->state.status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
if (F_status_is_error(setting->state.status)) {
+ iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(fll_iki_content_escape));
return;
* Project: IKI
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the process functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
-#ifndef _PRIVATE_write_h
-#define _PRIVATE_write_h
+#ifndef _PRIVATE_write_process_h
+#define _PRIVATE_write_process_h
#ifdef __cplusplus
extern "C" {
} // extern "C"
#endif
-#endif // _PRIVATE_write_h
+#endif // _PRIVATE_write_process_h
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_sources_library main/iki_write.c main/common.c main/common-print.c main/common-string.c main/common-type.c main/print.c main/private-common.c main/private-write.c
+build_sources_library main/iki_write.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/print.c main/print-error.c main/process.c
build_sources_program main/main.c
-build_sources_headers main/iki_write.h main/common.h main/common-print.h main/common-string.h main/common-type.h main/print.h
+build_sources_headers main/iki_write.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/print.h main/print-error.h main/process.h
build_sources_documentation man
* Project: Status Code
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _status_code_fss_print_h
#define _status_code_fss_print_h
#include <program/status_code/fss/common.h>
#include <program/status_code/main/convert.h>
#include <program/status_code/main/print.h>
+#include <program/status_code/main/print-data.h>
#include <program/status_code/main/print-error.h>
#include <program/status_code/main/process.h>
if (!main || !setting) return;
+ setting->state.step_small = status_code_allocation_console_d;
+
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = status_code_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
status_code_print_error(setting, main->error, macro_status_code_f(f_console_parameter_process));
if (!(setting->flag & status_code_main_flag_number_e)) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first_locked(setting, main->error);
+ status_code_print_line_first(setting, main->message);
status_code_print_error_cannot_error_warning_number(setting, main->error);
return;
if (setting->flag & status_code_main_flag_fine_e) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first_locked(setting, main->error);
+ status_code_print_line_first(setting, main->message);
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_error_s, status_code_long_fine_s);
return;
else if (setting->flag & status_code_main_flag_warning_e && setting->flag & status_code_main_flag_fine_e) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first_locked(setting, main->error);
+ status_code_print_line_first(setting, main->message);
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_warning_s, status_code_long_fine_s);
return;
if (main->parameters.remaining.used == 0 && !(main->pipe & fll_program_data_pipe_input_e)) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first_locked(setting, main->error);
+ status_code_print_line_first(setting, main->message);
status_code_print_error_no_status_codes(setting, main->error);
return;
/**
* The program defines.
*
+ * status_code_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
+ *
* macro_status_code_setting:
* - Used to represent a cast to ((status_code_setting_t *) setting).
* - Simplifies the number of parenthesis used to make code slightly cleaner.
* - Is wrapped in a parenthesis and not a block.
*/
#ifndef _di_status_code_d_
- #define status_code_signal_check_d 20000
+ #define status_code_allocation_console_d 4
+ #define status_code_allocation_large_d 256
+ #define status_code_allocation_small_d 16
+ #define status_code_signal_check_d 20000
#define macro_status_code_setting(setting) ((status_code_setting_t *) setting)
#endif // _di_status_code_d_
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, value, number);
if (*number > F_status_size_max_with_bits_d) {
- status_code_print_line_first_data(setting, main->message);
-
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
setting->state.status = F_status_set_error(F_number_overflow);
}
if (F_status_is_error(setting->state.status)) {
- status_code_print_line_first_data(setting, main->message);
-
if (F_status_set_fine(setting->state.status) == F_number_negative) {
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
}
else {
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_invalid_number_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_number_s);
}
}
else {
* Project: Status Code
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the convert functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _PRIVATE_status_code_convert_h
#define _PRIVATE_status_code_convert_h
--- /dev/null
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_status_code_print_data_code_
+ f_status_t status_code_print_data_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+ fll_print_format("%ui%r", print.to, code, f_string_eol_s);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_data_code_
+
+#ifndef _di_status_code_print_data_context_value_
+ f_status_t status_code_print_data_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+ fll_print_format("%[%Q%]%r", print.to, context, value, context, f_string_eol_s);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_data_context_value_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print data functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_print_data_h
+#define _status_code_print_data_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic code.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param code
+ * The code to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_print_format()
+ */
+#ifndef _di_status_code_print_data_code_
+ extern f_status_t status_code_print_data_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code);
+#endif // _di_status_code_print_data_code_
+
+/**
+ * Print generic context wrapped value.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param context
+ * The context string to wrap the variable with.
+ * @param value
+ * The value string.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_print_format()
+ */
+#ifndef _di_status_code_print_data_context_value_
+ extern f_status_t status_code_print_data_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value);
+#endif // _di_status_code_print_data_context_value_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_print_data_h
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_status_code_print_error_
+ f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ status_code_print_line_first(setting, print);
+ fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_error_
+
+#ifndef _di_status_code_print_error_cannot_error_warning_number_
+ f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%QCannot specify the '%]", print.to, print.context, print.prefix, print.context);
+ fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_error_s, print.notable);
+ fl_print_format("%[' parameter with the '%]", print.to, print.context, print.context);
+ fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_warning_s, print.notable);
+ fl_print_format("%[' parameter when not also specifying the '%]", print.to, print.context, print.context);
+ fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_number_s, print.notable);
+ fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_error_cannot_error_warning_number_
+
+#ifndef _di_status_code_print_error_no_status_codes_
+ f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ fll_print_format("%[No status code is specified.%]%r", print.to, print.context, print.context, f_string_eol_s);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_error_no_status_codes_
+
+#ifndef _di_status_code_print_error_invalid_callback_
+ f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%QInvalid callback specified for '%]", print.to, print.context, print.prefix, print.context);
+ fl_print_format("%[%s%]", print.to, print.notable, name, print.notable);
+ fl_print_format("%[' internal setting.%]%r", print.to, print.context, print.context, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_error_invalid_callback_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_print_error_h
+#define _status_code_print_error_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_print()
+ *
+ * @see status_code_print_line_first()
+ */
+#ifndef _di_status_code_print_error_
+ extern f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_status_code_print_error_
+
+/**
+ * Print an error message when error parameter and warning parameter are specified without number parameter.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_status_code_print_error_cannot_error_warning_number_
+ extern f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_error_cannot_error_warning_number_
+
+/**
+ * Print an error message when no status codes are provided.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_print_format()
+ */
+#ifndef _di_status_code_print_error_no_status_codes_
+ extern f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_error_no_status_codes_
+
+/**
+ * Print an error message when a callback from status_code_setting_t is invalid.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param name
+ * The name of the callback setting that is invalid.
+ * This should either be 'status_string_from' or 'status_string_to'.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_status_code_print_error_invalid_callback_
+ extern f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name);
+#endif // _di_status_code_print_error_invalid_callback_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_print_error_h
extern "C" {
#endif
-#ifndef _di_status_code_print_code_
- f_status_t status_code_print_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-
- fll_print_format("%ui%r", print.to, code, f_string_eol_s);
-
- return F_none;
- }
-#endif // _di_status_code_print_code_
-
-#ifndef _di_status_code_print_context_value_
- f_status_t status_code_print_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-
- fll_print_format("%[%Q%]%r", print.to, context, value, context, f_string_eol_s);
-
- return F_none;
- }
-#endif // _di_status_code_print_context_value_
-
-#ifndef _di_status_code_print_error_
- f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- status_code_print_line_first_locked(setting, print);
- fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
-
- return F_none;
- }
-#endif // _di_status_code_print_error_
-
-#ifndef _di_status_code_print_error_cannot_error_warning_number_
- f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- f_file_stream_lock(print.to);
-
- fl_print_format("%[%QCannot specify the '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_error_s, print.notable);
- fl_print_format("%[' parameter with the '%]", print.to, print.context, print.context);
- fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_warning_s, print.notable);
- fl_print_format("%[' parameter when not also specifying the '%]", print.to, print.context, print.context);
- fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_number_s, print.notable);
- fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
-
- return F_none;
- }
-#endif // _di_status_code_print_error_cannot_error_warning_number_
-
-#ifndef _di_status_code_print_error_no_status_codes_
- f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- fll_print_format("%[No status code is specified.%]%r", print.to, print.context, print.context, f_string_eol_s);
-
- return F_none;
- }
-#endif // _di_status_code_print_error_no_status_codes_
-
-#ifndef _di_status_code_print_error_invalid_callback_
- f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- f_file_stream_lock(print.to);
-
- fl_print_format("%[%QInvalid callback specified for '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%s%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[' internal setting.%]%r", print.to, print.context, print.context, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
-
- return F_none;
- }
-#endif // _di_status_code_print_error_invalid_callback_
-
#ifndef _di_status_code_print_help_
f_status_t status_code_print_help(status_code_setting_t * const setting, const fl_print_t print) {
}
#endif // _di_status_code_print_help_detail_
-#ifndef _di_status_code_print_line_first_data_
- f_status_t status_code_print_line_first_data(status_code_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_status_code_print_line_first_
+ f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print) {
if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-
- if (setting->flag & status_code_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- setting->flag -= status_code_main_flag_print_first_e;
+ if (F_status_is_error_not(setting->state.status)) {
+ if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
}
- return F_none;
- }
-#endif // _di_status_code_print_line_first_data_
-
-#ifndef _di_status_code_print_line_first_locked_
- f_status_t status_code_print_line_first_locked(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
if (setting->flag & status_code_main_flag_print_first_e) {
fll_print_dynamic_raw(setting->line_first, print.to);
setting->flag -= status_code_main_flag_print_first_e;
}
- else {
- fll_print_dynamic_raw(f_string_eol_s, print.to);
- }
return F_none;
}
-#endif // _di_status_code_print_line_first_locked_
+#endif // _di_status_code_print_line_first_
-#ifndef _di_status_code_print_line_first_unlocked_
- f_status_t status_code_print_line_first_unlocked(status_code_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_status_code_print_line_last_
+ f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print) {
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & status_code_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= status_code_main_flag_print_first_e;
- }
- else {
- fll_print_dynamic_raw(f_string_eol_s, print.to);
+ if (F_status_is_error_not(setting->state.status)) {
+ if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
}
- return F_none;
- }
-#endif // _di_status_code_print_line_first_unlocked_
-
-#ifndef _di_status_code_print_line_last_locked_
- f_status_t status_code_print_line_last_locked(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
fll_print_dynamic_raw(setting->line_last, print.to);
return F_none;
}
-#endif // _di_status_code_print_line_last_locked_
-
-#ifndef _di_status_code_print_line_last_unlocked_
- f_status_t status_code_print_line_last_unlocked(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_status_code_print_line_last_unlocked_
+#endif // _di_status_code_print_line_last_
#ifdef __cplusplus
} // extern "C"
* Project: Status Code
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _status_code_print_h
#define _status_code_print_h
#endif
/**
- * Print generic code.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- * @param code
- * The code to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_format()
- */
-#ifndef _di_status_code_print_code_
- f_status_t status_code_print_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code);
-#endif // _di_status_code_print_code_
-
-/**
- * Print generic context wrapped value.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- * @param context
- * The context string to wrap the variable with.
- * @param value
- * The value string.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_format()
- */
-#ifndef _di_status_code_print_context_value_
- f_status_t status_code_print_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value);
-#endif // _di_status_code_print_context_value_
-
-/**
- * Print generic error message regarding a function failing in some way.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_error_print()
- *
- * @see status_code_print_line_first_locked()
- */
-#ifndef _di_status_code_print_error_
- extern f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function);
-#endif // _di_status_code_print_error_
-
-/**
- * Print an error message when error parameter and warning parameter are specified without number parameter.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see fl_print_format()
- */
-#ifndef _di_status_code_print_error_cannot_error_warning_number_
- extern f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_error_cannot_error_warning_number_
-
-/**
- * Print an error message when no status codes are provided.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_format()
- */
-#ifndef _di_status_code_print_error_no_status_codes_
- extern f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_error_no_status_codes_
-
-/**
- * Print an error message when a callback from status_code_setting_t is invalid.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- * @param name
- * The name of the callback setting that is invalid.
- * This should either be 'status_string_from' or 'status_string_to'.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see fl_print_format()
- */
-#ifndef _di_status_code_print_error_invalid_callback_
- extern f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name);
-#endif // _di_status_code_print_error_invalid_callback_
-
-/**
* Print help.
*
* @param setting
* Print first new line, if applicable, otherwise nothing.
*
* This is generally intended to be used before data prints.
- * This should probably be printed to setting.message while data goes to setting.output.
*
* This ensures a first line is printed if the data is the first output to be performed.
*
*
* @see fll_print_dynamic_raw()
*/
-#ifndef _di_status_code_print_line_first_data_
- extern f_status_t status_code_print_line_first_data(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_data_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_first_locked_
- extern f_status_t status_code_print_line_first_locked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_first_unlocked_
- extern f_status_t status_code_print_line_first_unlocked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_unlocked_
+#ifndef _di_status_code_print_line_first_
+ extern f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_line_first_
/**
* Print last new line when the main is complete, unless verbosity says otherwise.
*
* @see fll_print_dynamic_raw()
*/
-#ifndef _di_status_code_print_line_last_locked_
- extern f_status_t status_code_print_line_last_locked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- * This does not alter setting.state.status.
- * @param print
- * Designates the how and where to print.
- *
- * @return
- * F_none on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see f_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_last_unlocked_
- extern f_status_t status_code_print_line_last_unlocked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_last_unlocked_
+#ifndef _di_status_code_print_line_last_
+ extern f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_line_last_
#ifdef __cplusplus
} // extern "C"
f_file_stream_lock(main->output.to);
- status_code_print_line_first_unlocked(setting, main->output);
-
if ((setting->flag & status_code_main_flag_error_e) && F_status_is_error(number) || (setting->flag & status_code_main_flag_warning_e) && F_status_is_warning(number) || (setting->flag & status_code_main_flag_fine_e) && F_status_is_fine(number)) {
f_print_dynamic_raw(f_status_true_s, main->output.to);
}
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, value, &number);
if (setting->state.status == F_none) {
- status_code_print_line_first_data(setting, main->message);
-
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_invalid_name_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_name_s);
setting->state.status = F_status_set_error(F_parameter);
}
if (setting->state.status == F_data_not || F_status_set_fine(setting->state.status) == F_parameter) {
- status_code_print_line_first_data(setting, main->message);
-
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_invalid_main_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_main_s);
return;
}
setting->state.status = setting->status_string_from(value, &code);
if (F_status_is_error(setting->state.status)) {
- status_code_print_line_first_data(setting, main->message);
-
if (F_status_set_fine(setting->state.status) == F_data) {
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_unknown_name_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_name_s);
}
else {
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
}
return;
}
if (setting->state.status == F_data) {
- status_code_print_line_first_data(setting, main->message);
-
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
setting->state.status = F_none;
code = F_status_set_warning(code);
}
- status_code_print_line_first_data(setting, main->message);
-
- status_code_print_code(setting, main->output, code);
+ status_code_print_data_code(setting, main->output, code);
setting->state.status = F_none;
}
setting->state.status = setting->status_string_to((f_status_t) number, &name);
}
- status_code_print_line_first_data(setting, main->message);
-
if (F_status_is_error(setting->state.status)) {
if (F_status_set_fine(setting->state.status) == F_data) {
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
}
else {
- status_code_print_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
+ status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
}
return;
}
- status_code_print_context_value(setting, main->output, f_color_set_empty_s, name);
+ status_code_print_data_context_value(setting, main->output, f_color_set_empty_s, name);
setting->state.status = F_none;
}
* Project: Status Code
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the process functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _PRIVATE_status_code_process_h
#define _PRIVATE_status_code_process_h
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- status_code_print_line_last_locked(setting, main->error);
+ status_code_print_line_last(setting, main->message);
return;
}
return;
}
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ status_code_print_line_first(setting, main->message);
+ }
+
f_status_t status = F_none;
if (setting->flag & status_code_main_flag_number_e) {
}
}
- if (F_status_is_error(setting->state.status)) {
- status_code_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
+ if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+ status_code_print_line_last(setting, main->message);
}
}
#endif // _di_status_code_main_
#include <program/status_code/main/common.h>
#include <program/status_code/main/convert.h>
#include <program/status_code/main/print.h>
+#include <program/status_code/main/print-data.h>
#include <program/status_code/main/print-error.h>
#include <program/status_code/main/process.h>
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_sources_library main/status_code.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print.c main/print-error.c main/process.c
+build_sources_library main/status_code.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print.c main/print-data.c main/print-error.c main/process.c
build_sources_library fss/status_code.c fss/common.c
-build_sources_headers main/status_code.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print.h main/print-error.h main/process.h
+build_sources_headers main/status_code.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print.h main/print-data.h main/print-error.h main/process.h
build_sources_headers fss/status_code.h fss/common.h
build_sources_documentation man
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the bytesequence functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _PRIVATE_utf8_bytesequence_h
#define _PRIVATE_utf8_bytesequence_h
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the codepoint functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _PRIVATE_utf8_codepoint_h
#define _PRIVATE_utf8_codepoint_h
if (!main || !setting) return;
+ setting->state.step_small = utf8_allocation_console_d;
+
f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ setting->state.step_small = utf8_allocation_small_d;
+
if (F_status_is_error(setting->state.status)) {
utf8_print_line_first(setting, main->message);
utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_process));
if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) {
setting->state.status = F_status_set_error(F_parameter);
+ utf8_print_line_first(setting, main->message);
utf8_print_error_parameter_file_to_too_many(setting, main->error);
return;
/**
* The program defines.
+ *
+ * utf8_*:
+ * - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers.
+ * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers.
+ * - signal_check: Number of iterations before performing signal check in non-threaded signal handling.
*/
#ifndef _di_utf8_d_
- #define utf8_signal_check_d 20000
+ #define utf8_allocation_console_d 4
+ #define utf8_allocation_large_d 256
+ #define utf8_allocation_small_d 16
+ #define utf8_signal_check_d 20000
#endif // _di_utf8_d_
/**
#ifndef _di_utf8_print_data_bytesequence_
f_status_t utf8_print_data_bytesequence(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
fl_print_format("%r%r%r", print.to, setting->prepend, sequence, setting->append);
#ifndef _di_utf8_print_data_character_invalid_
f_status_t utf8_print_data_character_invalid(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t invalid) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
if (!invalid.used) return F_output_not;
#ifndef _di_utf8_print_data_codepoint_
f_status_t utf8_print_data_codepoint(utf8_setting_t * const setting, const fl_print_t print, const uint32_t codepoint) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
if (codepoint < 0x10000) {
fl_print_format("%rU+%04_U%r", print.to, setting->prepend, codepoint, setting->append);
#ifndef _di_utf8_print_data_combining_or_width_
f_status_t utf8_print_data_combining_or_width(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
if (setting->mode & utf8_mode_to_combining_e) {
f_status_t status = f_utf_is_combining(sequence.string, sequence.used);
#ifndef _di_utf8_print_data_combining_or_width_invalid_
f_status_t utf8_print_data_combining_or_width_invalid(utf8_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
fl_print_format("%r%[%r%]%r", print.to, setting->prepend, setting->valid_not, utf8_string_unknown_s, setting->valid_not, setting->append);
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print data functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _utf8_print_data_h
#define _utf8_print_data_h
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- utf8_print_line_first(setting, print);
-
fll_print_format("%[%QToo many '%r' files specified, there may only be one '%r' file.%]%r", print.to, print.set->error, print.prefix, utf8_string_to_s, utf8_string_to_s, print.set->error, f_string_eol_s);
return F_none;
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _utf8_print_error_h
#define _utf8_print_error_h
* F_output_not (with error bit) if setting is NULL.
*
* @see fll_print_format()
- *
- * @see utf8_print_line_first()
*/
#ifndef _di_utf8_print_error_parameter_file_to_too_many_
extern f_status_t utf8_print_error_parameter_file_to_too_many(utf8_setting_t * const setting, const fl_print_t print);
#ifndef _di_utf8_print_help_
f_status_t utf8_print_help(utf8_setting_t * const setting, const fl_print_t print) {
- if (!setting) return F_output_not;
+ if (!setting) return F_status_set_error(F_output_not);
f_file_stream_lock(print.to);
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (F_status_is_error_not(setting->state.status)) {
+ if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ }
+
if (setting->flag & utf8_main_flag_print_first_e) {
fll_print_dynamic_raw(setting->line_first, print.to);
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _utf8_print_h
#define _utf8_print_h
* Project: UTF8
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
+ *
+ * Provides the process functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
*/
#ifndef _utf8_process_h
#define _utf8_process_h
return;
}
- utf8_print_line_first(setting, main->message);
+ if (main->message.verbosity > f_console_verbosity_error_e) {
+ utf8_print_line_first(setting, main->message);
+ }
f_status_t valid = F_true;