Lots of printing related changes and clean ups.
Begin preparing things for switching to the *_main_t structures.
The fake, status_code, and utf8 projects are already converted to this.
There is a lot of stubbing in this commit.
I am probably going to just start a clean slate when building fss_read.
The fss_read will be based off of fss_write's design.
For this reason, I am being lax and negligent on the fss_*_read projects as they are going to get replaced and merged into fss_read.
#endif
#ifndef _di_fll_error_print_
- f_status_t fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag) {
+ f_status_t fll_error_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
return private_fll_error_print(print, status, function, flag);
}
#endif // _di_fll_error_print_
#ifndef _di_fll_error_file_print_
- f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+ f_status_t fll_error_file_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
f_string_static_t type_name = fll_error_file_type_file_s;
}
if (status == F_access_denied) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QAccess denied while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QAccess denied while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_access_group) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QCurrent user is not allowed to use the given group while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QCurrent user is not allowed to use the given group while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_access_owner) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QCurrent user is not allowed to use the given owner while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QCurrent user is not allowed to use the given owner while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_directory) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid directory while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QInvalid directory while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_directory_empty_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', not empty.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', not empty.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_error) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', already in an error state->%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', already in an error state->%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_failure) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_close) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', failed to close.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', failed to close.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_closed) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', is closed.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', is closed.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_descriptor) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFile descriptor error while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFile descriptor error while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_descriptor_max) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QMax file descriptors reached while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QMax file descriptors reached while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_descriptor_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid file descriptor while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QInvalid file descriptor while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_empty) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', %Q is empty.%]%r", print.to, print.context, type_name, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', %Q is empty.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_flush) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', flush failed.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', flush failed.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_found) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', found.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', found.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_found_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', could not find.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', could not find.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_open) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', already open.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', already open.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_open_max) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QMax open files reached while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QMax open files reached while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_overflow) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QOverflow while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QOverflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_purge) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', purge failed.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', purge failed.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_read) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QRead failed while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QRead failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_seek) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QSeek failed while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QSeek failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_stat) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QStat failed while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QStat failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_synchronize) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QSynchronize failed while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QSynchronize failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_type_unknown) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[' is an unknown file type.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[' is an unknown file type.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_utf) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUTF failure while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUTF failure while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_utf_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid UTF while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QInvalid UTF while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_underflow) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnderflow while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnderflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_write) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', write failure.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', write failure.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_loop) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QLoop while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QLoop while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_name) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid %Q name '%]", print.to, print.context, print.prefix, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QInvalid %Q name '%]", print->to, print->context, print->prefix, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number_overflow) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QNumber overflow while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QNumber overflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number_underflow) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QNumber underflow while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QNumber underflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_parameter) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid parameter", print.to, print.context, print.prefix);
+ fl_print_format("%[%QInvalid parameter", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(" for the %Q '%]", print.to, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format(" for the %Q '%]", print->to, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_prohibited) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QProhibited by system while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QProhibited by system while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_read_only) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', %Q is read only.%]%r", print.to, print.context, type_name, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', %Q is read only.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
if (status == F_write_only) {
private_fll_error_print_unable_to(print, operation, name, type_name, "is write only");
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[', %Q is write only.%]%r", print.to, print.context, type_name, print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[', %Q is write only.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
if (type == fll_error_file_type_file_e) {
if (status == F_file_type_not_directory) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid or missing directory in path while trying to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QInvalid or missing directory in path while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_type_directory) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[' is a directory.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[' is a directory.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
else if (type == fll_error_file_type_directory_e) {
if (status == F_file_type_regular) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[' is a file.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[' is a file.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
if (type == fll_error_file_type_file_e || type == fll_error_file_type_directory_e || type == fll_error_file_type_path_e) {
if (status == F_directory_found_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[' due to an invalid directory in the path.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[' due to an invalid directory in the path.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_type_pipe || status == F_file_type_socket) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print.to, print.context, print.prefix, operation, type_name, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%[' is a %Q.%]%r", print.to, print.context, status == F_file_type_pipe ? fll_error_file_type_pipe_s : fll_error_file_type_socket_s, print.context, f_string_eol_s);
+ fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%[' is a %Q.%]%r", print->to, print->context, status == F_file_type_pipe ? fll_error_file_type_pipe_s : fll_error_file_type_socket_s, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
#endif // _di_fll_error_file_print_
#ifndef _di_fll_error_parameter_integer_print_
- f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t parameter, const f_string_static_t argument) {
+ f_status_t fll_error_parameter_integer_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t parameter, const f_string_static_t argument) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
if (status == F_data_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QThe argument for the parameter '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, parameter, print.notable);
- fl_print_format("%[' must not be an empty string.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QThe argument for the parameter '%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable);
+ fl_print_format("%[' must not be an empty string.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QThe argument '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, argument, print.notable);
- fl_print_format("%[' is not a valid number for the parameter '%]", print.to, print.context, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, parameter, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable);
+ fl_print_format("%[' is not a valid number for the parameter '%]", print->to, print->context, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number_negative) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QThe argument '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, argument, print.notable);
- fl_print_format("%[' is negative, which is not allowed for the parameter '%]", print.to, print.context, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, parameter, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable);
+ fl_print_format("%[' is negative, which is not allowed for the parameter '%]", print->to, print->context, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number_overflow) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QThe argument '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, argument, print.notable);
- fl_print_format("%[' is too large for the parameter '%]", print.to, print.context, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, parameter, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable);
+ fl_print_format("%[' is too large for the parameter '%]", print->to, print->context, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number_positive) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QThe argument '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, argument, print.notable);
- fl_print_format("%[' is positive, which is not allowed for the parameter '%]", print.to, print.context, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, parameter, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable);
+ fl_print_format("%[' is positive, which is not allowed for the parameter '%]", print->to, print->context, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_number_underflow) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QThe argument '%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, argument, print.notable);
- fl_print_format("%[' is too small for the parameter '%]", print.to, print.context, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, parameter, print.notable);
- fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s);
+ fl_print_format("%[%QThe argument '%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, argument, print->notable);
+ fl_print_format("%[' is too small for the parameter '%]", print->to, print->context, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, parameter, print->notable);
+ fl_print_format("%['.%]%r", print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
* F_true is returned if the status code is unknown.
*/
#ifndef _di_fll_error_print_
- extern f_status_t fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag);
+ extern f_status_t fll_error_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag);
#endif // _di_fll_error_print_
/**
* F_false is returned on successful print of known errors.
*/
#ifndef _di_fll_error_file_print_
- extern f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+ extern f_status_t fll_error_file_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
#endif // _di_fll_error_file_print_
/**
* F_false is returned on successful print of known errors.
*/
#ifndef _di_fll_error_parameter_integer_print_
- extern f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t parameter, const f_string_static_t argument);
+ extern f_status_t fll_error_parameter_integer_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t parameter, const f_string_static_t argument);
#endif // _di_fll_error_parameter_integer_print_
#ifdef __cplusplus
#endif
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- f_status_t private_fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag) {
+ f_status_t private_fll_error_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) {
if (status == F_access_denied) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QAccess denied", print.to, print.context, print.prefix);
+ fl_print_format("%[%QAccess denied", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_array_too_large) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QMaximum array length reached", print.to, print.context, print.prefix);
+ fl_print_format("%[%QMaximum array length reached", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_buffer_too_large) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QMaximum buffer length reached", print.to, print.context, print.prefix);
+ fl_print_format("%[%QMaximum buffer length reached", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_error) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QAn error has occurred", print.to, print.context, print.prefix);
+ fl_print_format("%[%QAn error has occurred", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_file_found_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFile not found", print.to, print.context, print.prefix);
+ fl_print_format("%[%QFile not found", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_memory_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to allocate memory", print.to, print.context, print.prefix);
+ fl_print_format("%[%QUnable to allocate memory", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_parameter) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid parameter", print.to, print.context, print.prefix);
+ fl_print_format("%[%QInvalid parameter", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_string_too_large) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QMaximum string length reached", print.to, print.context, print.prefix);
+ fl_print_format("%[%QMaximum string length reached", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_utf_not) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid UTF-8 character found", print.to, print.context, print.prefix);
+ fl_print_format("%[%QInvalid UTF-8 character found", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_utf_fragment) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QUTF-8 character (fragment) found", print.to, print.context, print.prefix);
+ fl_print_format("%[%QUTF-8 character (fragment) found", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_complete_not_utf || status == F_complete_not_utf_eos || status == F_complete_not_utf_stop) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInvalid (incomplete) UTF-8 character found", print.to, print.context, print.prefix);
+ fl_print_format("%[%QInvalid (incomplete) UTF-8 character found", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
if (status == F_complete_not_utf_eos) {
- fl_print_format(" at the end of string.%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(" at the end of string.%]%r", print->to, print->context, f_string_eol_s);
}
else if (status == F_complete_not_utf_stop) {
- fl_print_format(" at the stop point of string.%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(" at the stop point of string.%]%r", print->to, print->context, f_string_eol_s);
}
else {
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
}
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_failure) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QFailure", print.to, print.context, print.prefix);
+ fl_print_format("%[%QFailure", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_signal) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QSignal received", print.to, print.context, print.prefix);
+ fl_print_format("%[%QSignal received", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
if (status == F_interrupt) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%QInterrupt signal received", print.to, print.context, print.prefix);
+ fl_print_format("%[%QInterrupt signal received", print->to, print->context, print->prefix);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
return F_false;
}
- if ((flag & fll_error_file_flag_fallback_e) && print.verbosity != f_console_verbosity_quiet_e) {
- if (print.verbosity != f_console_verbosity_quiet_e) {
- flockfile(print.to.stream);
+ if ((flag & fll_error_file_flag_fallback_e) && print->verbosity != f_console_verbosity_quiet_e) {
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format("%[%Q(%]", print.to, print.context, print.prefix, print.context);
- fl_print_format("%[%ui%]%[)", print.to, print.notable, status, print.notable, print.context);
+ fl_print_format("%[%Q(%]", print->to, print->context, print->prefix, print->context);
+ fl_print_format("%[%ui%]%[)", print->to, print->notable, status, print->notable, print->context);
private_fll_error_print_function(print, function);
- fl_print_format(".%]%r", print.to, print.context, f_string_eol_s);
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
}
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- void private_fll_error_print_function(const fl_print_t print, const f_string_t function) {
+ void private_fll_error_print_function(fl_print_t * const print, const f_string_t function) {
if (function) {
- fl_print_format(" when calling function%] ", print.to, print.context);
- fl_print_format("%[%S%]", print.to, print.notable, function, print.notable);
- fl_print_format("%[()", print.to, print.context);
+ fl_print_format(" when calling function%] ", print->to, print->context);
+ fl_print_format("%[%S%]", print->to, print->notable, function, print->notable);
+ fl_print_format("%[()", print->to, print->context);
}
}
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- void private_fll_error_print_unable_to(const fl_print_t print, const f_string_static_t operation, const f_string_static_t name, const f_string_static_t type, const f_string_t message) {
+ void private_fll_error_print_unable_to(fl_print_t * const print, const f_string_static_t operation, const f_string_static_t name, const f_string_static_t type, const f_string_t message) {
- if (print.verbosity < f_console_verbosity_error_e) return;
+ if (print->verbosity < f_console_verbosity_error_e) return;
- flockfile(print.to.stream);
+ flockfile(print->to.stream);
- fl_print_format("%[%QUnable to %Q %Q '%]", print.to, print.context, print.prefix, operation, type, print.context);
- fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable);
- fl_print_format("%['%S%S.%]%r", print.to, print.context, message ? ", " : "", message ? message : "", print.context, f_string_eol_s);
+ fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type, print->context);
+ fl_print_format("%[%Q%]", print->to, print->notable, name, print->notable);
+ fl_print_format("%['%S%S.%]%r", print->to, print->context, message ? ", " : "", message ? message : "", print->context, f_string_eol_s);
- funlockfile(print.to.stream);
+ funlockfile(print->to.stream);
}
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
* @see fll_error_file_print()
*/
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- extern f_status_t private_fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag) F_attribute_visibility_internal_d;
+ extern f_status_t private_fll_error_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
/**
* @see fll_error_file_print()
*/
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- extern void private_fll_error_print_function(const fl_print_t print, const f_string_t function) F_attribute_visibility_internal_d;
+ extern void private_fll_error_print_function(fl_print_t * const print, const f_string_t function) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
/**
* @see fll_error_file_print()
*/
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- extern void private_fll_error_print_unable_to(const fl_print_t print, const f_string_static_t operation, const f_string_static_t name, const f_string_static_t type_name, const f_string_t message) F_attribute_visibility_internal_d;
+ extern void private_fll_error_print_unable_to(fl_print_t * const print, const f_string_static_t operation, const f_string_static_t name, const f_string_static_t type_name, const f_string_t message) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
#ifdef __cplusplus
#endif
#if !defined(_di_fll_program_print_help_option_) || !defined(_di_fll_program_print_help_option_standard_)
- f_status_t private_fll_program_print_help_option(const fl_print_t print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description) {
+ f_status_t private_fll_program_print_help_option(fl_print_t * const print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description) {
- fl_print_format("%r %Q%[%Q%]", print.to, f_string_eol_s, symbol_short, print.set->standout, option_short, print.set->standout);
- fl_print_format(", %Q%[%Q%] %S", print.to, symbol_long, print.set->standout, option_long, print.set->standout, description);
+ fl_print_format(" %Q%[%Q%]", print->to, symbol_short, print->set->standout, option_short, print->set->standout);
+ fl_print_format(", %Q%[%Q%] %S%r", print->to, symbol_long, print->set->standout, option_long, print->set->standout, description, f_string_eol_s);
return F_none;
}
#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_handle_)
- uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const main) {
+ uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const program) {
- if (!main || main->signal.id == -1) return 0;
+ if (!program || program->signal.id == -1) return 0;
struct signalfd_siginfo information;
memset(&information, 0, sizeof(struct signalfd_siginfo));
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
+ if (f_signal_read(program->signal, 0, &information) == F_signal) {
switch (information.ssi_signo) {
case F_signal_abort:
case F_signal_broken_pipe:
case F_signal_interrupt:
case F_signal_quit:
case F_signal_termination:
- main->signal_received = information.ssi_signo;
+ program->signal_received = information.ssi_signo;
return information.ssi_signo;
}
* @see fll_program_print_help_option_standard()
*/
#if !defined(_di_fll_program_print_help_option_) || !defined(_di_fll_program_print_help_option_standard_)
- extern f_status_t private_fll_program_print_help_option(const fl_print_t print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description) F_attribute_visibility_internal_d;
+ extern f_status_t private_fll_program_print_help_option(fl_print_t * const print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_program_print_help_option_) || !defined(_di_fll_program_print_help_option_standard_)
/**
*
* Intended to be shared to each of the different implementation variations.
*
- * @param main
- * The main program data.
+ * @param program
+ * The program data.
*
* @return
* A positive number representing a valid signal on signal received.
* @see fll_program_standard_signal_handle()
*/
#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;
+ uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const program) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
/**
#endif // _di_fll_program_parameter_additional_rip_mash_
#ifndef _di_fll_program_standard_set_down_
- f_status_t fll_program_standard_set_down(fll_program_data_t * const main) {
+ f_status_t fll_program_standard_set_down(fll_program_data_t * const program) {
#ifndef _di_level_2_parameter_checking_
- if (!main) return F_status_set_error(F_parameter);
+ if (!program) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
// The fclose() calls have undefined behavior when closing an already closed file.
// 0x20 = message descriptor, 0x40 = output descriptor, 0x80 = error descriptor, 0x100 = warning descriptor, 0x200 = debug descriptor.
uint16_t flag = 0;
- if (main->message.to.stream) {
- if (main->message.to.stream != F_type_error_d && main->message.to.stream != F_type_input_d && main->message.to.stream != F_type_output_d) {
- f_file_stream_flush(main->message.to);
+ if (program->message.to.stream) {
+ if (program->message.to.stream != F_type_error_d && program->message.to.stream != F_type_input_d && program->message.to.stream != F_type_output_d) {
+ f_file_stream_flush(program->message.to);
flag |= 0x1;
}
}
- if (main->message.to.id == -1) {
- if (main->message.to.id != F_type_descriptor_error_d && main->message.to.id != F_type_descriptor_input_d && main->message.to.id != F_type_descriptor_output_d) {
- f_file_flush(main->message.to);
+ if (program->message.to.id == -1) {
+ if (program->message.to.id != F_type_descriptor_error_d && program->message.to.id != F_type_descriptor_input_d && program->message.to.id != F_type_descriptor_output_d) {
+ f_file_flush(program->message.to);
flag |= 0x20;
}
}
- if (main->output.to.stream) {
- if (main->output.to.stream != main->message.to.stream) {
- if (main->output.to.stream != F_type_error_d && main->output.to.stream != F_type_input_d && main->output.to.stream != F_type_output_d) {
- f_file_stream_flush(main->output.to);
+ if (program->output.to.stream) {
+ if (program->output.to.stream != program->message.to.stream) {
+ if (program->output.to.stream != F_type_error_d && program->output.to.stream != F_type_input_d && program->output.to.stream != F_type_output_d) {
+ f_file_stream_flush(program->output.to);
flag |= 0x2;
}
}
}
- if (main->error.to.id != -1) {
- if (main->output.to.id != main->message.to.id) {
- if (main->output.to.id != F_type_descriptor_error_d && main->output.to.id != F_type_descriptor_input_d && main->output.to.id != F_type_descriptor_output_d) {
- f_file_flush(main->output.to);
+ if (program->error.to.id != -1) {
+ if (program->output.to.id != program->message.to.id) {
+ if (program->output.to.id != F_type_descriptor_error_d && program->output.to.id != F_type_descriptor_input_d && program->output.to.id != F_type_descriptor_output_d) {
+ f_file_flush(program->output.to);
flag |= 0x40;
}
}
}
- if (main->error.to.stream) {
- if (main->error.to.stream != main->message.to.stream && main->error.to.stream != main->output.to.stream) {
- if (main->error.to.stream != F_type_error_d && main->error.to.stream != F_type_input_d && main->error.to.stream != F_type_output_d) {
- f_file_stream_flush(main->error.to);
+ if (program->error.to.stream) {
+ if (program->error.to.stream != program->message.to.stream && program->error.to.stream != program->output.to.stream) {
+ if (program->error.to.stream != F_type_error_d && program->error.to.stream != F_type_input_d && program->error.to.stream != F_type_output_d) {
+ f_file_stream_flush(program->error.to);
flag |= 0x4;
}
}
}
- if (main->error.to.id != -1) {
- if (main->error.to.id != main->message.to.id && main->error.to.id != main->output.to.id) {
- if (main->error.to.id != F_type_descriptor_error_d && main->error.to.id != F_type_descriptor_input_d && main->error.to.id != F_type_descriptor_output_d) {
- f_file_flush(main->error.to);
+ if (program->error.to.id != -1) {
+ if (program->error.to.id != program->message.to.id && program->error.to.id != program->output.to.id) {
+ if (program->error.to.id != F_type_descriptor_error_d && program->error.to.id != F_type_descriptor_input_d && program->error.to.id != F_type_descriptor_output_d) {
+ f_file_flush(program->error.to);
flag |= 0x80;
}
}
}
- if (main->warning.to.stream) {
- if (main->warning.to.stream != main->message.to.stream && main->warning.to.stream != main->output.to.stream && main->warning.to.stream != main->error.to.stream) {
- if (main->warning.to.stream != F_type_error_d && main->warning.to.stream != F_type_input_d && main->warning.to.stream != F_type_output_d) {
- f_file_stream_flush(main->warning.to);
+ if (program->warning.to.stream) {
+ if (program->warning.to.stream != program->message.to.stream && program->warning.to.stream != program->output.to.stream && program->warning.to.stream != program->error.to.stream) {
+ if (program->warning.to.stream != F_type_error_d && program->warning.to.stream != F_type_input_d && program->warning.to.stream != F_type_output_d) {
+ f_file_stream_flush(program->warning.to);
flag |= 0x8;
}
}
}
- if (main->warning.to.id != -1) {
- if (main->warning.to.id != main->message.to.id && main->warning.to.id != main->output.to.id && main->warning.to.id != main->error.to.id) {
- if (main->warning.to.id != F_type_descriptor_error_d && main->warning.to.id != F_type_descriptor_input_d && main->warning.to.id != F_type_descriptor_output_d) {
- f_file_flush(main->warning.to);
+ if (program->warning.to.id != -1) {
+ if (program->warning.to.id != program->message.to.id && program->warning.to.id != program->output.to.id && program->warning.to.id != program->error.to.id) {
+ if (program->warning.to.id != F_type_descriptor_error_d && program->warning.to.id != F_type_descriptor_input_d && program->warning.to.id != F_type_descriptor_output_d) {
+ f_file_flush(program->warning.to);
flag |= 0x100;
}
}
- if (main->debug.to.stream) {
- if (main->debug.to.stream != main->message.to.stream && main->debug.to.stream != main->output.to.stream && main->debug.to.stream != main->error.to.stream && main->debug.to.stream != main->warning.to.stream) {
- if (main->debug.to.stream != F_type_error_d && main->debug.to.stream != F_type_input_d && main->debug.to.stream != F_type_output_d) {
- f_file_stream_flush(main->debug.to);
+ if (program->debug.to.stream) {
+ if (program->debug.to.stream != program->message.to.stream && program->debug.to.stream != program->output.to.stream && program->debug.to.stream != program->error.to.stream && program->debug.to.stream != program->warning.to.stream) {
+ if (program->debug.to.stream != F_type_error_d && program->debug.to.stream != F_type_input_d && program->debug.to.stream != F_type_output_d) {
+ f_file_stream_flush(program->debug.to);
flag |= 0x10;
}
}
}
- if (main->debug.to.id != -1) {
- if (main->debug.to.id != main->message.to.id && main->debug.to.id != main->output.to.id && main->debug.to.id != main->error.to.id && main->debug.to.id != main->warning.to.id) {
- if (main->debug.to.id != F_type_descriptor_error_d && main->debug.to.id != F_type_descriptor_input_d && main->debug.to.id != F_type_descriptor_output_d) {
- f_file_flush(main->debug.to);
+ if (program->debug.to.id != -1) {
+ if (program->debug.to.id != program->message.to.id && program->debug.to.id != program->output.to.id && program->debug.to.id != program->error.to.id && program->debug.to.id != program->warning.to.id) {
+ if (program->debug.to.id != F_type_descriptor_error_d && program->debug.to.id != F_type_descriptor_input_d && program->debug.to.id != F_type_descriptor_output_d) {
+ f_file_flush(program->debug.to);
flag |= 0x200;
}
}
if (flag & 0x1) {
- f_file_stream_close(&main->message.to);
+ f_file_stream_close(&program->message.to);
}
if (flag & 0x2) {
- f_file_stream_close(&main->output.to);
+ f_file_stream_close(&program->output.to);
}
if (flag & 0x4) {
- f_file_stream_close(&main->error.to);
+ f_file_stream_close(&program->error.to);
}
if (flag & 0x8) {
- f_file_stream_close(&main->warning.to);
+ f_file_stream_close(&program->warning.to);
}
if (flag & 0x10) {
- f_file_stream_close(&main->debug.to);
+ f_file_stream_close(&program->debug.to);
}
if (flag & 0x20) {
- f_file_close(&main->message.to);
+ f_file_close(&program->message.to);
}
if (flag & 0x40) {
- f_file_close(&main->output.to);
+ f_file_close(&program->output.to);
}
if (flag & 0x80) {
- f_file_close(&main->error.to);
+ f_file_close(&program->error.to);
}
if (flag & 0x100) {
- f_file_close(&main->warning.to);
+ f_file_close(&program->warning.to);
}
if (flag & 0x200) {
- f_file_close(&main->debug.to);
+ f_file_close(&program->debug.to);
}
// 0x1 = output stream, 0x2 = error stream, 0x4 = input stream.
f_file_close(&file);
}
- const f_status_t status = f_signal_close(&main->signal);
+ const f_status_t status = f_signal_close(&program->signal);
if (F_status_is_error(status)) return status;
return F_none;
#endif // _di_fll_program_standard_set_down_
#ifndef _di_fll_program_standard_set_up_
- f_status_t fll_program_standard_set_up(fll_program_data_t * const main) {
+ f_status_t fll_program_standard_set_up(fll_program_data_t * const program) {
#ifndef _di_level_2_parameter_checking_
- if (!main) return F_status_set_error(F_parameter);
+ if (!program) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- f_signal_set_empty(&main->signal.set);
- f_signal_set_add(F_signal_abort, &main->signal.set);
- f_signal_set_add(F_signal_broken_pipe, &main->signal.set);
- f_signal_set_add(F_signal_hangup, &main->signal.set);
- f_signal_set_add(F_signal_interrupt, &main->signal.set);
- f_signal_set_add(F_signal_quit, &main->signal.set);
- f_signal_set_add(F_signal_termination, &main->signal.set);
+ f_signal_set_empty(&program->signal.set);
+ f_signal_set_add(F_signal_abort, &program->signal.set);
+ f_signal_set_add(F_signal_broken_pipe, &program->signal.set);
+ f_signal_set_add(F_signal_hangup, &program->signal.set);
+ f_signal_set_add(F_signal_interrupt, &program->signal.set);
+ f_signal_set_add(F_signal_quit, &program->signal.set);
+ f_signal_set_add(F_signal_termination, &program->signal.set);
- f_status_t status = f_signal_mask(SIG_BLOCK, &main->signal.set, 0);
+ f_status_t status = f_signal_mask(SIG_BLOCK, &program->signal.set, 0);
if (F_status_is_error(status)) return status;
- status = f_signal_open(&main->signal);
+ status = f_signal_open(&program->signal);
// If there is an error opening a signal descriptor, then do not handle signals.
if (F_status_is_error(status)) {
- f_signal_mask(SIG_UNBLOCK, &main->signal.set, 0);
- f_signal_close(&main->signal);
+ f_signal_mask(SIG_UNBLOCK, &program->signal.set, 0);
+ f_signal_close(&program->signal);
return status;
}
// Unblock all other signals.
- memset(&main->signal.set, 0, sizeof(sigset_t));
+ memset(&program->signal.set, 0, sizeof(sigset_t));
- f_signal_set_fill(&main->signal.set);
- f_signal_set_delete(F_signal_abort, &main->signal.set);
- f_signal_set_delete(F_signal_broken_pipe, &main->signal.set);
- f_signal_set_delete(F_signal_hangup, &main->signal.set);
- f_signal_set_delete(F_signal_interrupt, &main->signal.set);
- f_signal_set_delete(F_signal_quit, &main->signal.set);
- f_signal_set_delete(F_signal_termination, &main->signal.set);
+ f_signal_set_fill(&program->signal.set);
+ f_signal_set_delete(F_signal_abort, &program->signal.set);
+ f_signal_set_delete(F_signal_broken_pipe, &program->signal.set);
+ f_signal_set_delete(F_signal_hangup, &program->signal.set);
+ f_signal_set_delete(F_signal_interrupt, &program->signal.set);
+ f_signal_set_delete(F_signal_quit, &program->signal.set);
+ f_signal_set_delete(F_signal_termination, &program->signal.set);
- status = f_signal_mask(SIG_UNBLOCK, &main->signal.set, 0);
+ status = f_signal_mask(SIG_UNBLOCK, &program->signal.set, 0);
if (F_status_is_error(status)) return status;
return F_none;
#endif // _di_fll_program_standard_set_up_
#ifndef _di_fll_program_standard_signal_received_
- uint32_t fll_program_standard_signal_received(fll_program_data_t * const main) {
+ uint32_t fll_program_standard_signal_received(fll_program_data_t * const program) {
#ifndef _di_level_2_parameter_checking_
- if (!main) return 0;
+ if (!program) return 0;
#endif // _di_level_2_parameter_checking_
- return private_fll_program_standard_signal_received(main);
+ return private_fll_program_standard_signal_received(program);
}
#endif // _di_fll_program_standard_signal_received_
return;
}
- fll_program_data_t * const data = (fll_program_data_t *) state->custom;
+ fll_program_data_t * const program = (fll_program_data_t *) state->custom;
- data->signal_received = private_fll_program_standard_signal_received(data);
+ program->signal_received = private_fll_program_standard_signal_received(program);
- if (data->signal_received == F_signal_abort || data->signal_received == F_signal_broken_pipe || data->signal_received == F_signal_hangup || data->signal_received == F_signal_interrupt || data->signal_received == F_signal_quit || data->signal_received == F_signal_termination) {
+ if (program->signal_received == F_signal_abort || program->signal_received == F_signal_broken_pipe || program->signal_received == F_signal_hangup || program->signal_received == F_signal_interrupt || program->signal_received == F_signal_quit || program->signal_received == F_signal_termination) {
state->status = F_status_set_error(F_interrupt);
}
else {
* - Closes standard inputs and outputs.
* - Closes the signal handler.
*
- * @param main
- * The main program data.
+ * @param program
+ * The program data.
*
* @return
* F_none on success.
* @see f_signal_close()
*/
#ifndef _di_fll_program_standard_set_down_
- extern f_status_t fll_program_standard_set_down(fll_program_data_t * const main);
+ extern f_status_t fll_program_standard_set_down(fll_program_data_t * const program);
#endif // _di_fll_program_standard_set_down_
/**
* This does the following:
* - Handle signals so that program can cleanly exit, de-allocating as appropriate.
*
- * @param main
- * The main program data.
+ * @param program
+ * The program data.
*
* @return
* F_none on success.
* @see f_signal_set_fill()
*/
#ifndef _di_fll_program_standard_set_up_
- extern f_status_t fll_program_standard_set_up(fll_program_data_t * const main);
+ extern f_status_t fll_program_standard_set_up(fll_program_data_t * const program);
#endif // _di_fll_program_standard_set_up_
/**
*
* If no signals are blocked, then this always returns F_false.
*
- * @param main
- * The main program data.
- * The main->signal must be used to designate blocked signals.
+ * @param program
+ * The program data.
+ * The program.signal must be used to designate blocked signals.
*
* @return
* A positive number representing a valid signal on signal received.
* @see f_signal_read()
*/
#ifndef _di_fll_program_standard_signal_received_
- extern uint32_t fll_program_standard_signal_received(fll_program_data_t * const main);
+ extern uint32_t fll_program_standard_signal_received(fll_program_data_t * const program);
#endif // _di_fll_program_standard_signal_received_
/**
#endif
#ifndef _di_fll_program_print_copyright_
- f_status_t fll_program_print_copyright(const fl_print_t print) {
+ f_status_t fll_program_print_copyright(fl_print_t * const print) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Copyright © 2007-2023 Kevin Day.%r", print->to, f_string_eol_s);
#ifndef _di_detailed_copyright_
- if (print.verbosity > f_console_verbosity_quiet_e) {
- if (print.verbosity > f_console_verbosity_normal_e) {
- fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", print.to, f_string_eol_s, f_string_eol_s);
- fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", print.to, f_string_eol_s);
+ if (print->verbosity > f_console_verbosity_quiet_e) {
+ if (print->verbosity > f_console_verbosity_normal_e) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", print->to, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", print->to, f_string_eol_s);
}
- fl_print_format("%rSource code license lgpl-2.1-or-later.%r", print.to, f_string_eol_s, f_string_eol_s);
- fl_print_format("Standard and specification license open-standard-license-1.0.%r", print.to, f_string_eol_s);
- fl_print_format("Documentation license cc-by-sa-4.0.%r", print.to, f_string_eol_s);
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", print->to, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", print->to, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r", print->to, f_string_eol_s);
}
#endif // _di_detailed_copyright_
- fl_print_format("%r", print.to, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_copyright_
#ifndef _di_fll_program_print_error_missing_file_
- f_status_t fll_program_print_error_missing_file(const fl_print_t print) {
+ f_status_t fll_program_print_error_missing_file(fl_print_t * const print) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QNo files are specified.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QNo files are specified.%]%r", print->to, print->set->error, print->prefix, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_missing_file_
#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) {
+ f_status_t fll_program_print_error_missing_variable_not_zero(fl_print_t * const print, const f_string_static_t variable) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe%] ", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, variable, print.set->notable);
- fl_print_format("%[ is missing or has a length of%] ", print.to, print.set->error, print.set->error);
- fl_print_format("%[0%]", print.to, print.set->notable, print.set->notable);
- fl_print_format("%[.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe%] ", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, variable, print->set->notable);
+ fl_print_format("%[ is missing or has a length of%] ", print->to, print->set->error, print->set->error);
+ fl_print_format("%[0%]", print->to, print->set->notable, print->set->notable);
+ fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_missing_variable_not_zero_
#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) {
+ f_status_t fll_program_print_error_parameter_both_specified_same_amount(fl_print_t * const 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) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
- fl_print_format("%[' parameter and the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
- fl_print_format("%[' parameter must be specified the same number of times.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_1, name_1, print->set->notable);
+ fl_print_format("%[' parameter and the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_2, name_2, print->set->notable);
+ fl_print_format("%[' parameter must be specified the same number of times.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_both_specified_same_amount_
#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) {
+ f_status_t fll_program_print_error_parameter_both_specified_same_amount_without(fl_print_t * const 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) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
- fl_print_format("%[' parameter and the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
- fl_print_format("%[' parameter must be specified the same number of times when not specifying the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_3, name_3, print.set->notable);
- fl_print_format("%[' parameter.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_1, name_1, print->set->notable);
+ fl_print_format("%[' parameter and the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_2, name_2, print->set->notable);
+ fl_print_format("%[' parameter must be specified the same number of times when not specifying the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_3, name_3, print->set->notable);
+ fl_print_format("%[' parameter.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_both_specified_same_amount_without_
#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) {
+ f_status_t fll_program_print_error_parameter_cannot_use_with(fl_print_t * const 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) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QCannot specify the '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
- fl_print_format("%[' parameter with the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
- fl_print_format("%[' parameter.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QCannot specify the '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_1, name_1, print->set->notable);
+ fl_print_format("%[' parameter with the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_2, name_2, print->set->notable);
+ fl_print_format("%[' parameter.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_cannot_use_with_
#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) {
+ f_status_t fll_program_print_error_parameter_cannot_use_with_without(fl_print_t * const 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) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QCannot specify the '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
- fl_print_format("%[' parameter with the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
- fl_print_format("%[' parameter without the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_3, name_3, print.set->notable);
- fl_print_format("%[' parameter.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QCannot specify the '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_1, name_1, print->set->notable);
+ fl_print_format("%[' parameter with the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_2, name_2, print->set->notable);
+ fl_print_format("%[' parameter without the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_3, name_3, print->set->notable);
+ fl_print_format("%[' parameter.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_cannot_use_with_without_
#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) {
+ f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t parameter) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QCannot specify the '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, parameter, print.set->notable);
- fl_print_format("%[' when processing a pipe.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QCannot specify the '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, parameter, print->set->notable);
+ fl_print_format("%[' when processing a pipe.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_cannot_use_with_pipe_
#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) {
+ f_status_t fll_program_print_error_parameter_cannot_use_with_xor(fl_print_t * const 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) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
- fl_print_format("%[' parameter only allows either the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
- fl_print_format("%[' parameter or the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_3, name_3, print.set->notable);
- fl_print_format("%[' parameter, but not both.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_1, name_1, print->set->notable);
+ fl_print_format("%[' parameter only allows either the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_2, name_2, print->set->notable);
+ fl_print_format("%[' parameter or the '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol_3, name_3, print->set->notable);
+ fl_print_format("%[' parameter, but not both.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_cannot_use_with_xor_
#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) {
+ f_status_t fll_program_print_error_parameter_integer_not(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
- fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%[' is not a valid integer.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable);
+ fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%[' is not a valid integer.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_integer_not_
#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) {
+ f_status_t fll_program_print_error_parameter_integer_not_negative(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
- fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%[' is not a valid negative integer.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable);
+ fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%[' is not a valid negative integer.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_integer_not_negative_
#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) {
+ f_status_t fll_program_print_error_parameter_integer_not_positive(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
- fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%[' is not a valid positive integer.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, value, print->set->notable);
+ fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%[' is not a valid positive integer.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_integer_not_positive_
#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) {
+ f_status_t fll_program_print_error_parameter_missing_value(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe parameter%] ", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format(" %[is specified, but no value is given.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe parameter%] ", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format(" %[is specified, but no value is given.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_missing_value_
#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) {
+ f_status_t fll_program_print_error_parameter_missing_value_requires_amount(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t amount) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe parameter%] ", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%[ is specified, but%] ", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, amount, print.set->notable);
- fl_print_format(" %[values are not given.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe parameter%] ", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%[ is specified, but%] ", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, amount, print->set->notable);
+ fl_print_format(" %[values are not given.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_missing_value_requires_amount_
#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) {
+ f_status_t fll_program_print_error_parameter_must_specify_once(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%[' may only be specified once.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe parameter '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%[' may only be specified once.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_must_specify_once_
#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) {
+ f_status_t fll_program_print_error_parameter_must_specify_once_value(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, value, print.set->notable);
- fl_print_format("%[' may only be specified once for the parameter '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%['.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%%[%QThe value '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, value, print->set->notable);
+ fl_print_format("%[' may only be specified once for the parameter '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_must_specify_once_value_
#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) {
+ f_status_t fll_program_print_error_parameter_process(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QFailure while processing the parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%['.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QFailure while processing the parameter '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_process_
#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) {
+ f_status_t fll_program_print_error_parameter_range_start_before_stop(fl_print_t * const 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) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe start range value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, value_start, print.set->notable);
- fl_print_format("%[' may not be greater than the stop value '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, value_stop, print.set->notable);
- fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
- fl_print_format("%['.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe start range value '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, value_start, print->set->notable);
+ fl_print_format("%[' may not be greater than the stop value '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%]", print->to, print->set->notable, value_stop, print->set->notable);
+ fl_print_format("%[' for the parameter '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->set->notable, symbol, name, print->set->notable);
+ fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_range_start_before_stop_
#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) {
+ f_status_t fll_program_print_error_parameter_value_too_long(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe value for the parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol, name, print.notable);
- fl_print_format("%[' is too long.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe value for the parameter '%]", print->to, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%Q%Q%]", print->to, print->notable, symbol, name, print->notable);
+ fl_print_format("%[' is too long.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_parameter_value_too_long_
#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) {
+ f_status_t fll_program_print_error_pipe_invalid_form_feed(fl_print_t * const print) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe pipe has incorrectly placed form-feed characters (\\f).%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe pipe has incorrectly placed form-feed characters (\\f).%]%r", print->to, print->set->error, print->prefix, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_pipe_invalid_form_feed_
#ifndef _di_fll_program_print_error_pipe_missing_content_
- f_status_t fll_program_print_error_pipe_missing_content(const fl_print_t print) {
+ f_status_t fll_program_print_error_pipe_missing_content(fl_print_t * const print) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe pipe has no content.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe pipe has no content.%]%r", print->to, print->set->error, print->prefix, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_pipe_missing_content_
#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) {
+ f_status_t fll_program_print_error_pipe_object_without_content(fl_print_t * const print) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- fl_print_format("%r%[%QThe pipe has an Object without Content.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%[%QThe pipe has an Object without Content.%]%r", print->to, print->set->error, print->prefix, print->set->error, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_error_pipe_object_without_content_
#ifndef _di_fll_program_print_help_header_
- f_status_t fll_program_print_help_header(const fl_print_t print, const f_string_static_t name, const f_string_static_t version) {
+ f_status_t fll_program_print_help_header(fl_print_t * const print, const f_string_static_t name, const f_string_static_t version) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- fl_print_format(" %[%Q%]%r", print.to, print.set->title, name, print.set->title, f_string_eol_s);
- fl_print_format(" %[Version %Q%]%r", print.to, print.set->notable, version, print.set->notable, f_string_eol_s);
+ fl_print_format(" %[%Q%]%r", print->to, print->set->title, name, print->set->title, f_string_eol_s);
+ fl_print_format(" %[Version %Q%]%r%r", print->to, print->set->notable, version, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format("%r %[Available Options:%] ", print.to, f_string_eol_s, print.set->important, print.set->important);
+ fl_print_format(" %[Available Options:%] %r", print->to, print->set->important, print->set->important, f_string_eol_s);
return F_none;
}
#endif // _di_fll_program_print_help_header_
#ifndef _di_fll_program_print_help_option_
- f_status_t fll_program_print_help_option(const fl_print_t print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description) {
+ f_status_t fll_program_print_help_option(fl_print_t * const print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
return private_fll_program_print_help_option(print, option_short, option_long, symbol_short, symbol_long, description);
}
#endif // _di_fll_program_print_help_option_
#ifndef _di_fll_program_print_help_option_standard_
- f_status_t fll_program_print_help_option_standard(const fl_print_t print) {
+ f_status_t fll_program_print_help_option_standard(fl_print_t * const print) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
private_fll_program_print_help_option(print, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print this help message.");
private_fll_program_print_help_option(print, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Print the copyright.");
private_fll_program_print_help_option(print, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Output using colors that show up better on dark backgrounds.");
private_fll_program_print_help_option(print, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Output using colors that show up better on light backgrounds.");
private_fll_program_print_help_option(print, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Do not print using color.");
- private_fll_program_print_help_option(print, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Decrease verbosity, silencing most print.to.");
- private_fll_program_print_help_option(print, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Decrease verbosity, using only error print.to.");
+ private_fll_program_print_help_option(print, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Decrease verbosity, silencing most print->to.");
+ private_fll_program_print_help_option(print, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Decrease verbosity, using only error print->to.");
private_fll_program_print_help_option(print, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Set verbosity to normal.");
- private_fll_program_print_help_option(print, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Increase verbosity beyond normal print.to.");
- private_fll_program_print_help_option(print, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Enable debugging, significantly increasing verbosity beyond normal print.to.");
+ private_fll_program_print_help_option(print, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Increase verbosity beyond normal print->to.");
+ private_fll_program_print_help_option(print, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Enable debugging, significantly increasing verbosity beyond normal print->to.");
private_fll_program_print_help_option(print, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Print only the version number.");
private_fll_program_print_help_option(print, f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, "Disable printing of first line.");
private_fll_program_print_help_option(print, f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Disable printing of last line.");
#endif // _di_fll_program_print_help_option_standard_
#ifndef _di_fll_program_print_help_option_long_
- f_status_t fll_program_print_help_option_long(const fl_print_t print, const f_string_static_t option_long, const f_string_static_t symbol_long, const char *description) {
+ f_status_t fll_program_print_help_option_long(fl_print_t * const print, const f_string_static_t option_long, const f_string_static_t symbol_long, const char *description) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- fl_print_format("%r %Q%[%Q%] %S", print.to, f_string_eol_s, symbol_long, print.set->standout, option_long, print.set->standout, description);
+ fl_print_format(" %Q%[%Q%] %S%r", print->to, symbol_long, print->set->standout, option_long, print->set->standout, description, f_string_eol_s);
return F_none;
}
#endif // _di_fll_program_print_help_option_long_
#ifndef _di_fll_program_print_help_option_other_
- f_status_t fll_program_print_help_option_other(const fl_print_t print, const f_string_static_t option_other, const char *description) {
+ f_status_t fll_program_print_help_option_other(fl_print_t * const print, const f_string_static_t option_other, const char *description) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- fl_print_format("%r %[%Q%] %S", print.to, f_string_eol_s, print.set->standout, option_other, print.set->standout, description);
+ fl_print_format(" %[%Q%] %S%r", print->to, print->set->standout, option_other, print->set->standout, description, f_string_eol_s);
return F_none;
}
#endif // _di_fll_program_print_help_option_other_
#ifndef _di_fll_program_print_help_usage_
- f_status_t fll_program_print_help_usage(const fl_print_t print, const f_string_static_t name, const f_string_static_t parameters) {
+ f_status_t fll_program_print_help_usage(fl_print_t * const print, const f_string_static_t name, const f_string_static_t parameters) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- fl_print_format(" %[Usage:%]%r", print.to, print.set->important, print.set->important, f_string_eol_s);
+ fl_print_format(" %[Usage:%]%r", print->to, print->set->important, print->set->important, f_string_eol_s);
- fl_print_format(" %[%Q%]", print.to, print.set->standout, name, print.set->standout);
- fl_print_format(" %[[%] options %[]%]", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable);
+ fl_print_format(" %[%Q%]", print->to, print->set->standout, name, print->set->standout);
+ fl_print_format(" %[[%] options %[]%]", print->to, print->set->notable, print->set->notable, print->set->notable, print->set->notable);
if (parameters.used) {
- fl_print_format(" %[[%] %Q %[]%]", print.to, print.set->notable, print.set->notable, parameters, print.set->notable, print.set->notable);
+ fl_print_format(" %[[%] %Q %[]%]", print->to, print->set->notable, print->set->notable, parameters, print->set->notable, print->set->notable);
}
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
return F_none;
}
#endif // _di_fll_program_print_help_usage_
#ifndef _di_fll_program_print_signal_received_
- f_status_t fll_program_print_signal_received(const fl_print_t print, const uint32_t signal) {
+ f_status_t fll_program_print_signal_received(fl_print_t * const print, const uint32_t signal) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- if (print.verbosity != f_console_verbosity_verbose_e && print.verbosity != f_console_verbosity_debug_e) {
+ if (print->verbosity != f_console_verbosity_verbose_e && print->verbosity != f_console_verbosity_debug_e) {
return F_output_not;
}
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
- f_file_stream_flush(print.to);
+ f_file_stream_flush(print->to);
- fl_print_format("%]%r%[Received signal code %]", print.to, print.set->reset, f_string_eol_s, print.set->warning, print.set->warning);
- fl_print_format("%[%u%]", print.to, print.set->notable, signal, print.set->notable);
- fl_print_format("%[.%]%r", print.to, print.set->warning, print.set->warning, f_string_eol_s);
+ fl_print_format("%]%[Received signal code %]", print->to, print->set->reset, print->set->warning, print->set->warning);
+ fl_print_format("%[%u%]", print->to, print->set->notable, signal, print->set->notable);
+ fl_print_format("%[.%]%r", print->to, print->set->warning, print->set->warning, f_string_eol_s);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
#endif // _di_fll_program_print_signal_received_
#ifndef _di_fll_program_print_version_
- f_status_t fll_program_print_version(const fl_print_t print, const f_string_static_t version) {
+ f_status_t fll_program_print_version(fl_print_t * const print, const f_string_static_t version) {
+ #ifndef _di_level_2_parameter_checking_
+ if (!print) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameter_checking_
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
- f_print_dynamic_raw(f_string_eol_s, print.to);
- f_print_dynamic(version, print.to);
- f_print_dynamic_raw(f_string_eol_s, print.to);
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic(version, print->to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
- f_file_stream_unlock(print.to);
+ f_file_stream_unlock(print->to);
return F_none;
}
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_copyright_
- extern f_status_t fll_program_print_copyright(const fl_print_t print);
+ extern f_status_t fll_program_print_copyright(fl_print_t * const print);
#endif // _di_fll_program_print_copyright_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_missing_file_
- extern f_status_t fll_program_print_error_missing_file(const fl_print_t print);
+ extern f_status_t fll_program_print_error_missing_file(fl_print_t * const print);
#endif // _di_fll_program_print_error_missing_file_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_missing_variable_not_zero_
- extern f_status_t fll_program_print_error_missing_variable_not_zero(const fl_print_t print, const f_string_static_t variable);
+ extern f_status_t fll_program_print_error_missing_variable_not_zero(fl_print_t * const print, const f_string_static_t variable);
#endif // _di_fll_program_print_error_missing_variable_not_zero_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_both_specified_same_amount(fl_print_t * const 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);
#endif // _di_fll_program_print_error_parameter_both_specified_same_amount_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_without_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_both_specified_same_amount_without(fl_print_t * const 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);
#endif // _di_fll_program_print_error_parameter_both_specified_same_amount_without_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_cannot_use_with(fl_print_t * const 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);
#endif // _di_fll_program_print_error_parameter_cannot_use_with_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_without_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_cannot_use_with_without(fl_print_t * const 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);
#endif // _di_fll_program_print_error_parameter_cannot_use_with_without_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
- extern 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 name);
+ extern f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name);
#endif // _di_fll_program_print_error_parameter_cannot_use_with_pipe_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_allows_either_xor_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_cannot_use_with_xor(fl_print_t * const 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);
#endif // _di_fll_program_print_error_parameter_allows_either_xor_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_integer_not_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_integer_not(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value);
#endif // _di_fll_program_print_error_parameter_integer_not_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_integer_not_negative_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_integer_not_negative(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value);
#endif // _di_fll_program_print_error_parameter_integer_not_negative_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_integer_not_positive_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_integer_not_positive(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value);
#endif // _di_fll_program_print_error_parameter_integer_not_positive_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_missing_value_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_missing_value(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name);
#endif // _di_fll_program_print_error_parameter_missing_value_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_missing_value_requires_amount_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_missing_value_requires_amount(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t amount);
#endif // _di_fll_program_print_error_parameter_missing_value_requires_amount_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_must_specify_once_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_must_specify_once(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name);
#endif // _di_fll_program_print_error_parameter_must_specify_once_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_must_specify_once_value_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_must_specify_once_value(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value);
#endif // _di_fll_program_print_error_parameter_must_specify_once_value_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_process_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_process(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name);
#endif // _di_fll_program_print_error_parameter_process_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_range_start_before_stop_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_range_start_before_stop(fl_print_t * const 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);
#endif // _di_fll_program_print_error_parameter_range_start_before_stop_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_parameter_value_too_long_
- extern 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);
+ extern f_status_t fll_program_print_error_parameter_value_too_long(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name);
#endif // _di_fll_program_print_error_parameter_value_too_long_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_pipe_invalid_form_feed_
- extern f_status_t fll_program_print_error_pipe_invalid_form_feed(const fl_print_t print);
+ extern f_status_t fll_program_print_error_pipe_invalid_form_feed(fl_print_t * const print);
#endif // _di_fll_program_print_error_pipe_invalid_form_feed_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fll_program_print_error_pipe_missing_content_
- extern f_status_t fll_program_print_error_pipe_missing_content(const fl_print_t print);
+ extern f_status_t fll_program_print_error_pipe_missing_content(fl_print_t * const print);
#endif // _di_fll_program_print_error_pipe_missing_content_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
*/
#ifndef _di_fll_program_print_error_pipe_object_without_content_
- extern f_status_t fll_program_print_error_pipe_object_without_content(const fl_print_t print);
+ extern f_status_t fll_program_print_error_pipe_object_without_content(fl_print_t * const print);
#endif // _di_fll_program_print_error_pipe_object_without_content_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see f_print_terminated()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_header_
- extern f_status_t fll_program_print_help_header(const fl_print_t print, const f_string_static_t name, const f_string_static_t version);
+ extern f_status_t fll_program_print_help_header(fl_print_t * const print, const f_string_static_t name, const f_string_static_t version);
#endif // _di_fll_program_print_help_header_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see f_print_terminated()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_
- extern f_status_t fll_program_print_help_option(const fl_print_t print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description);
+ extern f_status_t fll_program_print_help_option(fl_print_t * const print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char *description);
#endif // _di_fll_program_print_help_option_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see f_print_terminated()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_long_
- extern f_status_t fll_program_print_help_option_long(const fl_print_t print, const f_string_static_t option_long, const f_string_static_t symbol_long, const char *description);
+ extern f_status_t fll_program_print_help_option_long(fl_print_t * const print, const f_string_static_t option_long, const f_string_static_t symbol_long, const char *description);
#endif // _di_fll_program_print_help_option_long_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see f_print_terminated()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_other_
- extern f_status_t fll_program_print_help_option_other(const fl_print_t print, const f_string_static_t option_other, const char *description);
+ extern f_status_t fll_program_print_help_option_other(fl_print_t * const print, const f_string_static_t option_other, const char *description);
#endif // _di_fll_program_print_help_option_other_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see f_print_terminated()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_standard_
- extern f_status_t fll_program_print_help_option_standard(const fl_print_t print);
+ extern f_status_t fll_program_print_help_option_standard(fl_print_t * const print);
#endif // _di_fll_program_print_help_option_standard_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see f_print_terminated()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see f_print_dynamic_raw()
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_usage_
- extern f_status_t fll_program_print_help_usage(const fl_print_t print, const f_string_static_t name, const f_string_static_t parameters);
+ extern f_status_t fll_program_print_help_usage(fl_print_t * const print, const f_string_static_t name, const f_string_static_t parameters);
#endif // _di_fll_program_print_help_usage_
/**
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
*/
#ifndef _di_fll_program_print_signal_received_
- extern f_status_t fll_program_print_signal_received(const fl_print_t print, const uint32_t signal);
+ extern f_status_t fll_program_print_signal_received(fl_print_t * const print, const uint32_t signal);
#endif // _di_fll_program_print_signal_received_
/**
* F_none on success.
* F_output_not on success, but no printing is performed.
*
- * @see fl_print_format()
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see f_print_dynamic()
+ * @see f_print_dynamic_raw()
*/
#ifndef _di_fll_program_print_version_
- extern f_status_t fll_program_print_version(const fl_print_t print, const f_string_static_t version);
+ extern f_status_t fll_program_print_version(fl_print_t * const print, const f_string_static_t version);
#endif // _di_fll_program_print_version_
#ifdef __cplusplus
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
}
if (main->parameters.array[byte_dump_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, byte_dump_program_version_s);
+ fll_program_print_version(&main->message, byte_dump_program_version_s);
return F_none;
}
if (main->parameters.array[byte_dump_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message);
+ fll_program_print_copyright(&main->message);
return F_none;
}
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- byte_dump_setting_t setting = byte_dump_setting_t_initialize;
+ byte_dump_main_t data = byte_dump_main_t_initialize;
+
+ data.program.debug.flag |= byte_dump_print_flag_debug_e;
+ data.program.error.flag |= byte_dump_print_flag_error_e;
+ data.program.message.flag |= byte_dump_print_flag_message_e;
+ data.program.warning.flag |= byte_dump_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = byte_dump_console_parameter_t_initialize;
data.parameters.array = parameters;
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
}
if (main->parameters.array[control_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, control_program_version_s);
+ fll_program_print_version(&main->message, control_program_version_s);
return F_none;
}
if (main->parameters.array[control_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message);
+ fll_program_print_copyright(&main->message);
return F_none;
}
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- control_setting_t setting = control_setting_t_initialize;
+ control_main_t data = control_main_t_initialize;
+
+ data.program.debug.flag |= control_print_flag_debug_e;
+ data.program.error.flag |= control_print_flag_error_e;
+ data.program.message.flag |= control_print_flag_message_e;
+ data.program.warning.flag |= control_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = control_console_parameter_t_initialize;
data.parameters.array = parameters;
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
f_thread_mutex_lock(&thread->lock.print);
}
- fll_error_print(*print, status, function, flag);
+ fll_error_print(print, status, function, flag);
if (thread) {
f_thread_mutex_unlock(&thread->lock.print);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- controller_setting_t setting = controller_setting_t_initialize;
+ controller_main_t data = controller_main_t_initialize;
+
+ data.program.debug.flag |= controller_print_flag_debug_e;
+ data.program.error.flag |= controller_print_flag_error_e;
+ data.program.message.flag |= controller_print_flag_message_e;
+ data.program.warning.flag |= controller_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = controller_console_parameter_t_initialize;
data.parameters.array = parameters;
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_short_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
f_string_dynamics_resize(0, &arguments);
if (!((++data->main->program.signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
}
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
}
if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
- fll_program_print_error_parameter_missing_value(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
}
if (fake_print_error_fallback(&main->program.error, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
- fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_process(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
if (fake_print_error_fallback(&main->program.error, macro_fake_f(f_path_directory_cleanup)) == F_false) {
- fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_process(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
}
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fll_program_print_error_parameter_missing_value(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
if (fake_print_error_fallback(&main->program.error, macro_fake_f(fll_program_parameter_additional_rip)) == F_false) {
- fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_process(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
}
// @todo fix this to print an error about the actual invalid character so that it can be investigated.
if (fake_print_error_fallback(&main->program.error, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
- fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_process(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
- * Provides common define functionality.
+ * Provides common define types.
*
* This is auto-included and should not need to be explicitly included.
*/
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
- * Provides common enumeration functionality.
+ * Provides common enumeration types.
*
* This is auto-included and should not need to be explicitly included.
*/
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
- * Provides common type functionality.
+ * Provides common type structures.
*
* This is auto-included and should not need to be explicitly included.
*/
main->setting.state.status = F_none;
- if (main->setting.flag & fake_main_flag_help_e) {
- fake_print_message_help(&main->program.message);
+ if (main->setting.flag & (fake_main_flag_help_e | fake_main_flag_version_e | fake_main_flag_copyright_e)) {
- if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ if (main->setting.flag & fake_main_flag_help_e) {
+ fake_print_message_help(&main->program.message);
}
-
- return;
- }
-
- if (main->setting.flag & fake_main_flag_version_e) {
- fll_program_print_version(main->program.message, fake_program_version_s);
-
- if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ else if (main->setting.flag & fake_main_flag_version_e) {
+ fll_program_print_version(&main->program.message, fake_program_version_s);
+ }
+ else if (main->setting.flag & fake_main_flag_copyright_e) {
+ fll_program_print_copyright(&main->program.message);
}
-
- return;
- }
-
- if (main->setting.flag & fake_main_flag_copyright_e) {
- fll_program_print_copyright(main->program.message);
if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
if (!((++main->program.signal_check) % fake_signal_check_short_d)) {
if (fll_program_standard_signal_received(&main->program)) {
- fll_program_print_signal_received(main->program.warning, main->program.signal_received);
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++main->program.signal_check) % fake_signal_check_short_d)) {
if (fll_program_standard_signal_received(&main->program)) {
- fll_program_print_signal_received(main->program.warning, main->program.signal_received);
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
do {
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (F_status_is_error(data_make->main->setting.state.status)) return;
if (fll_program_standard_signal_received(&data_make->main->program)) {
- fll_program_print_signal_received(data_make->main->program.warning, data_make->main->program.signal_received);
+ fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
data_make->main->setting.state.status = F_status_set_error(F_interrupt);
if (!(i % fake_signal_check_short_d)) {
if (fll_program_standard_signal_received(&data_make->main->program)) {
- fll_program_print_signal_received(data_make->main->program.warning, data_make->main->program.signal_received);
+ fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
data_make->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data->main->program.signal_check) % fake_signal_check_d)) {
if (fll_program_standard_signal_received(&data->main->program)) {
- fll_program_print_signal_received(data->main->program.warning, data->main->program.signal_received);
+ fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received);
data->main->setting.state.status = F_status_set_error(F_interrupt);
if (!((++data_make->main->program.signal_check) % fake_signal_check_short_d)) {
if (fll_program_standard_signal_received(&data_make->main->program)) {
- fll_program_print_signal_received(data_make->main->program.warning, data_make->main->program.signal_received);
+ fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
data_make->main->setting.state.status = F_status_set_error(F_interrupt);
}
if (fll_program_standard_signal_received(&data_make->main->program)) {
- fll_program_print_signal_received(data_make->main->program.warning, data_make->main->program.signal_received);
+ fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
data_make->main->setting.state.status = F_status_set_error(F_interrupt);
data_make->main->setting.state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
if (fll_program_standard_signal_received(&data_make->main->program)) {
- fll_program_print_signal_received(data_make->main->program.warning, data_make->main->program.signal_received);
+ fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received);
data_make->main->setting.state.status = F_status_set_error(F_interrupt);
}
if (F_status_is_error(data_make->main->setting.state.status)) {
- fll_error_print(data_make->error, F_status_set_fine(data_make->main->setting.state.status), macro_fake_f(f_string_dynamic_append), F_true);
+ fll_error_print(&data_make->error, F_status_set_fine(data_make->main->setting.state.status), macro_fake_f(f_string_dynamic_append), F_true);
}
else {
data_make->main->setting.state.status = F_none;
fake_main_t * const main = (fake_main_t *) print->custom;
- fll_error_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e);
+ fll_error_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e);
return F_none;
}
return F_false;
}
- if (fll_error_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_none_e) == F_known_not && fallback && print->verbosity > f_console_verbosity_quiet_e) {
+ if (fll_error_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_none_e) == F_known_not && fallback && print->verbosity > f_console_verbosity_quiet_e) {
f_file_stream_lock(print->to);
fl_print_format("%[UNKNOWN %Q(%]", print->to, print->context, print->prefix, print->context);
fake_main_t * const main = (fake_main_t *) print->custom;
- if (fll_error_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_none_e) == F_known_not) return F_false;
+ if (fll_error_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_none_e) == F_known_not) return F_false;
return F_true;
}
fake_main_t * const main = (fake_main_t *) print->custom;
- fll_error_file_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+ fll_error_file_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
return F_none;
}
fake_main_t * const main = (fake_main_t *) print->custom;
- fll_error_file_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_simple_e, name, operation, type);
+ fll_error_file_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_simple_e, name, operation, type);
return F_none;
}
return F_false;
}
- if (fll_error_print(*print, main->setting.state.status, function, fll_error_file_flag_none_e) == F_known_not && fallback) {
+ if (fll_error_print(print, main->setting.state.status, function, fll_error_file_flag_none_e) == F_known_not && fallback) {
if (print->verbosity > f_console_verbosity_quiet_e) {
f_string_static_t function_s = f_string_static_t_initialize;
function_s.string = function;
f_file_stream_lock(print->to);
- fll_program_print_help_header(*print, fake_program_name_long_s, fake_program_version_s);
+ fll_program_print_help_header(print, fake_program_name_long_s, fake_program_version_s);
- fll_program_print_help_option_standard(*print);
+ fll_program_print_help_option_standard(print);
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(*print, fake_short_define_s, fake_long_define_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Append an additional define after defines from settings file.");
- fll_program_print_help_option(*print, fake_short_fakefile_s, fake_long_fakefile_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Use this fakefile.");
- fll_program_print_help_option(*print, fake_short_mode_s, fake_long_mode_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use this mode when processing the build settings.");
- fll_program_print_help_option(*print, fake_short_process_s, fake_long_process_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Process name for storing build states.");
- fll_program_print_help_option(*print, fake_short_settings_s, fake_long_settings_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Use this settings file.");
+ fll_program_print_help_option(print, fake_short_define_s, fake_long_define_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Append an additional define after defines from settings file.");
+ fll_program_print_help_option(print, fake_short_fakefile_s, fake_long_fakefile_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Use this fakefile.");
+ fll_program_print_help_option(print, fake_short_mode_s, fake_long_mode_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use this mode when processing the build settings.");
+ fll_program_print_help_option(print, fake_short_process_s, fake_long_process_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Process name for storing build states.");
+ fll_program_print_help_option(print, fake_short_settings_s, fake_long_settings_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Use this settings file.");
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(*print, fake_short_build_s, fake_long_build_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom build directory.");
- fll_program_print_help_option(*print, fake_short_data_s, fake_long_data_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom path to the data files.");
- fll_program_print_help_option(*print, fake_short_documents_s, fake_long_documents_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Specify a custom path to the documents files.");
- fll_program_print_help_option(*print, fake_short_licenses_s, fake_long_licenses_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom path to the licenses files.");
- fll_program_print_help_option(*print, fake_short_sources_s, fake_long_sources_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom path to the source files.");
- fll_program_print_help_option(*print, fake_short_work_s, fake_long_work_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use includes/libraries/programs from this directory instead of system.");
+ fll_program_print_help_option(print, fake_short_build_s, fake_long_build_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom build directory.");
+ fll_program_print_help_option(print, fake_short_data_s, fake_long_data_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom path to the data files.");
+ fll_program_print_help_option(print, fake_short_documents_s, fake_long_documents_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Specify a custom path to the documents files.");
+ fll_program_print_help_option(print, fake_short_licenses_s, fake_long_licenses_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom path to the licenses files.");
+ fll_program_print_help_option(print, fake_short_sources_s, fake_long_sources_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom path to the source files.");
+ fll_program_print_help_option(print, fake_short_work_s, fake_long_work_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use includes/libraries/programs from this directory instead of system.");
fl_print_format("%r%r %[Special Options:%] ", print->to, f_string_eol_s, f_string_eol_s, print->set->important, print->set->important);
- fll_program_print_help_option_long(*print, fake_long_documents_disabled_s, f_console_symbol_long_normal_s, " Forcibly do not build documents files.");
- fll_program_print_help_option_long(*print, fake_long_documents_enabled_s, f_console_symbol_long_normal_s, " Forcibly do build documents files.");
- fll_program_print_help_option_long(*print, fake_long_shared_disabled_s, f_console_symbol_long_normal_s, "Forcibly do not build shared files.");
- fll_program_print_help_option_long(*print, fake_long_shared_enabled_s, f_console_symbol_long_normal_s, " Forcibly do build shared files.");
- fll_program_print_help_option_long(*print, fake_long_static_disabled_s, f_console_symbol_long_normal_s, "Forcibly do not build static files.");
- fll_program_print_help_option_long(*print, fake_long_static_enabled_s, f_console_symbol_long_normal_s, " Forcibly do build static files.");
+ fll_program_print_help_option_long(print, fake_long_documents_disabled_s, f_console_symbol_long_normal_s, " Forcibly do not build documents files.");
+ fll_program_print_help_option_long(print, fake_long_documents_enabled_s, f_console_symbol_long_normal_s, " Forcibly do build documents files.");
+ fll_program_print_help_option_long(print, fake_long_shared_disabled_s, f_console_symbol_long_normal_s, "Forcibly do not build shared files.");
+ fll_program_print_help_option_long(print, fake_long_shared_enabled_s, f_console_symbol_long_normal_s, " Forcibly do build shared files.");
+ fll_program_print_help_option_long(print, fake_long_static_disabled_s, f_console_symbol_long_normal_s, "Forcibly do not build static files.");
+ fll_program_print_help_option_long(print, fake_long_static_enabled_s, f_console_symbol_long_normal_s, " Forcibly do build static files.");
- fl_print_format("%r%r %[Operations:%] ", print->to, f_string_eol_s, f_string_eol_s, print->set->important, print->set->important);
+ fl_print_format("%r %[Operations:%] ", print->to, f_string_eol_s, print->set->important, print->set->important);
- fll_program_print_help_option_other(*print, fake_other_operation_build_s, " Build or compile the code based on build settings file.");
- fll_program_print_help_option_other(*print, fake_other_operation_clean_s, " Delete all build files.");
- fll_program_print_help_option_other(*print, fake_other_operation_make_s, " Build or compile the code based on fakefile (default).");
- fll_program_print_help_option_other(*print, fake_other_operation_skeleton_s, "Build a skeleton directory structure.");
+ fll_program_print_help_option_other(print, fake_other_operation_build_s, " Build or compile the code based on build settings file.");
+ fll_program_print_help_option_other(print, fake_other_operation_clean_s, " Delete all build files.");
+ fll_program_print_help_option_other(print, fake_other_operation_make_s, " Build or compile the code based on fakefile (default).");
+ fll_program_print_help_option_other(print, fake_other_operation_skeleton_s, "Build a skeleton directory structure.");
f_print_dynamic_raw(f_string_eol_s, print->to);
- f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_usage(*print, fake_program_name_s, fake_program_help_parameters_s);
+ fll_program_print_help_usage(print, fake_program_name_s, fake_program_help_parameters_s);
fl_print_format("%r When performing the %[%r%] operation, the", print->to, f_string_eol_s, print->set->notable, fake_other_operation_build_s, print->set->notable);
fl_print_format(" %[%r%r%] parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.%r", print->to, print->set->notable, f_console_symbol_long_normal_s, fake_long_mode_s, print->set->notable, f_string_eol_s);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
}
if (main->parameters.array[firewall_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, firewall_program_version_s);
+ fll_program_print_version(&main->message, firewall_program_version_s);
return F_none;
}
if (main->parameters.array[firewall_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message);
+ fll_program_print_copyright(&main->message);
return F_none;
}
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- firewall_setting_t setting = firewall_setting_t_initialize;
+ firewall_main_t data = firewall_main_t_initialize;
+
+ data.program.debug.flag |= firewall_read_print_flag_debug_e;
+ data.program.error.flag |= firewall_read_print_flag_error_e;
+ data.program.message.flag |= firewall_read_print_flag_message_e;
+ data.program.warning.flag |= firewall_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = firewall_console_parameter_t_initialize;
data.parameters.array = parameters;
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
}
if (main->parameters.array[fss_basic_list_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, fss_basic_list_read_program_version_s);
+ fll_program_print_version(&main->message, fss_basic_list_read_program_version_s);
return F_none;
}
if (main->parameters.array[fss_basic_list_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message);
+ fll_program_print_copyright(&main->message);
return F_none;
}
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > fss_basic_list_read_block_max && fll_program_standard_signal_received(main)) {
+ if (size_file > fss_basic_list_read_block_max && fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_basic_list_read_setting_t setting = fss_basic_list_read_setting_t_initialize;
+ fss_basic_list_read_main_t data = fss_basic_list_read_main_t_initialize;
+
+ data.program.debug.flag |= fss_basic_list_read_print_flag_debug_e;
+ data.program.error.flag |= fss_basic_list_read_print_flag_error_e;
+ data.program.message.flag |= fss_basic_list_read_print_flag_message_e;
+ data.program.warning.flag |= fss_basic_list_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_basic_list_read_console_parameter_t_initialize;
data.parameters.array = parameters;
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (i = range.start; i <= range.stop; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[at]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_signal);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > fss_basic_read_block_max && fll_program_standard_signal_received(main)) {
+ if (size_file > fss_basic_read_block_max && fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_basic_read_setting_t setting = fss_basic_read_setting_t_initialize;
+ fss_basic_read_main_t data = fss_basic_read_main_t_initialize;
+
+ data.program.debug.flag |= fss_basic_read_print_flag_debug_e;
+ data.program.error.flag |= fss_basic_read_print_flag_error_e;
+ data.program.message.flag |= fss_basic_read_print_flag_message_e;
+ data.program.warning.flag |= fss_basic_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_basic_read_console_parameter_t_initialize;
data.parameters.array = parameters;
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[at]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > fss_embedded_list_read_block_max && fll_program_standard_signal_received(main)) {
+ if (size_file > fss_embedded_list_read_block_max && fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_extended_list_read_setting_t setting = fss_extended_list_read_setting_t_initialize;
+ fss_embedded_list_read_main_t data = fss_embedded_list_read_main_t_initialize;
+
+ data.program.debug.flag |= fss_embedded_list_read_print_flag_debug_e;
+ data.program.error.flag |= fss_embedded_list_read_print_flag_error_e;
+ data.program.message.flag |= fss_embedded_list_read_print_flag_message_e;
+ data.program.warning.flag |= fss_embedded_list_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_embedded_list_read_console_parameter_t_initialize;
data.parameters.array = parameters;
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > fss_extended_list_read_block_max && fll_program_standard_signal_received(main)) {
+ if (size_file > fss_extended_list_read_block_max && fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_extended_list_read_setting_t setting = fss_extended_list_read_setting_t_initialize;
+ fss_extended_list_read_main_t data = fss_extended_list_read_main_t_initialize;
+
+ data.program.debug.flag |= fss_extended_list_read_print_flag_debug_e;
+ data.program.error.flag |= fss_extended_list_read_print_flag_error_e;
+ data.program.message.flag |= fss_extended_list_read_print_flag_message_e;
+ data.program.warning.flag |= fss_extended_list_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_extended_list_read_console_parameter_t_initialize;
data.parameters.array = parameters;
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_signal);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_signal);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > fss_extended_read_block_max && fll_program_standard_signal_received(main)) {
+ if (size_file > fss_extended_read_block_max && fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_extended_read_setting_t setting = fss_extended_read_setting_t_initialize;
+ fss_extended_read_main_t data = fss_extended_read_main_t_initialize;
+
+ data.program.debug.flag |= fss_extended_read_print_flag_debug_e;
+ data.program.error.flag |= fss_extended_read_print_flag_error_e;
+ data.program.message.flag |= fss_extended_read_print_flag_message_e;
+ data.program.warning.flag |= fss_extended_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_extended_read_console_parameter_t_initialize;
data.parameters.array = parameters;
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
}
if (main->parameters.array[fss_identify_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, fss_identify_program_version_s);
+ fll_program_print_version(&main->message, fss_identify_program_version_s);
return F_none;
}
if (main->parameters.array[fss_identify_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message);
+ fll_program_print_copyright(&main->message);
return F_none;
}
if (F_status_is_error_not(status) && (main->parameters.array[fss_identify_parameter_total_e].result & f_console_result_found_e)) {
if (main->parameters.array[fss_identify_parameter_object_e].result & f_console_result_found_e) {
if (main->error.verbosity > f_console_verbosity_quiet_e) {
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_identify_long_object_s, fss_identify_long_total_s);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_identify_long_object_s, fss_identify_long_total_s);
}
status = F_status_set_error(F_parameter);
}
else if (main->parameters.array[fss_identify_parameter_content_e].result & f_console_result_found_e) {
if (main->error.verbosity > f_console_verbosity_quiet_e) {
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_identify_long_content_s, fss_identify_long_total_s);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_identify_long_content_s, fss_identify_long_total_s);
}
status = F_status_set_error(F_parameter);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_identify_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, main->signal_received);
+ if (fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(&main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_identify_setting_t setting = fss_identify_setting_t_initialize;
+ fss_identify_main_t data = fss_identify_main_t_initialize;
+
+ data.program.debug.flag |= fss_identify_print_flag_debug_e;
+ data.program.error.flag |= fss_identify_print_flag_error_e;
+ data.program.message.flag |= fss_identify_print_flag_message_e;
+ data.program.warning.flag |= fss_identify_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_identify_console_parameter_t_initialize;
data.parameters.array = parameters;
do {
if (!((++main->signal_check) % fss_identify_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > fss_payload_read_block_max && fll_program_standard_signal_received(main)) {
+ if (size_file > fss_payload_read_block_max && fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_payload_read_setting_t setting = fss_payload_read_setting_t_initialize;
+ fss_payload_read_main_t data = fss_payload_read_main_t_initialize;
+
+ data.program.debug.flag |= fss_payload_read_print_flag_debug_e;
+ data.program.error.flag |= fss_payload_read_print_flag_error_e;
+ data.program.message.flag |= fss_payload_read_print_flag_message_e;
+ data.program.warning.flag |= fss_payload_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = fss_payload_read_console_parameter_t_initialize;
data.parameters.array = parameters;
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
for (i = range.start; i <= range.stop; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[at]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
if (!names[at]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
#include <fll/level_2/program.h>
// FSS Write includes.
+#include <program/fss_write/main/common/define.h>
+#include <program/fss_write/main/common/enumeration.h>
#include <program/fss_write/main/common-print.h>
#include <program/fss_write/main/common-string.h>
#include <program/fss_write/main/common-type.h>
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
setting.state.custom = (void *) &data;
setting.standard = fss_write_basic_standard_s;
setting.process_content = &fss_write_basic_process_content;
#include <fll/level_2/program.h>
// FSS Write includes.
+#include <program/fss_write/main/common/define.h>
+#include <program/fss_write/main/common/enumeration.h>
#include <program/fss_write/main/common-print.h>
#include <program/fss_write/main/common-string.h>
#include <program/fss_write/main/common-type.h>
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
setting.state.custom = (void *) &data;
setting.standard = fss_write_basic_list_standard_s;
setting.process_content = &fss_write_basic_list_process_content;
#include <fll/level_2/program.h>
// FSS Write includes.
+#include <program/fss_write/main/common/define.h>
+#include <program/fss_write/main/common/enumeration.h>
#include <program/fss_write/main/common-print.h>
#include <program/fss_write/main/common-string.h>
#include <program/fss_write/main/common-type.h>
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
setting.state.custom = (void *) &data;
setting.standard = fss_write_embedded_list_standard_s;
setting.process_content = &fss_write_embedded_list_process_content;
#include <fll/level_2/program.h>
// FSS Write includes.
+#include <program/fss_write/main/common/define.h>
+#include <program/fss_write/main/common/enumeration.h>
#include <program/fss_write/main/common-print.h>
#include <program/fss_write/main/common-string.h>
#include <program/fss_write/main/common-type.h>
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
setting.state.custom = (void *) &data;
setting.standard = fss_write_extended_standard_s;
setting.process_content = &fss_write_extended_process_content;
#include <fll/level_2/program.h>
// FSS Write includes.
+#include <program/fss_write/main/common/define.h>
+#include <program/fss_write/main/common/enumeration.h>
#include <program/fss_write/main/common-print.h>
#include <program/fss_write/main/common-string.h>
#include <program/fss_write/main/common-type.h>
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
setting.state.custom = (void *) &data;
setting.standard = fss_write_extended_list_standard_s;
setting.process_content = &fss_write_extended_list_process_content;
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
+ fll_program_print_error_parameter_must_specify_once(&main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_object_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, fss_write_long_object_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_content_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, fss_write_long_content_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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]);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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]);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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]);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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]);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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]);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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]);
+ 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;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- 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);
+ 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;
}
setting->state.status = F_none;
- if (setting->flag & fss_write_main_flag_help_e) {
- if (setting->process_help) {
- setting->process_help(main, (void *) setting);
- }
+ if (main->setting.flag & (fss_write_main_flag_help_e | fss_write_main_flag_version_e | fss_write_main_flag_copyright_e)) {
- if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (main->setting.flag & fss_write_main_flag_help_e) {
+ fss_write_print_message_help(&main->program.message);
}
-
- return;
- }
-
- if (setting->flag & fss_write_main_flag_version_e) {
- fll_program_print_version(main->message, fss_write_program_version_s);
-
- if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ else if (main->setting.flag & fss_write_main_flag_version_e) {
+ fll_program_print_version(&main->program.message, fss_write_program_version_s);
+ }
+ else if (main->setting.flag & fss_write_main_flag_copyright_e) {
+ fll_program_print_copyright(&main->program.message);
}
- return;
- }
-
- if (setting->flag & fss_write_main_flag_copyright_e) {
- fll_program_print_copyright(main->message);
-
- if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & fss_write_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
return;
// @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
if (!((++main->signal_check) % fss_write_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
setting->state.status = F_status_set_error(F_interrupt);
return;
for (;;) {
if (!((++main->signal_check) % fss_write_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, main->signal_received);
+ if (fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(&main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
#include <fll/level_2/program.h>
// FSS Write includes.
+#include <program/fss_write/main/common/define.h>
+#include <program/fss_write/main/common/enumeration.h>
#include <program/fss_write/main/common-print.h>
#include <program/fss_write/main/common-string.h>
#include <program/fss_write/main/common-type.h>
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
setting.state.custom = (void *) &data;
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
data.parameters.used = fss_write_total_parameters_d;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
- fll_error_print(*print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+ fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
return F_none;
}
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
- fll_error_file_print(*print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+ 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;
}
for (;;) {
if (!((++main->signal_check) % fss_write_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fss_write_setting_t setting = fss_write_setting_t_initialize;
+ fss_write_main_t data = fss_write_main_t_initialize;
+
+ data.program.debug.flag |= fss_write_print_flag_debug_e;
+ data.program.error.flag |= fss_write_print_flag_error_e;
+ data.program.message.flag |= fss_write_print_flag_message_e;
+ data.program.warning.flag |= fss_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
setting.state.custom = (void *) &data;
setting.standard = fss_write_payload_standard_s;
setting.process_content = 0; // Not used by payload.
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_missing_file(main->error);
+ fll_program_print_error_missing_file(&main->error);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_at_s, iki_read_long_whole_s);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_at_s, iki_read_long_whole_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s, main->parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->error, f_console_symbol_long_normal_s, iki_read_long_at_s, main->parameters.arguments.array[index]);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, iki_read_long_at_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s, main->parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->error, f_console_symbol_long_normal_s, iki_read_long_line_s, main->parameters.arguments.array[index]);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, iki_read_long_line_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_name_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, iki_read_long_name_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_replace_s, iki_read_string_two_s);
+ fll_program_print_error_parameter_missing_value_requires_amount(&main->error, f_console_symbol_long_normal_s, iki_read_long_replace_s, iki_read_string_two_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_wrap_s, iki_read_string_three_s);
+ fll_program_print_error_parameter_missing_value_requires_amount(&main->error, f_console_symbol_long_normal_s, iki_read_long_wrap_s, iki_read_string_three_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_literal_s, names[i]);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_literal_s, names[i]);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_object_s, names[i]);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_object_s, names[i]);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_content_s, iki_read_long_total_s);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_content_s, iki_read_long_total_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_total_s, iki_read_long_wrap_s);
+ fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_total_s, iki_read_long_wrap_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, name, iki_read_string_three_s);
+ fll_program_print_error_parameter_missing_value_requires_amount(&main->error, f_console_symbol_long_normal_s, name, iki_read_string_three_s);
return F_false;
}
--- /dev/null
+#include "../iki_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Read
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common define types.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_read_common_define_h
+#define _iki_read_common_define_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_read_common_define_h
--- /dev/null
+#include "../iki_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Read
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common enumeration types.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_read_common_enumeration_h
+#define _iki_read_common_enumeration_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Flags for fine-tuned print control.
+ *
+ * iki_read_print_flag_*_e:
+ * - none: No flags set.
+ * - debug: Stream is for debug printing.
+ * - error: Stream is for error printing.
+ * - message: Stream is for message printing.
+ * - warning: Stream is for warning printing.
+ * - file_to: Stream is a destination file.
+ * - file_from: Stream is a source file.
+ */
+#ifndef _di_iki_read_print_flag_e_
+ enum {
+ iki_read_print_flag_none_e = 0x0,
+ iki_read_print_flag_debug_e = 0x1,
+ iki_read_print_flag_error_e = 0x2,
+ iki_read_print_flag_message_e = 0x4,
+ iki_read_print_flag_warning_e = 0x8,
+ iki_read_print_flag_file_to_e = 0x10,
+ iki_read_print_flag_file_from_e = 0x20,
+ }; // enum
+#endif // _di_iki_read_print_flag_e_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_read_common_enumeration_h
}
#endif // _di_iki_read_setting_t_
+/**
+ * The main program data as a single structure.
+ *
+ * program: The main program data.
+ * setting: The settings data.
+ */
+#ifndef _di_iki_read_main_t_
+ typedef struct {
+ fll_program_data_t program;
+ iki_read_setting_t setting;
+ } iki_read_main_t;
+
+ #define iki_read_main_t_initialize \
+ { \
+ fll_program_data_t_initialize, \
+ iki_read_setting_t_initialize, \
+ }
+#endif // _di_iki_read_main_t_
+
#ifdef __cplusplus
} // extern "C"
#endif
setting->state.status = F_none;
- if (setting->flag & iki_read_main_flag_help_e) {
- iki_read_print_help(setting, main->message);
+ if (main->setting.flag & (iki_read_main_flag_help_e | iki_read_main_flag_version_e | iki_read_main_flag_copyright_e)) {
- if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (main->setting.flag & iki_read_main_flag_help_e) {
+ iki_read_print_message_help(&main->program.message);
}
-
- return;
- }
-
- if (setting->flag & iki_read_main_flag_version_e) {
- fll_program_print_version(main->message, iki_read_program_version_s);
-
- if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ else if (main->setting.flag & iki_read_main_flag_version_e) {
+ fll_program_print_version(&main->program.message, iki_read_program_version_s);
+ }
+ else if (main->setting.flag & iki_read_main_flag_copyright_e) {
+ fll_program_print_copyright(&main->program.message);
}
- return;
- }
-
- if (setting->flag & iki_read_main_flag_copyright_e) {
- fll_program_print_copyright(main->message);
-
- if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & iki_read_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
return;
for (f_array_length_t i = 0; i < setting->files.used; ++i) {
if (!((++main->signal_check) % iki_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, main->signal_received);
+ if (fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(&main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
for (size_read = 0; size_read < size_file; size_read += size_block) {
// The signal check is always performed on each pass.
- if (size_file > iki_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, main->signal_received);
+ if (size_file > iki_read_block_max && fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(&main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
#include <fll/level_2/program.h>
// IKI Read includes.
+#include <program/iki_read/main/common/define.h>
+#include <program/iki_read/main/common/enumeration.h>
#include <program/iki_read/main/common/print.h>
#include <program/iki_read/main/common/string.h>
#include <program/iki_read/main/common/type.h>
#include <program/iki_read/main/common.h>
#include <program/iki_read/main/identify.h>
-#include <program/iki_read/main/print.h>
#include <program/iki_read/main/print/data.h>
#include <program/iki_read/main/print/error.h>
+#include <program/iki_read/main/print/message.h>
#include <program/iki_read/main/process.h>
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- iki_read_setting_t setting = iki_read_setting_t_initialize;
+ iki_read_main_t data = iki_read_main_t_initialize;
+
setting.state.custom = (void *) &data;
setting.state.handle = &fll_program_standard_signal_handle;
+ data.program.debug.flag |= iki_read_print_flag_debug_e;
+ data.program.error.flag |= iki_read_print_flag_error_e;
+ data.program.message.flag |= iki_read_print_flag_message_e;
+ data.program.warning.flag |= iki_read_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
f_console_parameter_t parameters[] = iki_read_console_parameter_t_initialize;
data.parameters.array = parameters;
data.parameters.used = iki_read_total_parameters_d;
#endif
#ifndef _di_iki_read_print_help_
- f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print) {
+ f_status_t iki_read_print_help(fl_print_t * const print) {
if (!setting) return F_status_set_error(F_output_not);
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
fll_program_print_help_header(print, iki_read_program_name_long_s, iki_read_program_version_s);
fll_program_print_help_option_standard(print);
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_option(print, iki_read_short_at_s, iki_read_long_at_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Select Variable at this numeric index.");
fll_program_print_help_option(print, iki_read_short_line_s, iki_read_long_line_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print only the Variables at the given line within the file.");
fll_program_print_help_option(print, iki_read_short_name_s, iki_read_long_name_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Select Variables with this name.");
fll_program_print_help_option(print, iki_read_short_whole_s, iki_read_long_whole_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Print all of the data instead of just the IKI Variable data.");
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_option(print, iki_read_short_content_s, iki_read_long_content_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Print the Variable value (aka: Content) (default)");
fll_program_print_help_option(print, iki_read_short_literal_s, iki_read_long_literal_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Print the entire Variable (aka: Object, Content, and syntax).");
fll_program_print_help_option(print, iki_read_short_object_s, iki_read_long_object_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print the Variable name (aka: Vocabulary) (aka: Object).");
fll_program_print_help_option(print, iki_read_short_total_s, iki_read_long_total_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print the total number of Variables.");
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_option(print, iki_read_short_reassign_s, iki_read_long_reassign_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Re-assign the Variable for the given name and matching Content value with the given string.");
fll_program_print_help_option(print, iki_read_short_replace_s, iki_read_long_replace_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Simple substitution, replacing the Variable for the given name with the given string.");
fll_program_print_help_option(print, iki_read_short_substitute_s, iki_read_long_substitute_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Substitute the Variable for the given name and matching Content value with the given string.");
fll_program_print_help_option(print, iki_read_short_wrap_s, iki_read_long_wrap_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Prepend and append strings for the given name.");
- f_print_dynamic_raw(f_string_eol_s, print.to);
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_usage(print, iki_read_program_name_s, fll_program_parameter_filenames_s);
- fl_print_format("%r %[Notes:%]%r", print.to, f_string_eol_s, print.set->important, print.set->important, f_string_eol_s);
- fl_print_format(" This program will find and print Variables, Vocabularies, or Content following the IKI standard, without focusing on any particular Vocabulary specification.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format("%r %[Notes:%]%r", print->to, f_string_eol_s, print->set->important, print->set->important, f_string_eol_s);
+ fl_print_format(" This program will find and print Variables, Vocabularies, or Content following the IKI standard, without focusing on any particular Vocabulary specification.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%r%] option requires 2 additional parameters:", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print.set->notable);
- fl_print_format(" %[<%]%r%[>%]", print.to, print.set->notable, print.set->notable, iki_read_substitution_vocabulary_s, print.set->notable, print.set->notable);
- fl_print_format(" %[<%]%r%[>%].%r", print.to, print.set->notable, print.set->notable, iki_read_substitution_with_s, print.set->notable, print.set->notable, f_string_eol_s);
+ fl_print_format(" The %[%r%r%] option requires 2 additional parameters:", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%]", print->to, print->set->notable, print->set->notable, iki_read_substitution_vocabulary_s, print->set->notable, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%].%r", print->to, print->set->notable, print->set->notable, iki_read_substitution_with_s, print->set->notable, print->set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The name of the Vocabulary whose content is to be substituted.%r", print.to, print.set->notable, iki_read_substitution_vocabulary_s, print.set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The new string to use as the substitute.%r%r", print.to, print.set->notable, iki_read_substitution_with_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%]: The name of the Vocabulary whose content is to be substituted.%r", print->to, print->set->notable, iki_read_substitution_vocabulary_s, print->set->notable, f_string_eol_s);
+ fl_print_format(" %[%r%]: The new string to use as the substitute.%r%r", print->to, print->set->notable, iki_read_substitution_with_s, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The Vocabulary is case-sensitive and must exactly match.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The Vocabulary is case-sensitive and must exactly match.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%r%] and the", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_reassign_s, print.set->notable);
- fl_print_format(" %[%r%r%] options require 3 additional parameters:", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print.set->notable);
- fl_print_format(" %[<%]%r%[>%]", print.to, print.set->notable, print.set->notable, iki_read_substitution_vocabulary_s, print.set->notable, print.set->notable);
- fl_print_format(" %[<%]%r%[>%]", print.to, print.set->notable, print.set->notable, iki_read_substitution_replace_s, print.set->notable, print.set->notable);
- fl_print_format(" %[<%]%r%[>%].%r", print.to, print.set->notable, print.set->notable, iki_read_substitution_with_s, print.set->notable, print.set->notable, f_string_eol_s);
+ fl_print_format(" The %[%r%r%] and the", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_reassign_s, print->set->notable);
+ fl_print_format(" %[%r%r%] options require 3 additional parameters:", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%]", print->to, print->set->notable, print->set->notable, iki_read_substitution_vocabulary_s, print->set->notable, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%]", print->to, print->set->notable, print->set->notable, iki_read_substitution_replace_s, print->set->notable, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%].%r", print->to, print->set->notable, print->set->notable, iki_read_substitution_with_s, print->set->notable, print->set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The name of the Vocabulary whose content is to be substituted or re-assigned.%r", print.to, print.set->notable, iki_read_substitution_vocabulary_s, print.set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The Content matching this exact string will be substituted or re-assigned.%r", print.to, print.set->notable, iki_read_substitution_replace_s, print.set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The new string to use as the substitute or re-assignment.%r%r", print.to, print.set->notable, iki_read_substitution_with_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%]: The name of the Vocabulary whose content is to be substituted or re-assigned.%r", print->to, print->set->notable, iki_read_substitution_vocabulary_s, print->set->notable, f_string_eol_s);
+ fl_print_format(" %[%r%]: The Content matching this exact string will be substituted or re-assigned.%r", print->to, print->set->notable, iki_read_substitution_replace_s, print->set->notable, f_string_eol_s);
+ fl_print_format(" %[%r%]: The new string to use as the substitute or re-assignment.%r%r", print->to, print->set->notable, iki_read_substitution_with_s, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The Vocabulary and replacement are case-sensitive and must exactly match.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The Vocabulary and replacement are case-sensitive and must exactly match.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%r%] option requires 3 additional parameters:", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_wrap_s, print.set->notable);
- fl_print_format(" %[<%]%r%[>%]", print.to, print.set->notable, print.set->notable, iki_read_substitution_vocabulary_s, print.set->notable, print.set->notable);
- fl_print_format(" %[<%]%r%[>%]", print.to, print.set->notable, print.set->notable, iki_read_substitution_before_s, print.set->notable, print.set->notable);
- fl_print_format(" %[<%]%r%[>%].%r", print.to, print.set->notable, print.set->notable, iki_read_substitution_after_s, print.set->notable, print.set->notable, f_string_eol_s);
+ fl_print_format(" The %[%r%r%] option requires 3 additional parameters:", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_wrap_s, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%]", print->to, print->set->notable, print->set->notable, iki_read_substitution_vocabulary_s, print->set->notable, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%]", print->to, print->set->notable, print->set->notable, iki_read_substitution_before_s, print->set->notable, print->set->notable);
+ fl_print_format(" %[<%]%r%[>%].%r", print->to, print->set->notable, print->set->notable, iki_read_substitution_after_s, print->set->notable, print->set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The name of the Vocabulary whose content is to be wrapped.%r", print.to, print.set->notable, iki_read_substitution_vocabulary_s, print.set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The string to prepend.%r", print.to, print.set->notable, iki_read_substitution_before_s, print.set->notable, f_string_eol_s);
- fl_print_format(" %[%r%]: The string to append.%r%r", print.to, print.set->notable, iki_read_substitution_after_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%]: The name of the Vocabulary whose content is to be wrapped.%r", print->to, print->set->notable, iki_read_substitution_vocabulary_s, print->set->notable, f_string_eol_s);
+ fl_print_format(" %[%r%]: The string to prepend.%r", print->to, print->set->notable, iki_read_substitution_before_s, print->set->notable, f_string_eol_s);
+ fl_print_format(" %[%r%]: The string to append.%r%r", print->to, print->set->notable, iki_read_substitution_after_s, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The Vocabulary is case-sensitive and must exactly match.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The Vocabulary is case-sensitive and must exactly match.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The difference between %[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print.set->notable);
- fl_print_format(" and %[%r%r%] is that the", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print.set->notable);
- fl_print_format(" %[%r%r%] option substitutes all matching Vocabulary names and the", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print.set->notable);
- fl_print_format(" %[%r%r%] option substitutes all matching Vocabulary names that must also have the given matching Content.%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The difference between %[%r%r%]", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print->set->notable);
+ fl_print_format(" and %[%r%r%] is that the", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print->set->notable);
+ fl_print_format(" %[%r%r%] option substitutes all matching Vocabulary names and the", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print->set->notable);
+ fl_print_format(" %[%r%r%] option substitutes all matching Vocabulary names that must also have the given matching Content.%r%r", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_reassign_s, print.set->notable);
- fl_print_format(" option is identical to the %[%r%r%] option", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print.set->notable);
- fl_print_format(" except that the %[%r%r%] option is ignored (not applied).%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_wrap_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The %[%r%r%]", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_reassign_s, print->set->notable);
+ fl_print_format(" option is identical to the %[%r%r%] option", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print->set->notable);
+ fl_print_format(" except that the %[%r%r%] option is ignored (not applied).%r%r", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_wrap_s, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print.set->notable);
- fl_print_format(" option takes priority over the %[%r%r%] option when matching the same Variable.%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The %[%r%r%]", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_substitute_s, print->set->notable);
+ fl_print_format(" option takes priority over the %[%r%r%] option when matching the same Variable.%r%r", print->to, print->set->notable, f_console_symbol_long_normal_s, iki_read_long_replace_s, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The default behavior is to only display Content portion of the IKI Variable.%r", print.to, f_string_eol_s);
+ fl_print_format(" The default behavior is to only display Content portion of the IKI Variable.%r", print->to, f_string_eol_s);
- f_file_stream_flush(print.to);
- f_file_stream_unlock(print.to);
+ f_file_stream_flush(print->to);
+ f_file_stream_unlock(print->to);
return F_none;
}
/**
* Print help.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
* The output structure to print to.
*
+ * This does not alter print.custom.setting.state.status.
+ *
* @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_read_print_help_
- extern f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print);
+ extern f_status_t iki_read_print_help(fl_print_t * const print);
#endif // _di_iki_read_print_help_
#ifdef __cplusplus
#endif
#ifndef _di_iki_read_print_data_
- void iki_read_print_data(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) {
+ void iki_read_print_data(fl_print_t * const print, const f_array_length_t index) {
if (!setting) return;
#endif // _di_iki_read_print_data_
#ifndef _di_iki_read_print_data_wrap_append_
- void iki_read_print_data_wrap_append(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) {
+ void iki_read_print_data_wrap_append(fl_print_t * const print, const f_array_length_t index) {
if (!setting) return;
#endif // _di_iki_read_print_data_wrap_append_
#ifndef _di_iki_read_print_data_wrap_prepend_
- void iki_read_print_data_wrap_prepend(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) {
+ void iki_read_print_data_wrap_prepend(fl_print_t * const print, const f_array_length_t index) {
if (!setting) return;
* This detects and prints any applicable substitution matching the vocabulary at the given index.
* If there is no substitution, then this prints the given range at the given index.
*
- * @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * @param print
+ * The output structure to print to.
*
* The setting.map_wraps is expected to be defined as a valid pointer to an array.
* The setting.map_replaces is expected to be defined as a valid pointer to an array.
*
- * This does not alter setting.state.status.
+ * This does not alter print.custom.setting.state.status.
* @param index
* The index used to identify the desired range in variable, content, and ranges.
*
* @see iki_read_print_data_wrap_append()
*/
#ifndef _di_iki_read_print_data_
- extern void iki_read_print_data(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d;
+ extern void iki_read_print_data(fl_print_t * const print, const f_array_length_t index) F_attribute_visibility_internal_d;
#endif // _di_iki_read_print_data_
/**
*
* This expects the caller to have the output locked appropriately.
*
- * @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * @param print
+ * The output structure to print to.
*
- * This does not alter setting.state.status.
+ * This does not alter print.custom.setting.state.status.
* @param index
* The index within the setting->map_wraps array to print.
*
* @see f_print_dynamic()
*/
#ifndef _di_iki_read_print_data_wrap_append_
- extern void iki_read_print_data_wrap_append(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d;
+ extern void iki_read_print_data_wrap_append(fl_print_t * const print, const f_array_length_t index) F_attribute_visibility_internal_d;
#endif // _di_iki_read_print_data_wrap_append_
/**
*
* This expects the caller to have the output locked appropriately.
*
- * @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * @param print
+ * The output structure to print to.
*
- * This does not alter setting.state.status.
+ * This does not alter print.custom.setting.state.status.
* @param index
* The index within the setting->map_wraps array to print.
*
* @see f_print_dynamic()
*/
#ifndef _di_iki_read_print_data_wrap_prepend_
- extern void iki_read_print_data_wrap_prepend(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d;
+ extern void iki_read_print_data_wrap_prepend(fl_print_t * const print, const f_array_length_t index) F_attribute_visibility_internal_d;
#endif // _di_iki_read_print_data_wrap_prepend_
#ifdef __cplusplus
#endif
#ifndef _di_iki_read_print_error_
- f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+ f_status_t iki_read_print_error(fl_print_t * const print, const f_string_t function) {
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);
+ fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
return F_none;
}
#endif // _di_iki_read_print_error_
#ifndef _di_iki_read_print_error_file_
- f_status_t iki_read_print_error_file(iki_read_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) {
+ f_status_t iki_read_print_error_file(fl_print_t * const 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;
/**
* 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
* @see fll_error_print()
*/
#ifndef _di_iki_read_print_error_
- extern f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function);
+ extern f_status_t iki_read_print_error(fl_print_t * const print, const f_string_t function);
#endif // _di_iki_read_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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param function
* The name of the function where the error happened.
* Set to 0 to disable.
* @see fll_error_file_print()
*/
#ifndef _di_iki_read_print_error_file_
- extern f_status_t iki_read_print_error_file(iki_read_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);
+ extern f_status_t iki_read_print_error_file(fl_print_t * const 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_read_print_error_file_
#ifdef __cplusplus
--- /dev/null
+#include "../iki_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Read
+ * 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_read_print_message_h
+#define _iki_read_print_message_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_read_print_message_h
for (i = 0; i < main->parameters.array[iki_read_parameter_name_e].values.used; ++i) {
if (!((++main->signal_check) % iki_read_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, main->signal_received);
+ if (fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(&main->warning, main->signal_received);
f_string_dynamic_resize(0, &name);
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_sources_library main/iki_read.c main/common.c main/identify.c main/common/print.c main/common/string.c main/common/type.c main/print.c main/print/data.c main/print/error.c main/process.c
+build_sources_library main/iki_read.c main/common.c main/identify.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/data.c main/print/error.c main/print/message.c main/process.c
build_sources_program main/main.c
-build_sources_headers main/iki_read.h main/common.h main/identify.h main/common/print.h main/common/string.h main/common/type.h main/print.h main/print/data.h main/print/error.h main/process.h
+build_sources_headers main/iki_read.h main/common.h main/identify.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/data.h main/print/error.h main/print/message.h main/process.h
build_sources_documentation man
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(setting->state.status)) {
if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
+ fll_program_print_error_parameter_must_specify_once(&main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_object_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, iki_write_long_object_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_content_s);
+ fll_program_print_error_parameter_missing_value(&main->error, f_console_symbol_long_normal_s, iki_write_long_content_s);
return;
}
--- /dev/null
+#include "../iki_write.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
+ *
+ * Provides the common define types.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_common_define_h
+#define _iki_write_common_define_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_common_define_h
--- /dev/null
+#include "../iki_write.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
+ *
+ * Provides the common enumeration types.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_common_enumeration_h
+#define _iki_write_common_enumeration_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Flags for fine-tuned print control.
+ *
+ * iki_write_print_flag_*_e:
+ * - none: No flags set.
+ * - debug: Stream is for debug printing.
+ * - error: Stream is for error printing.
+ * - message: Stream is for message printing.
+ * - warning: Stream is for warning printing.
+ * - file_to: Stream is a destination file.
+ * - file_from: Stream is a source file.
+ */
+#ifndef _di_iki_write_print_flag_e_
+ enum {
+ iki_write_print_flag_none_e = 0x0,
+ iki_write_print_flag_debug_e = 0x1,
+ iki_write_print_flag_error_e = 0x2,
+ iki_write_print_flag_message_e = 0x4,
+ iki_write_print_flag_warning_e = 0x8,
+ iki_write_print_flag_file_to_e = 0x10,
+ iki_write_print_flag_file_from_e = 0x20,
+ }; // enum
+#endif // _di_iki_write_print_flag_e_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_common_enumeration_h
}
#endif // _di_iki_write_setting_t_
+/**
+ * The main program data as a single structure.
+ *
+ * program: The main program data.
+ * setting: The settings data.
+ */
+#ifndef _di_iki_write_main_t_
+ typedef struct {
+ fll_program_data_t program;
+ iki_write_setting_t setting;
+ } iki_write_main_t;
+
+ #define iki_write_main_t_initialize \
+ { \
+ fll_program_data_t_initialize, \
+ iki_write_setting_t_initialize, \
+ }
+#endif // _di_iki_write_main_t_
+
#ifdef __cplusplus
} // extern "C"
#endif
setting->state.status = F_none;
- if (setting->flag & iki_write_main_flag_help_e) {
- iki_write_print_help(setting, main->message);
+ if (main->setting.flag & (iki_write_main_flag_help_e | iki_write_main_flag_version_e | iki_write_main_flag_copyright_e)) {
- if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (main->setting.flag & iki_write_main_flag_help_e) {
+ iki_write_print_message_help(&main->program.message);
}
-
- return;
- }
-
- if (setting->flag & iki_write_main_flag_version_e) {
- fll_program_print_version(main->message, iki_write_program_version_s);
-
- if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ else if (main->setting.flag & iki_write_main_flag_version_e) {
+ fll_program_print_version(&main->program.message, iki_write_program_version_s);
+ }
+ else if (main->setting.flag & iki_write_main_flag_copyright_e) {
+ fll_program_print_copyright(&main->program.message);
}
- return;
- }
-
- if (setting->flag & iki_write_main_flag_copyright_e) {
- fll_program_print_copyright(main->message);
-
- if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & iki_write_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
return;
do {
if (!((++main->signal_check) % iki_write_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
setting->state.status = F_status_set_error(F_interrupt);
object_ended = F_false;
if (!setting->buffer.used) {
setting->state.status = F_status_set_error(F_parameter);
- fll_program_print_error_pipe_missing_content(main->error);
+ fll_program_print_error_pipe_missing_content(&main->error);
object_ended = F_false;
if (object_ended && previous == range.start) {
setting->state.status = F_status_set_error(F_parameter);
- fll_program_print_error_pipe_invalid_form_feed(main->error);
+ fll_program_print_error_pipe_invalid_form_feed(&main->error);
object_ended = F_false;
if (object_ended) {
setting->state.status = F_status_set_error(F_parameter);
- fll_program_print_error_pipe_object_without_content(main->error);
+ fll_program_print_error_pipe_object_without_content(&main->error);
}
}
for (f_array_length_t i = 0; i < setting->objects.used; ++i) {
if (!((++main->signal_check) % iki_write_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
+ if (fll_program_standard_signal_received(&main->program)) {
setting->state.status = F_status_set_error(F_interrupt);
break;
#include <fll/level_2/program.h>
// IKI Write includes.
+#include <program/iki_write/main/common/define.h>
+#include <program/iki_write/main/common/enumeration.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/print/message.h>
#include <program/iki_write/main/process.h>
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- iki_write_setting_t setting = iki_write_setting_t_initialize;
+ iki_write_main_t data = iki_write_main_t_initialize;
+
+ data.program.debug.flag |= iki_write_print_flag_debug_e;
+ data.program.error.flag |= iki_write_print_flag_error_e;
+ data.program.message.flag |= iki_write_print_flag_message_e;
+ data.program.warning.flag |= iki_write_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = iki_write_console_parameter_t_initialize;
data.parameters.array = parameters;
#endif
#ifndef _di_iki_write_print_help_
- f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print) {
+ f_status_t iki_write_print_help(fl_print_t * const print) {
if (!setting) return F_status_set_error(F_output_not);
- f_file_stream_lock(print.to);
+ f_file_stream_lock(print->to);
fll_program_print_help_header(print, iki_write_program_name_long_s, iki_write_program_version_s);
fll_program_print_help_option(print, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
fll_program_print_help_option(print, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Print only the version number.");
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_option(print, iki_write_short_backtick_s, iki_write_long_backtick_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Use backtick for quotes.");
fll_program_print_help_option(print, iki_write_short_content_s, iki_write_long_content_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The Content to write.");
fll_program_print_help_option(print, iki_write_short_single_s, iki_write_long_single_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use single quotes.");
fll_program_print_help_option(print, iki_write_short_wrap_s, iki_write_long_wrap_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Wrap the vocabulary name.");
- f_print_dynamic_raw(f_string_eol_s, print.to);
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_usage(print, iki_write_program_name_s, f_string_empty_s);
- fl_print_format("%r %[Notes:%]%r", print.to, f_string_eol_s, print.set->important, print.set->important, f_string_eol_s);
- fl_print_format(" This program will accept Object and Content strings to generate an IKI string, such as %[object:\"content\"%].%r", print.to, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" Each Object must have a Content (and each Content must have an Object).%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format("%r %[Notes:%]%r", print->to, f_string_eol_s, print->set->important, print->set->important, f_string_eol_s);
+ fl_print_format(" This program will accept Object and Content strings to generate an IKI string, such as %[object:\"content\"%].%r", print->to, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" Each Object must have a Content (and each Content must have an Object).%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The Object is also called the Vocabulary.%r", print.to, f_string_eol_s);
- fl_print_format(" A complete Object and Content set is also called a Variable.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The Object is also called the Vocabulary.%r", print->to, f_string_eol_s);
+ fl_print_format(" A complete Object and Content set is also called a Variable.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When piping main to this program, a single form-feed character (\\f) (U+000C) must be used to separate each Object from each Content.%r", print.to, f_string_eol_s);
- fl_print_format(" Furthermore, each Object must be followed by a Content.%r", print.to, f_string_eol_s);
+ fl_print_format(" When piping main to this program, a single form-feed character (\\f) (U+000C) must be used to separate each Object from each Content.%r", print->to, f_string_eol_s);
+ fl_print_format(" Furthermore, each Object must be followed by a Content.%r", print->to, f_string_eol_s);
- f_file_stream_flush(print.to);
- f_file_stream_unlock(print.to);
+ f_file_stream_flush(print->to);
+ f_file_stream_unlock(print->to);
return F_none;
}
* 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);
+ extern f_status_t iki_write_print_help(fl_print_t * const print);
#endif // _di_iki_write_print_help_
#ifdef __cplusplus
--- /dev/null
+#include "../iki_write.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
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_print_data_h
+#define _iki_write_print_data_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_print_data_h
#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) {
+ f_status_t iki_write_print_error(fl_print_t * const 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;
+ if (!print) 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);
+ 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) {
+ f_status_t iki_write_print_error_file(fl_print_t * const 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;
+ if (!print) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- fll_error_file_print(*print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+ 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) {
+ f_status_t iki_write_print_error_main_missing(fl_print_t * const print) {
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!print) 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);
+ 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);
+ 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);
+ 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) {
+ f_status_t iki_write_print_error_object_not_valid(fl_print_t * const 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;
+ if (!print) 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);
+ 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);
+ 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);
+ f_file_stream_unlock(print->to);
return F_none;
}
/**
* FLL - Level 3
*
- * Project: UTF8
+ * Project: IKI Write
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
/**
* 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
* @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);
+ extern f_status_t iki_write_print_error(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param function
* The name of the function where the error happened.
* Set to 0 to disable.
* @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);
+ extern f_status_t iki_write_print_error_file(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
* 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);
+ extern f_status_t iki_write_print_error_main_missing(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param object
* The a string representing the object that is missing.
*
* 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);
+ extern f_status_t iki_write_print_error_object_not_valid(fl_print_t * const print, const f_string_static_t object);
#endif // _di_iki_write_print_error_object_not_valid_
#ifdef __cplusplus
--- /dev/null
+#include "../iki_write.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
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_print_message_h
+#define _iki_write_print_message_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_print_message_h
if (!object.used) {
setting->state.status = F_status_set_error(F_failure);
- 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;
}
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/print/error.c main/process.c
+build_sources_library main/iki_write.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/error.c main/print/message.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 main/print/error.h main/process.h
+build_sources_headers main/iki_write.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/error.h main/print/message.h main/process.h
build_sources_documentation man
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- status_code_setting_t setting = status_code_setting_t_initialize;
- setting.program_name = &status_code_fss_program_name_s;
- setting.program_name_long = &status_code_fss_program_name_long_s;
- setting.status_string_from = &fll_fss_status_string_from;
- setting.status_string_to = &fll_fss_status_string_to;
- setting.status_string_help_detail = &status_code_fss_print_help_detail;
+ status_code_main_t data = status_code_main_t_initialize;
+
+ data.program.debug.flag |= status_code_print_flag_debug_e;
+ data.program.error.flag |= status_code_print_flag_error_e;
+ data.program.message.flag |= status_code_print_flag_message_e;
+ data.program.warning.flag |= status_code_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
+ data.setting.program_name = &status_code_fss_program_name_s;
+ data.setting.program_name_long = &status_code_fss_program_name_long_s;
+ data.setting.status_string_from = &fll_fss_status_string_from;
+ data.setting.status_string_to = &fll_fss_status_string_to;
+ data.setting.status_string_help_detail = &status_code_fss_print_help_detail;
f_console_parameter_t parameters[] = status_code_console_parameter_t_initialize;
- data.parameters.array = parameters;
- data.parameters.used = status_code_total_parameters_d;
- data.environment = envp;
+
+ data.program.parameters.array = parameters;
+ data.program.parameters.used = status_code_total_parameters_d;
+ data.program.environment = envp;
if (f_pipe_input_exists()) {
- data.pipe = fll_program_data_pipe_input_e;
+ data.program.pipe = fll_program_data_pipe_input_e;
}
- fll_program_standard_set_up(&data);
+ fll_program_standard_set_up(&data.program);
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- status_code_setting_load(arguments, &data, &setting);
+ status_code_setting_load(arguments, &data);
}
- status_code_main(&data, &setting);
+ status_code_main(&data);
- status_code_setting_unload(&data, &setting);
+ status_code_setting_unload(&data);
- fll_program_data_delete(&data);
+ fll_program_data_delete(&data.program);
- fll_program_standard_set_down(&data);
+ fll_program_standard_set_down(&data.program);
- return (F_status_is_error(setting.state.status) || setting.state.status == F_false) ? 1 : 0;
+ return (F_status_is_error(data.setting.state.status) || data.setting.state.status == F_false) ? 1 : 0;
}
#endif
#ifndef _di_status_code_fss_print_help_detail_
- f_status_t status_code_fss_print_help_detail(void * const setting, const fl_print_t print) {
+ f_status_t status_code_fss_print_help_detail(fl_print_t * const print) {
- if (!setting) return F_status_set_error(F_output_not);
+ if (!print) return F_status_set_error(F_output_not);
- fl_print_format(" The FLL programs use a %[16-bit unsigned integer%] to represent the return status of programs and functions.%r%r", print.to, print.set->notable, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The FLL programs use a %[16-bit unsigned integer%] to represent the return status of programs and functions.%r%r", print->to, print->set->notable, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Programs may print a generic error with one of these codes.%r", print.to, f_string_eol_s);
- fl_print_format(" This is a tool for converting to or converting from these codes.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Programs may print a generic error with one of these codes.%r", print->to, f_string_eol_s);
+ fl_print_format(" This is a tool for converting to or converting from these codes.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[16-bit unsigned integer%] also has the first two high-order bits used to represent flags.%r", print.to, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" These flags are the %[error%] bit and the %[warning%] bit.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" When neither of these flags are set, then the status is considered %[fine%].%r%r", print.to, print.set->notable, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The %[16-bit unsigned integer%] also has the first two high-order bits used to represent flags.%r", print->to, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" These flags are the %[error%] bit and the %[warning%] bit.%r", print->to, print->set->notable, print->set->notable, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" When neither of these flags are set, then the status is considered %[fine%].%r%r", print->to, print->set->notable, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This operates identical to the %[status_codes%] program except that this program handles additional codes regarding FSS.%r", print.to, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" These special codes numericaly appear after the %[F_status_code_last%] code.%r", print.to, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" These codes stop at the %[F_fss_status_code_last%] code.%r%r", print.to, print.set->notable, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" This operates identical to the %[status_codes%] program except that this program handles additional codes regarding FSS.%r", print->to, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" These special codes numericaly appear after the %[F_status_code_last%] code.%r", print->to, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" These codes stop at the %[F_fss_status_code_last%] code.%r%r", print->to, print->set->notable, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Each code will be printed on its own line.%r", print.to, f_string_eol_s);
- fl_print_format(" Errors regarding each code may be printed on its own line.%r", print.to, f_string_eol_s);
+ fl_print_format(" Each code will be printed on its own line.%r", print->to, f_string_eol_s);
+ fl_print_format(" Errors regarding each code may be printed on its own line.%r", print->to, f_string_eol_s);
return F_none;
}
/**
* Print help detailed part of the help for fss_status_code.
*
- * This is designed to be called from within status_code_print_help().
+ * This is designed to be called from within status_code_print_message_help().
* This neither locks nor unlocks the stream and expects the stream to be unlocked.
*
- * @param setting
- * The main program settings.
- * (Must be of type status_code_setting_t.)
- *
- * This does not alter setting.state.status.
* @param print
* The output structure to print to.
*
+ * This does not alter print.custom.setting.state.status.
+ *
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
*
* @see fl_print_format()
*
- * @see status_code_print_help()
+ * @see status_code_print_message_help()
*/
#ifndef _di_status_code_fss_print_help_detail_
- extern f_status_t status_code_fss_print_help_detail(void * const setting, const fl_print_t print);
+ extern f_status_t status_code_fss_print_help_detail(fl_print_t * const print);
#endif // _di_status_code_fss_print_help_detail_
#ifdef __cplusplus
#include <fll/level_2/program.h>
// Status Code includes.
+#include <program/status_code/main/common/define.h>
+#include <program/status_code/main/common/enumeration.h>
#include <program/status_code/main/common/print.h>
#include <program/status_code/main/common/string.h>
#include <program/status_code/main/common/type.h>
#include <program/status_code/main/common.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/print/message.h>
#include <program/status_code/main/process.h>
#ifdef __cplusplus
#endif // _di_status_code_setting_delete_
#ifndef _di_status_code_setting_load_
- void status_code_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, status_code_setting_t * const setting) {
+ void status_code_setting_load(const f_console_arguments_t arguments, status_code_main_t * const main) {
- if (!main || !setting) return;
+ if (!main) return;
- setting->state.step_small = status_code_allocation_console_d;
+ main->setting.state.step_small = status_code_allocation_console_d;
- f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+ f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
- setting->state.step_small = status_code_allocation_small_d;
+ main->setting.state.step_small = status_code_allocation_small_d;
// Identify and pocess first/last parameters.
- if (main->parameters.array[status_code_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->flag -= setting->flag & status_code_main_flag_print_first_e;
+ if (main->program.parameters.array[status_code_parameter_line_first_no_e].result & f_console_result_found_e) {
+ main->setting.flag -= main->setting.flag & status_code_main_flag_print_first_e;
}
else {
- setting->flag |= status_code_main_flag_print_first_e;
+ main->setting.flag |= status_code_main_flag_print_first_e;
}
- if (main->parameters.array[status_code_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->flag -= setting->flag & status_code_main_flag_print_last_e;
+ if (main->program.parameters.array[status_code_parameter_line_last_no_e].result & f_console_result_found_e) {
+ main->setting.flag -= main->setting.flag & status_code_main_flag_print_last_e;
}
else {
- setting->flag |= status_code_main_flag_print_last_e;
+ main->setting.flag |= status_code_main_flag_print_last_e;
}
- if (F_status_is_error(setting->state.status)) {
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- status_code_print_error(setting, main->error, macro_status_code_f(f_console_parameter_process));
+ status_code_print_error(&main->program.error, macro_status_code_f(f_console_parameter_process));
return;
}
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
- if (F_status_is_error(setting->state.status)) {
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- status_code_print_error(setting, main->error, macro_status_code_f(fll_program_parameter_process_context));
+ status_code_print_error(&main->program.error, macro_status_code_f(fll_program_parameter_process_context));
return;
}
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
- if (F_status_is_error(setting->state.status)) {
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- status_code_print_error(setting, main->error, macro_status_code_f(fll_program_parameter_process_verbosity));
+ status_code_print_error(&main->program.error, macro_status_code_f(fll_program_parameter_process_verbosity));
return;
}
}
- if (main->parameters.array[status_code_parameter_help_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_help_e;
+ if (main->program.parameters.array[status_code_parameter_help_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_help_e;
return;
}
- if (main->parameters.array[status_code_parameter_version_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_version_e;
+ if (main->program.parameters.array[status_code_parameter_version_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_version_e;
return;
}
- if (main->parameters.array[status_code_parameter_copyright_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_copyright_e;
+ if (main->program.parameters.array[status_code_parameter_copyright_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_copyright_e;
return;
}
}
- if (main->parameters.array[status_code_parameter_error_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_error_e;
+ if (main->program.parameters.array[status_code_parameter_error_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_error_e;
}
- if (main->parameters.array[status_code_parameter_fine_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_fine_e;
+ if (main->program.parameters.array[status_code_parameter_fine_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_fine_e;
}
- if (main->parameters.array[status_code_parameter_warning_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_warning_e;
+ if (main->program.parameters.array[status_code_parameter_warning_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_warning_e;
}
- if (main->parameters.array[status_code_parameter_number_e].result & f_console_result_found_e) {
- setting->flag |= status_code_main_flag_number_e;
+ if (main->program.parameters.array[status_code_parameter_number_e].result & f_console_result_found_e) {
+ main->setting.flag |= status_code_main_flag_number_e;
}
- if (setting->flag & status_code_main_flag_error_e) {
- if (setting->flag & status_code_main_flag_warning_e) {
- if (!(setting->flag & status_code_main_flag_number_e)) {
- setting->state.status = F_status_set_error(F_parameter);
+ if (main->setting.flag & status_code_main_flag_error_e) {
+ if (main->setting.flag & status_code_main_flag_warning_e) {
+ if (!(main->setting.flag & status_code_main_flag_number_e)) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- status_code_print_error_cannot_error_warning_number(setting, main->error);
+ status_code_print_error_cannot_error_warning_number(&main->program.error);
return;
}
}
- if (setting->flag & status_code_main_flag_fine_e) {
- setting->state.status = F_status_set_error(F_parameter);
+ if (main->setting.flag & status_code_main_flag_fine_e) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- 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);
+ fll_program_print_error_parameter_cannot_use_with(&main->program.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);
+ else if (main->setting.flag & status_code_main_flag_warning_e && main->setting.flag & status_code_main_flag_fine_e) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- 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);
+ fll_program_print_error_parameter_cannot_use_with(&main->program.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);
+ if (main->program.parameters.remaining.used == 0 && !(main->program.pipe & fll_program_data_pipe_input_e)) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- status_code_print_error_no_status_codes(setting, main->error);
+ status_code_print_error_no_status_codes(&main->program.error);
return;
}
* @param arguments
* The parameters passed to the process (often referred to as command line arguments).
* @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * The main program and settings data.
*
* This alters setting.state.status:
* F_none on success.
* @see fll_program_parameter_process_context()
*/
#ifndef _di_status_code_setting_load_
- extern void status_code_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, status_code_setting_t * const setting);
+ extern void status_code_setting_load(const f_console_arguments_t arguments, status_code_main_t * const main);
#endif // _di_status_code_setting_load_
/**
--- /dev/null
+#include "../status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#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 common define types.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_common_define_h
+#define _status_code_common_define_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * 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.
+ */
+#ifndef _di_status_code_d_
+ #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
+#endif // _di_status_code_d_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_common_define_h
--- /dev/null
+#include "../status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#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 common enumeration types.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_common_enumeration_h
+#define _status_code_common_enumeration_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Flags passed to the main function or program.
+ *
+ * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode).
+ *
+ * status_code_main_flag_*_e:
+ * - none: No flags set.
+ * - copyright: Print copyright.
+ * - error: Check if status is "error".
+ * - fine: Check if status is "fine".
+ * - help: Print help.
+ * - number: Operate in number mode.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
+ * - version: Print version.
+ * - warning: Check if status is "warning".
+ */
+#ifndef _di_status_code_main_flag_e_
+ enum {
+ status_code_main_flag_none_e = 0x0,
+ status_code_main_flag_copyright_e = 0x1,
+ status_code_main_flag_error_e = 0x2,
+ status_code_main_flag_fine_e = 0x4,
+ status_code_main_flag_help_e = 0x8,
+ status_code_main_flag_number_e = 0x10,
+ status_code_main_flag_print_first_e = 0x20,
+ status_code_main_flag_print_last_e = 0x40,
+ status_code_main_flag_version_e = 0x80,
+ status_code_main_flag_warning_e = 0x100,
+ }; // enum
+#endif // _di_status_code_main_flag_e_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_status_code_parameter_e_
+ enum {
+ status_code_parameter_help_e,
+ status_code_parameter_copyright_e,
+ status_code_parameter_light_e,
+ status_code_parameter_dark_e,
+ status_code_parameter_no_color_e,
+ status_code_parameter_verbosity_quiet_e,
+ status_code_parameter_verbosity_error_e,
+ status_code_parameter_verbosity_normal_e,
+ status_code_parameter_verbosity_verbose_e,
+ status_code_parameter_verbosity_debug_e,
+ status_code_parameter_version_e,
+ status_code_parameter_line_first_no_e,
+ status_code_parameter_line_last_no_e,
+
+ status_code_parameter_fine_e,
+ status_code_parameter_warning_e,
+ status_code_parameter_error_e,
+ status_code_parameter_number_e,
+ }; // enum
+
+ #define status_code_console_parameter_t_initialize \
+ { \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \
+ \
+ macro_f_console_parameter_t_initialize_3(status_code_short_fine_s, status_code_long_fine_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(status_code_short_warning_s, status_code_long_warning_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(status_code_short_error_s, status_code_long_error_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(status_code_short_number_s, status_code_long_number_s, 0, f_console_flag_normal_e), \
+ }
+
+ #define status_code_total_parameters_d 17
+#endif // _di_status_code_parameter_e_
+
+/**
+ * Flags for fine-tuned print control.
+ *
+ * status_code_print_flag_*_e:
+ * - none: No flags set.
+ * - debug: Stream is for debug printing.
+ * - error: Stream is for error printing.
+ * - message: Stream is for message printing.
+ * - warning: Stream is for warning printing.
+ * - file_to: Stream is a destination file.
+ * - file_from: Stream is a source file.
+ */
+#ifndef _di_status_code_print_flag_e_
+ enum {
+ status_code_print_flag_none_e = 0x0,
+ status_code_print_flag_debug_e = 0x1,
+ status_code_print_flag_error_e = 0x2,
+ status_code_print_flag_message_e = 0x4,
+ status_code_print_flag_warning_e = 0x8,
+ status_code_print_flag_file_to_e = 0x10,
+ status_code_print_flag_file_from_e = 0x20,
+ }; // enum
+#endif // _di_status_code_print_flag_e_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_common_enumeration_h
#endif
/**
- * 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_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_
-
-/**
- * Flags passed to the main function or program.
- *
- * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode).
- *
- * status_code_main_flag_*_e:
- * - none: No flags set.
- * - copyright: Print copyright.
- * - error: Check if status is "error".
- * - fine: Check if status is "fine".
- * - help: Print help.
- * - number: Operate in number mode.
- * - print_first: When set, print new line to message output on program begin after loading settings.
- * - print_last: When set, print new line to message output on program end.
- * - version: Print version.
- * - warning: Check if status is "warning".
- */
-#ifndef _di_status_code_main_flag_e_
- enum {
- status_code_main_flag_none_e = 0x0,
- status_code_main_flag_copyright_e = 0x1,
- status_code_main_flag_error_e = 0x2,
- status_code_main_flag_fine_e = 0x4,
- status_code_main_flag_help_e = 0x8,
- status_code_main_flag_number_e = 0x10,
- status_code_main_flag_print_first_e = 0x20,
- status_code_main_flag_print_last_e = 0x40,
- status_code_main_flag_version_e = 0x80,
- status_code_main_flag_warning_e = 0x100,
- }; // enum
-#endif // _di_status_code_main_flag_e_
-
-/**
- * The main program parameters.
- */
-#ifndef _di_status_code_parameter_e_
- enum {
- status_code_parameter_help_e,
- status_code_parameter_copyright_e,
- status_code_parameter_light_e,
- status_code_parameter_dark_e,
- status_code_parameter_no_color_e,
- status_code_parameter_verbosity_quiet_e,
- status_code_parameter_verbosity_error_e,
- status_code_parameter_verbosity_normal_e,
- status_code_parameter_verbosity_verbose_e,
- status_code_parameter_verbosity_debug_e,
- status_code_parameter_version_e,
- status_code_parameter_line_first_no_e,
- status_code_parameter_line_last_no_e,
-
- status_code_parameter_fine_e,
- status_code_parameter_warning_e,
- status_code_parameter_error_e,
- status_code_parameter_number_e,
- }; // enum
-
- #define status_code_console_parameter_t_initialize \
- { \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \
- \
- macro_f_console_parameter_t_initialize_3(status_code_short_fine_s, status_code_long_fine_s, 0, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(status_code_short_warning_s, status_code_long_warning_s, 0, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(status_code_short_error_s, status_code_long_error_s, 0, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(status_code_short_number_s, status_code_long_number_s, 0, f_console_flag_normal_e), \
- }
-
- #define status_code_total_parameters_d 17
-#endif // _di_status_code_parameter_e_
-
-/**
* The status code main program settings.
*
* This is passed to the program-specific main entry point to designate program settings.
*
* status_string_from: A pointer to the status string function (usually either fll_status_string_from() or fll_fss_status_string_from()).
* status_string_to: A pointer to the status string function (usually either f_status_string_to() or fll_fss_status_string_to()).
- * status_string_help_detail: Print additional, more detailed help, in the help page (The setting paramete must be of type status_code_setting_t).
+ * status_string_help_detail: Print additional, more detailed help, in the help page.
*/
#ifndef _di_status_code_setting_t_
typedef struct {
f_status_t (*status_string_from)(const f_string_static_t name, f_status_t * const code);
f_status_t (*status_string_to)(const f_status_t code, f_string_static_t * const name);
- f_status_t (*status_string_help_detail)(void * const setting, const fl_print_t print);
+ f_status_t (*status_string_help_detail)(fl_print_t * const print);
} status_code_setting_t;
#define status_code_setting_t_initialize \
}
#endif // _di_status_code_setting_t_
+/**
+ * The main program data as a single structure.
+ *
+ * program: The main program data.
+ * setting: The settings data.
+ */
+#ifndef _di_status_code_main_t_
+ typedef struct {
+ fll_program_data_t program;
+ status_code_setting_t setting;
+ } status_code_main_t;
+
+ #define status_code_main_t_initialize \
+ { \
+ fll_program_data_t_initialize, \
+ status_code_setting_t_initialize, \
+ }
+#endif // _di_status_code_main_t_
+
#ifdef __cplusplus
} // extern "C"
#endif
#endif
#ifndef _di_status_code_convert_number_
- void status_code_convert_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value, f_number_unsigned_t *number) {
+ void status_code_convert_number(status_code_main_t * const main, const f_string_static_t value, f_number_unsigned_t *number) {
- if (!main || !setting) return;
+ if (!main) return;
- setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, value, number);
+ main->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_data_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_out_of_range_s);
- setting->state.status = F_status_set_error(F_number_overflow);
+ main->setting.state.status = F_status_set_error(F_number_overflow);
return;
}
- if (F_status_is_error(setting->state.status)) {
- if (F_status_set_fine(setting->state.status) == F_number_negative) {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
+ if (F_status_is_error(main->setting.state.status)) {
+ if (F_status_set_fine(main->setting.state.status) == F_number_negative) {
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_out_of_range_s);
}
else {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_number_s);
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_invalid_number_s);
}
}
else {
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
}
}
#endif // _di_status_code_convert_number_
* @see fl_console_parameter_to_number_unsigned()
*/
#ifndef _di_status_code_convert_number_
- extern void status_code_convert_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value, f_number_unsigned_t *number);
+ extern void status_code_convert_number(status_code_main_t * const main, const f_string_static_t value, f_number_unsigned_t *number);
#endif // _di_status_code_convert_number_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- status_code_setting_t setting = status_code_setting_t_initialize;
- setting.program_name = &status_code_program_name_s;
- setting.program_name_long = &status_code_program_name_long_s;
- setting.status_string_from = &fll_status_string_from;
- setting.status_string_to = &f_status_string_to;
- setting.status_string_help_detail = &status_code_print_help_detail;
+ status_code_main_t data = status_code_main_t_initialize;
+
+ data.program.debug.flag |= status_code_print_flag_debug_e;
+ data.program.error.flag |= status_code_print_flag_error_e;
+ data.program.message.flag |= status_code_print_flag_message_e;
+ data.program.warning.flag |= status_code_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
+ data.setting.program_name = &status_code_program_name_s;
+ data.setting.program_name_long = &status_code_program_name_long_s;
+ data.setting.status_string_from = &fll_status_string_from;
+ data.setting.status_string_to = &f_status_string_to;
+ data.setting.status_string_help_detail = &status_code_print_message_help_detail;
f_console_parameter_t parameters[] = status_code_console_parameter_t_initialize;
- data.parameters.array = parameters;
- data.parameters.used = status_code_total_parameters_d;
- data.environment = envp;
+
+ data.program.parameters.array = parameters;
+ data.program.parameters.used = status_code_total_parameters_d;
+ data.program.environment = envp;
if (f_pipe_input_exists()) {
- data.pipe = fll_program_data_pipe_input_e;
+ data.program.pipe = fll_program_data_pipe_input_e;
}
- fll_program_standard_set_up(&data);
+ fll_program_standard_set_up(&data.program);
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- status_code_setting_load(arguments, &data, &setting);
+ status_code_setting_load(arguments, &data);
}
- status_code_main(&data, &setting);
+ status_code_main(&data);
- status_code_setting_unload(&data, &setting);
+ status_code_setting_unload(&data);
- fll_program_data_delete(&data);
+ fll_program_data_delete(&data.program);
- fll_program_standard_set_down(&data);
+ fll_program_standard_set_down(&data.program);
- return (F_status_is_error(setting.state.status) || setting.state.status == F_false) ? 1 : 0;
+ return (F_status_is_error(data.setting.state.status) || data.setting.state.status == F_false) ? 1 : 0;
}
#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) {
+ f_status_t status_code_print_data_code(fl_print_t * const 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;
+ if (!print) 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);
+ 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) {
+ f_status_t status_code_print_data_context_value(fl_print_t * const 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;
+ if (!print) 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);
+ fll_print_format("%[%Q%]%r", print->to, context, value, context, f_string_eol_s);
return F_none;
}
/**
* 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param code
* The code to print.
*
* @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);
+ extern f_status_t status_code_print_data_code(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param context
* The context string to wrap the variable with.
* @param value
* @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);
+ extern f_status_t status_code_print_data_context_value(fl_print_t * const print, const f_color_set_t context, const f_string_static_t value);
#endif // _di_status_code_print_data_context_value_
#ifdef __cplusplus
#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) {
+ f_status_t status_code_print_error(fl_print_t * const 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;
+ if (!print || !print->custom) 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);
+ status_code_main_t * const main = (status_code_main_t *) print->custom;
+
+ fll_error_print(print, F_status_set_fine(main->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) {
+ f_status_t status_code_print_error_cannot_error_warning_number(fl_print_t * const print) {
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!print) 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);
+ 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);
+ 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);
+ 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) {
+ f_status_t status_code_print_error_no_status_codes(fl_print_t * const print) {
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!print) 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);
+ 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) {
+ f_status_t status_code_print_error_invalid_callback(fl_print_t * const 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;
+ if (!print) 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);
+ 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);
+ 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);
+ f_file_stream_unlock(print->to);
return F_none;
}
/**
* 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
* @see fll_error_print()
*/
#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);
+ extern f_status_t status_code_print_error(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
* @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);
+ extern f_status_t status_code_print_error_cannot_error_warning_number(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
* @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);
+ extern f_status_t status_code_print_error_no_status_codes(fl_print_t * const 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.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param name
* The name of the callback setting that is invalid.
* This should either be 'status_string_from' or 'status_string_to'.
* @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);
+ extern f_status_t status_code_print_error_invalid_callback(fl_print_t * const print, const f_string_t name);
#endif // _di_status_code_print_error_invalid_callback_
#ifdef __cplusplus
-#include "status_code.h"
+#include "../status_code.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_status_code_print_help_
- f_status_t status_code_print_help(status_code_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_status_code_print_message_help_
+ f_status_t status_code_print_message_help(fl_print_t * const print) {
- if (!setting) return F_status_set_error(F_output_not);
+ if (!print || !print->custom) return F_status_set_error(F_output_not);
- f_file_stream_lock(print.to);
+ status_code_main_t * const main = (status_code_main_t *) print->custom;
+
+ f_file_stream_lock(print->to);
fll_program_print_help_header(
print,
- setting->program_name_long
- ? *setting->program_name_long
+ main->setting.program_name_long
+ ? *main->setting.program_name_long
: status_code_program_name_long_s,
status_code_program_version_s
);
fll_program_print_help_option_standard(print);
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_option(print, status_code_short_fine_s, status_code_long_fine_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print F_true or F_false if status code is neither an error nor a warning or print number with neither the error code nor the warning code bits set.");
fll_program_print_help_option(print, status_code_short_warning_s, status_code_long_warning_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Print F_true or F_false if status code is a warning or print number with warning code bit set.");
fll_program_print_help_option(print, status_code_short_error_s, status_code_long_error_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print F_true or F_false if status code is an error or print number with error code bit set.");
fll_program_print_help_option(print, status_code_short_number_s, status_code_long_number_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Convert status code name to number.");
- f_print_dynamic_raw(f_string_eol_s, print.to);
- f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print->to);
fll_program_print_help_usage(
print,
- setting->program_name
- ? *setting->program_name
+ main->setting.program_name
+ ? *main->setting.program_name
: status_code_program_name_s,
status_code_program_help_parameters_s
);
- if (setting->status_string_help_detail) {
- setting->status_string_help_detail(setting, print);
+ if (main->setting.status_string_help_detail) {
+ main->setting.status_string_help_detail(print);
}
- f_file_stream_flush(print.to);
- f_file_stream_unlock(print.to);
+ f_file_stream_flush(print->to);
+ f_file_stream_unlock(print->to);
return F_none;
}
-#endif // _di_status_code_print_help_
+#endif // _di_status_code_print_message_help_
-#ifndef _di_status_code_print_help_detail_
- f_status_t status_code_print_help_detail(void * const void_setting, const fl_print_t print) {
+#ifndef _di_status_code_print_message_help_detail_
+ f_status_t status_code_print_message_help_detail(fl_print_t * const print) {
- if (!void_setting) return F_status_set_error(F_output_not);
+ if (!print) return F_status_set_error(F_output_not);
- fl_print_format(" The FLL programs use a %[16-bit unsigned integer%] to represent the return status of programs and functions.%r%r", print.to, print.set->notable, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The FLL programs use a %[16-bit unsigned integer%] to represent the return status of programs and functions.%r%r", print->to, print->set->notable, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Programs may print a generic error with one of these codes.%r", print.to, f_string_eol_s);
- fl_print_format(" This is a tool for converting to or converting from these codes.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Programs may print a generic error with one of these codes.%r", print->to, f_string_eol_s);
+ fl_print_format(" This is a tool for converting to or converting from these codes.%r%r", print->to, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[16-bit unsigned integer%] also has the first two high-order bits used to represent flags.%r", print.to, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" These flags are the %[error%] bit and the %[warning%] bit.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" When neither of these flags are set, then the status is considered %[fine%].%r%r", print.to, print.set->notable, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The %[16-bit unsigned integer%] also has the first two high-order bits used to represent flags.%r", print->to, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" These flags are the %[error%] bit and the %[warning%] bit.%r", print->to, print->set->notable, print->set->notable, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" When neither of these flags are set, then the status is considered %[fine%].%r%r", print->to, print->set->notable, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" These codes stop at the %[F_status_code_last%] code.%r%r", print.to, print.set->notable, print.set->notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" These codes stop at the %[F_status_code_last%] code.%r%r", print->to, print->set->notable, print->set->notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Each code will be printed on its own line.%r", print.to, print.set->notable, print.set->notable, f_string_eol_s);
- fl_print_format(" Errors regarding each code may be printed on its own line.%r", print.to, f_string_eol_s);
+ fl_print_format(" Each code will be printed on its own line.%r", print->to, print->set->notable, print->set->notable, f_string_eol_s);
+ fl_print_format(" Errors regarding each code may be printed on its own line.%r", print->to, f_string_eol_s);
return F_none;
}
-#endif // _di_status_code_print_help_detail_
+#endif // _di_status_code_print_message_help_detail_
#ifdef __cplusplus
} // extern "C"
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
- * Provides the print functionality.
+ * Provides the print data functionality.
*
* This is auto-included and should not need to be explicitly included.
*/
-#ifndef _status_code_print_h
-#define _status_code_print_h
+#ifndef _status_code_print_message_h
+#define _status_code_print_message_h
#ifdef __cplusplus
extern "C" {
/**
* Print help.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
* The output structure to print to.
*
+ * This does not alter print.custom.setting.state.status.
+ *
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
* @see fll_program_print_help_option_standard()
* @see fll_program_print_help_usage()
*/
-#ifndef _di_status_code_print_help_
- extern f_status_t status_code_print_help(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_help_
+#ifndef _di_status_code_print_message_help_
+ extern f_status_t status_code_print_message_help(fl_print_t * const print);
+#endif // _di_status_code_print_message_help_
/**
* Print help detailed part of the help.
*
- * This is designed to be called from within status_code_print_help().
+ * This is designed to be called from within status_code_print_message_help().
* This neither locks nor unlocks the stream and expects the stream to be unlocked.
*
- * @param setting
- * The main program settings.
- * (Must be of type status_code_setting_t.)
- *
- * This does not alter setting.state.status.
* @param print
* The output structure to print to.
*
+ * This does not alter print.custom.setting.state.status.
+ *
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
*
* @see fl_print_format()
*
- * @see status_code_print_help()
+ * @see status_code_print_message_help()
*/
-#ifndef _di_status_code_print_help_detail_
- extern f_status_t status_code_print_help_detail(void * const setting, const fl_print_t print);
-#endif // _di_status_code_print_help_detail_
+#ifndef _di_status_code_print_message_help_detail_
+ extern f_status_t status_code_print_message_help_detail(fl_print_t * const print);
+#endif // _di_status_code_print_message_help_detail_
#ifdef __cplusplus
} // extern "C"
#endif
-#endif // _status_code_print_h
+#endif // _status_code_print_message_h
#endif
#ifndef _di_status_code_process_check_
- void status_code_process_check(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) {
+ void status_code_process_check(status_code_main_t * const main, const f_string_static_t value) {
- if (!main || !setting) return;
+ if (!main) return;
f_number_unsigned_t number = 0;
{
- status_code_convert_number(main, setting, value, &number);
- if (F_status_is_error(setting->state.status)) return;
+ status_code_convert_number(main, value, &number);
+ if (F_status_is_error(main->setting.state.status)) return;
}
- f_file_stream_lock(main->output.to);
+ f_file_stream_lock(main->program.output.to);
- 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);
+ if ((main->setting.flag & status_code_main_flag_error_e) && F_status_is_error(number) || (main->setting.flag & status_code_main_flag_warning_e) && F_status_is_warning(number) || (main->setting.flag & status_code_main_flag_fine_e) && F_status_is_fine(number)) {
+ f_print_dynamic_raw(f_status_true_s, main->program.output.to);
}
else {
- f_print_dynamic_raw(f_status_false_s, main->output.to);
+ f_print_dynamic_raw(f_status_false_s, main->program.output.to);
}
- f_print_dynamic_raw(f_string_eol_s, main->output.to);
+ f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
- f_file_stream_unlock(main->output.to);
+ f_file_stream_unlock(main->program.output.to);
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
}
#endif // _di_status_code_process_check_
#ifndef _di_status_code_process_number_
- void status_code_process_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) {
+ void status_code_process_number(status_code_main_t * const main, const f_string_static_t value) {
- if (!main || !setting) return;
+ if (!main) return;
{
f_number_unsigned_t number = 0;
- setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, value, &number);
+ main->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_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_name_s);
+ if (main->setting.state.status == F_none) {
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_invalid_name_s);
- setting->state.status = F_status_set_error(F_parameter);
+ main->setting.state.status = F_status_set_error(F_parameter);
return;
}
- if (setting->state.status == F_data_not || F_status_set_fine(setting->state.status) == F_parameter) {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_main_s);
+ if (main->setting.state.status == F_data_not || F_status_set_fine(main->setting.state.status) == F_parameter) {
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_invalid_main_s);
return;
}
f_status_t code = F_none;
- setting->state.status = setting->status_string_from(value, &code);
+ main->setting.state.status = main->setting.status_string_from(value, &code);
- if (F_status_is_error(setting->state.status)) {
- if (F_status_set_fine(setting->state.status) == F_data) {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_name_s);
+ if (F_status_is_error(main->setting.state.status)) {
+ if (F_status_set_fine(main->setting.state.status) == F_data) {
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_unknown_name_s);
}
else {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_failed_to_convert_s);
}
return;
}
- if (setting->state.status == F_data) {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
+ if (main->setting.state.status == F_data) {
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_unknown_code_s);
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
return;
}
- if (setting->flag & status_code_main_flag_error_e) {
+ if (main->setting.flag & status_code_main_flag_error_e) {
code = F_status_set_error(code);
}
- if (setting->flag & status_code_main_flag_warning_e) {
+ if (main->setting.flag & status_code_main_flag_warning_e) {
code = F_status_set_warning(code);
}
- status_code_print_data_code(setting, main->output, code);
+ status_code_print_data_code(&main->program.output, code);
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
}
#endif // _di_status_code_process_number_
#ifndef _di_status_code_process_normal_
- void status_code_process_normal(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value) {
+ void status_code_process_normal(status_code_main_t * const main, const f_string_static_t value) {
- if (!main || !setting) return;
+ if (!main) return;
f_string_static_t name = f_string_static_t_initialize;
{
f_number_unsigned_t number = 0;
- status_code_convert_number(main, setting, value, &number);
- if (F_status_is_error(setting->state.status)) return;
+ status_code_convert_number(main, value, &number);
+ if (F_status_is_error(main->setting.state.status)) return;
- setting->state.status = setting->status_string_to((f_status_t) number, &name);
+ main->setting.state.status = main->setting.status_string_to((f_status_t) number, &name);
}
- if (F_status_is_error(setting->state.status)) {
- if (F_status_set_fine(setting->state.status) == F_data) {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
+ if (F_status_is_error(main->setting.state.status)) {
+ if (F_status_set_fine(main->setting.state.status) == F_data) {
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_unknown_code_s);
}
else {
- status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
+ status_code_print_data_context_value(&main->program.output, main->program.context.set.error, status_code_failed_to_convert_s);
}
return;
}
- status_code_print_data_context_value(setting, main->output, f_color_set_empty_s, name);
+ status_code_print_data_context_value(&main->program.output, f_color_set_empty_s, name);
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
}
#endif // _di_status_code_process_normal_
* @see fss_status_code_convert_number()
*/
#ifndef _di_status_code_process_check_
- extern void status_code_process_check(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value);
+ extern void status_code_process_check(status_code_main_t * const main, const f_string_static_t value);
#endif // _di_status_code_process_check_
/**
* @see fll_status_string_from()
*/
#ifndef _di_status_code_process_number_
- extern void status_code_process_number(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value);
+ extern void status_code_process_number(status_code_main_t * const main, const f_string_static_t value);
#endif // _di_status_code_process_number_
/**
* @see fss_status_code_convert_number()
*/
#ifndef _di_status_code_process_normal_
- extern void status_code_process_normal(fll_program_data_t * const main, status_code_setting_t * const setting, const f_string_static_t value);
+ extern void status_code_process_normal(status_code_main_t * const main, const f_string_static_t value);
#endif // _di_status_code_process_normal_
#ifdef __cplusplus
#endif
#ifndef _di_status_code_main_
- void status_code_main(fll_program_data_t * const main, status_code_setting_t * const setting) {
+ void status_code_main(status_code_main_t * const main) {
- if (!main || !setting) return;
+ if (!main) return;
- if (F_status_is_error(setting->state.status)) {
- if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & status_code_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
return;
}
- if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- if (!setting->status_string_from || !setting->status_string_to) {
- if (!setting->status_string_from) {
- status_code_print_error_invalid_callback(setting, main->error, macro_status_code_f(status_string_from));
+ if (!main->setting.status_string_from || !main->setting.status_string_to) {
+ if (!main->setting.status_string_from) {
+ status_code_print_error_invalid_callback(&main->program.error, macro_status_code_f(status_string_from));
}
- if (!setting->status_string_to) {
- status_code_print_error_invalid_callback(setting, main->error, macro_status_code_f(status_string_to));
+ if (!main->setting.status_string_to) {
+ status_code_print_error_invalid_callback(&main->program.error, macro_status_code_f(status_string_to));
}
- if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- setting->state.status = F_status_set_error(F_parameter);
+ main->setting.state.status = F_status_set_error(F_parameter);
return;
}
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
- if (setting->flag & status_code_main_flag_help_e) {
- status_code_print_help(setting, main->message);
+ if (main->setting.flag & (status_code_main_flag_help_e | status_code_main_flag_version_e | status_code_main_flag_copyright_e)) {
- if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if (main->setting.flag & status_code_main_flag_help_e) {
+ status_code_print_message_help(&main->program.message);
}
-
- return;
- }
-
- if (setting->flag & status_code_main_flag_version_e) {
- fll_program_print_version(main->message, status_code_program_version_s);
-
- if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ else if (main->setting.flag & status_code_main_flag_version_e) {
+ fll_program_print_version(&main->program.message, status_code_program_version_s);
+ }
+ else if (main->setting.flag & status_code_main_flag_copyright_e) {
+ fll_program_print_copyright(&main->program.message);
}
- return;
- }
-
- if (setting->flag & status_code_main_flag_copyright_e) {
- fll_program_print_copyright(main->message);
-
- if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
return;
f_status_t status = F_none;
- if (setting->flag & status_code_main_flag_number_e) {
- if (main->pipe & fll_program_data_pipe_input_e) {
+ if (main->setting.flag & status_code_main_flag_number_e) {
+ if (main->program.pipe & fll_program_data_pipe_input_e) {
// @todo call status_code_process_number() here for all main from pipe that are space separated.
}
- if (main->parameters.remaining.used) {
- f_file_stream_lock(main->output.to);
+ if (main->program.parameters.remaining.used) {
+ f_file_stream_lock(main->program.output.to);
- for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->program.parameters.remaining.used; ++i) {
- if (!((++main->signal_check) % status_code_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- setting->state.status = F_status_set_error(F_interrupt);
+ if (!((++main->program.signal_check) % status_code_signal_check_d)) {
+ if (fll_program_standard_signal_received(&main->program)) {
+ main->setting.state.status = F_status_set_error(F_interrupt);
break;
}
- main->signal_check = 0;
+ main->program.signal_check = 0;
}
- status = setting->state.status;
+ status = main->setting.state.status;
- status_code_process_number(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
+ status_code_process_number(main, main->program.parameters.arguments.array[main->program.parameters.remaining.array[i]]);
- if (F_status_is_error_not(setting->state.status)) {
- setting->state.status = status;
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.state.status = status;
}
} // for
- f_file_stream_unlock(main->output.to);
+ f_file_stream_unlock(main->program.output.to);
}
}
- else if ((setting->flag & status_code_main_flag_error_e) || (setting->flag & status_code_main_flag_warning_e) || (setting->flag & status_code_main_flag_fine_e)) {
- if (main->pipe & fll_program_data_pipe_input_e) {
+ else if ((main->setting.flag & status_code_main_flag_error_e) || (main->setting.flag & status_code_main_flag_warning_e) || (main->setting.flag & status_code_main_flag_fine_e)) {
+ if (main->program.pipe & fll_program_data_pipe_input_e) {
// @todo call status_code_process_check() here for all main from pipe that is space separated.
}
- if (main->parameters.remaining.used) {
- f_file_stream_lock(main->output.to);
+ if (main->program.parameters.remaining.used) {
+ f_file_stream_lock(main->program.output.to);
- for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->program.parameters.remaining.used; ++i) {
- if (!((++main->signal_check) % status_code_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- setting->state.status = F_status_set_error(F_interrupt);
+ if (!((++main->program.signal_check) % status_code_signal_check_d)) {
+ if (fll_program_standard_signal_received(&main->program)) {
+ main->setting.state.status = F_status_set_error(F_interrupt);
break;
}
- main->signal_check = 0;
+ main->program.signal_check = 0;
}
- status = setting->state.status;
+ status = main->setting.state.status;
- status_code_process_check(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
+ status_code_process_check(main, main->program.parameters.arguments.array[main->program.parameters.remaining.array[i]]);
- if (F_status_is_error_not(setting->state.status)) {
- setting->state.status = status;
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.state.status = status;
}
} // for
- f_file_stream_unlock(main->output.to);
+ f_file_stream_unlock(main->program.output.to);
}
}
else {
- if (main->pipe & fll_program_data_pipe_input_e) {
+ if (main->program.pipe & fll_program_data_pipe_input_e) {
// @todo call status_code_process_normal() here for all main from pipe that is space separated.
}
- if (main->parameters.remaining.used) {
- f_file_stream_lock(main->output.to);
+ if (main->program.parameters.remaining.used) {
+ f_file_stream_lock(main->program.output.to);
- for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->program.parameters.remaining.used; ++i) {
- if (!((++main->signal_check) % status_code_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- setting->state.status = F_status_set_error(F_interrupt);
+ if (!((++main->program.signal_check) % status_code_signal_check_d)) {
+ if (fll_program_standard_signal_received(&main->program)) {
+ main->setting.state.status = F_status_set_error(F_interrupt);
break;
}
- main->signal_check = 0;
+ main->program.signal_check = 0;
}
- status = setting->state.status;
+ status = main->setting.state.status;
- status_code_process_normal(main, setting, main->parameters.arguments.array[main->parameters.remaining.array[i]]);
+ status_code_process_normal(main, main->program.parameters.arguments.array[main->program.parameters.remaining.array[i]]);
- if (F_status_is_error_not(setting->state.status)) {
- setting->state.status = status;
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.state.status = status;
}
} // for
- f_file_stream_unlock(main->output.to);
+ f_file_stream_unlock(main->program.output.to);
}
}
- if (setting->state.status == F_status_set_error(F_interrupt)) {
- fll_program_print_signal_received(main->warning, main->signal_received);
+ if (main->setting.state.status == F_status_set_error(F_interrupt)) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
}
- if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ if ((main->setting.flag & status_code_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
}
#endif // _di_status_code_main_
#include <fll/level_2/status_string.h>
// Status Code includes.
+#include <program/status_code/main/common/define.h>
+#include <program/status_code/main/common/enumeration.h>
#include <program/status_code/main/common/print.h>
#include <program/status_code/main/common/string.h>
#include <program/status_code/main/common/type.h>
#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/print/message.h>
#include <program/status_code/main/process.h>
#ifdef __cplusplus
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_status_code_main_
- extern void status_code_main(fll_program_data_t * const main, status_code_setting_t * const setting);
+ extern void status_code_main(status_code_main_t * const main);
#endif // _di_status_code_main_
#ifdef __cplusplus
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/data.c main/print/error.c main/process.c
+build_sources_library main/status_code.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print/data.c main/print/error.c main/print/message.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/data.h main/print/error.h main/process.h
+build_sources_headers main/status_code.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print/data.h main/print/error.h main/print/message.h main/process.h
build_sources_headers fss/status_code.h fss/common.h
build_sources_documentation man
if (!((++main->program.signal_check) % utf8_signal_check_d)) {
if (fll_program_standard_signal_received(&main->program)) {
- fll_program_print_signal_received(main->program.warning, main->program.signal_received);
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
main->setting.state.status = F_interrupt;
if (!((++main->program.signal_check) % utf8_signal_check_d)) {
if (fll_program_standard_signal_received(&main->program)) {
- fll_program_print_signal_received(main->program.warning, main->program.signal_received);
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
main->setting.state.status = F_status_set_error(F_interrupt);
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fll_program_print_error_parameter_missing_value(main->program.error, f_console_symbol_long_normal_s, utf8_long_to_file_s);
+ fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, utf8_long_to_file_s);
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fll_error_print(main->program.error, F_status_set_fine(main->setting.state.status), macro_utf8_f(f_string_dynamic_append_nulless), fll_error_file_flag_fallback_e);
+ fll_error_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_utf8_f(f_string_dynamic_append_nulless), fll_error_file_flag_fallback_e);
break;
}
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fll_program_print_error_parameter_missing_value(main->program.error, f_console_symbol_long_normal_s, utf8_long_from_file_s);
+ fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, utf8_long_from_file_s);
return;
}
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
- * Provides the common type structures.
+ * Provides the common define types.
*
* This is auto-included and should not need to be explicitly included.
*/
* API Version: 0.7
* Licenses: lgpl-2.1-or-later
*
- * Provides the common type structures.
+ * Provides the common enumeration types.
*
* This is auto-included and should not need to be explicitly included.
*/
data.program.debug.custom = (void *) &data;
f_console_parameter_t parameters[] = utf8_console_parameter_t_initialize;
+
data.program.parameters.array = parameters;
data.program.parameters.used = utf8_total_parameters_d;
data.program.environment = envp;
/**
* Print the byte sequence character (such as '豸').
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param sequence
* A byte sequences representing a single character to print.
*
*
* This handles whether or not the invalid character should be printed or not based on program parameters.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param invalid
* The byte sequence string or unicode codepoint string representing a single character to print.
*
/**
* Print the codepoint number as a codepoint string (such as U+8C78).
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param codepoint
* The codepoint to print.
* This is the code that represents a single character.
/**
* Print the width or combining state of the given character.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param sequence
* A byte sequences representing a single character to print.
*
/**
* Print an error regarding the width or combining state of a some character.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
*
* @return
* F_none on success.
/**
* Print the raw character data (binary / byte sequence).
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param raw
* The raw string in integer format.
* @param width
/**
* Print the raw character data (codepoint).
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param raw
* The raw string already in codepoint format.
*
/**
* Print the width or combining state of the for a raw character.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param width
* The pre-calculated width.
*
/**
* Print the input file section header.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param name
* The name of the file.
* @param index
/**
* Print the input parameter section header.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
+ *
+ * This does not alter print.custom.setting.state.status.
* @param index
* The index position of the parameter.
*
utf8_main_t * const main = (utf8_main_t *) print->custom;
- fll_error_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e);
+ fll_error_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e);
return F_none;
}
if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
- fl_print_format("%r%[%QFailed to decode character code '%]", print->to, f_string_eol_s, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%QFailed to decode character code '%]", print->to, print->set->error, print->prefix, print->set->error);
if (invalid.used) {
fl_print_format("%[0x", print->to, print->set->notable);
if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
- fl_print_format("%r%[%QFailed to encode Unicode codepoint '%]", print->to, f_string_eol_s, print->set->error, print->prefix, print->set->error);
+ fl_print_format("%[%QFailed to encode Unicode codepoint '%]", print->to, print->set->error, print->prefix, print->set->error);
fl_print_format("%[U+%_U%]", print->to, print->set->notable, codepoint, print->set->notable);
if (F_status_set_fine(main->setting.state.status) == F_utf_not) {
utf8_main_t * const main = (utf8_main_t *) print->custom;
- fll_error_file_print(*print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+ fll_error_file_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
return F_none;
}
if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- fll_print_format("%r%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%r", print->to, f_string_eol_s, print->set->error, print->prefix, print->set->error, f_string_eol_s);
+ fll_print_format("%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%r", print->to, print->set->error, print->prefix, print->set->error, f_string_eol_s);
return F_none;
}
/**
* 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.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
*
/**
* Print error message when attempt to decode the character failed.
*
- * @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * @param print
+ * The output structure to print to.
*
- * This does not alter setting.state.status.
+ * This does not alter print.custom.setting.state.status.
* @param invalid
* The byte sequence string or unicode codepoint string representing a single character to print.
*
/**
* Print error message when attempt to encode the character failed.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
* @param codepoint
/**
* 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.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
* @param function
/**
* Print error message for when no sources are provided.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
*
/**
* Print error message for when the file parameter is an empty string.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
* @param index
/**
* Print error message for when no sources are provided in the main program parameters.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
* @param from
/**
* Print error message for when too many 'to' destinations are specified.
*
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.status.
* @param print
- * Designates how printing is to be performed.
+ * The output structure to print to.
*
* This does not alter print.custom.setting.state.status.
*
#ifndef _di_utf8_print_message_help_
f_status_t utf8_print_message_help(fl_print_t * const print) {
+ if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+ utf8_main_t * const main = (utf8_main_t *) print->custom;
+
f_file_stream_lock(print->to);
- fll_program_print_help_header(*print, utf8_program_name_long_s, utf8_program_version_s);
+ fll_program_print_help_header(print, utf8_program_name_long_s, utf8_program_version_s);
- fll_program_print_help_option_standard(*print);
+ fll_program_print_help_option_standard(print);
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(*print, utf8_short_from_bytesequence_s, utf8_long_from_bytesequence_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "The expected input format is byte sequence (character data).");
- fll_program_print_help_option(*print, utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The expected input format is codepoint (such as U+0000).");
- fll_program_print_help_option(*print, utf8_short_from_file_s, utf8_long_from_file_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use the given output as the input source.");
+ fll_program_print_help_option(print, utf8_short_from_bytesequence_s, utf8_long_from_bytesequence_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "The expected input format is byte sequence (character data).");
+ fll_program_print_help_option(print, utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The expected input format is codepoint (such as U+0000).");
+ fll_program_print_help_option(print, utf8_short_from_file_s, utf8_long_from_file_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use the given output as the input source.");
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(*print, utf8_short_to_bytesequence_s, utf8_long_to_bytesequence_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "The output format is byte sequence (character data).");
- fll_program_print_help_option(*print, utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The output format is codepoint (such as U+0000).");
- fll_program_print_help_option(*print, utf8_short_to_combining_s, utf8_long_to_combining_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The output format is to print whether or not character is combining or not.");
- fll_program_print_help_option(*print, utf8_short_to_file_s, utf8_long_to_file_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use the given file as the output destination.");
- fll_program_print_help_option(*print, utf8_short_to_width_s, utf8_long_to_width_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The output format is to print the width of a character (either 0, 1, or 2).");
+ fll_program_print_help_option(print, utf8_short_to_bytesequence_s, utf8_long_to_bytesequence_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "The output format is byte sequence (character data).");
+ fll_program_print_help_option(print, utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The output format is codepoint (such as U+0000).");
+ fll_program_print_help_option(print, utf8_short_to_combining_s, utf8_long_to_combining_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The output format is to print whether or not character is combining or not.");
+ fll_program_print_help_option(print, utf8_short_to_file_s, utf8_long_to_file_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use the given file as the output destination.");
+ fll_program_print_help_option(print, utf8_short_to_width_s, utf8_long_to_width_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The output format is to print the width of a character (either 0, 1, or 2).");
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(*print, utf8_short_headers_s, utf8_long_headers_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print headers for each section (pipe, file, or parameter).");
- fll_program_print_help_option(*print, utf8_short_separate_s, utf8_long_separate_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Separate characters by newlines (implied when printing headers).");
- fll_program_print_help_option(*print, utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Strip invalid Unicode characters (do not print invalid sequences).");
- fll_program_print_help_option(*print, utf8_short_verify_s, utf8_long_verify_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Only perform verification of valid sequences.");
+ fll_program_print_help_option(print, utf8_short_headers_s, utf8_long_headers_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print headers for each section (pipe, file, or parameter).");
+ fll_program_print_help_option(print, utf8_short_separate_s, utf8_long_separate_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Separate characters by newlines (implied when printing headers).");
+ fll_program_print_help_option(print, utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Strip invalid Unicode characters (do not print invalid sequences).");
+ fll_program_print_help_option(print, utf8_short_verify_s, utf8_long_verify_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Only perform verification of valid sequences.");
f_print_dynamic_raw(f_string_eol_s, print->to);
- f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_usage(*print, utf8_program_name_s, utf8_program_help_parameters_s);
+ fll_program_print_help_usage(print, utf8_program_name_s, utf8_program_help_parameters_s);
fl_print_format("%r The default behavior is to assume the expected input is byte sequences from the command line to be output to the screen as codepoints.%r%r", print->to, f_string_eol_s, f_string_eol_s, f_string_eol_s);
if (!((++main->program.signal_check) % utf8_signal_check_d)) {
if (fll_program_standard_signal_received(&main->program)) {
- fll_program_print_signal_received(main->program.warning, main->program.signal_received);
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
main->setting.state.status = F_status_set_error(F_interrupt);
utf8_detect_codepoint(main, text, &mode_codepoint);
if (F_status_is_error(main->setting.state.status)) {
- fll_error_print(main->program.error, F_status_set_fine(main->setting.state.status), macro_utf8_f(utf8_detect_codepoint), fll_error_file_flag_fallback_e);
+ fll_error_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_utf8_f(utf8_detect_codepoint), fll_error_file_flag_fallback_e);
break;
}
main->setting.state.status = F_none;
- if (main->setting.flag & utf8_main_flag_help_e) {
- utf8_print_message_help(&main->program.message);
+ if (main->setting.flag & (utf8_main_flag_help_e | utf8_main_flag_version_e | utf8_main_flag_copyright_e)) {
- return;
- }
-
- if (main->setting.flag & utf8_main_flag_version_e) {
- fll_program_print_version(main->program.message, utf8_program_version_s);
-
- if ((main->setting.flag & utf8_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ if (main->setting.flag & utf8_main_flag_help_e) {
+ utf8_print_message_help(&main->program.message);
+ }
+ else if (main->setting.flag & utf8_main_flag_version_e) {
+ fll_program_print_version(&main->program.message, utf8_program_version_s);
+ }
+ else if (main->setting.flag & utf8_main_flag_copyright_e) {
+ fll_program_print_copyright(&main->program.message);
}
-
- return;
- }
-
- if (main->setting.flag & utf8_main_flag_copyright_e) {
- fll_program_print_copyright(main->program.message);
if ((main->setting.flag & utf8_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);