Other fixes, cleanups, and improvements are made when observed.
#ifndef _F_account_h
#define _F_account_h
-// libc includes.
+// Libc includes.
#include <sys/types.h>
#include <grp.h>
#include <pwd.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _MOCK__account_h
#define _MOCK__account_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/account.h>
#ifdef __cplusplus
#ifndef _TEST__F_account_h
#define _TEST__F_account_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/account.h>
// mock includes.
#ifndef _F_capability_h
#define _F_capability_h
-// libc includes.
+// Libc includes.
#include <string.h>
#include <sys/types.h>
#include <sys/capability.h>
#endif // _di_libcap_
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _MOCK__capability_h
#define _MOCK__capability_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/capability.h>
#ifdef __cplusplus
#ifndef _TEST__F_capability_h
#define _TEST__F_capability_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/capability.h>
// mock includes.
const f_string_static_t *after;
} f_color_set_t;
- #define f_color_set_t_initialize { &f_string_empty_s, &f_string_empty_s }
+ #define f_color_set_t_initialize { 0, 0 }
#define macro_f_color_set_t_initialize(before, after) { before, after }
#define macro_f_color_set_t_clear(set) \
- set.before = &f_string_empty_s; \
- set.after = &f_string_empty_s;
+ set.before = 0; \
+ set.after = 0;
#endif // _di_f_color_set_t_
/**
#ifndef _F_color_h
#define _F_color_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _MOCK__color_h
#define _MOCK__color_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/color.h>
#ifdef __cplusplus
#ifndef _TEST__F_color_h
#define _TEST__F_color_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/color.h>
// mock includes.
* However, the libc/POSIX appears to limit this to 2^63 (signed).
*/
#ifndef _di_f_console_length_size_
- #define f_console_parameter_size F_string_t_size_d
+ #define F_console_parameter_size_d F_string_t_size_d
#endif // _di_f_console_length_size_
/**
f_console_identify(arguments.argv[location], &result);
- argument_length = strnlen(arguments.argv[location], f_console_parameter_size);
+ argument_length = strnlen(arguments.argv[location], F_console_parameter_size_d);
// Process the current parameter.
if (result == f_console_short_enable_e || result == f_console_short_disable_e) {
// libc include
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _TEST__F_console_h
#define _TEST__F_console_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/console.h>
// test includes.
#ifndef _F_control_group_h
#define _F_control_group_h
-// libc includes.
+// Libc includes.
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _TEST__F_control_group_h
#define _TEST__F_control_group_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/control_group.h>
// test includes.
#ifndef _F_conversion_h
#define _F_conversion_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _MOCK__conversion_h
#define _MOCK__conversion_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/conversion.h>
#ifdef __cplusplus
#ifndef _TEST__F_conversion_h
#define _TEST__F_conversion_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/conversion.h>
// mock includes.
#ifndef _F_directory_h
#define _F_directory_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <ftw.h>
#endif // __USE_XOPEN_EXTENDED
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_directory_type_h
#define _F_directory_type_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/string.h>
#ifndef _F_environment_h
#define _F_environment_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
// include pre-requirements
#define _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <sched.h>
#include <termios.h>
#include <sys/types.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#endif
#ifndef _di_f_file_type_
- const f_string_static_t f_file_type_name_blocks_s = macro_f_string_static_t_initialize2(F_file_type_name_block_s, 0, F_file_type_name_block_s_length);
+ const f_string_static_t f_file_type_name_block_s = macro_f_string_static_t_initialize2(F_file_type_name_block_s, 0, F_file_type_name_block_s_length);
const f_string_static_t f_file_type_name_character_s = macro_f_string_static_t_initialize2(F_file_type_name_character_s, 0, F_file_type_name_character_s_length);
const f_string_static_t f_file_type_name_directory_s = macro_f_string_static_t_initialize2(F_file_type_name_directory_s, 0, F_file_type_name_directory_s_length);
+ const f_string_static_t f_file_type_name_fifo_s = macro_f_string_static_t_initialize2(F_file_type_name_fifo_s, 0, F_file_type_name_fifo_s_length);
const f_string_static_t f_file_type_name_link_s = macro_f_string_static_t_initialize2(F_file_type_name_link_s, 0, F_file_type_name_link_s_length);
const f_string_static_t f_file_type_name_regular_s = macro_f_string_static_t_initialize2(F_file_type_name_regular_s, 0, F_file_type_name_regular_s_length);
const f_string_static_t f_file_type_name_socket_s = macro_f_string_static_t_initialize2(F_file_type_name_socket_s, 0, F_file_type_name_socket_s_length);
#define F_file_open_mode_read_write_s_length 2
#define F_file_open_mode_truncate_s_length 1
- extern const f_string_static_t f_file_type_name_blocks_s;
+ extern const f_string_static_t f_file_type_name_block_s;
extern const f_string_static_t f_file_type_name_character_s;
extern const f_string_static_t f_file_type_name_directory_s;
+ extern const f_string_static_t f_file_type_name_fifo_s;
extern const f_string_static_t f_file_type_name_link_s;
extern const f_string_static_t f_file_type_name_regular_s;
extern const f_string_static_t f_file_type_name_socket_s;
return private_f_file_copy_content(source, destination, size_block == 0 ? F_file_default_read_size_d : size_block);
}
- else if (macro_f_file_type_is_link(source_stat.st_mode)) {
+
+ if (macro_f_file_type_is_link(source_stat.st_mode)) {
status = private_f_file_link(destination, source);
if (F_status_set_fine(status) == F_file_found) {
if (exclusive) return status;
return private_f_file_copy_content(source, destination, size_block == 0 ? F_file_default_read_size_d : size_block);
}
- else if (macro_f_file_type_is_directory(source_stat.st_mode)) {
+
+ if (macro_f_file_type_is_directory(source_stat.st_mode)) {
status = private_f_file_create_directory(destination, (~F_file_type_mask_d) & mode.directory);
if (F_status_is_error(status)) {
return F_none;
}
- else if (macro_f_file_type_is_link(source_stat.st_mode)) {
+
+ if (macro_f_file_type_is_link(source_stat.st_mode)) {
f_string_dynamic_t target = f_string_dynamic_t_initialize;
status = private_f_file_link_read(source, source_stat, &target);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(target);
+ f_string_dynamic_resize(0, &target);
+
return status;
}
status = private_f_file_link(target.string, destination);
- macro_f_string_dynamic_t_delete_simple(target);
+ f_string_dynamic_resize(0, &target);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) != F_file_found || exclusive) {
return F_none;
}
- else if (macro_f_file_type_is_fifo(source_stat.st_mode)) {
+
+ if (macro_f_file_type_is_fifo(source_stat.st_mode)) {
status = private_f_file_create_fifo(destination, (~F_file_type_mask_d) & mode.fifo);
if (F_status_is_error(status)) {
return F_none;
}
- else if (macro_f_file_type_is_socket(source_stat.st_mode)) {
+
+ if (macro_f_file_type_is_socket(source_stat.st_mode)) {
status = private_f_file_create_node(destination, macro_f_file_type_get(source_stat.st_mode) | ((~F_file_type_mask_d) & mode.socket), source_stat.st_rdev);
if (F_status_is_error(status)) {
return F_none;
}
- else if (macro_f_file_type_is_block(source_stat.st_mode) || macro_f_file_type_is_character(source_stat.st_mode)) {
+
+ if (macro_f_file_type_is_block(source_stat.st_mode) || macro_f_file_type_is_character(source_stat.st_mode)) {
status = private_f_file_create_node(destination, macro_f_file_type_get(source_stat.st_mode) | ((~F_file_type_mask_d) & mode.block), source_stat.st_rdev);
if (F_status_is_error(status)) {
}
#endif // _di_f_file_type_at_
+#ifndef _di_f_file_umask_get_
+ f_status_t f_file_umask_get(mode_t *mask) {
+
+ // Bad design in POSIX where there is no get umask without setting it.
+ *mask = umask(0);
+
+ // Restore umask.
+ umask(*mask);
+
+ return F_none;
+ }
+#endif // _di_f_file_umask_get_
+
+#ifndef _di_f_file_umask_set_
+ f_status_t f_file_umask_set(const mode_t mask) {
+
+ umask(mask);
+
+ return F_none;
+ }
+#endif // _di_f_file_umask_set_
+
#ifndef _di_f_file_write_
f_status_t f_file_write(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written) {
#ifndef _di_level_0_parameter_checking_
#ifndef _F_file_h
#define _F_file_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
// non-standard libc includs
#include <sys/sysmacros.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#endif // _di_f_file_type_at_
/**
+ * Get the umask.
+ *
+ * This sets the umask after getting the umask.
+ * This is necessary because the umask() is poorly designed such that it requires changing the umask to get the current umask.
+ *
+ * @param mask
+ * The umask value.
+ * (The name "mask" is used avoid a naming conflict with the umask() function.)
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_f_file_umask_get_
+ extern f_status_t f_file_umask_get(mode_t *mask);
+#endif // _di_f_file_umask_get_
+
+/**
+ * Set the umask.
+ *
+ * @param mask
+ * The umask value to assigned.
+ * (The name "mask" is used avoid a naming conflict with the umask() function.)
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_f_file_umask_set_
+ extern f_status_t f_file_umask_set(const mode_t mask);
+#endif // _di_f_file_umask_set_
+
+/**
* Write until entire buffer is written.
*
* @param file
#ifndef _F_fss_h
#define _F_fss_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#endif
#ifndef _di_f_iki_content_is_
- f_status_t f_iki_content_is(const f_string_static_t content, const uint8_t quote) {
+ f_status_t f_iki_content_is(const f_string_static_t content, const f_string_static_t quote) {
#ifndef _di_level_0_parameter_checking_
- if (content.used > content.size) return F_status_set_error(F_parameter);
- if (quote != f_iki_syntax_quote_single_s.string[0] && quote != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
+ if (!quote.used) return F_status_set_error(F_parameter);
+ if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
- return private_f_iki_content_partial_is(content, range, quote);
+ return private_f_iki_content_partial_is(content, range, quote.string[0]);
}
#endif // _di_f_iki_content_is_
#ifndef _di_f_iki_content_partial_is_
- f_status_t f_iki_content_partial_is(const f_string_static_t content, const f_string_range_t range, const uint8_t quote) {
+ f_status_t f_iki_content_partial_is(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote) {
#ifndef _di_level_0_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
if (range.start > range.stop) return F_status_set_error(F_parameter);
if (range.start >= content.used) return F_status_set_error(F_parameter);
- if (quote != f_iki_syntax_quote_single_s.string[0] && quote != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
+ if (!quote.used) return F_status_set_error(F_parameter);
+ if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_iki_content_partial_is(content, range, quote);
+ return private_f_iki_content_partial_is(content, range, quote.string[0]);
}
#endif // _di_f_iki_content_partial_is_
#ifndef _F_iki_h
#define _F_iki_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_iki_content_is_
- extern f_status_t f_iki_content_is(const f_string_static_t content, const uint8_t quote);
+ extern f_status_t f_iki_content_is(const f_string_static_t content, const f_string_static_t quote);
#endif // _di_f_iki_content_is_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_iki_content_partial_is_
- extern f_status_t f_iki_content_partial_is(const f_string_static_t content, const f_string_range_t range, const uint8_t quote);
+ extern f_status_t f_iki_content_partial_is(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote);
#endif // _di_f_iki_content_partial_is_
/**
#endif // !defined(_di_f_iki_read_)
#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
- f_status_t private_f_iki_content_partial_is(const f_string_static_t buffer, const f_string_range_t range, const uint8_t quote) {
+ f_status_t private_f_iki_content_partial_is(const f_string_static_t buffer, const f_string_range_t range, const char quote) {
f_array_length_t delimits = 0;
* @see f_iki_content_partial_is()
*/
#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
- extern f_status_t private_f_iki_content_partial_is(const f_string_static_t buffer, const f_string_range_t range, const uint8_t quote) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_iki_content_partial_is(const f_string_static_t buffer, const f_string_range_t range, const char quote) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
/**
// include pre-requirements
#define _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <sys/time.h>
#include <sys/resource.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_memory_h
#define _F_memory_h
-// libc includes.
+// Libc includes.
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#ifndef _TEST__F_memory_h
#define _TEST__F_memory_h
-// libc includes.
+// Libc includes.
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
// cmocka includes.
#include <cmocka.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/memory.h>
// test includes.
#ifndef _F_path_h
#define _F_path_h
-// libc includes.
+// Libc includes.
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#define PATH_MAX 4096
#endif /* PATH_MAX */
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_pipe_h
#define _F_pipe_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
const f_string_static_t f_print_sequence_escape_s = macro_f_string_static_t_initialize2(F_print_sequence_escape_s, 0, F_print_sequence_escape_s_length);
const f_string_static_t f_print_sequence_form_feed_s = macro_f_string_static_t_initialize2(F_print_sequence_form_feed_s, 0, F_print_sequence_form_feed_s_length);
const f_string_static_t f_print_sequence_line_feed_s = macro_f_string_static_t_initialize2(F_print_sequence_line_feed_s, 0, F_print_sequence_line_feed_s_length);
+ const f_string_static_t f_print_sequence_line_new_s = macro_f_string_static_t_initialize2(F_print_sequence_line_new_s, 0, F_print_sequence_line_new_s_length);
const f_string_static_t f_print_sequence_null_s = macro_f_string_static_t_initialize2(F_print_sequence_null_s, 0, F_print_sequence_null_s_length);
const f_string_static_t f_print_sequence_separator_file_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_file_s, 0, F_print_sequence_separator_file_s_length);
const f_string_static_t f_print_sequence_separator_group_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_group_s, 0, F_print_sequence_separator_group_s_length);
const f_string_static_t f_print_sequence_separator_unit_s = macro_f_string_static_t_initialize2(F_print_sequence_separator_unit_s, 0, F_print_sequence_separator_unit_s_length);
const f_string_static_t f_print_sequence_shift_in_s = macro_f_string_static_t_initialize2(F_print_sequence_shift_in_s, 0, F_print_sequence_shift_in_s_length);
const f_string_static_t f_print_sequence_shift_out_s = macro_f_string_static_t_initialize2(F_print_sequence_shift_out_s, 0, F_print_sequence_shift_out_s_length);
+ const f_string_static_t f_print_sequence_space_s = macro_f_string_static_t_initialize2(F_print_sequence_space_s, 0, F_print_sequence_space_s_length);
const f_string_static_t f_print_sequence_start_of_header_s = macro_f_string_static_t_initialize2(F_print_sequence_start_of_header_s, 0, F_print_sequence_start_of_header_s_length);
const f_string_static_t f_print_sequence_start_of_text_s = macro_f_string_static_t_initialize2(F_print_sequence_start_of_text_s, 0, F_print_sequence_start_of_text_s_length);
const f_string_static_t f_print_sequence_substitute_s = macro_f_string_static_t_initialize2(F_print_sequence_substitute_s, 0, F_print_sequence_substitute_s_length);
#define F_print_sequence_escape_s "␛"
#define F_print_sequence_form_feed_s "␌"
#define F_print_sequence_line_feed_s "␊"
+ #define F_print_sequence_line_new_s ""
#define F_print_sequence_null_s "␀"
#define F_print_sequence_separator_file_s "␜"
#define F_print_sequence_separator_group_s "␝"
#define F_print_sequence_separator_unit_s "␟"
#define F_print_sequence_shift_in_s "␏"
#define F_print_sequence_shift_out_s "␎"
+ #define F_print_sequence_space_s "␠"
#define F_print_sequence_start_of_header_s "␁"
#define F_print_sequence_start_of_text_s "␂"
#define F_print_sequence_substitute_s "␚"
#define F_print_sequence_escape_s_length 3
#define F_print_sequence_form_feed_s_length 3
#define F_print_sequence_line_feed_s_length 3
+ #define F_print_sequence_line_new_s_length 3
#define F_print_sequence_null_s_length 3
#define F_print_sequence_separator_file_s_length 3
#define F_print_sequence_separator_group_s_length 3
#define F_print_sequence_separator_unit_s_length 3
#define F_print_sequence_shift_in_s_length 3
#define F_print_sequence_shift_out_s_length 3
+ #define F_print_sequence_space_s_length 3
#define F_print_sequence_start_of_header_s_length 3
#define F_print_sequence_start_of_text_s_length 3
#define F_print_sequence_substitute_s_length 3
extern const f_string_static_t f_print_sequence_equiry_s;
extern const f_string_static_t f_print_sequence_form_feed_s;
extern const f_string_static_t f_print_sequence_line_feed_s;
+ extern const f_string_static_t f_print_sequence_line_new_s;
extern const f_string_static_t f_print_sequence_null_s;
extern const f_string_static_t f_print_sequence_separator_file_s;
extern const f_string_static_t f_print_sequence_separator_group_s;
extern const f_string_static_t f_print_sequence_separator_unit_s;
extern const f_string_static_t f_print_sequence_shift_in_s;
extern const f_string_static_t f_print_sequence_shift_out_s;
+ extern const f_string_static_t f_print_sequence_space_s;
extern const f_string_static_t f_print_sequence_start_of_header_s;
extern const f_string_static_t f_print_sequence_start_of_text_s;
extern const f_string_static_t f_print_sequence_substitute_s;
#ifndef _F_print_h
#define _F_print_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <inttypes.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_serialize_h
#define _F_serialize_h
-// libc includes.
+// Libc includes.
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_signal_h
#define _F_signal_h
-// libc includes.
+// Libc includes.
#include <poll.h>
#include <signal.h>
#include <string.h>
#include <sys/signalfd.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#ifndef _F_socket_h
#define _F_socket_h
-// libc includes.
+// Libc includes.
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/un.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_status_h
#define _F_status_h
-// libc includes.
+// Libc includes.
#include <errno.h>
#ifdef __cplusplus
#ifndef _F_status_string_h
#define _F_status_string_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _F_string_h
#define _F_string_h
-// libc includes.
+// Libc includes.
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/type.h>
// include pre-requirements
#define _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <fcntl.h>
#include <semaphore.h>
#include <signal.h>
#include <pthread.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#define _GNU_SOURCE
#endif // _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <stdbool.h>
#include <stdint.h>
#include <sys/stat.h>
#ifndef _F_type_array_h
#define _F_type_array_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/memory.h>
#ifndef _F_utf_h
#define _F_utf_h
-// libc includes.
+// Libc includes.
#include <endian.h>
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <string.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
// include pre-requirements
#define _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <sched.h>
#include <stdio.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_conversion_h
#define _FL_conversion_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <stdlib.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_directory_h
#define _FL_directory_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <ftw.h>
#endif // __USE_XOPEN_EXTENDED
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
status = private_fl_directory_clone_file(list[i]->array[j], source, destination, role, recurse);
} // for
- macro_f_string_dynamics_t_delete_simple((*list[i]));
+ f_string_dynamics_resize(0, list[i]);
} // for
}
}
} // for
- macro_f_string_dynamics_t_delete_simple(listing.directory);
+ f_string_dynamics_resize(0, &listing.directory);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (recurse.failures && failures_used < recurse.failures->used) {
return F_failure;
status = private_fl_directory_copy_file(list[i]->array[j], source, destination, mode, recurse);
} // for
- macro_f_string_dynamics_t_delete_simple((*list[i]));
+ f_string_dynamics_resize(0, list[i]);
} // for
}
}
} // for
- macro_f_string_dynamics_t_delete_simple(listing.directory);
+ f_string_dynamics_resize(0, &listing.directory);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (recurse.failures && failures_used < recurse.failures->used) {
return F_failure;
#include <stdio.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
// include pre-requirements
#define _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <grp.h>
#include <sched.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_fss_h
#define _FL_fss_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_fss_basic_h
#define _FL_fss_basic_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#ifdef __cplusplus
#ifndef _FL_fss_basic_list_h
#define _FL_fss_basic_list_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_basic.h>
macro_f_fss_objects_t_resize(status, objects, state.step_small)
if (F_status_is_error(status)) {
- macro_f_array_lengths_t_delete_simple(positions_start);
+ f_type_array_lengths_resize(0, &positions_start);
return status;
}
macro_f_array_lengths_t_resize(status, slashes, state.step_small)
if (F_status_is_error(status)) {
- macro_f_array_lengths_t_delete_simple(positions_start);
+ f_type_array_lengths_resize(0, &positions_start);
macro_f_fss_objects_t_delete_simple(objects);
return status;
private_macro_fl_fss_nest_return_on_overflow_delimited((buffer), (*range), (*found), positions_start, objects, slashes, F_none_eos, F_none_stop)
- macro_f_array_lengths_t_delete_simple(positions_start);
+ f_type_array_lengths_resize(0, &positions_start);
macro_f_fss_objects_t_delete_simple(objects);
- macro_f_array_lengths_t_delete_simple(slashes);
+ f_type_array_lengths_resize(0, &slashes);
return F_fss_found_content;
}
if (F_status_is_error(status)) break;
} // while
- macro_f_array_lengths_t_delete_simple(positions_start);
+ f_type_array_lengths_resize(0, &positions_start);
macro_f_fss_objects_t_delete_simple(objects);
- macro_f_array_lengths_t_delete_simple(slashes);
+ f_type_array_lengths_resize(0, &slashes);
delimits->used = delimits_used;
comments->used = comments_used;
#ifndef _FL_fss_embedded_list_h
#define _FL_fss_embedded_list_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_basic.h>
#ifndef _FL_fss_extended_h
#define _FL_fss_extended_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#ifdef __cplusplus
#ifndef _FL_fss_extended_list_h
#define _FL_fss_extended_list_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_basic.h>
#ifndef _FL_iki_h
#define _FL_iki_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_print_h
#define _FL_print_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_signal_h
#define _FL_signal_h
-// libc includes.
+// Libc includes.
#include <signal.h>
#include <string.h>
#include <sys/signalfd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/signal.h>
#ifndef _di_fl_string_compare_
f_status_t fl_string_compare(const f_string_t string1, const f_string_t string2, const f_array_length_t length1, const f_array_length_t length2) {
+
return private_fl_string_compare(string1, string2, 0, 0, length1, length2);
}
#endif // _di_fl_string_compare_
#ifndef _di_fl_string_compare_except_
f_status_t fl_string_compare_except(const f_string_t string1, const f_string_t string2, const f_array_length_t length1, const f_array_length_t length2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
return private_fl_string_compare_except(string1, string2, 0, 0, length1, length2, except1, except2);
}
#endif // _di_fl_string_compare_except_
#ifndef _di_fl_string_compare_except_trim_
f_status_t fl_string_compare_except_trim(const f_string_t string1, const f_string_t string2, const f_array_length_t length1, const f_array_length_t length2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
return private_fl_string_compare_except_trim(string1, string2, 0, 0, length1, length2, except1, except2);
}
#endif // _di_fl_string_compare_except_trim_
#ifndef _di_fl_string_compare_trim_
f_status_t fl_string_compare_trim(const f_string_t string1, const f_string_t string2, const f_array_length_t length1, const f_array_length_t length2) {
+
return private_fl_string_compare_trim(string1, string2, 0, 0, length1, length2);
}
#endif // _di_fl_string_compare_trim_
#ifndef _di_fl_string_dynamic_compare_except_
f_status_t fl_string_dynamic_compare_except(const f_string_static_t string1, const f_string_static_t string2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
return private_fl_string_compare_except(string1.string, string2.string, 0, 0, string1.used, string2.used, except1, except2);
}
#endif // _di_fl_string_dynamic_compare_except_
#ifndef _di_fl_string_dynamic_compare_except_string_
f_status_t fl_string_dynamic_compare_except_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
return private_fl_string_compare_except(string1, string2.string, 0, 0, length1, string2.used, except1, except2);
}
#endif // _di_fl_string_dynamic_compare_except_string_
#ifndef _di_fl_string_dynamic_compare_except_trim_
f_status_t fl_string_dynamic_compare_except_trim(const f_string_static_t string1, const f_string_static_t string2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
return private_fl_string_compare_except_trim(string1.string, string2.string, 0, 0, string1.used, string2.used, except1, except2);
}
#endif // _di_fl_string_dynamic_compare_except_trim_
#ifndef _di_fl_string_dynamic_compare_except_trim_string_
f_status_t fl_string_dynamic_compare_except_trim_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
return private_fl_string_compare_except_trim(string1, string2.string, 0, 0, length1, string2.used, except1, except2);
}
#endif // _di_fl_string_dynamic_compare_except_trim_string_
#ifndef _di_fl_string_dynamic_compare_string_
f_status_t fl_string_dynamic_compare_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1) {
+
return private_fl_string_compare(string1, string2.string, 0, 0, length1, string2.used);
}
#endif // _di_fl_string_dynamic_compare_string_
#ifndef _di_fl_string_dynamic_compare_trim_
f_status_t fl_string_dynamic_compare_trim(const f_string_static_t string1, const f_string_static_t string2) {
+
return private_fl_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used);
}
#endif // _di_fl_string_dynamic_compare_trim_
#ifndef _di_fl_string_dynamic_compare_trim_string_
f_status_t fl_string_dynamic_compare_trim_string(const f_string_t string1, const f_string_static_t string2, const f_array_length_t length1) {
+
return private_fl_string_compare_trim(string1, string2.string, 0, 0, length1, string2.used);
}
#endif // _di_fl_string_dynamic_compare_trim_string_
f_array_length_t end = range.stop;
const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (status == F_data_not) {
return status;
f_array_length_t end = range.stop;
const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (status == F_data_not) {
return status;
f_utf_character_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (character == seek_to_this) {
return F_none;
while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (string[range->start] == f_string_eol_s.string[0]) {
return F_none_eol;
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (string[range->start] == f_string_eol_s.string[0]) {
return F_none_eol;
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
f_utf_character_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (character == seek_to_this) {
return F_none;
id->used = 0;
}
- // skip past all leading NULLs.
+ // Skip past all leading NULLs.
for (; range->start <= range->stop; ++range->start) {
if (buffer[range->start]) break;
} // for
f_array_length_t end = length - 1;
const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (status == F_data_not) {
return status;
f_array_length_t end = length - 1;
const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (status == F_data_not) {
return status;
f_utf_character_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (character == seek_to) {
return F_none;
while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (string[range->start] == f_string_eol_s.string[0]) {
return F_none_eol;
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (string[range->start] == f_string_eol_s.string[0]) {
return F_none_eol;
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
f_utf_character_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (character == seek_to) {
return F_none;
#ifndef _FL_string_h
#define _FL_string_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_string_h
#define _FL_string_h
-// libc includes.
+// Libc includes.
#include <ctype.h>
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FL_utf_file_h
#define _FL_utf_file_h
-// libc includes.
+// Libc includes.
#include <string.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FLL_control_h
#define _FLL_control_h
-// libc includes.
+// Libc includes.
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/file.h>
#include <fll/level_0/path.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/control_group.h>
#include <fll/level_1/directory.h>
// libc include
#include <stdio.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/file.h>
#include <fll/level_0/print.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/print.h>
// fll-2 error includes
status = f_file_exists(program ? program : arguments.array[0].string);
if (status != F_true) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return F_status_set_error(F_file_found_not);
}
status = fl_environment_path_explode_dynamic(path, &paths);
}
- macro_f_string_dynamic_t_delete_simple(path);
+ f_string_dynamic_resize(0, &path);
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return status;
}
}
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return status;
}
} // for
if (!found) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return F_status_set_error(F_file_found_not);
}
memcpy(&program_path, found->string, found->used);
- status = macro_f_string_dynamics_t_delete_simple(paths);
- if (F_status_is_error(status)) return status;
+ f_string_dynamics_resize(0, &paths);
fixed_arguments[0] = program_path;
status = f_file_exists(program ? program : arguments.array[0].string);
if (status != F_true) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return F_status_set_error(F_file_found_not);
}
status = fl_environment_path_explode_dynamic(path, &paths);
}
- macro_f_string_dynamic_t_delete_simple(path);
+ f_string_dynamic_resize(0, &path);
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return status;
}
}
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return status;
}
} // for
if (!found) {
- macro_f_string_dynamics_t_delete_simple(paths);
+ f_string_dynamics_resize(0, &paths);
return F_status_set_error(F_file_found_not);
}
memcpy(&program_path, found->string, found->used);
- status = macro_f_string_dynamics_t_delete_simple(paths);
- if (F_status_is_error(status)) return status;
+ f_string_dynamics_resize(0, &paths);
if (parameter && (parameter->option & FL_execute_parameter_option_path_d)) {
fixed_arguments[0] = program_path;
// include pre-requirements
#define _GNU_SOURCE
-// libc includes.
+// Libc includes.
#include <memory.h>
#include <sched.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/thread.h>
#endif // _di_pthread_support_
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/control_group.h>
#include <fll/level_1/environment.h>
#include <fll/level_1/execute.h>
status = f_string_append(source, length, &argument);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(argument);
+ f_string_dynamic_resize(0, &argument);
return status;
}
status = f_string_dynamic_terminate(&argument);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(argument);
+ f_string_dynamic_resize(0, &argument);
return status;
}
status = f_string_append(value, value_length, &argument);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(argument);
+ f_string_dynamic_resize(0, &argument);
return status;
}
status = f_string_dynamic_terminate(&argument);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(argument);
+ f_string_dynamic_resize(0, &argument);
return status;
}
#ifndef _FLL_file_h
#define _FLL_file_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/file.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/directory.h>
#ifdef __cplusplus
status = f_file_mode_set(path_sub, mode);
} // for
- macro_f_string_dynamics_t_delete_simple((*list[i]));
+ f_string_dynamics_resize(0, list[i]);
} // for
}
- macro_f_string_dynamics_t_delete_simple(listing.unknown);
+ f_string_dynamics_resize(0, &listing.unknown);
for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) {
if (status == F_false) {
status = F_status_set_error(F_directory);
+
break;
}
}
} // for
- macro_f_string_dynamics_t_delete_simple(listing.directory);
+ f_string_dynamics_resize(0, &listing.directory);
if (F_status_is_error(status)) {
return status;
status = f_file_role_change(path_sub, uid, gid, dereference);
} // for
- macro_f_string_dynamics_t_delete_simple((*list[i]));
+ f_string_dynamics_resize(0, list[i]);
} // for
}
if (status == F_false) {
status = F_status_set_error(F_directory);
+
break;
}
}
} // for
- macro_f_string_dynamics_t_delete_simple(listing.directory);
+ f_string_dynamics_resize(0, &listing.directory);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return f_file_role_change(path, uid, gid, dereference);
}
#endif // _di_fll_fss_identify_
#ifndef _di_fll_fss_snatch_
- f_status_t fll_fss_snatch(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]) {
+ f_status_t fll_fss_snatch(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
for (; i < objects.used; ++i) {
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
if (matched[j]) continue;
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#endif // _di_fll_fss_snatch_
#ifndef _di_fll_fss_snatch_apart_
- f_status_t fll_fss_snatch_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_string_dynamics_t *value = 0;
f_fss_content_t *content = 0;
for (; i < objects.used; ++i) {
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#endif // _di_fll_fss_snatch_apart_
#ifndef _di_fll_fss_snatch_map_
- f_status_t fll_fss_snatch_map(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_map(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_name = 0;
f_string_dynamic_t name = f_string_dynamic_t_initialize;
f_array_length_t i = 0;
if (!contents.array[i].used) continue;
- length_name = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_name, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
matched = F_false;
- length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
for (k = 0; k < values[j]->used; ++k) {
- status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
+ status = fl_string_dynamic_partial_compare_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
matches[j] = F_true;
}
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
+
break;
}
} // for
if (values[j]->used == values[j]->size) {
if (values[j]->used + F_fss_default_allocation_step_d > F_array_length_t_size_d) {
if (values[j]->used == F_array_length_t_size_d) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return F_status_set_error(F_array_too_large);
}
macro_f_string_maps_t_resize(status, (*values[j]), values[j]->used + 1);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
macro_f_string_maps_t_resize(status, (*values[j]), values[j]->used + F_fss_default_allocation_step_d);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[1], &map->value);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
} // for
} // for
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
+
return F_none;
}
#endif // _di_fll_fss_snatch_map_
#ifndef _di_fll_fss_snatch_map_apart_
- f_status_t fll_fss_snatch_map_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_map_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
if (!contents.array[i].used) continue;
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#endif // _di_fll_fss_snatch_map_apart_
#ifndef _di_fll_fss_snatch_map_mash_
- f_status_t fll_fss_snatch_map_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_map_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
if (!contents.array[i].used) continue;
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#endif // _di_fll_fss_snatch_map_mash_
#ifndef _di_fll_fss_snatch_map_mash_apart_
- f_status_t fll_fss_snatch_map_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_map_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_name = 0;
f_string_dynamic_t name = f_string_dynamic_t_initialize;
f_array_length_t i = 0;
if (!contents.array[i].used) continue;
- length_name = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_name, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
matched = F_false;
- length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
for (k = 0; k < values[j]->used; ++k) {
- status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
+ status = fl_string_dynamic_partial_compare_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
} // for
} // for
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return F_none;
}
#endif // _di_fll_fss_snatch_map_mash_apart_
#ifndef _di_fll_fss_snatch_map_together_
- f_status_t fll_fss_snatch_map_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_map_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_name = 0;
f_string_dynamic_t name = f_string_dynamic_t_initialize;
f_array_length_t i = 0;
if (!contents.array[i].used) continue;
- length_name = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_name, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
matched = F_false;
- length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
for (k = 0; k < values[j]->used; ++k) {
- status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
+ status = fl_string_dynamic_partial_compare_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
if (status == F_equal_to) {
matched = F_true;
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
break;
}
} // for
status = f_string_dynamic_partial_mash_nulless(glue, buffer, contents.array[i].array[1], &map->value);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
} // for
} // for
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return F_none;
}
#endif // _di_fll_fss_snatch_map_together_
#ifndef _di_fll_fss_snatch_mash_
- f_status_t fll_fss_snatch_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]) {
+ f_status_t fll_fss_snatch_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
for (; i < objects.used; ++i) {
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
if (matched[j]) continue;
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#endif // _di_fll_fss_snatch_mash_
#ifndef _di_fll_fss_snatch_mash_apart_
- f_status_t fll_fss_snatch_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
+ f_status_t fll_fss_snatch_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
for (; i < objects.used; ++i) {
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#endif // _di_fll_fss_snatch_mash_apart_
#ifndef _di_fll_fss_snatch_together_
- f_status_t fll_fss_snatch_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]) {
+ f_status_t fll_fss_snatch_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]) {
#ifndef _di_level_2_parameter_checking_
if (!size) return F_status_set_error(F_parameter);
if (objects.used != contents.used) return F_status_set_error(F_parameter);
if (!contents.used) return F_data_not;
f_status_t status = F_none;
- f_array_length_t length_object = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
for (; i < objects.used; ++i) {
- length_object = (objects.array[i].stop - objects.array[i].start) + 1;
-
for (j = 0; j < size; ++j) {
- status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
+ status = fl_string_dynamic_partial_compare_trim_string(names[j].string, buffer, names[j].used, objects.array[i]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
#ifndef _FLL_fss_h
#define _FLL_fss_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/conversion.h>
#include <fll/level_1/fss.h>
#include <fll/level_1/string.h>
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param values
* An array of values where "snatched" content is stored.
* @param matches
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_append_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_
- extern f_status_t fll_fss_snatch(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]);
+ extern f_status_t fll_fss_snatch(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]);
#endif // _di_fll_fss_snatch_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param values
* An array of values where "snatched" content is stored.
* @param matches
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_append_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_apart_
- extern f_status_t fll_fss_snatch_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_apart_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param values
* An array of map arrays where "snatched" content is stored.
* @param matches
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_append_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_map_
- extern f_status_t fll_fss_snatch_map(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_map(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_map_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param values
* An array of multi map arrays where "snatched" content is stored.
* @param matches
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_append_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_map_apart_
- extern f_status_t fll_fss_snatch_map_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_map_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_map_apart_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param values
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_mash_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*/
#ifndef _di_fll_fss_snatch_map_mash_
- extern f_status_t fll_fss_snatch_map_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_map_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_map_mash_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param values
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_mash_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_map_mash_apart_
- extern f_status_t fll_fss_snatch_map_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_map_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_map_multis_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_map_mash_apart_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param values
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_mash_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_map_together_
- extern f_status_t fll_fss_snatch_map_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_map_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_maps_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_map_together_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param values
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_mash_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*/
#ifndef _di_fll_fss_snatch_mash_
- extern f_status_t fll_fss_snatch_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]);
+ extern f_status_t fll_fss_snatch_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]);
#endif // _di_fll_fss_snatch_mash_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param values
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_mash_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_mash_apart_
- extern f_status_t fll_fss_snatch_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]);
+ extern f_status_t fll_fss_snatch_mash_apart(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamics_t *values[], bool matches[], f_array_lengths_t *indexs[]);
#endif // _di_fll_fss_snatch_mash_apart_
/**
* This content mappings to process.
* @param names
* An array of strings to "snatch" from the buffer.
- * @param lengths
- * An array of lengths for each names string.
* @param size
- * The total size of the names, lengths, and values arrays.
+ * The total size of the names and values arrays.
* @param glue
* A string to append between each duplicate name found when "snatching".
* @param values
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: fl_string_compare_trim().
* Errors (with error bit) from: f_string_dynamic_partial_mash_nulless().
+ * Errors (with error bit) from: fl_string_dynamic_partial_compare_trim_string().
*
* @see f_string_dynamic_partial_append_nulless()
* @see fl_string_compare_trim()
*/
#ifndef _di_fll_fss_snatch_together_
- extern f_status_t fll_fss_snatch_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_array_length_t lengths[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]);
+ extern f_status_t fll_fss_snatch_together(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_static_t names[], const f_array_length_t size, const f_string_static_t glue, f_string_dynamic_t *values[], bool matches[], f_array_length_t *indexs[]);
#endif // _di_fll_fss_snatch_together_
#ifdef __cplusplus
#ifndef _FLL_fss_basic_h
#define _FLL_fss_basic_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_basic.h>
#include <fll/level_1/string.h>
#ifndef _FLL_fss_basic_list_h
#define _FLL_fss_basic_list_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_basic_list.h>
#include <fll/level_1/string.h>
#ifndef _FLL_fss_embedded_list_h
#define _FLL_fss_embedded_list_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_embedded_list.h>
#ifndef _FLL_fss_extended_h
#define _FLL_fss_extended_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_extended.h>
#ifndef _FLL_fss_extended_list_h
#define _FLL_fss_extended_list_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_extended_list.h>
if (range->start >= range->stop || range->start >= buffer.used) {
if (status == F_fss_found_object || status == F_fss_found_object_content_not) {
- if (fl_string_dynamic_partial_compare_string(F_fss_string_payload_s, buffer, F_fss_string_payload_s_length, objects->array[objects->used]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, buffer, f_fss_string_payload_s.used, objects->array[objects->used]) == F_equal_to) {
status = F_fss_found_object_content_not;
}
else {
if (status == F_fss_found_object) {
found_data = F_true;
- if (fl_string_dynamic_partial_compare_string(F_fss_string_payload_s, buffer, F_fss_string_payload_s_length, objects->array[objects->used]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, buffer, f_fss_string_payload_s.used, objects->array[objects->used]) == F_equal_to) {
status2 = f_string_ranges_increase(F_fss_default_allocation_step_small_d, &contents->array[contents->used]);
if (F_status_is_error(status)) return status;
status2 = f_string_ranges_increase(F_fss_default_allocation_step_small_d, &contents->array[contents->used]);
if (F_status_is_error(status2)) return status2;
- if (fl_string_dynamic_partial_compare_string(F_fss_string_payload_s, buffer, F_fss_string_payload_s_length, objects->array[objects->used]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, buffer, f_fss_string_payload_s.used, objects->array[objects->used]) == F_equal_to) {
++objects->used;
status2 = f_string_ranges_increase(F_fss_default_allocation_step_small_d, &contents->array[contents->used]);
}
if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) {
- if (fl_string_dynamic_compare_string(F_fss_string_payload_s, object, F_fss_string_payload_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(f_fss_string_payload_s, object) == F_equal_to) {
status = f_string_dynamic_increase_by(content.used, destination);
if (F_status_is_error(status)) return status;
#ifndef _FLL_fss_payload_h
#define _FLL_fss_payload_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/fss.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss.h>
#include <fll/level_1/fss_basic_list.h>
#include <fll/level_1/string.h>
#ifndef _FLL_fss_status_string_h
#define _FLL_fss_status_string_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/fss.h>
#include <fll/level_0/status_string.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/string.h>
#ifdef __cplusplus
#endif
#ifndef _di_fll_iki_content_escape_
- f_status_t fll_iki_content_escape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped) {
+ f_status_t fll_iki_content_escape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t *escaped) {
#ifndef _di_level_2_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
- if (quote != f_iki_syntax_quote_single_s.string[0] && quote != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
+ if (!quote.used) return F_status_set_error(F_parameter);
+ if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
if (escaped->used > escaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
- return private_fll_iki_content_partial_escape(content, range, quote, escaped);
+ return private_fll_iki_content_partial_escape(content, range, quote.string[0], escaped);
}
#endif // _di_fll_iki_content_escape_
#ifndef _di_fll_iki_content_partial_escape_
- f_status_t fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped) {
+ f_status_t fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote, f_string_dynamic_t *escaped) {
#ifndef _di_level_2_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
if (range.start > range.stop) return F_status_set_error(F_parameter);
if (range.start >= content.used) return F_status_set_error(F_parameter);
- if (quote != f_iki_syntax_quote_single_s.string[0] && quote != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
+ if (!quote.used) return F_status_set_error(F_parameter);
+ if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
if (escaped->used > escaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- return private_fll_iki_content_partial_escape(content, range, quote, escaped);
+ return private_fll_iki_content_partial_escape(content, range, quote.string[0], escaped);
}
#endif // _di_fll_iki_content_partial_escape_
#ifndef _di_fll_iki_content_partial_unescape_
- f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) {
+ f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote, f_string_dynamic_t *unescaped) {
#ifndef _di_level_2_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
if (range.start > range.stop) return F_status_set_error(F_parameter);
if (range.start >= content.used) return F_status_set_error(F_parameter);
- if (quote != f_iki_syntax_quote_single_s.string[0] && quote != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
+ if (!quote.used) return F_status_set_error(F_parameter);
+ if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- return private_fll_iki_content_partial_unescape(content, range, quote, unescaped);
+ return private_fll_iki_content_partial_unescape(content, range, quote.string[0], unescaped);
}
#endif // _di_fll_iki_content_partial_unescape_
#ifndef _di_fll_iki_content_unescape_
- f_status_t fll_iki_content_unescape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped) {
+ f_status_t fll_iki_content_unescape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t *unescaped) {
#ifndef _di_level_2_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
- if (quote != f_iki_syntax_quote_single_s.string[0] && quote != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
+ if (!quote.used) return F_status_set_error(F_parameter);
+ if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter);
if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
- return private_fll_iki_content_partial_unescape(content, range, quote, unescaped);
+ return private_fll_iki_content_partial_unescape(content, range, quote.string[0], unescaped);
}
#endif // _di_fll_iki_content_unescape_
#ifndef _FLL_iki_h
#define _FLL_iki_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/utf.h>
#include <fll/level_0/iki.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/iki.h>
#include <fll/level_1/string.h>
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#ifndef _di_fll_iki_content_escape_
- extern f_status_t fll_iki_content_escape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped);
+ extern f_status_t fll_iki_content_escape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t *escaped);
#endif // _di_fll_iki_content_escape_
/**
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#ifndef _di_fll_iki_content_partial_escape_
- extern f_status_t fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped);
+ extern f_status_t fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote, f_string_dynamic_t *escaped);
#endif // _di_fll_iki_content_partial_escape_
/**
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#ifndef _di_fll_iki_content_partial_unescape_
- extern f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped);
+ extern f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote, f_string_dynamic_t *unescaped);
#endif // _di_fll_iki_content_partial_unescape_
/**
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#ifndef _di_fll_iki_content_unescape_
- extern f_status_t fll_iki_content_unescape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped);
+ extern f_status_t fll_iki_content_unescape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t *unescaped);
#endif // _di_fll_iki_content_unescape_
#ifdef __cplusplus
#endif
#if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
- f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped) {
+ f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t *escaped) {
+
f_status_t status = F_none;
- // ensure escaped is at least the same size as content.
+ // Ensure escaped is at least the same size as content.
if (content.used > escaped->size) {
macro_f_string_dynamic_t_resize(status, (*escaped), content.used);
if (F_status_is_error(status)) return status;
}
} // for
- // delimits found at the end must be escaped to prevent escaping the end quote.
+ // Delimits found at the end must be escaped to prevent escaping the end quote.
if (delimits) {
if (escaped->used + delimits > escaped->size) {
status = f_string_dynamic_increase_by(delimits, escaped);
#endif // !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
#if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
- f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) {
+ f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t *unescaped) {
+
f_status_t status = F_none;
- // ensure escaped is at least the same size as content.
+ // Ensure escaped is at least the same size as content.
if (content.used > unescaped->size) {
macro_f_string_dynamic_t_resize(status, (*unescaped), content.used);
if (F_status_is_error(status)) return status;
if (content.string[i] == quote) {
- // reset the used array on failure.
+ // Reset the used array on failure.
unescaped->used = used;
return F_status_set_error(F_syntax);
} // for
}
- // at this point if delimits > 0, then this should be the end of the string.
+ // At this point if delimits > 0, then this should be the end of the string.
if (delimits) {
- // delimits at the end must be even to prevent escaping the closing quote.
+ // Delimits at the end must be even to prevent escaping the closing quote.
if (delimits % 2) {
- // reset the used array on failure.
+ // Reset the used array on failure.
unescaped->used = used;
return F_status_set_error(F_syntax);
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
- extern f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped) F_attribute_visibility_internal_d;
+ extern f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t *escaped) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
/**
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
- extern f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) F_attribute_visibility_internal_d;
+ extern f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t *unescaped) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
#ifdef __cplusplus
#ifndef _FLL_path_h
#define _FLL_path_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#ifndef _FLL_print_h
#define _FLL_print_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/conversion.h>
#include <fll/level_0/print.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/print.h>
#ifdef __cplusplus
#endif
#ifndef _di_fll_program_print_help_header_
- f_status_t fll_program_print_help_header(const f_file_t output, const f_color_context_t context, const f_string_t name, const f_string_t version) {
+ f_status_t fll_program_print_help_header(const f_file_t output, const f_color_context_t context, const f_string_static_t name, const f_string_static_t version) {
- fl_print_format("%q %[%S%]%q", output.stream, f_string_eol_s, context.set.title, name, context.set.title, f_string_eol_s);
- fl_print_format(" %[Version %s%]%q", output.stream, context.set.notable, version, context.set.notable, f_string_eol_s);
+ fl_print_format("%q %[%Q%]%q", output.stream, f_string_eol_s, context.set.title, name, context.set.title, f_string_eol_s);
+ fl_print_format(" %[Version %Q%]%q", output.stream, context.set.notable, version, context.set.notable, f_string_eol_s);
fl_print_format("%q %[Available Options:%] ", output.stream, f_string_eol_s, context.set.important, context.set.important);
#endif // _di_fll_program_print_help_header_
#ifndef _di_fll_program_print_help_option_
- f_status_t fll_program_print_help_option(const f_file_t output, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description) {
+ f_status_t fll_program_print_help_option(const f_file_t output, const f_color_context_t context, 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 f_string_t description) {
- fl_print_format("%q %s%[%S%]", output.stream, f_string_eol_s, symbol_short, context.set.standout, option_short, context.set.standout);
- fl_print_format(", %s%[%S%]", output.stream, symbol_long, context.set.standout, option_long, context.set.standout);
- fl_print_format(" %S", output.stream, description);
+ fl_print_format("%q %Q%[%Q%]", output.stream, f_string_eol_s, symbol_short, context.set.standout, option_short, context.set.standout);
+ fl_print_format(", %Q%[%Q%] %S", output.stream, symbol_long, context.set.standout, option_long, context.set.standout, description);
return F_none;
}
#endif // _di_fll_program_print_help_option_
#ifndef _di_fll_program_print_help_option_long_
- f_status_t fll_program_print_help_option_long(const f_file_t output, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) {
+ f_status_t fll_program_print_help_option_long(const f_file_t output, const f_color_context_t context, const f_string_static_t option_long, const f_string_static_t symbol_long, const f_string_t description) {
- fl_print_format("%q %s%[%S%]", output.stream, f_string_eol_s, symbol_long, context.set.standout, option_long, context.set.standout);
- fl_print_format(" %S", output.stream, description);
+ fl_print_format("%q %Q%[%Q%] %S", output.stream, f_string_eol_s, symbol_long, context.set.standout, option_long, context.set.standout, description);
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 f_file_t output, const f_color_context_t context, const f_string_t option_other, const f_string_t description) {
+ f_status_t fll_program_print_help_option_other(const f_file_t output, const f_color_context_t context, const f_string_static_t option_other, const f_string_t description) {
- fl_print_format("%q %[%S%]", output.stream, f_string_eol_s, context.set.standout, option_other, context.set.standout);
- fl_print_format(" %S", output.stream, description);
+ fl_print_format("%q %[%Q%] %S", output.stream, f_string_eol_s, context.set.standout, option_other, context.set.standout, description);
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 f_file_t output, const f_color_context_t context, const f_string_t name, const f_string_t parameters) {
+ f_status_t fll_program_print_help_usage(const f_file_t output, const f_color_context_t context, const f_string_static_t name, const f_string_static_t parameters) {
- fl_print_format("%q%q %[Usage:%]", output.stream, f_string_eol_s, f_string_eol_s, context.set.important, context.set.important);
-
- f_print_dynamic(f_string_eol_s, output.stream);
- fl_print_format(" %[%S%]", output.stream, context.set.standout, name, context.set.standout);
+ fl_print_format("%q%q %[Usage:%]%q", output.stream, f_string_eol_s, f_string_eol_s, context.set.important, context.set.important, f_string_eol_s);
+ fl_print_format(" %[%Q%]", output.stream, context.set.standout, name, context.set.standout);
fl_print_format(" %[[%] options %[]%]", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable);
-
- if (parameters[0] != '\0') {
- fl_print_format(" %[[%] %S %[]%]", output.stream, context.set.notable, context.set.notable, parameters, context.set.notable, context.set.notable);
- }
-
- f_print_dynamic(f_string_eol_s, output.stream);
- f_print_dynamic(f_string_eol_s, output.stream);
+ fl_print_format(" %[[%] %Q", output.stream, context.set.notable, context.set.notable, parameters);
+ fl_print_format(" %[]%]%q%q", output.stream, context.set.notable, context.set.notable, f_string_eol_s, f_string_eol_s);
return F_none;
}
#endif // _di_fll_program_print_help_usage_
#ifndef _di_fll_program_print_version_
- f_status_t fll_program_print_version(const f_file_t output, const f_string_t version) {
+ f_status_t fll_program_print_version(const f_file_t output, const f_string_static_t version) {
- fl_print_format("%S%q", output.stream, version, f_string_eol_s);
+ f_print_dynamic(version, output.stream);
+ f_print_dynamic(f_string_eol_s, output.stream);
return F_none;
}
for (f_array_length_t i = 0; i < values.used; ++i) {
- length = strnlen(argv[values.array[i]], f_console_parameter_size);
+ length = strnlen(argv[values.array[i]], F_console_parameter_size_d);
if (length > 0) {
f_string_dynamic_t ripped = f_string_dynamic_t_initialize;
for (f_array_length_t i = 0; i < values.used; ++i) {
- length = strnlen(argv[values.array[i]], f_console_parameter_size);
+ length = strnlen(argv[values.array[i]], F_console_parameter_size_d);
if (length > 0) {
status = f_string_mash(glue.string, glue.used, argv[values.array[i]], length, destination);
for (f_array_length_t i = 0; i < values.used; ++i) {
- length = strnlen(argv[values.array[i]], f_console_parameter_size);
+ length = strnlen(argv[values.array[i]], F_console_parameter_size_d);
- if (length > 0) {
+ if (length) {
f_string_dynamic_t ripped = f_string_dynamic_t_initialize;
status = fl_string_rip(argv[values.array[i]], length, &ripped);
for (f_array_length_t i = 0; i < values.used; ++i) {
- length = strnlen(argv[values.array[i]], f_console_parameter_size);
+ length = strnlen(argv[values.array[i]], F_console_parameter_size_d);
if (length > 0) {
status = fl_string_rip(argv[values.array[i]], length, &ripped);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(ripped);
+ f_string_dynamic_resize(0, &ripped);
+
return status;
}
} // for
if (ripped.size) {
- macro_f_string_dynamic_t_delete_simple(ripped)
+ f_string_dynamic_resize(0, &ripped);
}
if (status == F_none && start == destination->used) {
}
#endif // _di_fll_program_parameter_additional_rip_mash_
+#ifndef _di_fll_program_standard_setdown_
+ f_status_t fll_program_standard_setdown(f_signal_t * const signal) {
+
+ // Flush output pipes before closing.
+ fflush(F_type_output_d);
+ fflush(F_type_error_d);
+
+ // Close all open file descriptors.
+ close(F_type_descriptor_output_d);
+ close(F_type_descriptor_input_d);
+ close(F_type_descriptor_error_d);
+
+ const f_status_t status = f_signal_close(signal);
+
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_fll_program_standard_setdown_
+
+#ifndef _di_fll_program_standard_setup_
+ f_status_t fll_program_standard_setup(f_signal_t * const signal) {
+
+ f_signal_set_empty(&signal->set);
+ f_signal_set_add(F_signal_abort, &signal->set);
+ f_signal_set_add(F_signal_broken_pipe, &signal->set);
+ f_signal_set_add(F_signal_hangup, &signal->set);
+ f_signal_set_add(F_signal_interrupt, &signal->set);
+ f_signal_set_add(F_signal_quit, &signal->set);
+ f_signal_set_add(F_signal_termination, &signal->set);
+
+ f_status_t status = f_signal_mask(SIG_BLOCK, &signal->set, 0);
+
+ if (F_status_is_error_not(status)) {
+ status = f_signal_open(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, &signal->set, 0);
+ f_signal_close(signal);
+ }
+ }
+
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_fll_program_standard_setup_
+
#ifdef __cplusplus
} // extern "C"
#endif
// libc include
#include <stdio.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/console.h>
#include <fll/level_0/file.h>
#include <fll/level_0/print.h>
+#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/string.h>
#include <fll/level_1/print.h>
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_header_
- extern f_status_t fll_program_print_help_header(const f_file_t output, const f_color_context_t context, const f_string_t name, const f_string_t version);
+ extern f_status_t fll_program_print_help_header(const f_file_t output, const f_color_context_t context, const f_string_static_t name, const f_string_static_t version);
#endif // _di_fll_program_print_help_header_
/**
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_
- extern f_status_t fll_program_print_help_option(const f_file_t output, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description);
+ extern f_status_t fll_program_print_help_option(const f_file_t output, const f_color_context_t context, 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 f_string_t description);
#endif // _di_fll_program_print_help_option_
/**
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_long_
- extern f_status_t fll_program_print_help_option_long(const f_file_t output, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description);
+ extern f_status_t fll_program_print_help_option_long(const f_file_t output, const f_color_context_t context, const f_string_static_t option_long, const f_string_static_t symbol_long, const f_string_t description);
#endif // _di_fll_program_print_help_option_long_
/**
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_option_other_
- extern f_status_t fll_program_print_help_option_other(const f_file_t output, const f_color_context_t context, const f_string_t option_other, const f_string_t description);
+ extern f_status_t fll_program_print_help_option_other(const f_file_t output, const f_color_context_t context, const f_string_static_t option_other, const f_string_t description);
#endif // _di_fll_program_print_help_option_other_
/**
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_help_usage_
- extern f_status_t fll_program_print_help_usage(const f_file_t output, const f_color_context_t context, const f_string_t name, const f_string_t parameters);
+ extern f_status_t fll_program_print_help_usage(const f_file_t output, const f_color_context_t context, const f_string_static_t name, const f_string_static_t parameters);
#endif // _di_fll_program_print_help_usage_
/**
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_version_
- extern f_status_t fll_program_print_version(const f_file_t output, const f_string_t version);
+ extern f_status_t fll_program_print_version(const f_file_t output, const f_string_static_t version);
#endif // _di_fll_program_print_version_
/**
*
* @param argv
* The program argument array to parse.
+ * The caller must guarantee that the values.used does not exceed the argv length.
* @param values
* The string locations where the console parameters are found.
* @param destination
* A string to append between the source and destination, such as a space: ' '.
* @param argv
* The program argument array to parse.
+ * The caller must guarantee that the values.used does not exceed the argv length.
* @param values
* The string locations where the console parameters are found.
* @param destination
*
* @param argv
* The program argument array to parse.
+ * The caller must guarantee that the values.used does not exceed the argv length.
* @param values
* The string locations where the console parameters are found.
* @param destination
extern f_status_t fll_program_parameter_additional_rip_mash(const f_string_static_t glue, const f_string_t *argv, const f_array_lengths_t values, f_string_dynamic_t *destination);
#endif // _di_fll_program_parameter_additional_rip_mash_
+/**
+ * This provides a standard program setdown operations used by FLL programs.
+ *
+ * This does the following:
+ * - Flushes standard outputs.
+ * - Closes standard inputs and outputs.
+ * - Closes the signal handler.
+ *
+ * @param signal
+ * The signal structure.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_signal_close().
+ *
+ * @see f_signal_close()
+ */
+#ifndef _di_fll_program_standard_setdown_
+ extern f_status_t fll_program_standard_setdown(f_signal_t * const signal);
+#endif // _di_fll_program_standard_setdown_
+
+/**
+ * This provides a standard program setup operations used by FLL programs.
+ *
+ * This does the following:
+ * - Handle signals so that program can cleanly exit, deallocating as appropriate.
+ *
+ * @param signal
+ * The signal structure.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_signal_mask().
+ * Errors (with error bit) from: f_signal_open().
+ *
+ * @see f_signal_mask()
+ * @see f_signal_open()
+ */
+#ifndef _di_fll_program_standard_setup_
+ extern f_status_t fll_program_standard_setup(f_signal_t * const signal);
+#endif // _di_fll_program_standard_setup_
+
#ifdef __cplusplus
} // extern "C"
#endif
f_console
f_file
f_print
+f_signal
fl_string
fl_print
build_indexer_arguments rcs
build_language c
build_libraries -lc
-build_libraries-individual -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_print -lf_string -lf_type_array -lf_utf
+build_libraries-individual -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_print -lf_signal -lf_string -lf_type_array -lf_utf
build_libraries_shared
build_libraries_static
build_sources_library program.c
#ifndef _FLL_status_string_h
#define _FLL_status_string_h
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/conversion.h>
#include <fll/level_0/status_string.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/string.h>
#ifdef __cplusplus
flockfile(file.stream);
- fll_program_print_help_header(file, context, byte_dump_program_name_long_s, byte_dump_version_s);
-
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_header(file, context, byte_dump_program_name_long_s, byte_dump_program_version_s);
+
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, byte_dump_short_binary_s, byte_dump_long_binary_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Display binary representation.");
- fll_program_print_help_option(file, context, byte_dump_short_decimal_s, byte_dump_long_decimal_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Display decimal representation.");
- fll_program_print_help_option(file, context, byte_dump_short_duodecimal_s, byte_dump_long_duodecimal_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Display duodecimal representation.");
- fll_program_print_help_option(file, context, byte_dump_short_hexidecimal_s, byte_dump_long_hexidecimal_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Display hexadecimal representation.");
- fll_program_print_help_option(file, context, byte_dump_short_octal_s, byte_dump_long_octal_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Display octal representation.");
- fll_program_print_help_option(file, context, byte_dump_short_unicode_s, byte_dump_long_unicode_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Display using Unicode representation for valid Unicode (like: U+0000).");
+ fll_program_print_help_option(file, context, byte_dump_short_binary_s, byte_dump_long_binary_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display binary representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_decimal_s, byte_dump_long_decimal_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display decimal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_duodecimal_s, byte_dump_long_duodecimal_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display duodecimal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_hexidecimal_s, byte_dump_long_hexidecimal_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Display hexadecimal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_octal_s, byte_dump_long_octal_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display octal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_unicode_s, byte_dump_long_unicode_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display using Unicode representation for valid Unicode (like: U+0000).");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, byte_dump_short_first_s, byte_dump_long_first_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Start reading at this byte offset.");
- fll_program_print_help_option(file, context, byte_dump_short_last_s, byte_dump_long_last_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Stop reading at this (inclusive) byte offset.");
+ fll_program_print_help_option(file, context, byte_dump_short_first_s, byte_dump_long_first_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Start reading at this byte offset.");
+ fll_program_print_help_option(file, context, byte_dump_short_last_s, byte_dump_long_last_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Stop reading at this (inclusive) byte offset.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, byte_dump_short_narrow_s, byte_dump_long_narrow_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use narrow display, resulting in 1*width reducing size of the text columns.");
- fll_program_print_help_option(file, context, byte_dump_short_placeholder_s, byte_dump_long_placeholder_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Use a placeholder character instead of a space for placeholders.");
- fll_program_print_help_option(file, context, byte_dump_short_text_s, byte_dump_long_text_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include a column of text when displaying the bytes.");
- fll_program_print_help_option(file, context, byte_dump_short_wide_s, byte_dump_long_wide_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use wide display, resulting in 2*width allowing for space for wide characters in the text columns.");
- fll_program_print_help_option(file, context, byte_dump_short_width_s, byte_dump_long_width_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Set number of columns of Bytes to display.");
+ fll_program_print_help_option(file, context, byte_dump_short_narrow_s, byte_dump_long_narrow_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use narrow display, resulting in 1*width reducing size of the text columns.");
+ fll_program_print_help_option(file, context, byte_dump_short_placeholder_s, byte_dump_long_placeholder_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use a placeholder character instead of a space for placeholders.");
+ fll_program_print_help_option(file, context, byte_dump_short_text_s, byte_dump_long_text_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include a column of text when displaying the bytes.");
+ fll_program_print_help_option(file, context, byte_dump_short_wide_s, byte_dump_long_wide_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use wide display, resulting in 2*width allowing for space for wide characters in the text columns.");
+ fll_program_print_help_option(file, context, byte_dump_short_width_s, byte_dump_long_width_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Set number of columns of Bytes to display.");
f_print_dynamic(f_string_eol_s, file.stream);
f_print_dynamic(f_string_eol_s, file.stream);
fl_print_format(" %[Special Options:%] ", file.stream, context.set.important, context.set.important);
- fll_program_print_help_option_long(file, context, byte_dump_long_normal_s, f_console_symbol_long_enable_s.string, " Display UTF-8 symbols for ASCII control codes.");
- fll_program_print_help_option_long(file, context, byte_dump_long_simple_s, f_console_symbol_long_enable_s.string, " Display spaces for ASCII control codes.");
- fll_program_print_help_option_long(file, context, byte_dump_long_classic_s, f_console_symbol_long_enable_s.string, "Display periods for ASCII control codes.");
+ fll_program_print_help_option_long(file, context, byte_dump_long_normal_s, f_console_symbol_long_enable_s, " Display UTF-8 symbols for ASCII control codes.");
+ fll_program_print_help_option_long(file, context, byte_dump_long_simple_s, f_console_symbol_long_enable_s, " Display spaces for ASCII control codes.");
+ fll_program_print_help_option_long(file, context, byte_dump_long_classic_s, f_console_symbol_long_enable_s, "Display periods for ASCII control codes.");
- fll_program_print_help_usage(file, context, byte_dump_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, byte_dump_program_name_s, byte_dump_program_help_parameters_s);
- fl_print_format(" When using the %[%q%s%] option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_text_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When using the %[%q%q%] option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_text_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the %[%q%s%] option is used).%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_placeholder_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the %[%q%q%] option is used).%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_placeholder_s, context.set.notable, f_string_eol_s, f_string_eol_s);
fl_print_format(" UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues.%q%q", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When %[%q%s%] is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When %[%q%q%] is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%q%s%] option, invalid Unicode will fallback to being displayed using one of the other modes.%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_unicode_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When using the %[%q%q%] option, invalid Unicode will fallback to being displayed using one of the other modes.%q%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_unicode_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fflush(file.stream);
funlockfile(file.stream);
return F_none;
fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
byte_dump_main_delete(main);
+
return F_status_set_error(status);
}
}
if (main->parameters[byte_dump_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, byte_dump_version_s);
+ fll_program_print_version(main->output.to, byte_dump_program_version_s);
byte_dump_main_delete(main);
if (main->parameters[byte_dump_parameter_width_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width_s, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error(status) || number < 1 || number >= 0xfb) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width_s, main->context.set.notable);
fl_print_format("%[' value can only be a number (inclusively) between %]", main->error.to.stream, main->context.set.error, main->context.set.error);
fl_print_format("%[1%]", main->error.to.stream, main->context.set.notable, main->context.set.notable);
fl_print_format(" %[and%] ", main->error.to.stream, main->context.set.error, main->context.set.error);
byte_dump_main_delete(main);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_status_set_error(F_parameter);
}
if (main->parameters[byte_dump_parameter_first_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error(status) || number > F_number_t_size_unsigned_d) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
fl_print_format("%[' value can only be a number (inclusively) between %]", main->error.to.stream, main->context.set.error, main->context.set.error);
fl_print_format("%[0%]", main->error.to.stream, main->context.set.notable, main->context.set.notable);
fl_print_format(" %[and%] ", main->error.to.stream, main->context.set.error, main->context.set.error);
byte_dump_main_delete(main);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_status_set_error(F_parameter);
}
if (main->parameters[byte_dump_parameter_last_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error(status) || number < 0 || number > F_number_t_size_unsigned_d) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
fl_print_format("%[' value can only be a number (inclusively) between %]", main->error.to.stream, main->context.set.error, main->context.set.error);
fl_print_format("%[0%]", main->error.to.stream, main->context.set.notable, main->context.set.notable);
fl_print_format(" %[and%] ", main->error.to.stream, main->context.set.error, main->context.set.error);
byte_dump_main_delete(main);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_status_set_error(F_parameter);
}
if (main->first > main->last) {
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first_s, main->context.set.notable);
fl_print_format("%[' value cannot be greater than the parameter '%]", main->error.to.stream, main->context.set.error, main->context.set.error);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last_s, main->context.set.notable);
fl_print_format("%[' value.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->output.to.stream);
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
fl_print_format("%[Piped Byte Dump: (in ", main->output.to.stream, main->context.set.title);
if (main->mode == byte_dump_mode_hexidecimal_e) {
flockfile(main->output.to.stream);
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
fl_print_format("%[Byte Dump of: %]%[", main->output.to.stream, main->context.set.title, main->context.set.title, main->context.set.notable);
fl_print_format("%S%] %[(in ", main->output.to.stream, arguments->argv[main->remaining.array[counter]], main->context.set.notable, main->context.set.title);
}
}
else {
- fll_print_format("%[%SYou failed to specify one or more filenames.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s);
+ fll_print_format("%[%QYou failed to specify one or more filenames.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
}
#endif // _di_byte_dump_main_
-#ifndef _di_byte_dump_main_delete_
- f_status_t byte_dump_main_delete(byte_dump_main_t * const main) {
-
- for (f_array_length_t i = 0; i < byte_dump_total_parameters_d; ++i) {
-
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
- } // for
-
- macro_f_array_lengths_t_delete_simple(main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
- macro_f_color_context_t_clear(main->context)
-
- return F_none;
- }
-#endif // _di_byte_dump_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
* The solution is to add the invalid character codes to this project so that this project can properly print the invalid UTF-8 marker and therefore properly display the information.
*/
#ifndef _byte_dump_h
+#define _byte_dump_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
#include <fll/level_1/utf.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// Byte Dump includes.
+#include <program/byte_dump/common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_byte_dump_program_version_
- #define byte_dump_program_version_major_s F_string_ascii_0_s
- #define byte_dump_program_version_minor_s F_string_ascii_5_s
- #define byte_dump_program_version_micro_s F_string_ascii_8_s
-
- #ifndef byte_dump_program_version_nano_prefix_s
- #define byte_dump_program_version_nano_prefix_s
- #endif
-
- #ifndef byte_dump_program_version_nano_s
- #define byte_dump_program_version_nano_s
- #endif
-
- #define byte_dump_version_s byte_dump_program_version_major_s F_string_ascii_period_s byte_dump_program_version_minor_s F_string_ascii_period_s byte_dump_program_version_micro_s byte_dump_program_version_nano_prefix_s byte_dump_program_version_nano_s
-#endif // _di_byte_dump_program_version_
-
-#ifndef _di_byte_dump_program_name_
- #define byte_dump_program_name_s "byte_dump"
- #define byte_dump_program_name_long_s "Byte Dump"
-#endif // _di_byte_dump_program_name_
-
-/**
- * Set to at least 4 to provide a UTF-8 friendly allocation step.
- */
-#ifndef _di_byte_dump_default_allocation_step_
- #define byte_dump_default_allocation_step_d 4
-#endif // _di_byte_dump_default_allocation_step_
-
-/**
- * Byte Dump defines.
- *
- * byte_dump_mode_*:
- * - hexidecimal: Display using hexidecimal notation (base 16).
- * - duodecimal: Display using duodecimal notation (base 12).
- * - octal: Display using octal notation (base 8).
- * - binary: Display using binary notation (base 2).
- * - decimal: Display using decimal notation (base 10).
- *
- * byte_dump_presentation_*:
- * - normal: Normal presentation mode.
- * - simple: Simple presentation mode.
- * - classic: Classic presentation mode.
- */
-#ifndef _di_byte_dump_defines_
- enum {
- byte_dump_mode_hexidecimal_e = 1,
- byte_dump_mode_duodecimal_e,
- byte_dump_mode_octal_e,
- byte_dump_mode_binary_e,
- byte_dump_mode_decimal_e,
- };
-
- enum {
- byte_dump_presentation_normal_e = 1,
- byte_dump_presentation_simple_e,
- byte_dump_presentation_classic_e,
- };
-
- #define byte_dump_option_wide_d 0x1
-
- #define byte_dump_signal_check_d 10000
-
- #define byte_dump_sequence_acknowledge_s "␆"
- #define byte_dump_sequence_acknowledge_negative_s "␕"
- #define byte_dump_sequence_backspace_s "␈"
- #define byte_dump_sequence_bell_s "␇"
- #define byte_dump_sequence_cancel_s "␘"
- #define byte_dump_sequence_carriage_return_s "␍"
- #define byte_dump_sequence_data_link_escape_s "␐"
- #define byte_dump_sequence_delete_s "␡"
- #define byte_dump_sequence_device_control_1_s "␑"
- #define byte_dump_sequence_device_control_2_s "␒"
- #define byte_dump_sequence_device_control_3_s "␓"
- #define byte_dump_sequence_device_control_4_s "␔"
- #define byte_dump_sequence_end_of_enquiry_s "␅"
- #define byte_dump_sequence_end_of_medium_s "␙"
- #define byte_dump_sequence_end_of_text_s "␃"
- #define byte_dump_sequence_end_of_transmission_s "␄"
- #define byte_dump_sequence_end_of_transmission_block_s "␗"
- #define byte_dump_sequence_escape_s "␛"
- #define byte_dump_sequence_file_separator_s "␜"
- #define byte_dump_sequence_form_feed_s "␌"
- #define byte_dump_sequence_group_separator_s "␝"
- #define byte_dump_sequence_line_feed_s "␊"
- #define byte_dump_sequence_new_line_s ""
- #define byte_dump_sequence_null_s "␀"
- #define byte_dump_sequence_record_separator_s "␞"
- #define byte_dump_sequence_shift_in_s "␏"
- #define byte_dump_sequence_shift_out_s "␎"
- #define byte_dump_sequence_space_s "␠"
- #define byte_dump_sequence_start_of_header_s "␁"
- #define byte_dump_sequence_start_of_text_s "␂"
- #define byte_dump_sequence_substitute_s "␚"
- #define byte_dump_sequence_synchronous_idle_s "␖"
- #define byte_dump_sequence_tab_s "␉"
- #define byte_dump_sequence_tab_vertical_s "␋"
- #define byte_dump_sequence_unit_separator_s "␟"
-
- #define byte_dump_character_wall_s "|"
- #define byte_dump_character_placeholder_s "␣" // other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
- #define byte_dump_character_incomplete_s "�"
- #define byte_dump_character_unused_s "�"
-
- #define byte_dump_short_binary_s "b"
- #define byte_dump_short_decimal_s "d"
- #define byte_dump_short_duodecimal_s "D"
- #define byte_dump_short_hexidecimal_s "x"
- #define byte_dump_short_octal_s "o"
- #define byte_dump_short_unicode_s "U"
-
- #define byte_dump_short_first_s "f"
- #define byte_dump_short_last_s "l"
-
- #define byte_dump_short_narrow_s "N"
- #define byte_dump_short_placeholder_s "p"
- #define byte_dump_short_text_s "t"
- #define byte_dump_short_wide_s "W"
- #define byte_dump_short_width_s "w"
-
- #define byte_dump_long_binary_s "binary"
- #define byte_dump_long_decimal_s "decimal"
- #define byte_dump_long_duodecimal_s "duodecimal"
- #define byte_dump_long_hexidecimal_s "hexidecimal"
- #define byte_dump_long_octal_s "octal"
- #define byte_dump_long_unicode_s "unicode"
-
- #define byte_dump_long_first_s "first" // First offset byte size.
- #define byte_dump_long_last_s "last" // Last offset byte size.
-
- #define byte_dump_long_narrow_s "narrow" // Each character in the displyed text will take at least 1 columns.
- #define byte_dump_long_placeholder_s "placeholder" // Display (colored) placeholders to signify codes that are UTF-8 fragments.
- #define byte_dump_long_text_s "text" // Display text
- #define byte_dump_long_wide_s "wide" // Each character in the displyed text will take at least 2 columns.
- #define byte_dump_long_width_s "width" // Number of characters to display per row.
-
- #define byte_dump_long_normal_s "normal" // Use normal presentation, displaying UTF-8 sequence codes for ASCII special codes.
- #define byte_dump_long_simple_s "simple" // Use simple presentation, displaying spaces for ASCII special codes instead of UTF-8 sequence codes.
- #define byte_dump_long_classic_s "classic" // Use classic presentation, displaying periods for ASCII special codes instead of UTF-8 sequence codes.
-
- enum {
- byte_dump_parameter_help_e,
- byte_dump_parameter_light_e,
- byte_dump_parameter_dark_e,
- byte_dump_parameter_no_color_e,
- byte_dump_parameter_verbosity_quiet_e,
- byte_dump_parameter_verbosity_normal_e,
- byte_dump_parameter_verbosity_verbose_e,
- byte_dump_parameter_verbosity_debug_e,
- byte_dump_parameter_version_e,
-
- byte_dump_parameter_binary_e,
- byte_dump_parameter_decimal_e,
- byte_dump_parameter_duodecimal_e,
- byte_dump_parameter_hexidecimal_e,
- byte_dump_parameter_octal_e,
- byte_dump_parameter_unicode_e,
-
- byte_dump_parameter_first_e,
- byte_dump_parameter_last_e,
-
- byte_dump_parameter_narrow_e,
- byte_dump_parameter_placeholder_e,
- byte_dump_parameter_text_e,
- byte_dump_parameter_wide_e,
- byte_dump_parameter_width_e,
-
- byte_dump_parameter_normal_e,
- byte_dump_parameter_simple_e,
- byte_dump_parameter_classic_e,
- };
-
- #define byte_dump_console_parameter_t_initialize \
- { \
- macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_binary_s, byte_dump_long_binary_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_decimal_s, byte_dump_long_decimal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_duodecimal_s, byte_dump_long_duodecimal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_hexidecimal_s, byte_dump_long_hexidecimal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_octal_s, byte_dump_long_octal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_unicode_s, byte_dump_long_unicode_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_first_s, byte_dump_long_first_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_last_s, byte_dump_long_last_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_narrow_s, byte_dump_long_narrow_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_placeholder_s, byte_dump_long_placeholder_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_text_s, byte_dump_long_text_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_wide_s, byte_dump_long_wide_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(byte_dump_short_width_s, byte_dump_long_width_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, byte_dump_long_normal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, byte_dump_long_simple_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, byte_dump_long_classic_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define byte_dump_total_parameters_d 25
-#endif // _di_byte_dump_defines_
-
-#ifndef _di_byte_dump_main_t_
- typedef struct {
- f_console_parameter_t parameters[byte_dump_total_parameters_d];
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- uint64_t first;
- uint64_t last;
- uint8_t width;
- uint8_t mode;
- uint8_t presentation;
- uint8_t options;
-
- f_color_context_t context;
- } byte_dump_main_t;
-
- #define byte_dump_main_t_initialize \
- { \
- byte_dump_console_parameter_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- 0, \
- 0, \
- 8, \
- byte_dump_option_wide_d, \
- byte_dump_mode_hexidecimal_e, \
- byte_dump_presentation_normal_e, \
- f_color_context_t_initialize, \
- }
-#endif // _di_byte_dump_main_t_
-
/**
* Print help.
*
*
* @return
* F_none on success.
+ *
+ * @see byte_dump_main()
*/
#ifndef _di_byte_dump_print_help_
extern f_status_t byte_dump_print_help(const f_file_t file, const f_color_context_t context);
extern f_status_t byte_dump_main(byte_dump_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_byte_dump_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing byte_dump_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see byte_dump_main()
- */
-#ifndef _di_byte_dump_main_delete_
- extern f_status_t byte_dump_main_delete(byte_dump_main_t * const main);
-#endif // _di_byte_dump_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
--- /dev/null
+#include "byte_dump.h"
+#include "private-common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_byte_dump_program_version_
+ const f_string_static_t byte_dump_program_version_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_version_s, 0, BYTE_DUMP_program_version_s_length);
+#endif // _di_byte_dump_program_version_
+
+#ifndef _di_byte_dump_program_name_
+ const f_string_static_t byte_dump_program_name_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_name_s, 0, BYTE_DUMP_program_name_s_length);
+ const f_string_static_t byte_dump_program_name_long_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_name_long_s, 0, BYTE_DUMP_program_name_long_s_length);
+#endif // _di_byte_dump_program_name_
+
+#ifndef _di_byte_dump_program_help_parameters_
+ const f_string_static_t byte_dump_program_help_parameters_s = macro_f_string_static_t_initialize2(BYTE_DUMP_program_help_parameters_s, 0, BYTE_DUMP_program_help_parameters_s_length);
+#endif // _di_byte_dump_program_help_parameters_
+
+#ifndef _di_byte_dump_defines_
+ const f_string_static_t byte_dump_character_wall_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_wall_s, 0, BYTE_DUMP_character_wall_s_length);
+ const f_string_static_t byte_dump_character_placeholder_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_placeholder_s, 0, BYTE_DUMP_character_placeholder_s_length);
+ const f_string_static_t byte_dump_character_incomplete_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_incomplete_s, 0, BYTE_DUMP_character_incomplete_s_length);
+ const f_string_static_t byte_dump_character_unused_s = macro_f_string_static_t_initialize2(BYTE_DUMP_character_unused_s, 0, BYTE_DUMP_character_unused_s_length);
+
+ const f_string_static_t byte_dump_short_binary_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_binary_s, 0, BYTE_DUMP_short_binary_s_length);
+ const f_string_static_t byte_dump_short_decimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_decimal_s, 0, BYTE_DUMP_short_decimal_s_length);
+ const f_string_static_t byte_dump_short_duodecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_duodecimal_s, 0, BYTE_DUMP_short_duodecimal_s_length);
+ const f_string_static_t byte_dump_short_hexidecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_hexidecimal_s, 0, BYTE_DUMP_short_hexidecimal_s_length);
+ const f_string_static_t byte_dump_short_octal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_octal_s, 0, BYTE_DUMP_short_octal_s_length);
+ const f_string_static_t byte_dump_short_unicode_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_unicode_s, 0, BYTE_DUMP_short_unicode_s_length);
+
+ const f_string_static_t byte_dump_short_first_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_first_s, 0, BYTE_DUMP_short_first_s_length);
+ const f_string_static_t byte_dump_short_last_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_last_s, 0, BYTE_DUMP_short_last_s_length);
+
+ const f_string_static_t byte_dump_short_narrow_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_narrow_s, 0, BYTE_DUMP_short_narrow_s_length);
+ const f_string_static_t byte_dump_short_placeholder_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_placeholder_s, 0, BYTE_DUMP_short_placeholder_s_length);
+ const f_string_static_t byte_dump_short_text_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_text_s, 0, BYTE_DUMP_short_text_s_length);
+ const f_string_static_t byte_dump_short_wide_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_wide_s, 0, BYTE_DUMP_short_wide_s_length);
+ const f_string_static_t byte_dump_short_width_s = macro_f_string_static_t_initialize2(BYTE_DUMP_short_width_s, 0, BYTE_DUMP_short_width_s_length);
+
+ const f_string_static_t byte_dump_long_binary_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_binary_s, 0, BYTE_DUMP_long_binary_s_length);
+ const f_string_static_t byte_dump_long_decimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_decimal_s, 0, BYTE_DUMP_long_decimal_s_length);
+ const f_string_static_t byte_dump_long_duodecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_duodecimal_s, 0, BYTE_DUMP_long_duodecimal_s_length);
+ const f_string_static_t byte_dump_long_hexidecimal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_hexidecimal_s, 0, BYTE_DUMP_long_hexidecimal_s_length);
+ const f_string_static_t byte_dump_long_octal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_octal_s, 0, BYTE_DUMP_long_octal_s_length);
+ const f_string_static_t byte_dump_long_unicode_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_unicode_s, 0, BYTE_DUMP_long_unicode_s_length);
+
+ const f_string_static_t byte_dump_long_first_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_first_s, 0, BYTE_DUMP_long_first_s_length);
+ const f_string_static_t byte_dump_long_last_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_last_s, 0, BYTE_DUMP_long_last_s_length);
+
+ const f_string_static_t byte_dump_long_narrow_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_narrow_s, 0, BYTE_DUMP_long_narrow_s_length);
+ const f_string_static_t byte_dump_long_placeholder_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_placeholder_s, 0, BYTE_DUMP_long_placeholder_s_length);
+ const f_string_static_t byte_dump_long_text_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_text_s, 0, BYTE_DUMP_long_text_s_length);
+ const f_string_static_t byte_dump_long_wide_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_wide_s, 0, BYTE_DUMP_long_wide_s_length);
+ const f_string_static_t byte_dump_long_width_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_width_s, 0, BYTE_DUMP_long_width_s_length);
+
+ const f_string_static_t byte_dump_long_normal_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_normal_s, 0, BYTE_DUMP_long_normal_s_length);
+ const f_string_static_t byte_dump_long_simple_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_simple_s, 0, BYTE_DUMP_long_simple_s_length);
+ const f_string_static_t byte_dump_long_classic_s = macro_f_string_static_t_initialize2(BYTE_DUMP_long_classic_s, 0, BYTE_DUMP_long_classic_s_length);
+#endif // _di_byte_dump_defines_
+
+#ifndef _di_byte_dump_main_delete_
+ f_status_t byte_dump_main_delete(byte_dump_main_t * const main) {
+
+ for (f_array_length_t i = 0; i < byte_dump_total_parameters_d; ++i) {
+
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
+ } // for
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+ macro_f_color_context_t_clear(main->context)
+
+ return F_none;
+ }
+#endif // _di_byte_dump_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Byte Dump
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _byte_dump_common_h
+#define _byte_dump_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_byte_dump_program_version_
+ #define BYTE_DUMP_program_version_major_s F_string_ascii_0_s
+ #define BYTE_DUMP_program_version_minor_s F_string_ascii_5_s
+ #define BYTE_DUMP_program_version_micro_s F_string_ascii_8_s
+
+ #define BYTE_DUMP_program_version_major_s_length F_string_ascii_0_s_length
+ #define BYTE_DUMP_program_version_minor_s_length F_string_ascii_5_s_length
+ #define BYTE_DUMP_program_version_micro_s_length F_string_ascii_8_s_length
+
+ #if !(defined(BYTE_DUMP_program_version_nano_prefix_s) && defined(BYTE_DUMP_program_version_nano_prefix_s_length))
+ #define BYTE_DUMP_program_version_nano_prefix_s
+ #define BYTE_DUMP_program_version_nano_prefix_s_length 0
+ #endif // !(defined(BYTE_DUMP_program_version_nano_prefix_s) && defined(BYTE_DUMP_program_version_nano_prefix_s_length))
+
+ #if !(defined(BYTE_DUMP_program_version_nano_s) && defined(BYTE_DUMP_program_version_nano_s_length))
+ #define BYTE_DUMP_program_version_nano_s
+ #define BYTE_DUMP_program_version_nano_s_length 0
+ #endif // !(defined(BYTE_DUMP_program_version_nano_s) && defined(BYTE_DUMP_program_version_nano_s_length))
+
+ #define BYTE_DUMP_program_version_s BYTE_DUMP_program_version_major_s F_string_ascii_period_s BYTE_DUMP_program_version_minor_s F_string_ascii_period_s BYTE_DUMP_program_version_micro_s BYTE_DUMP_program_version_nano_prefix_s BYTE_DUMP_program_version_nano_s
+
+ #define BYTE_DUMP_program_version_s_length BYTE_DUMP_program_version_major_s_length + F_string_ascii_period_s_length + BYTE_DUMP_program_version_minor_s_length + F_string_ascii_period_s_length + BYTE_DUMP_program_version_micro_s_length + BYTE_DUMP_program_version_nano_prefix_s_length + BYTE_DUMP_program_version_nano_s_length
+
+ extern const f_string_static_t byte_dump_program_version_s;
+#endif // _di_byte_dump_program_version_
+
+#ifndef _di_byte_dump_program_name_
+ #define BYTE_DUMP_program_name_s "byte_dump"
+ #define BYTE_DUMP_program_name_long_s "Byte Dump"
+
+ #define BYTE_DUMP_program_name_s_length 9
+ #define BYTE_DUMP_program_name_long_s_length 9
+
+ extern const f_string_static_t byte_dump_program_name_s;
+ extern const f_string_static_t byte_dump_program_name_long_s;
+#endif // _di_byte_dump_program_name_
+
+#ifndef _di_byte_dump_program_help_parameters_
+ #define BYTE_DUMP_program_help_parameters_s "filename(s)"
+ #define BYTE_DUMP_program_help_parameters_s_length 11
+
+ extern const f_string_static_t byte_dump_program_help_parameters_s;
+#endif // _di_byte_dump_program_help_parameters_
+
+/**
+ * Set to at least 4 to provide a UTF-8 friendly allocation step.
+ */
+#ifndef _di_byte_dump_default_allocation_step_
+ #define byte_dump_default_allocation_step_d 4
+#endif // _di_byte_dump_default_allocation_step_
+
+/**
+ * Byte Dump defines.
+ *
+ * byte_dump_mode_*:
+ * - hexidecimal: Display using hexidecimal notation (base 16).
+ * - duodecimal: Display using duodecimal notation (base 12).
+ * - octal: Display using octal notation (base 8).
+ * - binary: Display using binary notation (base 2).
+ * - decimal: Display using decimal notation (base 10).
+ *
+ * byte_dump_presentation_*:
+ * - normal: Normal presentation mode.
+ * - simple: Simple presentation mode.
+ * - classic: Classic presentation mode.
+ */
+#ifndef _di_byte_dump_defines_
+ enum {
+ byte_dump_mode_hexidecimal_e = 1,
+ byte_dump_mode_duodecimal_e,
+ byte_dump_mode_octal_e,
+ byte_dump_mode_binary_e,
+ byte_dump_mode_decimal_e,
+ };
+
+ enum {
+ byte_dump_presentation_normal_e = 1,
+ byte_dump_presentation_simple_e,
+ byte_dump_presentation_classic_e,
+ };
+
+ #define byte_dump_option_wide_d 0x1
+
+ #define byte_dump_signal_check_d 10000
+
+ #define BYTE_DUMP_character_wall_s "|"
+ #define BYTE_DUMP_character_placeholder_s "␣" // other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
+ #define BYTE_DUMP_character_incomplete_s "�"
+ #define BYTE_DUMP_character_unused_s "�"
+
+ #define BYTE_DUMP_short_binary_s "b"
+ #define BYTE_DUMP_short_decimal_s "d"
+ #define BYTE_DUMP_short_duodecimal_s "D"
+ #define BYTE_DUMP_short_hexidecimal_s "x"
+ #define BYTE_DUMP_short_octal_s "o"
+ #define BYTE_DUMP_short_unicode_s "U"
+
+ #define BYTE_DUMP_short_first_s "f"
+ #define BYTE_DUMP_short_last_s "l"
+
+ #define BYTE_DUMP_short_narrow_s "N"
+ #define BYTE_DUMP_short_placeholder_s "p"
+ #define BYTE_DUMP_short_text_s "t"
+ #define BYTE_DUMP_short_wide_s "W"
+ #define BYTE_DUMP_short_width_s "w"
+
+ #define BYTE_DUMP_long_binary_s "binary"
+ #define BYTE_DUMP_long_decimal_s "decimal"
+ #define BYTE_DUMP_long_duodecimal_s "duodecimal"
+ #define BYTE_DUMP_long_hexidecimal_s "hexidecimal"
+ #define BYTE_DUMP_long_octal_s "octal"
+ #define BYTE_DUMP_long_unicode_s "unicode"
+
+ #define BYTE_DUMP_long_first_s "first" // First offset byte size.
+ #define BYTE_DUMP_long_last_s "last" // Last offset byte size.
+
+ #define BYTE_DUMP_long_narrow_s "narrow" // Each character in the displyed text will take at least 1 columns.
+ #define BYTE_DUMP_long_placeholder_s "placeholder" // Display (colored) placeholders to signify codes that are UTF-8 fragments.
+ #define BYTE_DUMP_long_text_s "text" // Display text
+ #define BYTE_DUMP_long_wide_s "wide" // Each character in the displyed text will take at least 2 columns.
+ #define BYTE_DUMP_long_width_s "width" // Number of characters to display per row.
+
+ #define BYTE_DUMP_long_normal_s "normal" // Use normal presentation, displaying UTF-8 sequence codes for ASCII special codes.
+ #define BYTE_DUMP_long_simple_s "simple" // Use simple presentation, displaying spaces for ASCII special codes instead of UTF-8 sequence codes.
+ #define BYTE_DUMP_long_classic_s "classic" // Use classic presentation, displaying periods for ASCII special codes instead of UTF-8 sequence codes.
+
+ #define BYTE_DUMP_character_wall_s_length 1
+ #define BYTE_DUMP_character_placeholder_s_length 3
+ #define BYTE_DUMP_character_incomplete_s_length 3
+ #define BYTE_DUMP_character_unused_s_length 3
+
+ #define BYTE_DUMP_short_binary_s_length 1
+ #define BYTE_DUMP_short_decimal_s_length 1
+ #define BYTE_DUMP_short_duodecimal_s_length 1
+ #define BYTE_DUMP_short_hexidecimal_s_length 1
+ #define BYTE_DUMP_short_octal_s_length 1
+ #define BYTE_DUMP_short_unicode_s_length 1
+
+ #define BYTE_DUMP_short_first_s_length 1
+ #define BYTE_DUMP_short_last_s_length 1
+
+ #define BYTE_DUMP_short_narrow_s_length 1
+ #define BYTE_DUMP_short_placeholder_s_length 1
+ #define BYTE_DUMP_short_text_s_length 1
+ #define BYTE_DUMP_short_wide_s_length 1
+ #define BYTE_DUMP_short_width_s_length 1
+
+ #define BYTE_DUMP_long_binary_s_length 6
+ #define BYTE_DUMP_long_decimal_s_length 7
+ #define BYTE_DUMP_long_duodecimal_s_length 10
+ #define BYTE_DUMP_long_hexidecimal_s_length 11
+ #define BYTE_DUMP_long_octal_s_length 5
+ #define BYTE_DUMP_long_unicode_s_length 7
+
+ #define BYTE_DUMP_long_first_s_length 5
+ #define BYTE_DUMP_long_last_s_length 4
+
+ #define BYTE_DUMP_long_narrow_s_length 6
+ #define BYTE_DUMP_long_placeholder_s_length 11
+ #define BYTE_DUMP_long_text_s_length 4
+ #define BYTE_DUMP_long_wide_s_length 4
+ #define BYTE_DUMP_long_width_s_length 5
+
+ #define BYTE_DUMP_long_normal_s_length 6
+ #define BYTE_DUMP_long_simple_s_length 6
+ #define BYTE_DUMP_long_classic_s_length 7
+
+ extern const f_string_static_t byte_dump_character_wall_s;
+ extern const f_string_static_t byte_dump_character_placeholder_s;
+ extern const f_string_static_t byte_dump_character_incomplete_s;
+ extern const f_string_static_t byte_dump_character_unused_s;
+
+ extern const f_string_static_t byte_dump_short_binary_s;
+ extern const f_string_static_t byte_dump_short_decimal_s;
+ extern const f_string_static_t byte_dump_short_duodecimal_s;
+ extern const f_string_static_t byte_dump_short_hexidecimal_s;
+ extern const f_string_static_t byte_dump_short_octal_s;
+ extern const f_string_static_t byte_dump_short_unicode_s;
+
+ extern const f_string_static_t byte_dump_short_first_s;
+ extern const f_string_static_t byte_dump_short_last_s;
+
+ extern const f_string_static_t byte_dump_short_narrow_s;
+ extern const f_string_static_t byte_dump_short_placeholder_s;
+ extern const f_string_static_t byte_dump_short_text_s;
+ extern const f_string_static_t byte_dump_short_wide_s;
+ extern const f_string_static_t byte_dump_short_width_s;
+
+ extern const f_string_static_t byte_dump_long_binary_s;
+ extern const f_string_static_t byte_dump_long_decimal_s;
+ extern const f_string_static_t byte_dump_long_duodecimal_s;
+ extern const f_string_static_t byte_dump_long_hexidecimal_s;
+ extern const f_string_static_t byte_dump_long_octal_s;
+ extern const f_string_static_t byte_dump_long_unicode_s;
+
+ extern const f_string_static_t byte_dump_long_first_s;
+ extern const f_string_static_t byte_dump_long_last_s;
+
+ extern const f_string_static_t byte_dump_long_narrow_s;
+ extern const f_string_static_t byte_dump_long_placeholder_s;
+ extern const f_string_static_t byte_dump_long_text_s;
+ extern const f_string_static_t byte_dump_long_wide_s;
+ extern const f_string_static_t byte_dump_long_width_s;
+
+ extern const f_string_static_t byte_dump_long_normal_s;
+ extern const f_string_static_t byte_dump_long_simple_s;
+ extern const f_string_static_t byte_dump_long_classic_s;
+
+ enum {
+ byte_dump_parameter_help_e,
+ byte_dump_parameter_light_e,
+ byte_dump_parameter_dark_e,
+ byte_dump_parameter_no_color_e,
+ byte_dump_parameter_verbosity_quiet_e,
+ byte_dump_parameter_verbosity_normal_e,
+ byte_dump_parameter_verbosity_verbose_e,
+ byte_dump_parameter_verbosity_debug_e,
+ byte_dump_parameter_version_e,
+
+ byte_dump_parameter_binary_e,
+ byte_dump_parameter_decimal_e,
+ byte_dump_parameter_duodecimal_e,
+ byte_dump_parameter_hexidecimal_e,
+ byte_dump_parameter_octal_e,
+ byte_dump_parameter_unicode_e,
+
+ byte_dump_parameter_first_e,
+ byte_dump_parameter_last_e,
+
+ byte_dump_parameter_narrow_e,
+ byte_dump_parameter_placeholder_e,
+ byte_dump_parameter_text_e,
+ byte_dump_parameter_wide_e,
+ byte_dump_parameter_width_e,
+
+ byte_dump_parameter_normal_e,
+ byte_dump_parameter_simple_e,
+ byte_dump_parameter_classic_e,
+ };
+
+ #define byte_dump_console_parameter_t_initialize \
+ { \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_binary_s.string, byte_dump_long_binary_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_decimal_s.string, byte_dump_long_decimal_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_duodecimal_s.string, byte_dump_long_duodecimal_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_hexidecimal_s.string, byte_dump_long_hexidecimal_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_octal_s.string, byte_dump_long_octal_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_unicode_s.string, byte_dump_long_unicode_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_first_s.string, byte_dump_long_first_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_last_s.string, byte_dump_long_last_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_narrow_s.string, byte_dump_long_narrow_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_placeholder_s.string, byte_dump_long_placeholder_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_text_s.string, byte_dump_long_text_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_wide_s.string, byte_dump_long_wide_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(byte_dump_short_width_s.string, byte_dump_long_width_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, byte_dump_long_normal_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, byte_dump_long_simple_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, byte_dump_long_classic_s.string, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define byte_dump_total_parameters_d 25
+#endif // _di_byte_dump_defines_
+
+#ifndef _di_byte_dump_main_t_
+ typedef struct {
+ f_console_parameter_t parameters[byte_dump_total_parameters_d];
+
+ f_array_lengths_t remaining;
+ bool process_pipe;
+
+ fl_print_t output;
+ fl_print_t error;
+ fl_print_t warning;
+
+ f_signal_t signal;
+
+ uint64_t first;
+ uint64_t last;
+ uint8_t width;
+ uint8_t mode;
+ uint8_t presentation;
+ uint8_t options;
+
+ f_color_context_t context;
+ } byte_dump_main_t;
+
+ #define byte_dump_main_t_initialize \
+ { \
+ byte_dump_console_parameter_t_initialize, \
+ f_array_lengths_t_initialize, \
+ F_false, \
+ fl_print_t_initialize, \
+ macro_fl_print_t_initialize_error(), \
+ macro_fl_print_t_initialize_warning(), \
+ f_signal_t_initialize, \
+ 0, \
+ 0, \
+ 8, \
+ byte_dump_option_wide_d, \
+ byte_dump_mode_hexidecimal_e, \
+ byte_dump_presentation_normal_e, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_byte_dump_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing byte_dump_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see byte_dump_main()
+ */
+#ifndef _di_byte_dump_main_delete_
+ extern f_status_t byte_dump_main_delete(byte_dump_main_t * const main);
+#endif // _di_byte_dump_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _byte_dump_common_h
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = byte_dump_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
byte_dump_print_text(main, characters, invalid, &previous, &offset);
}
else {
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
}
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
funlockfile(main->output.to.stream);
- // make sure to flush standard out to help prevent standard error from causing poblems.
+ // Make sure to flush standard out to help prevent standard error from causing problems.
fflush(main->output.to.stream);
if (found_invalid_utf) {
// @todo determine what the error is and display it.
flockfile(main->error.to.stream);
- fl_print_format("%[%Sread() failed for '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%Qread() failed for '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, file_name ? file_name : "-", main->context.set.notable);
fl_print_format("%['.%]%q%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s, f_string_eol_s);
if (width_utf < 2) {
- // 1 == U+0000 -> U+007F
+ // 1 == U+0000 -> U+007F.
unicode = macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0x7f;
}
else if (width_utf == 2) {
- // 2 == U+0080 -> U+07FF
+ // 2 == U+0080 -> U+07FF.
unicode = (macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0x1f) << 6;
unicode |= macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f;
}
else if (width_utf == 3) {
- // 3 == U+0800 -> U+FFFF
+ // 3 == U+0800 -> U+FFFF.
unicode = (macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0xf) << 12;
unicode |= (macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f) << 6;
unicode |= macro_f_utf_character_t_to_char_3(characters.string[character_current]) & 0x3f;
}
else if (width_utf == 4) {
- // 4 == U+10000 -> U+10FFFF
+ // 4 == U+10000 -> U+10FFFF.
unicode = (macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0x7) << 18;
unicode |= (macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f) << 12;
unicode |= (macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f) << 6;
byte_dump_print_text(main, characters, invalid, previous, offset);
}
else {
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
}
cell->column = 0;
char byte[5] = { 0, 0, 0, 0, 0 };
- fl_print_format(" %[%s%] ", main->output.to.stream, main->context.set.notable, byte_dump_character_wall_s, main->context.set.notable);
+ fl_print_format(" %[%q%] ", main->output.to.stream, main->context.set.notable, byte_dump_character_wall_s, main->context.set.notable);
if (*offset) {
if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) {
for (; *offset && at < main->width; --(*offset), ++at) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
if (main->options & byte_dump_option_wide_d) {
f_print_dynamic(f_string_space_s, main->output.to.stream);
for (; at < previous->bytes && at < main->width; ++at) {
if (previous->invalid) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
}
else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
}
if (main->options & byte_dump_option_wide_d) {
width_utf = macro_f_utf_byte_width_is(c);
if (invalid[i]) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_incomplete_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_incomplete_s, main->context.set.error);
if (main->options & byte_dump_option_wide_d) {
f_print_dynamic(f_string_ascii_space_s, main->output.to.stream);
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else {
- fl_print_format("%[%[%s%]%]", main->output.to.stream, main->context.set.notable, main->context.set.warning, byte_dump_sequence_space_s, main->context.set.warning, main->context.set.notable);
+ fl_print_format("%[%[%q%]%]", main->output.to.stream, main->context.set.notable, main->context.set.warning, f_print_sequence_space_s, main->context.set.warning, main->context.set.notable);
}
if (main->options & byte_dump_option_wide_d) {
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) {
- fl_print_format("%[%[%s%]%]", main->output.to.stream, main->context.set.notable, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning, main->context.set.notable);
+ fl_print_format("%[%[%q%]%]", main->output.to.stream, main->context.set.notable, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning, main->context.set.notable);
}
else {
f_print_dynamic(f_string_space_s, main->output.to.stream);
// Print invalid placeholder for invalid UTF-8 widths.
if (invalid[i]) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_incomplete_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_incomplete_s, main->context.set.error);
}
else {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_incomplete_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_incomplete_s, main->context.set.warning);
}
}
else if (width_utf == 2) {
if (width_utf > 1 && at + 1 < main->width) {
if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) {
if (invalid[i]) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
}
else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
}
}
else {
if (width_utf > 2 && at + 1 < main->width) {
if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) {
if (invalid[i]) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
}
else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
}
}
else {
if (width_utf > 3 && at + 1 < main->width) {
if (main->parameters[byte_dump_parameter_placeholder_e].result == f_console_result_found_e) {
if (invalid[i]) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
}
else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
}
}
else {
for (; at < main->width; ++at) {
if (invalid[at]) {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.error, byte_dump_character_placeholder_s, main->context.set.error);
}
else if (main->parameters[byte_dump_parameter_classic_e].result == f_console_result_found_e) {
f_print_dynamic(f_string_ascii_period_s, main->output.to.stream);
}
else {
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.warning, byte_dump_character_placeholder_s, main->context.set.warning);
}
if (main->options & byte_dump_option_wide_d) {
} // for
}
- fl_print_format(" %[%s%]%s", main->output.to.stream, main->context.set.notable, byte_dump_character_wall_s, main->context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%q%]%q", main->output.to.stream, main->context.set.notable, byte_dump_character_wall_s, main->context.set.notable, f_string_eol_s);
}
#endif // _di_byte_dump_print_text_
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library byte_dump.c private-common.c private-byte_dump.c
+build_sources_library byte_dump.c common.c private-common.c private-byte_dump.c
build_sources_library_shared
build_sources_library_static
build_sources_program main.c
build_sources_program_shared
build_sources_program_static
-build_sources_headers byte_dump.h
+build_sources_headers byte_dump.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "control.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_control_program_version_
+ const f_string_static_t control_program_version_s = macro_f_string_static_t_initialize2(CONTROL_program_version_s, 0, CONTROL_program_version_s_length);
+#endif // _di_control_program_version_
+
+#ifndef _di_control_program_name_
+ const f_string_static_t control_program_name_s = macro_f_string_static_t_initialize2(CONTROL_program_name_s, 0, CONTROL_program_name_s_length);
+ const f_string_static_t control_program_name_long_s = macro_f_string_static_t_initialize2(CONTROL_program_name_long_s, 0, CONTROL_program_name_long_s_length);
+#endif // _di_control_program_name_
+
+#ifndef _di_control_defines_
+ const f_string_static_t control_short_name_s = macro_f_string_static_t_initialize2(CONTROL_short_name_s, 0, CONTROL_short_name_s_length);
+ const f_string_static_t control_short_settings_s = macro_f_string_static_t_initialize2(CONTROL_short_settings_s, 0, CONTROL_short_settings_s_length);
+ const f_string_static_t control_short_socket_s = macro_f_string_static_t_initialize2(CONTROL_short_socket_s, 0, CONTROL_short_socket_s_length);
+
+ const f_string_static_t control_long_name_s = macro_f_string_static_t_initialize2(CONTROL_long_name_s, 0, CONTROL_long_name_s_length);
+ const f_string_static_t control_long_settings_s = macro_f_string_static_t_initialize2(CONTROL_long_settings_s, 0, CONTROL_long_settings_s_length);
+ const f_string_static_t control_long_socket_s = macro_f_string_static_t_initialize2(CONTROL_long_socket_s, 0, CONTROL_long_socket_s_length);
+#endif // _di_control_defines_
+
+#ifndef _di_control_main_delete_
+ f_status_t control_main_delete(control_main_t * const main) {
+
+ for (f_array_length_t i = 0; i < control_total_parameters_d; ++i) {
+
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
+ } // for
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_control_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Control
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _control_common_h
+#define _control_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_control_program_version_
+ #define CONTROL_program_version_major_s F_string_ascii_0_s
+ #define CONTROL_program_version_minor_s F_string_ascii_5_s
+ #define CONTROL_program_version_micro_s F_string_ascii_8_s
+
+ #define CONTROL_program_version_major_s_length F_string_ascii_0_s_length
+ #define CONTROL_program_version_minor_s_length F_string_ascii_5_s_length
+ #define CONTROL_program_version_micro_s_length F_string_ascii_8_s_length
+
+ #if !(defined(CONTROL_program_version_nano_prefix_s) && defined(CONTROL_program_version_nano_prefix_s_length))
+ #define CONTROL_program_version_nano_prefix_s
+ #define CONTROL_program_version_nano_prefix_s_length 0
+ #endif // !(defined(CONTROL_program_version_nano_prefix_s) && defined(CONTROL_program_version_nano_prefix_s_length))
+
+ #if !(defined(CONTROL_program_version_nano_s) && defined(CONTROL_program_version_nano_s_length))
+ #define CONTROL_program_version_nano_s
+ #define CONTROL_program_version_nano_s_length 0
+ #endif // !(defined(CONTROL_program_version_nano_s) && defined(CONTROL_program_version_nano_s_length))
+
+ #define CONTROL_program_version_s CONTROL_program_version_major_s F_string_ascii_period_s CONTROL_program_version_minor_s F_string_ascii_period_s CONTROL_program_version_micro_s CONTROL_program_version_nano_prefix_s CONTROL_program_version_nano_s
+
+ #define CONTROL_program_version_s_length CONTROL_program_version_major_s_length + F_string_ascii_period_s_length + CONTROL_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROL_program_version_nano_prefix_s_length + CONTROL_program_version_nano_s_length
+
+ extern const f_string_static_t control_program_version_s;
+#endif // _di_control_program_version_
+
+#ifndef _di_control_program_name_
+ #define CONTROL_program_name_s "control"
+ #define CONTROL_program_name_long_s "Control Program"
+
+ #define CONTROL_program_name_s_length 7
+ #define CONTROL_program_name_long_s_length 15
+
+ extern const f_string_static_t control_program_name_s;
+ extern const f_string_static_t control_program_name_long_s;
+#endif // _di_control_program_name_
+
+#ifndef _di_control_defines_
+ #define CONTROL_short_name_s "n"
+ #define CONTROL_short_settings_s "s"
+ #define CONTROL_short_socket_s "k"
+
+ #define CONTROL_long_name_s "name"
+ #define CONTROL_long_settings_s "settings"
+ #define CONTROL_long_socket_s "socket"
+
+ #define CONTROL_short_name_s_length 1
+ #define CONTROL_short_settings_s_length 1
+ #define CONTROL_short_socket_s_length 1
+
+ #define CONTROL_long_name_s_length 4
+ #define CONTROL_long_settings_s_length 8
+ #define CONTROL_long_socket_s_length 6
+
+ extern const f_string_static_t control_short_name_s;
+ extern const f_string_static_t control_short_settings_s;
+ extern const f_string_static_t control_short_socket_s;
+
+ extern const f_string_static_t control_long_name_s;
+ extern const f_string_static_t control_long_settings_s;
+ extern const f_string_static_t control_long_socket_s;
+
+ enum {
+ control_parameter_help_e = 0,
+ control_parameter_light_e,
+ control_parameter_dark_e,
+ control_parameter_no_color_e,
+ control_parameter_verbosity_quiet_e,
+ control_parameter_verbosity_normal_e,
+ control_parameter_verbosity_verbose_e,
+ control_parameter_verbosity_debug_e,
+ control_parameter_version_e,
+
+ control_parameter_name_e,
+ control_parameter_settings_e,
+ control_parameter_socket_e,
+ };
+
+ #define control_console_parameter_t_initialize \
+ { \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(control_short_name_s.string, control_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(control_short_settings_s.string, control_long_settings_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(control_short_socket_s.string, control_long_socket_s.string, 0, 1, f_console_type_normal_e), \
+ }
+
+ #define control_total_parameters_d 12
+#endif // _di_control_defines_
+
+#ifndef _di_control_main_t_
+ typedef struct {
+ f_console_parameter_t parameters[control_total_parameters_d];
+
+ uint16_t signal_check;
+
+ f_array_lengths_t remaining;
+ bool process_pipe;
+
+ fl_print_t output;
+ fl_print_t error;
+ fl_print_t warning;
+
+ f_signal_t signal;
+
+ f_color_context_t context;
+ } control_main_t;
+
+ #define control_main_initialize \
+ { \
+ control_console_parameter_t_initialize, \
+ 0, \
+ f_array_lengths_t_initialize, \
+ F_false, \
+ fl_print_t_initialize, \
+ macro_fl_print_t_initialize_error(), \
+ macro_fl_print_t_initialize_warning(), \
+ f_signal_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_control_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing control_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see control_main()
+ */
+#ifndef _di_control_main_delete_
+ extern f_status_t control_main_delete(control_main_t * const main);
+#endif // _di_control_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _control_common_h
extern "C" {
#endif
-#ifndef _di_control_program_version_
- const f_string_static_t control_program_version_s = macro_f_string_static_t_initialize2(CONTROL_program_version_s, 0, CONTROL_program_version_s_length);
-#endif // _di_control_program_version_
-
-#ifndef _di_control_program_name_
- const f_string_static_t control_program_name_s = macro_f_string_static_t_initialize2(CONTROL_program_name_s, 0, CONTROL_program_name_s_length);
- const f_string_static_t control_program_name_long_s = macro_f_string_static_t_initialize2(CONTROL_program_name_long_s, 0, CONTROL_program_name_long_s_length);
-#endif // _di_control_program_name_
-
-#ifndef _di_control_defines_
- const f_string_static_t control_short_name_s = macro_f_string_static_t_initialize2(CONTROL_short_name_s, 0, CONTROL_short_name_s_length);
- const f_string_static_t control_short_settings_s = macro_f_string_static_t_initialize2(CONTROL_short_settings_s, 0, CONTROL_short_settings_s_length);
- const f_string_static_t control_short_socket_s = macro_f_string_static_t_initialize2(CONTROL_short_socket_s, 0, CONTROL_short_socket_s_length);
-
- const f_string_static_t control_long_name_s = macro_f_string_static_t_initialize2(CONTROL_long_name_s, 0, CONTROL_long_name_s_length);
- const f_string_static_t control_long_settings_s = macro_f_string_static_t_initialize2(CONTROL_long_settings_s, 0, CONTROL_long_settings_s_length);
- const f_string_static_t control_long_socket_s = macro_f_string_static_t_initialize2(CONTROL_long_socket_s, 0, CONTROL_long_socket_s_length);
-#endif // _di_control_defines_
-
#ifndef _di_control_print_help_
f_status_t control_print_help(control_main_t * const main) {
flockfile(main->output.to.stream);
- fll_program_print_help_header(main->output.to, main->context, control_program_name_long_s.string, control_program_version_s.string);
+ fll_program_print_help_header(main->output.to, main->context, control_program_name_long_s, control_program_version_s);
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not main->output.to in color.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal main->output.to.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not main->output.to in color.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal main->output.to.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, main->output.to.stream);
- fll_program_print_help_option(main->output.to, main->context, control_short_name_s.string, control_long_name_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify the name of the controller socket file.");
- fll_program_print_help_option(main->output.to, main->context, control_short_settings_s.string, control_long_settings_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Specify a directory path or a full path to the control settings file.");
- fll_program_print_help_option(main->output.to, main->context, control_short_socket_s.string, control_long_socket_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a directory path or a full path to the controller socket file.");
+ fll_program_print_help_option(main->output.to, main->context, control_short_name_s, control_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify the name of the controller socket file.");
+ fll_program_print_help_option(main->output.to, main->context, control_short_settings_s, control_long_settings_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Specify a directory path or a full path to the control settings file.");
+ fll_program_print_help_option(main->output.to, main->context, control_short_socket_s, control_long_socket_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a directory path or a full path to the controller socket file.");
- fll_program_print_help_usage(main->output.to, main->context, control_program_name_s.string, control_command_s.string);
+ fll_program_print_help_usage(main->output.to, main->context, control_program_name_s, control_command_s);
- fl_print_format(" When the %[%s%q%] parameter represents a directory path then the file name is generated from either the", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s.string, control_long_socket_s, main->context.set.notable);
- fl_print_format(" %[%s%q%] parameter or from the control settings file.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s.string, control_long_name_s, main->context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When the %[%s%q%] parameter represents a directory path then the file name is generated from either the", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, control_long_socket_s, main->context.set.notable);
+ fl_print_format(" %[%s%q%] parameter or from the control settings file.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, control_long_name_s, main->context.set.notable, f_string_eol_s, f_string_eol_s);
fl_print_format(" A rule action allows for either the full rule path, such as '%[boot/root%]'", main->output.to.stream, main->context.set.notable, main->context.set.notable);
fl_print_format(" as a single parameter or two parameters with the first representing the rule directory path '%[boot%]'", main->output.to.stream, main->context.set.notable, main->context.set.notable);
}
if (main->parameters[control_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, control_program_version_s.string);
+ fll_program_print_version(main->output.to, control_program_version_s);
control_main_delete(main);
else if (main->parameters[ids[i]].result == f_console_result_additional_e) {
location = main->parameters[ids[i]].values.array[main->parameters[ids[i]].values.used - 1];
- if (!strnlen(arguments->argv[location], f_console_parameter_size)) {
+ if (!strnlen(arguments->argv[location], F_console_parameter_size_d)) {
control_print_error_parameter_value_empty(main, names[i]);
status = F_status_set_error(F_parameter);
}
#endif // _di_control_main_
-#ifndef _di_control_main_delete_
- f_status_t control_main_delete(control_main_t * const main) {
-
- for (f_array_length_t i = 0; i < control_total_parameters_d; ++i) {
-
- f_type_array_lengths_resize(0, &main->parameters[i].locations);
- f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
- f_type_array_lengths_resize(0, &main->parameters[i].values);
- } // for
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_control_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
* This program is used to communicate with the "controller" program that exists as a system init (an alternative to sysvinit, initng, etc..).
*/
#ifndef _control_h
+#define _control_h
-// libc includes.
+// Libc includes.
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/signal.h>
#include <fll/level_0/socket.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/fss.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/fss_extended.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// Control includes.
+#include <program/control/common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_control_program_version_
- #define CONTROL_program_version_major_s F_string_ascii_0_s
- #define CONTROL_program_version_minor_s F_string_ascii_5_s
- #define CONTROL_program_version_micro_s F_string_ascii_8_s
-
- #define CONTROL_program_version_major_s_length 1
- #define CONTROL_program_version_minor_s_length 1
- #define CONTROL_program_version_micro_s_length 1
-
- #ifndef CONTROL_program_version_nano_prefix_s
- #define CONTROL_program_version_nano_prefix_s
-
- #define CONTROL_program_version_nano_prefix_s_length 0
- #endif
-
- #ifndef CONTROL_program_version_nano_s
- #define CONTROL_program_version_nano_s
-
- #define CONTROL_program_version_nano_s_length 0
- #endif
-
- #define CONTROL_program_version_s CONTROL_program_version_major_s F_string_ascii_period_s CONTROL_program_version_minor_s F_string_ascii_period_s CONTROL_program_version_micro_s CONTROL_program_version_nano_prefix_s CONTROL_program_version_nano_s
-
- #define CONTROL_program_version_s_length CONTROL_program_version_major_s_length + F_string_ascii_period_s_length + CONTROL_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROL_program_version_nano_prefix_s_length + CONTROL_program_version_nano_s_length
-
- extern const f_string_static_t control_program_version_s;
-#endif // _di_control_program_version_
-
-#ifndef _di_control_program_name_
- #define CONTROL_program_name_s "control"
- #define CONTROL_program_name_long_s "Control Program"
-
- #define CONTROL_program_name_s_length 7
- #define CONTROL_program_name_long_s_length 15
-
- extern const f_string_static_t control_program_name_s;
- extern const f_string_static_t control_program_name_long_s;
-#endif // _di_control_program_name_
-
-#ifndef _di_control_defines_
- #define CONTROL_short_name_s "n"
- #define CONTROL_short_settings_s "s"
- #define CONTROL_short_socket_s "k"
-
- #define CONTROL_long_name_s "name"
- #define CONTROL_long_settings_s "settings"
- #define CONTROL_long_socket_s "socket"
-
- #define CONTROL_short_name_s_length 1
- #define CONTROL_short_settings_s_length 1
- #define CONTROL_short_socket_s_length 1
-
- #define CONTROL_long_name_s_length 4
- #define CONTROL_long_settings_s_length 8
- #define CONTROL_long_socket_s_length 6
-
- extern const f_string_static_t control_short_name_s;
- extern const f_string_static_t control_short_settings_s;
- extern const f_string_static_t control_short_socket_s;
-
- extern const f_string_static_t control_long_name_s;
- extern const f_string_static_t control_long_settings_s;
- extern const f_string_static_t control_long_socket_s;
-
- enum {
- control_parameter_help_e = 0,
- control_parameter_light_e,
- control_parameter_dark_e,
- control_parameter_no_color_e,
- control_parameter_verbosity_quiet_e,
- control_parameter_verbosity_normal_e,
- control_parameter_verbosity_verbose_e,
- control_parameter_verbosity_debug_e,
- control_parameter_version_e,
-
- control_parameter_name_e,
- control_parameter_settings_e,
- control_parameter_socket_e,
- };
-
- #define control_console_parameter_t_initialize \
- { \
- macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(control_short_name_s.string, control_long_name_s.string, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(control_short_settings_s.string, control_long_settings_s.string, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(control_short_socket_s.string, control_long_socket_s.string, 0, 1, f_console_type_normal_e), \
- }
-
- #define control_total_parameters_d 12
-#endif // _di_control_defines_
-
-#ifndef _di_control_main_t_
- typedef struct {
- f_console_parameter_t parameters[control_total_parameters_d];
-
- uint16_t signal_check;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } control_main_t;
-
- #define control_main_initialize \
- { \
- control_console_parameter_t_initialize, \
- 0, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_control_main_t_
-
/**
* Print help.
*
*
* @return
* F_none on success.
+ *
+ * @see control_main()
*/
#ifndef _di_control_print_help_
extern f_status_t control_print_help(control_main_t * const main);
extern f_status_t control_main(control_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_control_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing control_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see control_main()
- */
-#ifndef _di_control_main_delete_
- extern f_status_t control_main_delete(control_main_t * const main);
-#endif // _di_control_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = control_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
const f_string_static_t control_path_socket_prefix_s = macro_f_string_static_t_initialize2(CONTROL_path_socket_prefix_s, 0, CONTROL_path_socket_prefix_s_length);
const f_string_static_t control_path_socket_suffix_s = macro_f_string_static_t_initialize2(CONTROL_path_socket_suffix_s, 0, CONTROL_path_socket_suffix_s_length);
- const f_string_static_t control_error_s_length = macro_f_string_static_t_initialize2(CONTROL_error_s, 0, CONTROL_error_s_length);
- const f_string_static_t control_freeze_s_length = macro_f_string_static_t_initialize2(CONTROL_freeze_s, 0, CONTROL_freeze_s_length);
- const f_string_static_t control_kill_s_length = macro_f_string_static_t_initialize2(CONTROL_kill_s, 0, CONTROL_kill_s_length);
- const f_string_static_t control_pause_s_length = macro_f_string_static_t_initialize2(CONTROL_pause_s, 0, CONTROL_pause_s_length);
- const f_string_static_t control_reboot_s_length = macro_f_string_static_t_initialize2(CONTROL_reboot_s, 0, CONTROL_reboot_s_length);
- const f_string_static_t control_reload_s_length = macro_f_string_static_t_initialize2(CONTROL_reload_s, 0, CONTROL_reload_s_length);
- const f_string_static_t control_rerun_s_length = macro_f_string_static_t_initialize2(CONTROL_rerun_s, 0, CONTROL_rerun_s_length);
- const f_string_static_t control_restart_s_length = macro_f_string_static_t_initialize2(CONTROL_restart_s, 0, CONTROL_restart_s_length);
- const f_string_static_t control_resume_s_length = macro_f_string_static_t_initialize2(CONTROL_resume_s, 0, CONTROL_resume_s_length);
- const f_string_static_t control_shutdown_s_length = macro_f_string_static_t_initialize2(CONTROL_shutdown_s, 0, CONTROL_shutdown_s_length);
- const f_string_static_t control_start_s_length = macro_f_string_static_t_initialize2(CONTROL_start_s, 0, CONTROL_start_s_length);
- const f_string_static_t control_stop_s_length = macro_f_string_static_t_initialize2(CONTROL_stop_s, 0, CONTROL_stop_s_length);
- const f_string_static_t control_thaw_s_length = macro_f_string_static_t_initialize2(CONTROL_thaw_s, 0, CONTROL_thaw_s_length);
+ const f_string_static_t control_error_s = macro_f_string_static_t_initialize2(CONTROL_error_s, 0, CONTROL_error_s_length);
+ const f_string_static_t control_freeze_s = macro_f_string_static_t_initialize2(CONTROL_freeze_s, 0, CONTROL_freeze_s_length);
+ const f_string_static_t control_kill_s = macro_f_string_static_t_initialize2(CONTROL_kill_s, 0, CONTROL_kill_s_length);
+ const f_string_static_t control_pause_s = macro_f_string_static_t_initialize2(CONTROL_pause_s, 0, CONTROL_pause_s_length);
+ const f_string_static_t control_reboot_s = macro_f_string_static_t_initialize2(CONTROL_reboot_s, 0, CONTROL_reboot_s_length);
+ const f_string_static_t control_reload_s = macro_f_string_static_t_initialize2(CONTROL_reload_s, 0, CONTROL_reload_s_length);
+ const f_string_static_t control_rerun_s = macro_f_string_static_t_initialize2(CONTROL_rerun_s, 0, CONTROL_rerun_s_length);
+ const f_string_static_t control_restart_s = macro_f_string_static_t_initialize2(CONTROL_restart_s, 0, CONTROL_restart_s_length);
+ const f_string_static_t control_resume_s = macro_f_string_static_t_initialize2(CONTROL_resume_s, 0, CONTROL_resume_s_length);
+ const f_string_static_t control_shutdown_s = macro_f_string_static_t_initialize2(CONTROL_shutdown_s, 0, CONTROL_shutdown_s_length);
+ const f_string_static_t control_start_s = macro_f_string_static_t_initialize2(CONTROL_start_s, 0, CONTROL_start_s_length);
+ const f_string_static_t control_stop_s = macro_f_string_static_t_initialize2(CONTROL_stop_s, 0, CONTROL_stop_s_length);
+ const f_string_static_t control_thaw_s = macro_f_string_static_t_initialize2(CONTROL_thaw_s, 0, CONTROL_thaw_s_length);
#endif // _di_control_strings_s_
#ifndef _di_control_data_delete_
extern const f_string_static_t control_path_socket_prefix_s;
extern const f_string_static_t control_path_socket_suffix_s;
- extern const f_string_static_t control_error_s_length;
- extern const f_string_static_t control_freeze_s_length;
- extern const f_string_static_t control_kill_s_length;
- extern const f_string_static_t control_pause_s_length;
- extern const f_string_static_t control_reboot_s_length;
- extern const f_string_static_t control_reload_s_length;
- extern const f_string_static_t control_rerun_s_length;
- extern const f_string_static_t control_restart_s_length;
- extern const f_string_static_t control_resume_s_length;
- extern const f_string_static_t control_shutdown_s_length;
- extern const f_string_static_t control_start_s_length;
- extern const f_string_static_t control_stop_s_length;
- extern const f_string_static_t control_thaw_s_length;
+ extern const f_string_static_t control_error_s;
+ extern const f_string_static_t control_freeze_s;
+ extern const f_string_static_t control_kill_s;
+ extern const f_string_static_t control_pause_s;
+ extern const f_string_static_t control_reboot_s;
+ extern const f_string_static_t control_reload_s;
+ extern const f_string_static_t control_rerun_s;
+ extern const f_string_static_t control_restart_s;
+ extern const f_string_static_t control_resume_s;
+ extern const f_string_static_t control_shutdown_s;
+ extern const f_string_static_t control_start_s;
+ extern const f_string_static_t control_stop_s;
+ extern const f_string_static_t control_thaw_s;
#endif // _di_control_strings_s_
/**
#ifndef _di_control_command_identify_
f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_t command) {
- const f_array_length_t length = strnlen(command, f_console_parameter_size);
+ const f_string_static_t command_string = macro_f_string_static_t_initialize2(command, 0, strnlen(command, F_console_parameter_size_d));
- if (fl_string_dynamic_compare_string(command, control_freeze_s_length, length) == F_equal_to) {
+
+ if (fl_string_dynamic_compare(command_string, control_freeze_s) == F_equal_to) {
data->command = control_command_type_freeze_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_kill_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_kill_s) == F_equal_to) {
data->command = control_command_type_kill_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_pause_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_pause_s) == F_equal_to) {
data->command = control_command_type_pause_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_reboot_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_reboot_s) == F_equal_to) {
data->command = control_command_type_reboot_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_reload_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_reload_s) == F_equal_to) {
data->command = control_command_type_reload_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_rerun_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_rerun_s) == F_equal_to) {
data->command = control_command_type_rerun_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_restart_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_restart_s) == F_equal_to) {
data->command = control_command_type_restart_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_resume_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_resume_s) == F_equal_to) {
data->command = control_command_type_resume_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_shutdown_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_shutdown_s) == F_equal_to) {
data->command = control_command_type_shutdown_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_start_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_start_s) == F_equal_to) {
data->command = control_command_type_start_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_stop_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_stop_s) == F_equal_to) {
data->command = control_command_type_stop_e;
return F_found;
}
- if (fl_string_dynamic_compare_string(command, control_thaw_s_length, length) == F_equal_to) {
+ if (fl_string_dynamic_compare(command_string, control_thaw_s) == F_equal_to) {
data->command = control_command_type_thaw_e;
return F_found;
return F_status_set_error(F_parameter);
}
- if (!strnlen(arguments->argv[main->remaining.array[1]], f_console_parameter_size)) {
+ if (!strnlen(arguments->argv[main->remaining.array[1]], F_console_parameter_size_d)) {
if (main->remaining.used == 2) {
control_print_error_parameter_command_rule_empty(main, arguments->argv[0]);
}
}
if (main->remaining.used == 3) {
- if (!strnlen(arguments->argv[main->remaining.array[2]], f_console_parameter_size)) {
+ if (!strnlen(arguments->argv[main->remaining.array[2]], F_console_parameter_size_d)) {
control_print_error_parameter_command_rule_basename_empty(main, arguments->argv[0]);
return F_status_set_error(F_parameter);
if (main->parameters[control_parameter_socket_e].result == f_console_result_additional_e) {
const f_array_length_t location = main->parameters[control_parameter_settings_e].values.array[main->parameters[control_parameter_settings_e].values.used - 1];
- status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], f_console_parameter_size), &data->cache.buffer_small);
+ status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], F_console_parameter_size_d), &data->cache.buffer_small);
}
else {
status = f_string_dynamic_append_nulless(control_path_settings_s, &data->cache.buffer_small);
{
f_file_t file = f_file_t_initialize;
- status = f_file_stream_open(data->cache.buffer_small.string, f_file_open_mode_read_s, &file);
+ status = f_file_stream_open(data->cache.buffer_small.string, f_file_open_mode_read_s.string, &file);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data->cache.buffer_small.string, "open", fll_error_file_type_file_e);
if (main->parameters[control_parameter_socket_e].result == f_console_result_additional_e) {
const f_array_length_t location = main->parameters[control_parameter_socket_e].values.array[main->parameters[control_parameter_socket_e].values.used - 1];
- status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], f_console_parameter_size), &data->cache.buffer_small);
+ status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], F_console_parameter_size_d), &data->cache.buffer_small);
}
else if (parameter_hass[1]) {
status = f_string_dynamic_partial_append_nulless(data->cache.buffer_large, objects.array[parameter_ats[1]], &data->cache.buffer_small);
if (append_ids[i] && main->parameters[append_ids[i]].result == f_console_result_additional_e) {
const f_array_length_t location = main->parameters[append_ids[i]].values.array[main->parameters[append_ids[i]].values.used - 1];
- status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], f_console_parameter_size), &data->cache.buffer_small);
+ status = f_string_append(arguments->argv[location], strnlen(arguments->argv[location], F_console_parameter_size_d), &data->cache.buffer_small);
}
else if (append_hass[i]) {
status = f_string_dynamic_partial_append_nulless(data->cache.buffer_large, objects.array[append_hass[i]], &data->cache.buffer_small);
}
}
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable);
fl_print_format("%[' is not a known controller command.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable);
fl_print_format("%[' a rule base name cannot be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable);
fl_print_format("%[' a rule directory path cannot be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable);
fl_print_format("%[' a rule name cannot be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable);
fl_print_format("%[' requires either a full rule name or a rule directory path along with the rule base name.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe command parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%S%]", main->error.to.stream, main->context.set.notable, command, main->context.set.notable);
fl_print_format("%[' has too many arguments.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%[%SNo commands are provided.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s);
+ fll_print_format("%[%QNo commands are provided.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s);
}
#endif // _di_control_print_error_commands_none_
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe value for the parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe value for the parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe parameter '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, parameter, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%[%SPipe input is not supported by this program.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s);
+ fll_print_format("%[%QPipe input is not supported by this program.%]%q", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error, f_string_eol_s);
}
#endif // _di_control_print_error_pipe_supported_not_
flockfile(main->error.to.stream);
- fl_print_format("%[%SFailed to connect to the socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QFailed to connect to the socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe controller socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe controller socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable);
fl_print_format("%[' could not be found and is required.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%[%SThe controller socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
+ fl_print_format("%[%QThe controller socket file '%]", main->error.to.stream, main->context.set.error, main->error.prefix, main->context.set.error);
fl_print_format("%[%Q%]", main->error.to.stream, main->context.set.notable, path_socket, main->context.set.notable);
fl_print_format("%[' is not a socket file.%]%q", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library control.c private-common.c private-control.c private-print.c
+build_sources_library control.c common.c private-common.c private-control.c private-print.c
build_sources_library_shared
build_sources_library_static
build_sources_program main.c
build_sources_program_shared
build_sources_program_static
-build_sources_headers control.h
+build_sources_headers control.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "controller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_controller_program_version_
+ const f_string_static_t controller_program_version_s = macro_f_string_static_t_initialize2(CONTROLLER_program_version_s, 0, CONTROLLER_program_version_s_length);
+#endif // _di_controller_program_version_
+
+#ifndef _di_controller_program_name_
+ const f_string_static_t controller_program_name_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_s, 0, CONTROLLER_program_name_s_length);
+ const f_string_static_t controller_program_name_long_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_long_s, 0, CONTROLLER_program_name_long_s_length);
+
+ const f_string_static_t controller_program_name_init_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_init_s, 0, CONTROLLER_program_name_init_s_length);
+ const f_string_static_t controller_program_name_init_long_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_init_long_s, 0, CONTROLLER_program_name_init_long_s_length);
+#endif // _di_controller_program_name_
+
+#ifndef _di_controller_defines_
+ const f_string_static_t controller_default_program_script_s = macro_f_string_static_t_initialize2(CONTROLLER_default_program_script_s, 0, CONTROLLER_default_program_script_s_length);
+ const f_string_static_t controller_path_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_s, 0, CONTROLLER_path_pid_s_length);
+ const f_string_static_t controller_path_pid_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_init_s, 0, CONTROLLER_path_pid_init_s_length);
+ const f_string_static_t controller_path_pid_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_prefix_s, 0, CONTROLLER_path_pid_prefix_s_length);
+ const f_string_static_t controller_path_pid_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_suffix_s, 0, CONTROLLER_path_pid_suffix_s_length);
+ const f_string_static_t controller_path_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_path_settings_s, 0, CONTROLLER_path_settings_s_length);
+ const f_string_static_t controller_path_settings_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_settings_init_s, 0, CONTROLLER_path_settings_init_s_length);
+ const f_string_static_t controller_path_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_s, 0, CONTROLLER_path_socket_s_length);
+ const f_string_static_t controller_path_socket_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_init_s, 0, CONTROLLER_path_socket_s_length);
+ const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length);
+ const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length);
+
+ const f_string_static_t controller_short_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_short_cgroup_s, 0, CONTROLLER_short_cgroup_s_length);
+ const f_string_static_t controller_short_daemon_s = macro_f_string_static_t_initialize2(CONTROLLER_short_daemon_s, 0, CONTROLLER_short_daemon_s_length);
+ const f_string_static_t controller_short_init_s = macro_f_string_static_t_initialize2(CONTROLLER_short_init_s, 0, CONTROLLER_short_init_s_length);
+ const f_string_static_t controller_short_interruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_short_interruptible_s, 0, CONTROLLER_short_interruptible_s_length);
+ const f_string_static_t controller_short_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_short_pid_s, 0, CONTROLLER_short_pid_s_length);
+ const f_string_static_t controller_short_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_short_settings_s, 0, CONTROLLER_short_settings_s_length);
+ const f_string_static_t controller_short_simulate_s = macro_f_string_static_t_initialize2(CONTROLLER_short_simulate_s, 0, CONTROLLER_short_simulate_s_length);
+ const f_string_static_t controller_short_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_short_socket_s, 0, CONTROLLER_short_socket_s_length);
+ const f_string_static_t controller_short_uninterruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_short_uninterruptible_s, 0, CONTROLLER_short_uninterruptible_s_length);
+ const f_string_static_t controller_short_validate_s = macro_f_string_static_t_initialize2(CONTROLLER_short_validate_s, 0, CONTROLLER_short_validate_s_length);
+
+ const f_string_static_t controller_long_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_long_cgroup_s, 0, CONTROLLER_long_cgroup_s_length);
+ const f_string_static_t controller_long_daemon_s = macro_f_string_static_t_initialize2(CONTROLLER_long_daemon_s, 0, CONTROLLER_long_daemon_s_length);
+ const f_string_static_t controller_long_init_s = macro_f_string_static_t_initialize2(CONTROLLER_long_init_s, 0, CONTROLLER_long_init_s_length);
+ const f_string_static_t controller_long_interruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_long_interruptible_s, 0, CONTROLLER_long_interruptible_s_length);
+ const f_string_static_t controller_long_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_long_pid_s, 0, CONTROLLER_long_pid_s_length);
+ const f_string_static_t controller_long_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_long_settings_s, 0, CONTROLLER_long_settings_s_length);
+ const f_string_static_t controller_long_simulate_s = macro_f_string_static_t_initialize2(CONTROLLER_long_simulate_s, 0, CONTROLLER_long_simulate_s_length);
+ const f_string_static_t controller_long_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_long_socket_s, 0, CONTROLLER_long_socket_s_length);
+ const f_string_static_t controller_long_uninterruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_long_uninterruptible_s, 0, CONTROLLER_long_uninterruptible_s_length);
+ const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize2(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length);
+#endif // _di_controller_defines_
+
+#ifndef _di_controller_main_delete_
+ f_status_t controller_main_delete(controller_main_t * const main) {
+
+ for (f_array_length_t i = 0; i < controller_total_parameters_d; ++i) {
+
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
+ } // for
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_controller_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
* API Version: 0.5
* Licenses: lgpl-2.1-or-later
*
- * This is the Controller program.
+ * Provides the common data structures.
*
- * This program utilizes the Featureless Linux Library.
- * This program provides system service management, much like sysvcontroller and controllerng.
- * This program can be controlled from user-space via the "control" program.
- * This program can be used in an initrd and should be capable of pivot root operations.
- *
- * @todo Implement "exit" files that are the opposite of "entry" files whereas rules specified within are all called via the "stop" action type.
- * This would then allow for switching modes.
- * The "exit" would be specified in the "entry", by name and would be found under "exits" directory alongside the "entries" directory.
- *
- * @todo check the return status of unlocks.
- *
- * @todo the read/write locks (and unlocks) needs to be more robust in that they need to attempt to keep going even on failure or need to wait until resolvable.
- * this is done to help ensure that the controller program always continues onward.
- *
- * @todo just like with the read/write locks, the out of memory cases need to be handled to keep going instead of bailing.
- * likely these will need to be sleeps on the premise that eventually memory will clear itself up.
+ * This is auto-included and should not need to be explicitly included.
*/
-#ifndef _controller_h
-
-// include pre-requirements
-#define _GNU_SOURCE
-
-// libc includes
-#include <sched.h>
-#include <string.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <linux/sched.h>
-#include <unistd.h>
-
-// fll-0 includes
-#include <fll/level_0/type.h>
-#include <fll/level_0/status.h>
-#include <fll/level_0/memory.h>
-#include <fll/level_0/type_array.h>
-#include <fll/level_0/string.h>
-#include <fll/level_0/utf.h>
-#include <fll/level_0/account.h>
-#include <fll/level_0/capability.h>
-#include <fll/level_0/color.h>
-#include <fll/level_0/console.h>
-#include <fll/level_0/control_group.h>
-#include <fll/level_0/directory.h>
-#include <fll/level_0/environment.h>
-#include <fll/level_0/execute.h>
-#include <fll/level_0/file.h>
-#include <fll/level_0/fss.h>
-#include <fll/level_0/path.h>
-#include <fll/level_0/pipe.h>
-#include <fll/level_0/print.h>
-#include <fll/level_0/signal.h>
-#include <fll/level_0/socket.h>
-
-// fll-1 includes
-#include <fll/level_1/console.h>
-#include <fll/level_1/control_group.h>
-#include <fll/level_1/environment.h>
-#include <fll/level_1/fss.h>
-#include <fll/level_1/print.h>
-#include <fll/level_1/string.h>
-
-// fll-2 includes
-#include <fll/level_2/control_group.h>
-#include <fll/level_2/error.h>
-#include <fll/level_2/execute.h>
-#include <fll/level_2/fss.h>
-#include <fll/level_2/fss_basic_list.h>
-#include <fll/level_2/fss_extended.h>
-#include <fll/level_2/fss_extended_list.h>
-#include <fll/level_2/fss_payload.h>
-#include <fll/level_2/path.h>
-#include <fll/level_2/print.h>
-#include <fll/level_2/program.h>
+#ifndef _controller_common_h
+#define _controller_common_h
#ifdef __cplusplus
extern "C" {
#define CONTROLLER_program_version_minor_s F_string_ascii_5_s
#define CONTROLLER_program_version_micro_s F_string_ascii_8_s
- #define CONTROLLER_program_version_major_s_length 1
- #define CONTROLLER_program_version_minor_s_length 1
- #define CONTROLLER_program_version_micro_s_length 1
+ #define CONTROLLER_program_version_major_s_length F_string_ascii_0_s_length
+ #define CONTROLLER_program_version_minor_s_length F_string_ascii_5_s_length
+ #define CONTROLLER_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef CONTROLLER_program_version_nano_prefix_s
+ #if !(defined(CONTROLLER_program_version_nano_prefix_s) && defined(CONTROLLER_program_version_nano_prefix_s_length))
#define CONTROLLER_program_version_nano_prefix_s
-
#define CONTROLLER_program_version_nano_prefix_s_length 0
- #endif
+ #endif // !(defined(CONTROLLER_program_version_nano_prefix_s) && defined(CONTROLLER_program_version_nano_prefix_s_length))
- #ifndef CONTROLLER_program_version_nano_s
+ #if !(defined(CONTROLLER_program_version_nano_s) && defined(CONTROLLER_program_version_nano_s_length))
#define CONTROLLER_program_version_nano_s
-
#define CONTROLLER_program_version_nano_s_length 0
- #endif
+ #endif // !(defined(CONTROLLER_program_version_nano_s) && defined(CONTROLLER_program_version_nano_s_length))
#define CONTROLLER_program_version_s CONTROLLER_program_version_major_s F_string_ascii_period_s CONTROLLER_program_version_minor_s F_string_ascii_period_s CONTROLLER_program_version_micro_s CONTROLLER_program_version_nano_prefix_s CONTROLLER_program_version_nano_s
- #define CONTROLLER_program_version_s_length CONTROLLER_program_version_major_s_length + F_string_ascii_period_s_length + CONTROLLER_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROLLER_program_version_nano_prefix_s_length + CONTROLLER_program_version_nano_s_length
+ #define CONTROLLER_program_version_s_length CONTROLLER_program_version_major_s_length + F_string_ascii_period_s_length + CONTROLLER_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROLLER_program_version_micro_s_length + CONTROLLER_program_version_nano_prefix_s_length + CONTROLLER_program_version_nano_s_length
extern const f_string_static_t controller_program_version_s;
#endif // _di_controller_program_version_
#define CONTROLLER_program_name_init_s "init"
#define CONTROLLER_program_name_init_long_s "Init Program"
- #define CONTROLLER_program_name_s_length 7
- #define CONTROLLER_program_name_long_s_length 15
+ #define CONTROLLER_program_name_s_length 10
+ #define CONTROLLER_program_name_long_s_length 18
#define CONTROLLER_program_name_init_s_length 4
#define CONTROLLER_program_name_init_long_s_length 12
#define CONTROLLER_path_pid_prefix_s_length _override_controller_path_pid_prefix_length_
#elif defined(_controller_as_init_)
#define CONTROLLER_path_pid_prefix_s "init-"
-
#define CONTROLLER_path_pid_prefix_s_length 5
#else
#define CONTROLLER_path_pid_prefix_s ""
-
#define CONTROLLER_path_pid_prefix_s_length 0
#endif // defined(_override_controller_name_pid_prefix_) && defined(_override_controller_name_pid_prefix_length_)
// The socket suffix path is a system-specific path part and needs to be more easily contolled at compile time.
#if defined(_override_controller_path_pid_suffix_) && defined(_override_controller_path_pid_suffix_length_)
#define CONTROLLER_path_pid_suffix_s _override_controller_path_pid_suffix_
-
#define CONTROLLER_path_pid_suffix_s_length _override_controller_path_pid_suffix_length_
#else
#define CONTROLLER_path_pid_suffix_s ".pid"
-
#define CONTROLLER_path_pid_suffix_s_length 4
#endif // defined(_override_controller_name_pid_suffix_) && defined(_override_controller_name_pid_suffix_length_)
// The socket path is a system-specific path and needs to be more easily contolled at compile time.
#if defined(_override_controller_path_socket_) && defined(_override_controller_path_socket_length_)
#define CONTROLLER_path_socket_s _override_controller_path_socket_
-
#define CONTROLLER_path_socket_s_length _override_controller_path_socket_length_
#else
#define CONTROLLER_path_socket_s "controller/run"
-
#define CONTROLLER_path_socket_s_length 14
#endif // defined(_override_controller_path_socket_) && defined(_override_controller_path_socket_length_)
#define CONTROLLER_path_socket_init_s_length _override_controller_path_socket_init_length_
#elif defined(_controller_as_init_)
#define CONTROLLER_path_socket_init_s "/var/run/init"
-
#define CONTROLLER_path_socket_init_s_length 13
#else
#define CONTROLLER_path_socket_init_s "/var/run/controller"
-
#define CONTROLLER_path_socket_init_s_length 19
#endif // defined(_override_controller_path_socket_init_) && defined(_override_controller_path_socket_init_length_)
#define CONTROLLER_path_socket_prefix_s_length _override_controller_path_socket_prefix_length_
#elif defined(_controller_as_init_)
#define CONTROLLER_path_socket_prefix_s "init-"
-
#define CONTROLLER_path_socket_prefix_s_length 5
#else
#define CONTROLLER_path_socket_prefix_s ""
-
#define CONTROLLER_path_socket_prefix_s_length 0
#endif // defined(_override_controller_path_socket_prefix_) && defined(_override_controller_path_socket_prefix_length_)
// The socket suffix path is a system-specific path part and needs to be more easily contolled at compile time.
#if defined(_override_controller_path_socket_suffix_) && defined(_override_controller_path_socket_suffix_length_)
#define CONTROLLER_path_socket_suffix_s _override_controller_path_socket_suffix_
-
#define CONTROLLER_path_socket_suffix_s_length _override_controller_path_socket_suffix_length_
#else
#define CONTROLLER_path_socket_suffix_s ".socket"
-
#define CONTROLLER_path_socket_suffix_s_length 7
#endif // defined(_override_controller_path_socket_suffix_) && defined(_override_controller_path_socket_suffix_length_)
#if defined(_override_controller_default_program_script_) && defined(_override_controller_default_program_script_length_)
#define CONTROLLER_default_program_script_s _override_controller_default_program_script_
-
#define CONTROLLER_default_program_script_s_length _override_controller_default_program_script_length_
#else
#define CONTROLLER_default_program_script_s "bash"
-
#define CONTROLLER_default_program_script_s_length 4
#endif // defined(_override_controller_default_program_script_) && defined(_override_controller_default_program_script_length_)
#endif // _di_controller_main_t_
/**
- * Print help.
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- */
-#ifndef _di_controller_print_help_
- extern f_status_t controller_print_help(controller_main_t * const main);
-#endif // _di_controller_print_help_
-
-/**
- * Execute main program.
- *
- * Be sure to call controller_main_delete() after executing this.
- *
- * If main.signal is non-zero, then this blocks and handles the following signals:
- * - F_signal_abort
- * - F_signal_broken_pipe
- * - F_signal_hangup
- * - F_signal_interrupt
- * - F_signal_quit
- * - F_signal_termination
- *
- * @param main
- * The main program data.
- * @param arguments
- * The parameters passed to the process.
- *
- * @return
- * F_none on success.
- * F_child if this is a child process returning.
- *
- * F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see controller_main_delete()
- */
-#ifndef _di_controller_main_
- extern f_status_t controller_main(controller_main_t * const main, const f_console_arguments_t *arguments);
-#endif // _di_controller_main_
-
-/**
* Deallocate main.
*
* Be sure to call this after executing controller_main().
} // extern "C"
#endif
-#endif // _controller_h
+#endif // _controller_common_h
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
#ifndef _di_controller_cache_delete_simple_
void controller_cache_delete_simple(controller_cache_t * const cache) {
- macro_f_array_lengths_t_delete_simple(cache->ats)
- macro_f_array_lengths_t_delete_simple(cache->stack)
+ f_type_array_lengths_resize(0, &cache->ats);
+ f_type_array_lengths_resize(0, &cache->stack);
macro_f_fss_delimits_t_delete_simple(cache->delimits)
f_string_dynamic_resize(0, &cache->buffer_file);
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
#define CONTROLLER_with_s "with"
#define CONTROLLER_yes_s "yes"
- #define controller_action_s_length 6
- #define controller_actions_s_length 7
- #define controller_affinity_s_length 8
- #define controller_as_s_length 2
- #define controller_asynchronous_s_length 12
- #define controller_bash_s_length 4
- #define controller_batch_s_length 5
- #define controller_capability_s_length 10
- #define controller_cgroup_s_length 6
- #define controller_create_s_length 6
- #define controller_command_s_length 7
- #define controller_consider_s_length 8
- #define controller_control_s_length 7
- #define controller_control_group_s_length 13
- #define controller_control_mode_s_length 12
- #define controller_control_user_s_length 12
- #define controller_core_s_length 4
- #define controller_cpu_s_length 3
- #define controller_data_s_length 4
- #define controller_deadline_s_length 8
- #define controller_default_s_length 7
- #define controller_define_s_length 6
- #define controller_delay_s_length 5
- #define controller_disable_s_length 7
- #define controller_entry_s_length 5
- #define controller_entries_s_length 7
- #define controller_environment_s_length 11
- #define controller_error_s_length 5
- #define controller_existing_s_length 8
- #define controller_execute_s_length 7
- #define controller_exit_s_length 4
- #define controller_exits_s_length 5
- #define controller_fail_s_length 4
- #define controller_failure_s_length 7
- #define controller_failsafe_s_length 8
- #define controller_fifo_s_length 4
- #define controller_freeze_s_length 6
- #define controller_fsize_s_length 5
- #define controller_full_path_s_length 9
- #define controller_group_s_length 5
- #define controller_groups_s_length 6
- #define controller_how_s_length 3
- #define controller_idle_s_length 4
- #define controller_init_s_length 4
- #define controller_item_s_length 4
- #define controller_kill_s_length 4
- #define controller_length_s_length 6
- #define controller_limit_s_length 5
- #define controller_locks_s_length 5
- #define controller_main_s_length 4
- #define controller_max_s_length 3
- #define controller_memlock_s_length 7
- #define controller_method_s_length 6
- #define controller_mode_s_length 4
- #define controller_msgqueue_s_length 8
- #define controller_name_s_length 4
- #define controller_need_s_length 4
- #define controller_new_s_length 3
- #define controller_nice_s_length 4
- #define controller_no_s_length 2
- #define controller_nofile_s_length 6
- #define controller_normal_s_length 6
- #define controller_nproc_s_length 5
- #define controller_on_s_length 2
- #define controller_optional_s_length 8
- #define controller_other_s_length 5
- #define controller_parameter_s_length 9
- #define controller_parameters_s_length 10
- #define controller_path_s_length 4
- #define controller_pause_s_length 5
- #define controller_payload_type_s_length 11
- #define controller_pid_s_length 3
- #define controller_pid_file_s_length 8
- #define controller_processor_s_length 9
- #define controller_program_s_length 7
- #define controller_ready_s_length 5
- #define controller_reload_s_length 6
- #define controller_require_s_length 7
- #define controller_required_s_length 8
- #define controller_rerun_s_length 5
- #define controller_reset_s_length 5
- #define controller_restart_s_length 7
- #define controller_resume_s_length 6
- #define controller_round_robin_s_length 11
- #define controller_rss_s_length 3
- #define controller_rtprio_s_length 6
- #define controller_rttime_s_length 6
- #define controller_rule_s_length 4
- #define controller_rules_s_length 5
- #define controller_same_s_length 4
- #define controller_scheduler_s_length 9
- #define controller_script_s_length 6
- #define controller_service_s_length 7
- #define controller_session_s_length 7
- #define controller_session_new_s_length 11
- #define controller_session_same_s_length 12
- #define controller_setting_s_length 7
- #define controller_show_s_length 4
- #define controller_sigpending_s_length 10
- #define controller_stack_s_length 5
- #define controller_start_s_length 5
- #define controller_status_s_length 6
- #define controller_stop_s_length 4
- #define controller_succeed_s_length 7
- #define controller_success_s_length 7
- #define controller_synchronous_s_length 11
- #define controller_thaw_s_length 4
- #define controller_timeout_s_length 7
- #define controller_type_s_length 4
- #define controller_use_s_length 3
- #define controller_user_s_length 4
- #define controller_utility_s_length 7
- #define controller_value_s_length 5
- #define controller_wait_s_length 4
- #define controller_want_s_length 4
- #define controller_wish_s_length 4
- #define controller_with_s_length 4
- #define controller_yes_s_length 3
+ #define CONTROLLER_action_s_length 6
+ #define CONTROLLER_actions_s_length 7
+ #define CONTROLLER_affinity_s_length 8
+ #define CONTROLLER_as_s_length 2
+ #define CONTROLLER_asynchronous_s_length 12
+ #define CONTROLLER_bash_s_length 4
+ #define CONTROLLER_batch_s_length 5
+ #define CONTROLLER_capability_s_length 10
+ #define CONTROLLER_cgroup_s_length 6
+ #define CONTROLLER_create_s_length 6
+ #define CONTROLLER_command_s_length 7
+ #define CONTROLLER_consider_s_length 8
+ #define CONTROLLER_control_s_length 7
+ #define CONTROLLER_control_group_s_length 13
+ #define CONTROLLER_control_mode_s_length 12
+ #define CONTROLLER_control_user_s_length 12
+ #define CONTROLLER_core_s_length 4
+ #define CONTROLLER_cpu_s_length 3
+ #define CONTROLLER_data_s_length 4
+ #define CONTROLLER_deadline_s_length 8
+ #define CONTROLLER_default_s_length 7
+ #define CONTROLLER_define_s_length 6
+ #define CONTROLLER_delay_s_length 5
+ #define CONTROLLER_disable_s_length 7
+ #define CONTROLLER_entry_s_length 5
+ #define CONTROLLER_entries_s_length 7
+ #define CONTROLLER_environment_s_length 11
+ #define CONTROLLER_error_s_length 5
+ #define CONTROLLER_existing_s_length 8
+ #define CONTROLLER_execute_s_length 7
+ #define CONTROLLER_exit_s_length 4
+ #define CONTROLLER_exits_s_length 5
+ #define CONTROLLER_fail_s_length 4
+ #define CONTROLLER_failure_s_length 7
+ #define CONTROLLER_failsafe_s_length 8
+ #define CONTROLLER_fifo_s_length 4
+ #define CONTROLLER_freeze_s_length 6
+ #define CONTROLLER_fsize_s_length 5
+ #define CONTROLLER_full_path_s_length 9
+ #define CONTROLLER_group_s_length 5
+ #define CONTROLLER_groups_s_length 6
+ #define CONTROLLER_how_s_length 3
+ #define CONTROLLER_idle_s_length 4
+ #define CONTROLLER_init_s_length 4
+ #define CONTROLLER_item_s_length 4
+ #define CONTROLLER_kill_s_length 4
+ #define CONTROLLER_length_s_length 6
+ #define CONTROLLER_limit_s_length 5
+ #define CONTROLLER_locks_s_length 5
+ #define CONTROLLER_main_s_length 4
+ #define CONTROLLER_max_s_length 3
+ #define CONTROLLER_memlock_s_length 7
+ #define CONTROLLER_method_s_length 6
+ #define CONTROLLER_mode_s_length 4
+ #define CONTROLLER_msgqueue_s_length 8
+ #define CONTROLLER_name_s_length 4
+ #define CONTROLLER_need_s_length 4
+ #define CONTROLLER_new_s_length 3
+ #define CONTROLLER_nice_s_length 4
+ #define CONTROLLER_no_s_length 2
+ #define CONTROLLER_nofile_s_length 6
+ #define CONTROLLER_normal_s_length 6
+ #define CONTROLLER_nproc_s_length 5
+ #define CONTROLLER_on_s_length 2
+ #define CONTROLLER_optional_s_length 8
+ #define CONTROLLER_other_s_length 5
+ #define CONTROLLER_parameter_s_length 9
+ #define CONTROLLER_parameters_s_length 10
+ #define CONTROLLER_path_s_length 4
+ #define CONTROLLER_pause_s_length 5
+ #define CONTROLLER_payload_type_s_length 11
+ #define CONTROLLER_pid_s_length 3
+ #define CONTROLLER_pid_file_s_length 8
+ #define CONTROLLER_processor_s_length 9
+ #define CONTROLLER_program_s_length 7
+ #define CONTROLLER_ready_s_length 5
+ #define CONTROLLER_reload_s_length 6
+ #define CONTROLLER_require_s_length 7
+ #define CONTROLLER_required_s_length 8
+ #define CONTROLLER_rerun_s_length 5
+ #define CONTROLLER_reset_s_length 5
+ #define CONTROLLER_restart_s_length 7
+ #define CONTROLLER_resume_s_length 6
+ #define CONTROLLER_round_robin_s_length 11
+ #define CONTROLLER_rss_s_length 3
+ #define CONTROLLER_rtprio_s_length 6
+ #define CONTROLLER_rttime_s_length 6
+ #define CONTROLLER_rule_s_length 4
+ #define CONTROLLER_rules_s_length 5
+ #define CONTROLLER_same_s_length 4
+ #define CONTROLLER_scheduler_s_length 9
+ #define CONTROLLER_script_s_length 6
+ #define CONTROLLER_service_s_length 7
+ #define CONTROLLER_session_s_length 7
+ #define CONTROLLER_session_new_s_length 11
+ #define CONTROLLER_session_same_s_length 12
+ #define CONTROLLER_setting_s_length 7
+ #define CONTROLLER_show_s_length 4
+ #define CONTROLLER_sigpending_s_length 10
+ #define CONTROLLER_stack_s_length 5
+ #define CONTROLLER_start_s_length 5
+ #define CONTROLLER_status_s_length 6
+ #define CONTROLLER_stop_s_length 4
+ #define CONTROLLER_succeed_s_length 7
+ #define CONTROLLER_success_s_length 7
+ #define CONTROLLER_synchronous_s_length 11
+ #define CONTROLLER_thaw_s_length 4
+ #define CONTROLLER_timeout_s_length 7
+ #define CONTROLLER_type_s_length 4
+ #define CONTROLLER_use_s_length 3
+ #define CONTROLLER_user_s_length 4
+ #define CONTROLLER_utility_s_length 7
+ #define CONTROLLER_value_s_length 5
+ #define CONTROLLER_wait_s_length 4
+ #define CONTROLLER_want_s_length 4
+ #define CONTROLLER_wish_s_length 4
+ #define CONTROLLER_with_s_length 4
+ #define CONTROLLER_yes_s_length 3
extern const f_string_static_t controller_action_s;
extern const f_string_static_t controller_actions_s;
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
f_string_dynamics_resize(0, &process->path_pids);
- macro_f_array_lengths_t_delete_simple(process->stack)
+ f_type_array_lengths_resize(0, &process->stack);
}
#endif // _di_controller_process_delete_simple_
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_controller_rule_action_t_
+ const f_string_static_t controller_rule_action_method_string_extended_s = macro_f_string_static_t_initialize2(CONTROLLER_rule_action_method_string_extended_s, 0, CONTROLLER_rule_action_method_string_extended_s_length);
+ const f_string_static_t controller_rule_action_method_string_extended_list_s = macro_f_string_static_t_initialize2(CONTROLLER_rule_action_method_string_extended_list_s, 0, CONTROLLER_rule_action_method_string_extended_list_s_length);
+#endif // _di_controller_rule_action_t_
+
#ifndef _di_controller_rule_action_delete_simple_
void controller_rule_action_delete_simple(controller_rule_action_t * const action) {
* parameters: All parameters associated with the Rule Action.
*/
#ifndef _di_controller_rule_action_t_
- #define controller_rule_action_method_string_extended_s "FSS-0001 (Extended)"
- #define controller_rule_action_method_string_extended_list_s "FSS-0003 (Extended List)"
+ #define CONTROLLER_rule_action_method_string_extended_s "FSS-0001 (Extended)"
+ #define CONTROLLER_rule_action_method_string_extended_list_s "FSS-0003 (Extended List)"
- #define controller_rule_action_method_string_extended_s_length 19
- #define controller_rule_action_method_string_extended_list_s_length 24
+ #define CONTROLLER_rule_action_method_string_extended_s_length 19
+ #define CONTROLLER_rule_action_method_string_extended_list_s_length 24
+
+ extern const f_string_static_t controller_rule_action_method_string_extended_s;
+ extern const f_string_static_t controller_rule_action_method_string_extended_list_s;
enum {
controller_rule_action_method_extended_e = 1,
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "private-common.h"
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "private-control.h"
#include "../controller/private-controller_print.h"
f_status_t status2 = F_none;
- const f_string_static_t object_header = macro_f_string_static_t_initialize(f_fss_string_header_s, F_fss_string_header_s_length);
- const f_string_static_t object_type = macro_f_string_static_t_initialize(controller_type_s, controller_type_s_length);
- const f_string_static_t object_status = macro_f_string_static_t_initialize(controller_status_s, controller_status_s_length);
- const f_string_static_t object_length = macro_f_string_static_t_initialize(controller_length_s, controller_length_s_length);
const f_state_t state = f_state_t_initialize;
const f_conversion_data_t data_conversion = macro_f_conversion_data_t_initialize(10, 0, 1);
if (type.used) {
contents[0] = type;
- status2 = fll_fss_extended_write_string(object_type, content, 0, state, &control->cache_1);
+ status2 = fll_fss_extended_write_string(controller_type_s, content, 0, state, &control->cache_1);
if (F_status_is_error(status2)) return status2;
}
if (status.used) {
contents[0] = status;
- status2 = fll_fss_extended_write_string(object_status, content, 0, state, &control->cache_1);
+ status2 = fll_fss_extended_write_string(controller_status_s, content, 0, state, &control->cache_1);
if (F_status_is_error(status2)) return status2;
control->cache_2.used = 0;
contents[0] = control->cache_2;
- status2 = fll_fss_extended_write_string(object_length, content, 0, state, &control->cache_1);
+ status2 = fll_fss_extended_write_string(controller_length_s, content, 0, state, &control->cache_1);
if (F_status_is_error(status2)) return status2;
// Prepend the identifier comment to the output.
- status2 = f_string_append(controller_payload_type_s, controller_payload_type_s_length, &control->output);
+ status2 = f_string_dynamic_append(controller_payload_type_s, &control->output);
if (F_status_is_error(status2)) return status2;
// Append entire header block to the output.
- status2 = fll_fss_payload_write_string(object_header, control->cache_1, F_false, 0, state, &control->output);
+ status2 = fll_fss_payload_write_string(f_fss_string_header_s, control->cache_1, F_false, 0, state, &control->output);
if (F_status_is_error(status2)) return status2;
return F_none;
f_status_t controller_control_respond_error(const controller_global_t *global, controller_control_t * const control, const f_status_t status, const f_string_static_t message) {
f_status_t status2 = F_none;
- const f_state_t state = f_state_t_initialize;
control->output.used = 0;
control->cache_3.used = 0;
if (F_status_is_error(status2)) return status2;
}
- {
- const f_string_static_t content_error = macro_f_string_static_t_initialize(controller_error_s, controller_error_s_length);
-
- status2 = controller_control_respond_build_header(global, control, content_error, control->cache_3, message.used);
- if (F_status_is_error(status2)) return status2;
- }
+ status2 = controller_control_respond_build_header(global, control, controller_error_s, control->cache_3, message.used);
+ if (F_status_is_error(status2)) return status2;
{
- const f_string_static_t object_payload = macro_f_string_static_t_initialize(f_fss_string_payload_s, F_fss_string_payload_s_length);
+ const f_state_t state = f_state_t_initialize;
- status2 = fll_fss_payload_write_string(object_payload, message, F_false, 0, state, &control->output);
+ status2 = fll_fss_payload_write_string(f_fss_string_payload_s, message, F_false, 0, state, &control->output);
if (F_status_is_error(status2)) return status2;
}
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "private-control.h"
#include "../lock/private-lock_print.h"
#include "controller.h"
-#include "../common/private-common.h"
-#include "../control/private-control.h"
-#include "private-controller.h"
-#include "private-controller_print.h"
-#include "../entry/private-entry.h"
-#include "../lock/private-lock_print.h"
-#include "../rule/private-rule.h"
-#include "../thread/private-thread.h"
+#include "common/private-common.h"
+#include "control/private-control.h"
+#include "controller/private-controller.h"
+#include "controller/private-controller_print.h"
+#include "entry/private-entry.h"
+#include "lock/private-lock_print.h"
+#include "rule/private-rule.h"
+#include "thread/private-thread.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_controller_program_version_
- const f_string_static_t controller_program_version_s = macro_f_string_static_t_initialize2(CONTROLLER_program_version_s, 0, CONTROLLER_program_version_s_length);
-#endif // _di_controller_program_version_
-
-#ifndef _di_controller_program_name_
- const f_string_static_t controller_program_name_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_s, 0, CONTROLLER_program_name_s_length);
- const f_string_static_t controller_program_name_long_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_long_s, 0, CONTROLLER_program_name_long_s_length);
-
- const f_string_static_t controller_program_name_init_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_init_s, 0, CONTROLLER_program_name_init_s_length);
- const f_string_static_t controller_program_name_init_long_s = macro_f_string_static_t_initialize2(CONTROLLER_program_name_init_long_s, 0, CONTROLLER_program_name_init_long_s_length);
-#endif // _di_controller_program_name_
-
-#ifndef _di_controller_defines_
- const f_string_static_t controller_default_program_script_s = macro_f_string_static_t_initialize2(CONTROLLER_default_program_script_s, 0, CONTROLLER_default_program_script_s_length);
- const f_string_static_t controller_path_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_s, 0, CONTROLLER_path_pid_s_length);
- const f_string_static_t controller_path_pid_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_init_s, 0, CONTROLLER_path_pid_init_s_length);
- const f_string_static_t controller_path_pid_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_prefix_s, 0, CONTROLLER_path_pid_prefix_s_length);
- const f_string_static_t controller_path_pid_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_pid_suffix_s, 0, CONTROLLER_path_pid_suffix_s_length);
- const f_string_static_t controller_path_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_path_settings_s, 0, CONTROLLER_path_settings_s_length);
- const f_string_static_t controller_path_settings_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_settings_init_s, 0, CONTROLLER_path_settings_init_s_length);
- const f_string_static_t controller_path_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_s, 0, CONTROLLER_path_socket_s_length);
- const f_string_static_t controller_path_socket_init_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_init_s, 0, CONTROLLER_path_socket_s_length);
- const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length);
- const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize2(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length);
-
- const f_string_static_t controller_short_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_short_cgroup_s, 0, CONTROLLER_short_cgroup_s_length);
- const f_string_static_t controller_short_daemon_s = macro_f_string_static_t_initialize2(CONTROLLER_short_daemon_s, 0, CONTROLLER_short_daemon_s_length);
- const f_string_static_t controller_short_init_s = macro_f_string_static_t_initialize2(CONTROLLER_short_init_s, 0, CONTROLLER_short_init_s_length);
- const f_string_static_t controller_short_interruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_short_interruptible_s, 0, CONTROLLER_short_interruptible_s_length);
- const f_string_static_t controller_short_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_short_pid_s, 0, CONTROLLER_short_pid_s_length);
- const f_string_static_t controller_short_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_short_settings_s, 0, CONTROLLER_short_settings_s_length);
- const f_string_static_t controller_short_simulate_s = macro_f_string_static_t_initialize2(CONTROLLER_short_simulate_s, 0, CONTROLLER_short_simulate_s_length);
- const f_string_static_t controller_short_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_short_socket_s, 0, CONTROLLER_short_socket_s_length);
- const f_string_static_t controller_short_uninterruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_short_uninterruptible_s, 0, CONTROLLER_short_uninterruptible_s_length);
- const f_string_static_t controller_short_validate_s = macro_f_string_static_t_initialize2(CONTROLLER_short_validate_s, 0, CONTROLLER_short_validate_s_length);
-
- const f_string_static_t controller_long_cgroup_s = macro_f_string_static_t_initialize2(CONTROLLER_long_cgroup_s, 0, CONTROLLER_long_cgroup_s_length);
- const f_string_static_t controller_long_daemon_s = macro_f_string_static_t_initialize2(CONTROLLER_long_daemon_s, 0, CONTROLLER_long_daemon_s_length);
- const f_string_static_t controller_long_init_s = macro_f_string_static_t_initialize2(CONTROLLER_long_init_s, 0, CONTROLLER_long_init_s_length);
- const f_string_static_t controller_long_interruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_long_interruptible_s, 0, CONTROLLER_long_interruptible_s_length);
- const f_string_static_t controller_long_pid_s = macro_f_string_static_t_initialize2(CONTROLLER_long_pid_s, 0, CONTROLLER_long_pid_s_length);
- const f_string_static_t controller_long_settings_s = macro_f_string_static_t_initialize2(CONTROLLER_long_settings_s, 0, CONTROLLER_long_settings_s_length);
- const f_string_static_t controller_long_simulate_s = macro_f_string_static_t_initialize2(CONTROLLER_long_simulate_s, 0, CONTROLLER_long_simulate_s_length);
- const f_string_static_t controller_long_socket_s = macro_f_string_static_t_initialize2(CONTROLLER_long_socket_s, 0, CONTROLLER_long_socket_s_length);
- const f_string_static_t controller_long_uninterruptible_s = macro_f_string_static_t_initialize2(CONTROLLER_long_uninterruptible_s, 0, CONTROLLER_long_uninterruptible_s_length);
- const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize2(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length);
-#endif // _di_controller_defines_
-
#ifndef _di_controller_print_help_
f_status_t controller_print_help(controller_main_t * const main) {
controller_lock_print(main->output.to, 0);
- fll_program_print_help_header(main->output.to, main->context, main->program_name_long->string, controller_program_version_s.string);
+ fll_program_print_help_header(main->output.to, main->context, *main->program_name_long, controller_program_version_s);
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not main->output.to in color.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity beyond normal main->output.to.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal main->output.to.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal main->output.to.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, inceasing verbosity beyond normal main->output.to.");
- fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not main->output.to in color.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal main->output.to.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal main->output.to.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal main->output.to.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal main->output.to.");
+ fll_program_print_help_option(main->output.to, main->context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, main->output.to.stream);
- fll_program_print_help_option(main->output.to, main->context, controller_short_cgroup_s.string, controller_long_cgroup_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a custom control group file path, such as '" F_control_group_path_system_prefix_s F_control_group_path_system_default_s "'.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_daemon_s.string, controller_long_daemon_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Run in daemon only mode (do not process the entry).");
- fll_program_print_help_option(main->output.to, main->context, controller_short_init_s.string, controller_long_init_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The program will run as an init replacement.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_interruptible_s.string, controller_long_interruptible_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate that this program can be interrupted by a signal.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_pid_s.string, controller_long_pid_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a custom pid file path, such as '" CONTROLLER_path_pid_s CONTROLLER_default_s CONTROLLER_path_pid_suffix_s "'.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_settings_s.string, controller_long_settings_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a custom settings path, such as '" CONTROLLER_path_settings_s "'.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_simulate_s.string, controller_long_simulate_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Run as a simulation.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_socket_s.string, controller_long_socket_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a custom socket file path, such as '" CONTROLLER_path_socket_s CONTROLLER_default_s CONTROLLER_path_socket_suffix_s "'.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_uninterruptible_s.string, controller_long_uninterruptible_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Designate that this program cannot be interrupted by a signal.");
- fll_program_print_help_option(main->output.to, main->context, controller_short_validate_s.string, controller_long_validate_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Validate the settings (entry and rules) without running (does not simulate).");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_cgroup_s, controller_long_cgroup_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom control group file path, such as '" F_control_group_path_system_prefix_s F_control_group_path_system_default_s "'.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_daemon_s, controller_long_daemon_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run in daemon only mode (do not process the entry).");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_init_s, controller_long_init_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The program will run as an init replacement.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_interruptible_s, controller_long_interruptible_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate that this program can be interrupted by a signal.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_pid_s, controller_long_pid_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom pid file path, such as '" CONTROLLER_path_pid_s CONTROLLER_default_s CONTROLLER_path_pid_suffix_s "'.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_settings_s, controller_long_settings_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom settings path, such as '" CONTROLLER_path_settings_s "'.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_simulate_s, controller_long_simulate_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run as a simulation.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_socket_s, controller_long_socket_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom socket file path, such as '" CONTROLLER_path_socket_s CONTROLLER_default_s CONTROLLER_path_socket_suffix_s "'.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_uninterruptible_s, controller_long_uninterruptible_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Designate that this program cannot be interrupted by a signal.");
+ fll_program_print_help_option(main->output.to, main->context, controller_short_validate_s, controller_long_validate_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Validate the settings (entry and rules) without running (does not simulate).");
- fll_program_print_help_usage(main->output.to, main->context, main->program_name->string, "entry");
+ fll_program_print_help_usage(main->output.to, main->context, *main->program_name, controller_entry_s);
fl_print_format(" When both the %[%q%q%] parameter and the", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_simulate_s, main->context.set.notable);
fl_print_format(" %[%q%q%] parameter are specified, then additional information on each would be executed rule is printed but no simulation is performed.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_validate_s, main->context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The default interrupt behavior is to operate as if the %[%q%q%] parameter is passed.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, main->setting_default.used ? controller_long_uninterruptible_s : controller_long_interruptible_s, main->context.set.notable, f_string_eol_s, f_string_eol_s);
+ #ifdef _controller_as_init_
+ const f_string_static_t interruptable = controller_long_uninterruptible_s;
+ #else
+ const f_string_static_t interruptable = controller_long_interruptible_s;
+ #endif // _controller_as_init_
+
+ fl_print_format(" The default interrupt behavior is to operate as if the %[%q%q%] parameter is passed.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, interruptable, main->context.set.notable, f_string_eol_s, f_string_eol_s);
fl_print_format(" Specify an empty string for the %[%q%q%] parameter to disable pid file creation for this program.%q%q", main->output.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_pid_s, main->context.set.notable, f_string_eol_s, f_string_eol_s);
if (main->parameters[controller_parameter_version_e].result == f_console_result_found_e) {
controller_lock_print(main->output.to, 0);
- fll_program_print_version(main->output.to, controller_program_version_s.string);
+ fll_program_print_version(main->output.to, controller_program_version_s);
controller_unlock_print_flush(main->output.to, 0);
memset(&address, 0, setting.control_socket.length);
if (main->remaining.used) {
- status = f_string_append_nulless(arguments->argv[main->remaining.array[0]], strnlen(arguments->argv[main->remaining.array[0]], f_console_parameter_size), &setting.name_entry);
+ status = f_string_append_nulless(arguments->argv[main->remaining.array[0]], strnlen(arguments->argv[main->remaining.array[0]], F_console_parameter_size_d), &setting.name_entry);
}
else {
- status = f_string_append_nulless(controller_default_s, controller_default_s_length, &setting.name_entry);
+ status = f_string_dynamic_append_nulless(controller_default_s, &setting.name_entry);
}
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), main->remaining.used ? "f_string_append_nulless" : "f_string_dynamic_append_nulless", F_true);
controller_main_delete(main);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, 0);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_settings_s, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->parameters[controller_parameter_init_e].result == f_console_result_found_e && !main->as_init) {
status = f_string_dynamic_append(controller_path_settings_init_s, &setting.path_setting);
}
- else if (main->setting_default->used) {
- status = f_string_dynamic_append(*main->setting_default, &setting.path_setting);
+ else if (main->default_path_setting->used) {
+ status = f_string_dynamic_append(*main->default_path_setting, &setting.path_setting);
}
else {
status = f_string_dynamic_append(controller_path_settings_s, &setting.path_setting);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, 0);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_pid_s, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
else if (main->parameters[controller_parameter_pid_e].locations.used) {
const f_array_length_t location = main->parameters[controller_parameter_pid_e].values.array[main->parameters[controller_parameter_pid_e].values.used - 1];
- if (strnlen(arguments->argv[location], f_console_parameter_size)) {
+ if (strnlen(arguments->argv[location], F_console_parameter_size_d)) {
status = fll_path_canonical(arguments->argv[location], &setting.path_pid);
if (F_status_is_error(status)) {
status = f_string_dynamic_append(controller_path_pid_init_s, &setting.path_pid);
}
else {
- status = f_string_dynamic_append(main->default_path_pid, &setting.path_pid);
+ status = f_string_dynamic_append(*main->default_path_pid, &setting.path_pid);
}
if (F_status_is_error_not(status)) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, 0);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_cgroup_s, main->context.set.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
else if (main->parameters[controller_parameter_cgroup_e].locations.used) {
const f_array_length_t location = main->parameters[controller_parameter_cgroup_e].values.array[main->parameters[controller_parameter_cgroup_e].values.used - 1];
- if (strnlen(arguments->argv[location], f_console_parameter_size)) {
+ if (strnlen(arguments->argv[location], F_console_parameter_size_d)) {
status = fll_path_canonical(arguments->argv[location], &setting.path_cgroup);
if (F_status_is_error(status)) {
if (main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(main->warning.to, 0);
- fl_print_format("%q%[%SThe parameter '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
+ fl_print_format("%q%[%QThe parameter '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
fl_print_format("%[%q%q%]", main->warning.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_cgroup_s, main->context.set.notable);
fl_print_format("%[' must be a file directory path but instead is an empty string, falling back to the default.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, 0);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[' must not be specified with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%q%q%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_daemon_s, main->context.set.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_set_fine(status_delete) == F_number_not) {
controller_lock_print(main->warning.to, 0);
- fl_print_format("%q%[%SThe pid file '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
+ fl_print_format("%q%[%QThe pid file '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, setting.path_pid, main->warning.notable);
fl_print_format("%[' must not be specified with the parameter '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%i%]", main->warning.to.stream, main->warning.notable, main->pid, main->warning.notable);
}
#endif // _di_controller_main_
-#ifndef _di_controller_main_delete_
- f_status_t controller_main_delete(controller_main_t * const main) {
-
- for (f_array_length_t i = 0; i < controller_total_parameters_d; ++i) {
-
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
- } // for
-
- macro_f_array_lengths_t_delete_simple(main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_controller_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * This is the Controller program.
+ *
+ * This program utilizes the Featureless Linux Library.
+ * This program provides system service management, much like sysvcontroller and controllerng.
+ * This program can be controlled from user-space via the "control" program.
+ * This program can be used in an initrd and should be capable of pivot root operations.
+ *
+ * @todo Implement "exit" files that are the opposite of "entry" files whereas rules specified within are all called via the "stop" action type.
+ * This would then allow for switching modes.
+ * The "exit" would be specified in the "entry", by name and would be found under "exits" directory alongside the "entries" directory.
+ *
+ * @todo check the return status of unlocks.
+ *
+ * @todo the read/write locks (and unlocks) needs to be more robust in that they need to attempt to keep going even on failure or need to wait until resolvable.
+ * this is done to help ensure that the controller program always continues onward.
+ *
+ * @todo just like with the read/write locks, the out of memory cases need to be handled to keep going instead of bailing.
+ * likely these will need to be sleeps on the premise that eventually memory will clear itself up.
+ */
+#ifndef _controller_h
+#define _controller_h
+
+// Include pre-requirements.
+#define _GNU_SOURCE
+
+// Libc includes.
+#include <sched.h>
+#include <string.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <linux/sched.h>
+#include <unistd.h>
+
+// FLL-0 includes.
+#include <fll/level_0/type.h>
+#include <fll/level_0/status.h>
+#include <fll/level_0/memory.h>
+#include <fll/level_0/type_array.h>
+#include <fll/level_0/string.h>
+#include <fll/level_0/utf.h>
+#include <fll/level_0/account.h>
+#include <fll/level_0/capability.h>
+#include <fll/level_0/color.h>
+#include <fll/level_0/console.h>
+#include <fll/level_0/control_group.h>
+#include <fll/level_0/directory.h>
+#include <fll/level_0/environment.h>
+#include <fll/level_0/execute.h>
+#include <fll/level_0/file.h>
+#include <fll/level_0/fss.h>
+#include <fll/level_0/path.h>
+#include <fll/level_0/pipe.h>
+#include <fll/level_0/print.h>
+#include <fll/level_0/signal.h>
+#include <fll/level_0/socket.h>
+
+// FLL-1 includes.
+#include <fll/level_1/console.h>
+#include <fll/level_1/control_group.h>
+#include <fll/level_1/environment.h>
+#include <fll/level_1/fss.h>
+#include <fll/level_1/print.h>
+#include <fll/level_1/string.h>
+
+// FLL-2 includes.
+#include <fll/level_2/control_group.h>
+#include <fll/level_2/error.h>
+#include <fll/level_2/execute.h>
+#include <fll/level_2/fss.h>
+#include <fll/level_2/fss_basic_list.h>
+#include <fll/level_2/fss_extended.h>
+#include <fll/level_2/fss_extended_list.h>
+#include <fll/level_2/fss_payload.h>
+#include <fll/level_2/path.h>
+#include <fll/level_2/print.h>
+#include <fll/level_2/program.h>
+
+// Controller includes.
+#include <program/controller/common.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print help.
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * @see controller_main()
+ */
+#ifndef _di_controller_print_help_
+ extern f_status_t controller_print_help(controller_main_t * const main);
+#endif // _di_controller_print_help_
+
+/**
+ * Execute main program.
+ *
+ * Be sure to call controller_main_delete() after executing this.
+ *
+ * If main.signal is non-zero, then this blocks and handles the following signals:
+ * - F_signal_abort
+ * - F_signal_broken_pipe
+ * - F_signal_hangup
+ * - F_signal_interrupt
+ * - F_signal_quit
+ * - F_signal_termination
+ *
+ * @param main
+ * The main program data.
+ * @param arguments
+ * The parameters passed to the process.
+ *
+ * @return
+ * F_none on success.
+ * F_child if this is a child process returning.
+ *
+ * F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see controller_main_delete()
+ */
+#ifndef _di_controller_main_
+ extern f_status_t controller_main(controller_main_t * const main, const f_console_arguments_t *arguments);
+#endif // _di_controller_main_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_h
-#include "controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "private-controller.h"
#include "private-controller_print.h"
#endif // _di_controller_string_dynamic_partial_append_terminated_
#ifndef _di_controller_file_load_
- f_status_t controller_file_load(const controller_global_t global, const bool required, const f_string_t path_prefix, const f_string_static_t path_name, const f_string_t path_suffix, const f_array_length_t path_prefix_length, const f_array_length_t path_suffix_length, controller_cache_t * const cache) {
+ f_status_t controller_file_load(const controller_global_t global, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix, controller_cache_t * const cache) {
f_status_t status = F_none;
f_file_t file = f_file_t_initialize;
macro_f_time_spec_t_clear(cache->timestamp);
- status = f_string_append(path_prefix, path_prefix_length, &cache->action.name_file);
+ status = f_string_dynamic_append(path_prefix, &cache->action.name_file);
if (F_status_is_error_not(status)) {
- status = f_string_append(f_path_separator_s, F_path_separator_s_length, &cache->action.name_file);
+ status = f_string_dynamic_append(f_path_separator_s, &cache->action.name_file);
}
if (F_status_is_error_not(status)) {
- status = f_string_append(path_name.string, path_name.used, &cache->action.name_file);
+ status = f_string_dynamic_append(path_name, &cache->action.name_file);
}
if (F_status_is_error_not(status)) {
- status = f_string_append(F_path_extension_separator_s, F_path_extension_separator_s_length, &cache->action.name_file);
+ status = f_string_dynamic_append(f_path_extension_separator_s, &cache->action.name_file);
}
if (F_status_is_error_not(status)) {
- status = f_string_append(path_suffix, path_suffix_length, &cache->action.name_file);
+ status = f_string_dynamic_append(path_suffix, &cache->action.name_file);
}
if (F_status_is_error(status)) {
- if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_append", F_true);
- }
+ controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
return status;
}
status = f_string_dynamic_terminate_after(&cache->action.name_file);
if (F_status_is_error(status)) {
- if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
+ controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
return status;
}
status = f_directory_exists(path_directory.string);
}
- macro_f_string_dynamic_t_delete_simple(path_directory)
+ f_string_dynamic_resize(0, &path_directory);
if (F_status_is_error(status)) return status;
file.flag = F_file_flag_write_only_d;
- status = f_file_stream_open(path.string, f_file_open_mode_truncate_s, &file);
+ status = f_file_stream_open(path.string, f_file_open_mode_truncate_s.string, &file);
if (F_status_is_error(status)) return status;
fll_print_format("%i%q", file.stream, pid, f_string_eol_s);
f_status_t status = F_none;
f_file_t pid_file = f_file_t_initialize;
- status = f_file_stream_open(path.string, f_file_open_mode_read_s, &pid_file);
+ status = f_file_stream_open(path.string, f_file_open_mode_read_s.string, &pid_file);
if (F_status_is_error(status)) return status;
f_string_dynamic_t pid_buffer = f_string_dynamic_t_initialize;
}
}
- macro_f_string_dynamic_t_delete_simple(pid_buffer);
+ f_string_dynamic_resize(0, &pid_buffer);
return status;
}
f_file_t pid_file = f_file_t_initialize;
- status = f_file_stream_open(path.string, f_file_open_mode_read_s, &pid_file);
+ status = f_file_stream_open(path.string, f_file_open_mode_read_s.string, &pid_file);
if (F_status_is_error(status)) return status;
f_string_dynamic_t pid_buffer = f_string_dynamic_t_initialize;
}
}
- macro_f_string_dynamic_t_delete_simple(pid_buffer);
+ f_string_dynamic_resize(0, &pid_buffer);
return status;
}
return status;
}
- else if (number > F_type_size_32_unsigned_d) {
+
+ if (number > F_type_size_32_unsigned_d) {
return F_status_set_error(F_number_too_large);
}
return status;
}
- else if (number > F_type_size_32_unsigned_d) {
+
+ if (number > F_type_size_32_unsigned_d) {
return F_status_set_error(F_number_too_large);
}
controller_lock_print(global->main->warning.to, global->thread);
if (F_status_set_fine(status) == F_read_only) {
- fl_print_format("%q%[%SThe pid file '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
+ fl_print_format("%q%[%QThe pid file '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
fl_print_format("%[%Q%]", global->main->warning.to.stream, global->main->warning.notable, global->setting->path_pid, global->main->warning.notable);
fl_print_format("%[' could not be written because the destination is read only.%]%q", global->main->warning.to.stream, global->main->warning.context, global->main->warning.context, f_string_eol_s);
}
if (global->main->output.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%[%SControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
+ fl_print_format("%q%[%QControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable);
fl_print_format("' .%q", global->main->output.to.stream, f_string_eol_s);
fl_print_format("%[' cannot be found while read only mode is enabled and so the Control socket is unavailable.%]%q", global->main->output.to.stream, global->main->warning.context, global->main->warning.context, f_string_eol_s);
if (global->main->output.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%[%SControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
+ fl_print_format("%q%[%QControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable);
fl_print_format("%[' could not be created, code %]", global->main->output.to.stream, global->main->warning.context, global->main->warning.context);
fl_print_format("%[%ui%]", global->main->output.to.stream, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable);
if (global->main->output.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%[%SControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
+ fl_print_format("%q%[%QControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable);
fl_print_format("%[' could not be bound, code %]", global->main->output.to.stream, global->main->warning.context, global->main->warning.context);
fl_print_format("%[%ui%]", global->main->output.to.stream, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable);
if (global->main->output.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%[%SControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
+ fl_print_format("%q%[%QControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable);
fl_print_format("%[' failed to set file roles, code %]", global->main->output.to.stream, global->main->warning.context, global->main->warning.context);
fl_print_format("%[%ui%]", global->main->output.to.stream, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable);
if (global->main->output.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%[%SControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
+ fl_print_format("%q%[%QControl socket '%]", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.notable, global->setting->path_control, global->main->context.set.notable);
fl_print_format("%[' failed to set file mode, code %]", global->main->output.to.stream, global->main->warning.context, global->main->warning.context);
fl_print_format("%[%ui%]", global->main->output.to.stream, global->main->context.set.notable, F_status_set_fine(status), global->main->context.set.notable);
* The path name, such as 'default' from '/etc/controller/entries/default.entry'.
* @param path_suffix
* The path suffix, such as 'entry' from '/etc/controller/entries/default.entry'.
- * @param path_prefix_length
- * The length of the prefix path.
- * @param path_suffix_length
- * The length of the suffix path.
* @param cache
* The following within the cache is updated:
* - name_file: The partial path of the file is inserted.
* @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_file_load_
- extern f_status_t controller_file_load(const controller_global_t global, const bool required, const f_string_t path_prefix, const f_string_static_t path_name, const f_string_t path_suffix, const f_array_length_t path_prefix_length, const f_array_length_t path_suffix_length, controller_cache_t * const cache) F_attribute_visibility_internal_d;
+ extern f_status_t controller_file_load(const controller_global_t global, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix, controller_cache_t * const cache) F_attribute_visibility_internal_d;
#endif // _di_controller_file_load_
/**
-#include "controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "private-controller_print.h"
#include "../lock/private-lock_print.h"
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "../controller/private-controller_print.h"
switch (type) {
case controller_entry_action_type_consider_e:
- buffer.string = controller_consider_s;
- buffer.used = controller_consider_s_length;
+ buffer = controller_consider_s;
break;
case controller_entry_action_type_execute_e:
- buffer.string = controller_execute_s;
- buffer.used = controller_execute_s_length;
+ buffer = controller_execute_s;
break;
case controller_entry_action_type_failsafe_e:
- buffer.string = controller_failsafe_s;
- buffer.used = controller_failsafe_s_length;
+ buffer = controller_failsafe_s;
break;
case controller_entry_action_type_freeze_e:
- buffer.string = controller_freeze_s;
- buffer.used = controller_freeze_s_length;
+ buffer = controller_freeze_s;
break;
case controller_entry_action_type_item_e:
- buffer.string = controller_item_s;
- buffer.used = controller_item_s_length;
+ buffer = controller_item_s;
break;
case controller_entry_action_type_kill_e:
- buffer.string = controller_kill_s;
- buffer.used = controller_kill_s_length;
+ buffer = controller_kill_s;
break;
case controller_entry_action_type_pause_e:
- buffer.string = controller_pause_s;
- buffer.used = controller_pause_s_length;
+ buffer = controller_pause_s;
break;
case controller_entry_action_type_ready_e:
- buffer.string = controller_ready_s;
- buffer.used = controller_ready_s_length;
+ buffer = controller_ready_s;
break;
case controller_entry_action_type_reload_e:
- buffer.string = controller_reload_s;
- buffer.used = controller_reload_s_length;
+ buffer = controller_reload_s;
break;
case controller_entry_action_type_restart_e:
- buffer.string = controller_restart_s;
- buffer.used = controller_restart_s_length;
+ buffer = controller_restart_s;
break;
case controller_entry_action_type_resume_e:
- buffer.string = controller_resume_s;
- buffer.used = controller_resume_s_length;
+ buffer = controller_resume_s;
break;
case controller_entry_action_type_start_e:
- buffer.string = controller_start_s;
- buffer.used = controller_start_s_length;
+ buffer = controller_start_s;
break;
case controller_entry_action_type_stop_e:
- buffer.string = controller_stop_s;
- buffer.used = controller_stop_s_length;
+ buffer = controller_stop_s;
break;
case controller_entry_action_type_thaw_e:
- buffer.string = controller_thaw_s;
- buffer.used = controller_thaw_s_length;
+ buffer = controller_thaw_s;
break;
case controller_entry_action_type_timeout_e:
- buffer.string = controller_timeout_s;
- buffer.used = controller_timeout_s_length;
+ buffer = controller_timeout_s;
break;
}
break;
}
- if (fl_string_dynamic_compare_string(controller_consider_s, cache->action.name_action, controller_consider_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_consider_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_consider_e;
}
- else if (fl_string_dynamic_compare_string(controller_execute_s, cache->action.name_action, controller_execute_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_execute_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_execute_e;
}
- else if (fl_string_dynamic_compare_string(controller_failsafe_s, cache->action.name_action, controller_failsafe_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_failsafe_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_failsafe_e;
}
- else if (fl_string_dynamic_compare_string(controller_freeze_s, cache->action.name_action, controller_freeze_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_freeze_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_freeze_e;
}
- else if (fl_string_dynamic_compare_string(controller_item_s, cache->action.name_action, controller_item_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_item_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_item_e;
}
- else if (fl_string_dynamic_compare_string(controller_kill_s, cache->action.name_action, controller_kill_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_kill_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_kill_e;
}
- else if (fl_string_dynamic_compare_string(controller_pause_s, cache->action.name_action, controller_pause_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_pause_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_pause_e;
}
- else if (fl_string_dynamic_compare_string(controller_ready_s, cache->action.name_action, controller_ready_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_ready_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_ready_e;
}
- else if (fl_string_dynamic_compare_string(controller_reload_s, cache->action.name_action, controller_reload_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_reload_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_reload_e;
}
- else if (fl_string_dynamic_compare_string(controller_restart_s, cache->action.name_action, controller_restart_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_restart_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_restart_e;
}
- else if (fl_string_dynamic_compare_string(controller_resume_s, cache->action.name_action, controller_resume_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_resume_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_resume_e;
}
- else if (fl_string_dynamic_compare_string(controller_start_s, cache->action.name_action, controller_start_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_start_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_start_e;
}
- else if (fl_string_dynamic_compare_string(controller_stop_s, cache->action.name_action, controller_stop_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_stop_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_stop_e;
}
- else if (fl_string_dynamic_compare_string(controller_thaw_s, cache->action.name_action, controller_thaw_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_thaw_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_thaw_e;
}
- else if (fl_string_dynamic_compare_string(controller_timeout_s, cache->action.name_action, controller_timeout_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_timeout_s, cache->action.name_action) == F_equal_to) {
actions->array[actions->used].type = controller_entry_action_type_timeout_e;
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SUnknown %s item action '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
- fl_print_format("%[%S%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
+ fl_print_format("%q%[%QUnknown %q item action '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
+ fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
controller_entry_print_error_cache(is_entry, global.main->warning, cache->action);
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%q%[%QThe %q item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
fl_print_format("%[' requires ", global.main->error.to.stream, global.main->error.context);
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%SThe %s item action must not have an empty string for a path (the first parameter).%]%q", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe %q item action must not have an empty string for a path (the first parameter).%]%q", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
}
}
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action second parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%q%[%QThe %q item action second parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[1], global.main->error.notable);
fl_print_format("%[' must be a base path name, such as '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_path, global.main->error.notable);
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%SThe %s item action must not have an empty string for a rule name (the second parameter).%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe %q item action must not have an empty string for a rule name (the second parameter).%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
}
}
for (j = 2; j < action->parameters.used; ++j) {
- if (fl_string_dynamic_compare_string(controller_asynchronous_s, action->parameters.array[j], controller_asynchronous_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_asynchronous_s, action->parameters.array[j]) == F_equal_to) {
action->code |= controller_entry_rule_code_asynchronous_d;
}
- else if (fl_string_dynamic_compare_string(controller_require_s, action->parameters.array[j], controller_require_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_require_s, action->parameters.array[j]) == F_equal_to) {
action->code |= controller_entry_rule_code_require_d;
}
- else if (fl_string_dynamic_compare_string(controller_wait_s, action->parameters.array[j], controller_wait_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_wait_s, action->parameters.array[j]) == F_equal_to) {
action->code |= controller_entry_rule_code_wait_d;
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action third parameter (and beyond) must be one of '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_asynchronous_s, global.main->error.notable);
+ fl_print_format("%q%[%QThe %q item action third parameter (and beyond) must be one of '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_asynchronous_s, global.main->error.notable);
fl_print_format("%[', '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_require_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_require_s, global.main->error.notable);
fl_print_format("%[', or '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_wait_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_wait_s, global.main->error.notable);
fl_print_format("%[' but instead has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[j], global.main->error.notable);
fl_print_format("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
} // for
}
else if (action->type == controller_entry_action_type_failsafe_e || action->type == controller_entry_action_type_item_e) {
- if (fl_string_dynamic_compare_string(controller_main_s, action->parameters.array[0], controller_main_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_main_s, action->parameters.array[0]) == F_equal_to) {
action->status = F_status_set_error(F_supported_not);
if (F_status_is_error_not(status_action)) {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action may not specify the reserved item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_main_s, global.main->error.notable);
+ fl_print_format("%q%[%QThe %q item action may not specify the reserved item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_main_s, global.main->error.notable);
fl_print_format("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
funlockfile(global.main->error.to.stream);
}
else if (action->type == controller_entry_action_type_timeout_e) {
- if (fl_string_dynamic_compare_string(controller_kill_s, action->parameters.array[0], controller_kill_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_kill_s, action->parameters.array[0]) == F_equal_to) {
action->code = controller_entry_timeout_code_kill_d;
}
- else if (fl_string_dynamic_compare_string(controller_start_s, action->parameters.array[0], controller_start_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_start_s, action->parameters.array[0]) == F_equal_to) {
action->code = controller_entry_timeout_code_start_d;
}
- else if (fl_string_dynamic_compare_string(controller_stop_s, action->parameters.array[0], controller_stop_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_stop_s, action->parameters.array[0]) == F_equal_to) {
action->code = controller_entry_timeout_code_stop_d;
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action must have one of '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_kill_s, global.main->error.notable);
+ fl_print_format("%q%[%QThe %q item action must have one of '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_kill_s, global.main->error.notable);
fl_print_format("%[', '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_start_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_start_s, global.main->error.notable);
fl_print_format("%[', or '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_stop_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_stop_s, global.main->error.notable);
fl_print_format("%[' but instead has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[0], global.main->error.notable);
fl_print_format("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%q%[%QThe %q item action parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[1], global.main->error.notable);
fl_print_format("%[' is not a valid supported number.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
}
else if (action->type == controller_entry_action_type_ready_e) {
if (action->parameters.used) {
- if (fl_string_dynamic_compare_string(controller_wait_s, action->parameters.array[0], controller_wait_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_wait_s, action->parameters.array[0]) == F_equal_to) {
action->code |= controller_entry_rule_code_wait_d;
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(global.main->error.to.stream);
- fl_print_format("%q%[%SThe %s item action may only have '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_wait_s, global.main->error.notable);
+ fl_print_format("%q%[%QThe %q item action may only have '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_wait_s, global.main->error.notable);
fl_print_format("%[' but instead has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[0], global.main->error.notable);
fl_print_format("%['.%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SMultiple '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
- fl_print_format("%[%s%]", global.main->warning.to.stream, global.main->warning.notable, controller_ready_s, global.main->warning.notable);
- fl_print_format("%[' %s item actions detected; only the first will be used.%]%q", global.main->warning.to.stream, global.main->warning.context, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context, f_string_eol_s);
+ fl_print_format("%q%[%QMultiple '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_format("%[%q%]", global.main->warning.to.stream, global.main->warning.notable, controller_ready_s, global.main->warning.notable);
+ fl_print_format("%[' %q item actions detected; only the first will be used.%]%q", global.main->warning.to.stream, global.main->warning.context, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context, f_string_eol_s);
controller_entry_print_error_cache(is_entry, global.main->warning, cache->action);
error_has = F_false;
// "main" is not allowed to be used for an "item" and "setting" is not an executable "item".
- if (fl_string_dynamic_compare_string(controller_main_s, actions->array[cache->ats.array[at_j]].parameters.array[0], controller_main_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_main_s, actions->array[cache->ats.array[at_j]].parameters.array[0]) == F_equal_to) {
continue;
}
- else if (fl_string_dynamic_compare_string(controller_setting_s, actions->array[cache->ats.array[at_j]].parameters.array[0], controller_setting_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_setting_s, actions->array[cache->ats.array[at_j]].parameters.array[0]) == F_equal_to) {
continue;
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe %s item named '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QThe %q item named '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, entry->items.array[i].name, global.main->error.notable);
fl_print_format("%[' cannot be executed because recursion is not allowed.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe %s item named '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QThe %q item named '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->error.notable);
fl_print_format("%[' does not exist.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%qProcessing %s%s item '", global->main->output.to.stream, f_string_eol_s, failsafe ? "failsafe " : "", is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%qProcessing %q%q item '", global->main->output.to.stream, f_string_eol_s, failsafe ? controller_entry_print_failsafe_s : f_string_empty_s, is_entry ? controller_entry_s : controller_exit_s);
fl_print_format("%[%Q%]'.%q", global->main->output.to.stream, global->main->context.set.notable, cache->action.name_item, global->main->context.set.notable, f_string_eol_s);
controller_unlock_print_flush(global->main->output.to, global->thread);
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%qThe %s item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%qThe %q item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.title, cache->action.name_action, global->main->context.set.title);
if (entry_action->parameters.used) {
fl_print_format("%]", global->main->output.to.stream, global->main->context.set.notable);
}
- fl_print_format("' is %[%s%] and is in a ", global->main->output.to.stream, global->main->context.set.notable, entry_action->code & controller_entry_rule_code_require_d ? "required" : "optional", global->main->context.set.notable);
+ fl_print_format("' is %[%q%] and is in a ", global->main->output.to.stream, global->main->context.set.notable, entry_action->code & controller_entry_rule_code_require_d ? "required" : "optional", global->main->context.set.notable);
fl_print_format("%[failed%] state, skipping.%q", global->main->output.to.stream, global->main->context.set.notable, global->main->context.set.notable, global->main->context.set.notable, f_string_eol_s);
controller_lock_print(output->to, global->thread);
- fl_print_format("%q%[%QThe %s item action '%]", output->to.stream, f_string_eol_s, output->context, output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_entry_s : controller_exit_s, output->context);
+ fl_print_format("%q%[%QThe %q item action '%]", output->to.stream, f_string_eol_s, output->context, output->prefix, is_entry ? controller_entry_s : controller_exit_s, output->context);
fl_print_format("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (global->main->output.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%qWaiting before processing %s item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
- fl_print_format("%[%s%]", global->main->output.to.stream, global->main->context.set.title, controller_ready_s, global->main->context.set.title);
+ fl_print_format("%qWaiting before processing %q item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%[%q%]", global->main->output.to.stream, global->main->context.set.title, controller_ready_s, global->main->context.set.title);
fl_print_format("'.%q", global->main->output.to.stream, f_string_eol_s);
controller_unlock_print_flush(global->main->output.to, global->thread);
if (global->main->output.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%qIgnoring %s item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
- fl_print_format("%[%s%]", global->main->output.to.stream, global->main->context.set.title, controller_ready_s, global->main->context.set.title);
+ fl_print_format("%qIgnoring %q item action '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%[%q%]", global->main->output.to.stream, global->main->context.set.title, controller_ready_s, global->main->context.set.title);
fl_print_format("', state already is ready.%q", global->main->output.to.stream, f_string_eol_s);
controller_unlock_print_flush(global->main->output.to, global->thread);
}
else {
if (!failsafe && (global->main->error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && global->main->parameters[controller_parameter_simulate_e].result == f_console_result_none_e) {
- fl_print_format("%qState is now '%[%s%]'.%q", global->main->output.to.stream, f_string_eol_s, global->main->context.set.notable, controller_ready_s, global->main->context.set.notable, f_string_eol_s);
+ fl_print_format("%qState is now '%[%q%]'.%q", global->main->output.to.stream, f_string_eol_s, global->main->context.set.notable, controller_ready_s, global->main->context.set.notable, f_string_eol_s);
}
status = controller_perform_ready(global, cache, is_entry);
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->error.to, global->thread);
- fl_print_format("%q%[Invalid %s item index '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, is_entry ? controller_entry_s : controller_exit_s, global->main->error.context);
+ fl_print_format("%q%[Invalid %q item index '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, is_entry ? controller_entry_s : controller_exit_s, global->main->error.context);
fl_print_format("%[%un%]", global->main->error.to.stream, global->main->error.notable, entry_action->number, global->main->error.notable);
fl_print_format("%[' detected.%]%q", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s);
if (global->main->output.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%qProcessing %s item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%qProcessing %q item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.title, cache->action.name_item, global->main->context.set.title);
fl_print_format("'.%q", global->main->output.to.stream, f_string_eol_s);
if (global->main->output.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%s %s item rule ", global->main->output.to.stream, f_string_eol_s, entry_action->type == controller_entry_action_type_consider_e ? "Considering" : "Processing", is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%q%q %q item rule ", global->main->output.to.stream, f_string_eol_s, entry_action->type == controller_entry_action_type_consider_e ? controller_entry_print_considering_s : controller_entry_print_processing_s, is_entry ? controller_entry_s : controller_exit_s);
fl_print_format("'%[%Q%]'", global->main->output.to.stream, global->main->context.set.title, alias_rule, global->main->context.set.title);
if (entry->show == controller_entry_show_init_e && global->main->parameters[controller_parameter_simulate_e].result == f_console_result_none_e) {
- fl_print_format(" [%[%s%]]", global->main->output.to.stream, global->main->context.set.notable, entry_action->code == controller_entry_rule_code_asynchronous_d ? controller_asynchronous_s : controller_synchronous_s, global->main->context.set.notable);
+ fl_print_format(" [%[%q%]]", global->main->output.to.stream, global->main->context.set.notable, entry_action->code == controller_entry_rule_code_asynchronous_d ? controller_asynchronous_s : controller_synchronous_s, global->main->context.set.notable);
if (entry_action->code == controller_entry_rule_code_wait_d) {
- fl_print_format(" [%[%s%]]", global->main->output.to.stream, global->main->context.set.notable, controller_wait_s, global->main->context.set.notable);
+ fl_print_format(" [%[%q%]]", global->main->output.to.stream, global->main->context.set.notable, controller_wait_s, global->main->context.set.notable);
}
if (entry_action->code == controller_entry_rule_code_require_d) {
- fl_print_format(" [%[%s%]]", global->main->output.to.stream, global->main->context.set.notable, controller_required_s, global->main->context.set.notable);
+ fl_print_format(" [%[%q%]]", global->main->output.to.stream, global->main->context.set.notable, controller_required_s, global->main->context.set.notable);
}
}
if (F_status_is_error(status_lock)) {
controller_lock_print_error_critical(global->main->error, F_status_set_fine(status_lock), F_false, global->thread);
+
break;
}
if (global->main->output.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%q%s is executing '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%q%Q is executing '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
for (f_array_length_t k = 0; k < entry_action->parameters.used; ++k) {
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->error.to, global->thread);
- fl_print_format("%q%[%SExecution failed, unable to find program or script '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
+ fl_print_format("%q%[%QExecution failed, unable to find program or script '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix, global->main->error.context);
fl_print_format("%[%Q%]", global->main->error.to.stream, global->main->error.notable, entry_action->parameters.array[0], global->main->error.notable);
fl_print_format("%['.%]%q", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s);
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->error.to, global->thread);
- fl_print_format("%q%[%SExecution failed with return value of '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
+ fl_print_format("%q%[%QExecution failed with return value of '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix, global->main->error.context);
fl_print_format("%[%i%]", global->main->error.to.stream, global->main->error.notable, result, global->main->error.notable);
fl_print_format("$['.%]%q", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s);
return F_execute;
}
else if (entry_action->type == controller_entry_action_type_timeout_e) {
- const f_string_t suffix = " MegaTime (milliseconds)";
-
if (entry_action->code == controller_entry_timeout_code_kill_d) {
entry->timeout_kill = entry_action->number;
- controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_timeout_s, controller_kill_s, entry->items.array[global->setting->failsafe_item_id].name, suffix);
+ controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_timeout_s, controller_kill_s, entry->items.array[global->setting->failsafe_item_id].name, controller_entry_print_suffix_megatime_s);
}
else if (entry_action->code == controller_entry_timeout_code_start_d) {
entry->timeout_start = entry_action->number;
- controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_timeout_s, controller_start_s, entry->items.array[global->setting->failsafe_item_id].name, suffix);
+ controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_timeout_s, controller_start_s, entry->items.array[global->setting->failsafe_item_id].name, controller_entry_print_suffix_megatime_s);
}
else if (entry_action->code == controller_entry_timeout_code_stop_d) {
entry->timeout_stop = entry_action->number;
- controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_timeout_s, controller_stop_s, entry->items.array[global->setting->failsafe_item_id].name, suffix);
+ controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_timeout_s, controller_stop_s, entry->items.array[global->setting->failsafe_item_id].name, controller_entry_print_suffix_megatime_s);
}
}
else if (entry_action->type == controller_entry_action_type_failsafe_e) {
if (global->main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->warning.to, global->thread);
- fl_print_format("%q%[%SFailsafe may not be specified when running in failsafe, ignoring.%]%q", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context, f_string_eol_s);
+ fl_print_format("%q%[%QFailsafe may not be specified when running in failsafe, ignoring.%]%q", global->main->warning.to.stream, f_string_eol_s, global->main->warning.context, global->main->warning.prefix, global->main->warning.context, f_string_eol_s);
controller_entry_print_error_cache(is_entry, global->main->warning, cache->action);
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->error.to, global->thread);
- fl_print_format("%q%[%SInvalid %s item index '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, is_entry ? controller_entry_s : controller_exit_s, global->main->error.context);
+ fl_print_format("%q%[%QInvalid %q item index '%]", global->main->error.to.stream, f_string_eol_s, global->main->error.context, global->main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global->main->error.context);
fl_print_format("%[%un%]", global->main->error.to.stream, global->main->error.notable, entry_action->number, global->main->error.notable);
fl_print_format("%[' detected.%]%q", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s);
global->setting->failsafe_enabled = F_true;
global->setting->failsafe_item_id = entry_action->number;
- controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_failsafe_s, 0, entry->items.array[global->setting->failsafe_item_id].name, 0);
+ controller_entry_preprocess_print_simulate_setting_value(*global, is_entry, controller_failsafe_s, f_string_empty_s, entry->items.array[global->setting->failsafe_item_id].name, f_string_empty_s);
}
}
}
if ((global->main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity != f_console_verbosity_quiet_e) || global->main->error.verbosity == f_console_verbosity_verbose_e) {
controller_lock_print(global->main->output.to, global->thread);
- fl_print_format("%qDone processing %s item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
- fl_print_format("%[%s%]", global->main->output.to.stream, global->main->context.set.title, controller_main_s, global->main->context.set.title);
+ fl_print_format("%qDone processing %q item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%[%q%]", global->main->output.to.stream, global->main->context.set.title, controller_main_s, global->main->context.set.title);
fl_print_format("'.%q", global->main->output.to.stream, f_string_eol_s);
// failsafe should not print the extra newline because the failure exit from controller_main should handle this.
if (!failsafe) {
- f_print_terminated(f_string_eol_s, global->main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, global->main->output.to.stream);
}
controller_unlock_print_flush(global->main->output.to, global->thread);
cache->action.name_item.used = 0;
if (is_entry) {
- status = controller_file_load(global, F_true, controller_entries_s, global.setting->name_entry, controller_entry_s, controller_entries_s_length, controller_entry_s_length, cache);
+ status = controller_file_load(global, F_true, controller_entries_s, global.setting->name_entry, controller_entry_s, cache);
}
else {
- status = controller_file_load(global, F_false, controller_exits_s, global.setting->name_entry, controller_exit_s, controller_exits_s_length, controller_exit_s_length, cache);
+ status = controller_file_load(global, F_false, controller_exits_s, global.setting->name_entry, controller_exit_s, cache);
if (status == F_file_found_not) {
return F_file_found_not;
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fll_print_format("%q%[%SThe %s file is empty.%]%q", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe %q file is empty.%]%q", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : is_entry ? controller_entry_s : controller_exit_s, global.main->error.context, f_string_eol_s);
controller_unlock_print_flush(global.main->error.to, global.thread);
}
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SIgnoring duplicate %s item '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
+ fl_print_format("%q%[%QIgnoring duplicate %q item '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_file, global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
range = &cache->content_items.array[i].array[0];
- if (fl_string_dynamic_compare_string(controller_main_s, cache->action.name_item, controller_main_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_main_s, cache->action.name_item) == F_equal_to) {
code |= 0x1;
at = 0;
entry->items.used = 1;
}
}
- else if (fl_string_dynamic_compare_string(controller_setting_s, cache->action.name_item, controller_setting_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_setting_s, cache->action.name_item) == F_equal_to) {
status = controller_entry_settings_read(global, is_entry, *range, cache);
continue;
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe required %s item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_main_s, global.main->error.notable);
+ fl_print_format("%q%[%QThe required %q item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_main_s, global.main->error.notable);
fl_print_format("%[' was not found.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
controller_unlock_print_flush(global.main->error.to, global.thread);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe required %s item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%q%[%QThe required %q item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, action->parameters.array[0], global.main->error.notable);
fl_print_format("%[' does not exist.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
break;
}
- if (is_entry && fl_string_dynamic_compare_string(controller_control_s, cache->action.name_action, controller_control_s_length) == F_equal_to) {
+ if (is_entry && fl_string_dynamic_compare(controller_control_s, cache->action.name_action) == F_equal_to) {
if (cache->content_actions.array[i].used != 1) {
controller_entry_settings_read_print_setting_requires_exactly(global, is_entry, *cache, 1);
break;
}
- status = f_string_append(f_path_separator_s, 1, &cache->action.generic);
-
- if (F_status_is_error(status)) {
- controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, global.thread);
+ status = f_string_dynamic_append(f_path_separator_s, &cache->action.generic);
- global.setting->path_control.used = 0;
-
- break;
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_append(global.setting->path_control, &cache->action.generic);
}
- status = f_string_dynamic_append(global.setting->path_control, &cache->action.generic);
-
if (F_status_is_error(status)) {
controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, global.thread);
continue;
}
}
- else if (is_entry && fl_string_dynamic_compare_string(controller_control_group_s, cache->action.name_action, controller_control_group_s_length) == F_equal_to) {
+ else if (is_entry && fl_string_dynamic_compare(controller_control_group_s, cache->action.name_action) == F_equal_to) {
gid_t number = 0;
status = controller_get_id_group(cache->buffer_file, cache->content_actions.array[i].array[0], cache, &number);
global.setting->control_group = number;
}
- else if (is_entry && fl_string_dynamic_compare_string(controller_control_mode_s, cache->action.name_action, controller_control_mode_s_length) == F_equal_to) {
+ else if (is_entry && fl_string_dynamic_compare(controller_control_mode_s, cache->action.name_action) == F_equal_to) {
mode_t mode = 0;
uint8_t replace = 0;
f_file_mode_t mode_file = f_file_mode_t_initialize;
global.setting->control_mode = mode;
}
- else if (is_entry && fl_string_dynamic_compare_string(controller_control_user_s, cache->action.name_action, controller_control_user_s_length) == F_equal_to) {
+ else if (is_entry && fl_string_dynamic_compare(controller_control_user_s, cache->action.name_action) == F_equal_to) {
uid_t number = 0;
status = controller_get_id_user(cache->buffer_file, cache->content_actions.array[i].array[0], cache, &number);
global.setting->control_user = number;
}
- else if (is_entry && fl_string_dynamic_compare_string(controller_mode_s, cache->action.name_action, controller_mode_s_length) == F_equal_to) {
+ else if (is_entry && fl_string_dynamic_compare(controller_mode_s, cache->action.name_action) == F_equal_to) {
if (cache->content_actions.array[i].used != 1) {
controller_entry_settings_read_print_setting_requires_exactly(global, is_entry, *cache, 1);
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_service_s, cache->buffer_file, controller_service_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_service_s.string, cache->buffer_file, controller_service_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
global.setting->mode = controller_setting_mode_service_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_program_s, cache->buffer_file, controller_program_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_program_s.string, cache->buffer_file, controller_program_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
global.setting->mode = controller_setting_mode_program_e;
}
else {
continue;
}
}
- else if (fl_string_dynamic_compare_string(controller_pid_s, cache->action.name_action, controller_pid_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_pid_s, cache->action.name_action) == F_equal_to) {
if (cache->content_actions.array[i].used != 1) {
controller_entry_settings_read_print_setting_requires_exactly(global, is_entry, *cache, 1);
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_disable_s, cache->buffer_file, controller_disable_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_disable_s.string, cache->buffer_file, controller_disable_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->pid = controller_entry_pid_disable_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_ready_s, cache->buffer_file, controller_ready_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_ready_s.string, cache->buffer_file, controller_ready_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->pid = controller_entry_pid_ready_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_require_s, cache->buffer_file, controller_require_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_require_s.string, cache->buffer_file, controller_require_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->pid = controller_entry_pid_require_e;
}
else {
continue;
}
}
- else if (fl_string_dynamic_compare_string(controller_session_s, cache->action.name_action, controller_session_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_session_s, cache->action.name_action) == F_equal_to) {
if (cache->content_actions.array[i].used != 1) {
controller_entry_settings_read_print_setting_requires_exactly(global, is_entry, *cache, 1);
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_new_s, cache->buffer_file, controller_new_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_new_s.string, cache->buffer_file, controller_new_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->session = controller_entry_session_new_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_same_s, cache->buffer_file, controller_same_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_same_s.string, cache->buffer_file, controller_same_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->session = controller_entry_session_same_e;
}
else {
continue;
}
}
- else if (fl_string_dynamic_compare_string(controller_show_s, cache->action.name_action, controller_show_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_show_s, cache->action.name_action) == F_equal_to) {
if (cache->content_actions.array[i].used != 1) {
controller_entry_settings_read_print_setting_requires_exactly(global, is_entry, *cache, 1);
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_normal_s, cache->buffer_file, controller_normal_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_normal_s.string, cache->buffer_file, controller_normal_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->show = controller_entry_show_normal_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_init_s, cache->buffer_file, controller_init_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_init_s.string, cache->buffer_file, controller_init_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
entry->show = controller_entry_show_init_e;
}
else {
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../entry/private-entry_print.h"
#include "../lock/private-lock_print.h"
extern "C" {
#endif
+#ifndef _di_controller_entry_print_string_s_
+ const f_string_static_t controller_entry_print_considering_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_considering_s, 0, CONTROLLER_entry_print_considering_s_length);
+ const f_string_static_t controller_entry_print_failsafe_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_failsafe_s, 0, CONTROLLER_entry_print_failsafe_s_length);
+ const f_string_static_t controller_entry_print_processing_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_processing_s, 0, CONTROLLER_entry_print_processing_s_length);
+ const f_string_static_t controller_entry_print_suffix_megatime_s = macro_f_string_static_t_initialize2(CONTROLLER_entry_print_suffix_megatime_s, 0, CONTROLLER_entry_print_suffix_megatime_s_length);
+#endif // _di_controller_entry_print_string_s_
+
#ifndef _di_controller_entry_action_parameters_print_
void controller_entry_action_parameters_print(FILE * const stream, const controller_entry_action_t action) {
if (index == action.parameters.used) break;
- f_print_terminated(f_string_space_s, stream);
+ f_print_dynamic(f_string_space_s, stream);
} // for
}
#endif // _di_controller_entry_action_parameters_print_
#ifndef _di_controller_entry_preprocess_print_simulate_setting_value_
- void controller_entry_preprocess_print_simulate_setting_value(const controller_global_t global, const bool is_entry, const f_string_t name, const f_string_t name_sub, const f_string_static_t value, const f_string_t suffix) {
+ void controller_entry_preprocess_print_simulate_setting_value(const controller_global_t global, const bool is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix) {
if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) {
return;
controller_lock_print(global.main->output.to, global.thread);
- fl_print_format("%qProcessing %s item action '", global.main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+ fl_print_format("%qProcessing %q item action '", global.main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
- fl_print_format("%[%S%]' setting ", global.main->output.to.stream, global.main->context.set.title, name, global.main->context.set.title);
+ fl_print_format("%[%Q%]' setting ", global.main->output.to.stream, global.main->context.set.title, name, global.main->context.set.title);
- if (name_sub) {
- fl_print_format("'%[%S%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable);
+ if (name_sub.used) {
+ fl_print_format("'%[%Q%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable);
}
else {
fl_print_format("value", global.main->output.to.stream);
fl_print_format(" to '%[%Q%]", global.main->output.to.stream, global.main->context.set.important, value, global.main->context.set.important);
- fl_print_format("'%S.%q", global.main->output.to.stream, suffix, f_string_eol_s);
+ fl_print_format("'%Q.%q", global.main->output.to.stream, suffix, f_string_eol_s);
controller_unlock_print_flush(global.main->output.to, global.thread);
}
#ifndef _di_controller_entry_print_error_cache_
void controller_entry_print_error_cache(const bool is_entry, const fl_print_t output, const controller_cache_action_t cache) {
- fl_print_format("%q%[%SWhile processing ", output.to.stream, f_string_eol_s, output.context, output.prefix);
+ fl_print_format("%q%[%QWhile processing ", output.to.stream, f_string_eol_s, output.context, output.prefix);
if (cache.name_action.used) {
fl_print_format("action '%]", output.to.stream, output.context);
}
if (cache.name_item.used) {
- fl_print_format("%s item '%]", output.to.stream, is_entry ? controller_entry_s : controller_exit_s, output.context);
+ fl_print_format("%q item '%]", output.to.stream, is_entry ? controller_entry_s : controller_exit_s, output.context);
fl_print_format("%[%Q%]", output.to.stream, output.notable, cache.name_item, output.notable);
fl_print_format("%[' on line%] ", output.to.stream, output.context, output.context);
fl_print_format("%[%un%]", output.to.stream, output.notable, cache.line_item, output.notable);
}
if (cache.name_file.used) {
- fl_print_format("%s file '%]", output.to.stream, is_entry ? controller_entry_s : controller_exit_s, output.context);
+ fl_print_format("%q file '%]", output.to.stream, is_entry ? controller_entry_s : controller_exit_s, output.context);
fl_print_format("%[%Q%]%['", output.to.stream, output.notable, cache.name_file, output.notable, output.context);
}
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe %s item setting '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
+ fl_print_format("%q%[%QThe %s item setting '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache.action.name_action, global.main->error.notable);
fl_print_format("%[' requires exactly %]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%un%]", global.main->error.to.stream, global.main->error.notable, total, global.main->error.notable);
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SUnknown %s item setting '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
+ fl_print_format("%q%[%QUnknown %q item setting '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache.action.name_action, global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SThe %s item setting '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
+ fl_print_format("%q%[%QThe %Q item setting '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache.action.name_action, global.main->warning.notable);
- fl_print_format("%[' has an unknown value '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->warning.context);
+ fl_print_format("%[' has an unknown value '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache.content_actions.array[index].array[0], global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
#endif
/**
+ * Special strings used for printing.
+ */
+#ifndef _di_controller_entry_print_string_s_
+ #define CONTROLLER_entry_print_considering_s "Considering"
+ #define CONTROLLER_entry_print_failsafe_s "failsafe"
+ #define CONTROLLER_entry_print_processing_s "Processing"
+ #define CONTROLLER_entry_print_suffix_megatime_s " MegaTime (milliseconds)"
+
+ #define CONTROLLER_entry_print_considering_s_length 11
+ #define CONTROLLER_entry_print_failsafe_s_length 8
+ #define CONTROLLER_entry_print_processing_s_length 10
+ #define CONTROLLER_entry_print_suffix_megatime_s_length 24
+
+ extern const f_string_static_t controller_entry_print_considering_s;
+ extern const f_string_static_t controller_entry_print_failsafe_s;
+ extern const f_string_static_t controller_entry_print_processing_s;
+ extern const f_string_static_t controller_entry_print_suffix_megatime_s;
+#endif // _di_controller_entry_print_string_s_
+
+/**
* Print all parameters for some action, separated by a space.
*
* @param stream
* @param name
* The Object name of the setting being populated.
* @param name_sub
- * (optional) A sub-name associated with the setting being populated.
- * Set to NULL to disable.
+ * A sub-name associated with the setting being populated.
+ * Set to a string with used set to 0 to not use.
* @param value
* The value being set.
* @param suffix
* An additional message to append at the end (before the final period).
*/
#ifndef _di_controller_entry_preprocess_print_simulate_setting_value_
- extern void controller_entry_preprocess_print_simulate_setting_value(const controller_global_t global, const bool is_entry, const f_string_t name, const f_string_t name_sub, const f_string_static_t value, const f_string_t suffix) F_attribute_visibility_internal_d;
+ extern void controller_entry_preprocess_print_simulate_setting_value(const controller_global_t global, const bool is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix) F_attribute_visibility_internal_d;
#endif // _di_controller_entry_preprocess_print_simulate_setting_value_
/**
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "../lock/private-lock.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../lock/private-lock_print.h"
if (print.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(print.to, thread);
- fl_print_format("%q%[%QThe pid file '%]", print.to.stream, f_string_eol_s, print.context, print.prefix ? print.prefix : f_string_empty_s, print.context);
+ fl_print_format("%q%[%QThe pid file '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context);
fl_print_format("%['Critical failure while attempting to establish '%]", print.to.stream, print.context, print.context);
fl_print_format("%[%s lock%]", print.to.stream, print.notable, read ? "read" : "write", print.notable);
-#include "controller/controller.h"
+#include "controller.h"
int main(const int argc, const f_string_t *argv) {
data.pid = getpid();
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
+ fll_program_standard_setup(&data.signal);
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
+ f_file_umask_get(&data.umask);
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
-
- // @fixme bad design in POSIX where there is no get umask without setting it.
- data.umask = umask(0);
-
- // Restore umask.
- umask(data.umask);
-
- // when run as "init" by default, provide the default system-level init path.
+ // When run as "init" by default, provide the default system-level init path.
// This change must only exist within this main file so that the change only exists within the program rather than the library.
#ifdef _controller_as_init_
data.program_name = &controller_program_name_init_s;
const f_status_t status = controller_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
-
- f_signal_close(&data.signal);
+ fll_program_standard_setdown(&data.signal);
// When the child process exits, it must return the code to the parent so the parent knows how to handle the exit.
if (status == F_child) {
exit(data.child);
}
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "../lock/private-lock.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "../controller/private-controller_print.h"
switch (type) {
case controller_rule_action_method_extended_e:
- buffer.string = controller_rule_action_method_string_extended_s;
- buffer.used = controller_rule_action_method_string_extended_s_length;
+ buffer = controller_rule_action_method_string_extended_s;
break;
case controller_rule_action_method_extended_list_e:
- buffer.string = controller_rule_action_method_string_extended_list_s;
- buffer.used = controller_rule_action_method_string_extended_list_s_length;
+ buffer = controller_rule_action_method_string_extended_list_s;
break;
}
- buffer.size = buffer.used;
-
return buffer;
}
#endif // _di_controller_rule_action_method_name_
switch (type) {
case controller_rule_action_type_freeze_e:
- buffer.string = controller_freeze_s;
- buffer.used = controller_freeze_s_length;
+ buffer = controller_freeze_s;
break;
case controller_rule_action_type_group_e:
- buffer.string = controller_group_s;
- buffer.used = controller_group_s_length;
+ buffer = controller_group_s;
break;
case controller_rule_action_type_kill_e:
- buffer.string = controller_kill_s;
- buffer.used = controller_kill_s_length;
+ buffer = controller_kill_s;
break;
case controller_rule_action_type_pause_e:
- buffer.string = controller_pause_s;
- buffer.used = controller_pause_s_length;
+ buffer = controller_pause_s;
break;
case controller_rule_action_type_pid_file_e:
- buffer.string = controller_pid_file_s;
- buffer.used = controller_pid_file_s_length;
+ buffer = controller_pid_file_s;
break;
case controller_rule_action_type_rerun_e:
- buffer.string = controller_rerun_s;
- buffer.used = controller_rerun_s_length;
+ buffer = controller_rerun_s;
break;
case controller_rule_action_type_reload_e:
- buffer.string = controller_reload_s;
- buffer.used = controller_reload_s_length;
+ buffer = controller_reload_s;
break;
case controller_rule_action_type_restart_e:
- buffer.string = controller_restart_s;
- buffer.used = controller_restart_s_length;
+ buffer = controller_restart_s;
break;
case controller_rule_action_type_resume_e:
- buffer.string = controller_resume_s;
- buffer.used = controller_resume_s_length;
+ buffer = controller_resume_s;
break;
case controller_rule_action_type_start_e:
- buffer.string = controller_start_s;
- buffer.used = controller_start_s_length;
+ buffer = controller_start_s;
break;
case controller_rule_action_type_stop_e:
- buffer.string = controller_stop_s;
- buffer.used = controller_stop_s_length;
+ buffer = controller_stop_s;
break;
case controller_rule_action_type_thaw_e:
- buffer.string = controller_thaw_s;
- buffer.used = controller_thaw_s_length;
+ buffer = controller_thaw_s;
break;
case controller_rule_action_type_user_e:
- buffer.string = controller_user_s;
- buffer.used = controller_user_s_length;
+ buffer = controller_user_s;
break;
case controller_rule_action_type_with_e:
- buffer.string = controller_with_s;
- buffer.used = controller_with_s_length;
+ buffer = controller_with_s;
break;
}
switch (type) {
case controller_rule_action_type_execute_freeze_e:
- buffer.string = controller_freeze_s;
- buffer.used = controller_freeze_s_length;
+ buffer = controller_freeze_s;
break;
case controller_rule_action_type_execute_kill_e:
- buffer.string = controller_kill_s;
- buffer.used = controller_kill_s_length;
+ buffer = controller_kill_s;
break;
case controller_rule_action_type_execute_pause_e:
- buffer.string = controller_pause_s;
- buffer.used = controller_pause_s_length;
+ buffer = controller_pause_s;
break;
case controller_rule_action_type_execute_reload_e:
- buffer.string = controller_reload_s;
- buffer.used = controller_reload_s_length;
+ buffer = controller_reload_s;
break;
case controller_rule_action_type_execute_restart_e:
- buffer.string = controller_restart_s;
- buffer.used = controller_restart_s_length;
+ buffer = controller_restart_s;
break;
case controller_rule_action_type_execute_resume_e:
- buffer.string = controller_resume_s;
- buffer.used = controller_resume_s_length;
+ buffer = controller_resume_s;
break;
case controller_rule_action_type_execute_start_e:
- buffer.string = controller_start_s;
- buffer.used = controller_start_s_length;
+ buffer = controller_start_s;
break;
case controller_rule_action_type_execute_stop_e:
- buffer.string = controller_stop_s;
- buffer.used = controller_stop_s_length;
+ buffer = controller_stop_s;
break;
case controller_rule_action_type_execute_thaw_e:
- buffer.string = controller_thaw_s;
- buffer.used = controller_thaw_s_length;
+ buffer = controller_thaw_s;
break;
}
uint8_t type_rerun = 0;
if (cache->content_action.used) {
- if (fl_string_dynamic_partial_compare_string(controller_freeze_s, cache->buffer_item, controller_freeze_s_length, cache->content_action.array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_freeze_s.string, cache->buffer_item, controller_freeze_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_freeze_e;
}
- if (fl_string_dynamic_partial_compare_string(controller_kill_s, cache->buffer_item, controller_kill_s_length, cache->content_action.array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_kill_s.string, cache->buffer_item, controller_kill_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_kill_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_pause_s, cache->buffer_item, controller_pause_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_pause_s.string, cache->buffer_item, controller_pause_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_pause_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_reload_s, cache->buffer_item, controller_reload_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_reload_s.string, cache->buffer_item, controller_reload_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_reload_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_restart_s, cache->buffer_item, controller_restart_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_restart_s.string, cache->buffer_item, controller_restart_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_restart_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_resume_s, cache->buffer_item, controller_resume_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_resume_s.string, cache->buffer_item, controller_resume_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_resume_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_start_s, cache->buffer_item, controller_start_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_start_s.string, cache->buffer_item, controller_start_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_start_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_stop_s, cache->buffer_item, controller_stop_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_stop_s.string, cache->buffer_item, controller_stop_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_stop_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_thaw_s, cache->buffer_item, controller_thaw_s_length, cache->content_action.array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_thaw_s.string, cache->buffer_item, controller_thaw_s.used, cache->content_action.array[0]) == F_equal_to) {
type_rerun = controller_rule_action_type_execute_thaw_e;
}
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
+ fl_print_format("%q%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
fl_print_format("%[' has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_action.array[0], global.main->error.notable);
fl_print_format("%[' as the first value, only the following are allowed: '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_freeze_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_kill_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_pause_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_reload_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_restart_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_resume_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_start_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[', or '%]", global.main->error.to.stream, global.main->error.notable, controller_stop_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_thaw_s, global.main->error.notable, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_freeze_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_kill_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_pause_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_reload_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_restart_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_resume_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', '%]", global.main->error.to.stream, global.main->error.notable, controller_start_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]%[', or '%]", global.main->error.to.stream, global.main->error.notable, controller_stop_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_thaw_s, global.main->error.notable, global.main->error.context);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->error, cache->action, F_true);
controller_rule_rerun_item_t *rerun_item = 0;
if (cache->content_action.used > 1) {
- if (fl_string_dynamic_partial_compare_string(controller_failure_s, cache->buffer_item, controller_failure_s_length, cache->content_action.array[1]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_failure_s.string, cache->buffer_item, controller_failure_s.used, cache->content_action.array[1]) == F_equal_to) {
rerun_item = &item->reruns[type_rerun].failure;
item->reruns[type_rerun].is |= controller_rule_rerun_is_failure_d;
}
- else if (fl_string_dynamic_partial_compare_string(controller_success_s, cache->buffer_item, controller_success_s_length, cache->content_action.array[1]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_success_s.string, cache->buffer_item, controller_success_s.used, cache->content_action.array[1]) == F_equal_to) {
rerun_item = &item->reruns[type_rerun].success;
item->reruns[type_rerun].is |= controller_rule_rerun_is_success_d;
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
+ fl_print_format("%q%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
fl_print_format("%[' has '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_action.array[1], global.main->error.notable);
fl_print_format("%[' as the second value, only the following are allowed: '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]%[' or '%]", global.main->error.to.stream, global.main->error.notable, controller_stop_s, global.main->error.notable, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_thaw_s, global.main->error.notable, global.main->error.context);
+ fl_print_format("%[%q%]%[' or '%]", global.main->error.to.stream, global.main->error.notable, controller_stop_s, global.main->error.notable, global.main->error.context, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_thaw_s, global.main->error.notable, global.main->error.context);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->error, cache->action, F_true);
for (f_array_length_t i = 2; i < cache->content_action.used; ++i) {
- if (fl_string_dynamic_partial_compare_string(controller_delay_s, cache->buffer_item, controller_delay_s_length, cache->content_action.array[i]) == F_equal_to) {
- status = controller_rule_action_read_rerun_number(global, controller_delay_s, cache, &i, &rerun_item->delay);
+ if (fl_string_dynamic_partial_compare_string(controller_delay_s.string, cache->buffer_item, controller_delay_s.used, cache->content_action.array[i]) == F_equal_to) {
+ status = controller_rule_action_read_rerun_number(global, controller_delay_s.string, cache, &i, &rerun_item->delay);
}
- else if (fl_string_dynamic_partial_compare_string(controller_max_s, cache->buffer_item, controller_max_s_length, cache->content_action.array[i]) == F_equal_to) {
- status = controller_rule_action_read_rerun_number(global, controller_max_s, cache, &i, &rerun_item->max);
+ else if (fl_string_dynamic_partial_compare_string(controller_max_s.string, cache->buffer_item, controller_max_s.used, cache->content_action.array[i]) == F_equal_to) {
+ status = controller_rule_action_read_rerun_number(global, controller_max_s.string, cache, &i, &rerun_item->max);
}
- else if (fl_string_dynamic_partial_compare_string(controller_reset_s, cache->buffer_item, controller_reset_s_length, cache->content_action.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_reset_s.string, cache->buffer_item, controller_reset_s.used, cache->content_action.array[i]) == F_equal_to) {
item->reruns[type_rerun].is |= rerun_item == &item->reruns[type_rerun].failure ? controller_rule_rerun_is_failure_reset_d : controller_rule_rerun_is_success_reset_d;
}
else {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
+ fl_print_format("%q%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
fl_print_format("%[' has an unknown value '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_action.array[i], global.main->error.notable);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
for (f_array_length_t i = 0; i < cache->content_action.used; ++i) {
- if (fl_string_dynamic_partial_compare_string(controller_full_path_s, cache->buffer_item, controller_full_path_s_length, cache->content_action.array[i]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_full_path_s.string, cache->buffer_item, controller_full_path_s.used, cache->content_action.array[i]) == F_equal_to) {
item->with |= controller_with_full_path_d;
}
- else if (fl_string_dynamic_partial_compare_string(controller_session_new_s, cache->buffer_item, controller_session_new_s_length, cache->content_action.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_session_new_s.string, cache->buffer_item, controller_session_new_s.used, cache->content_action.array[i]) == F_equal_to) {
item->with |= controller_with_session_new_d;
// "session_new" and "session_same" are mutually exclusive.
item->with -= controller_with_session_same_d;
}
}
- else if (fl_string_dynamic_partial_compare_string(controller_session_same_s, cache->buffer_item, controller_session_same_s_length, cache->content_action.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_session_same_s.string, cache->buffer_item, controller_session_same_s.used, cache->content_action.array[i]) == F_equal_to) {
item->with |= controller_with_session_same_d;
// "session_new" and "session_same" are mutually exclusive.
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SUnknown value '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QUnknown value '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_action.array[i], global.main->error.notable);
- fl_print_format("%[' for rule item action '%]%[%s%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, global.main->error.notable, controller_with_s, global.main->error.notable);
+ fl_print_format("%[' for rule item action '%]%[%q%]", global.main->error.to.stream, global.main->error.context, global.main->error.context, global.main->error.notable, controller_with_s, global.main->error.notable);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->error, cache->action, F_true);
for (f_array_length_t i = 0; i < cache->content_action.used; ++i) {
- status = f_string_dynamic_partial_mash_nulless(f_string_space_s, F_string_space_s_length, cache->buffer_item, cache->content_action.array[i], &actions->array[actions->used].parameters.array[0]);
+ status = f_string_dynamic_partial_mash_nulless(f_string_space_s, cache->buffer_item, cache->content_action.array[i], &actions->array[actions->used].parameters.array[0]);
if (F_status_is_error(status)) break;
} // for
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SAction is empty, nothing to do.%]%q", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s);
+ fl_print_format("%q%[%QAction is empty, nothing to do.%]%q", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->warning, cache->action, F_true);
else {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
+ fl_print_format("%q%[%QRule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rerun_s, global.main->error.notable);
fl_print_format("%[' requires a positive whole number or 0 for the '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%S%]", global.main->error.to.stream, global.main->error.notable, name, global.main->error.notable);
fl_print_format("%[' value", global.main->error.to.stream, global.main->error.context, global.main->error.context);
if (process->rule.items.array[i].type == controller_rule_item_type_command_e) {
for (;;) {
- status = controller_rule_execute_foreground(process->rule.items.array[i].type, f_string_static_empty_s, process->rule.items.array[i].actions.array[j].parameters, options, &execute_set, process);
+ status = controller_rule_execute_foreground(process->rule.items.array[i].type, f_string_empty_s, process->rule.items.array[i].actions.array[j].parameters, options, &execute_set, process);
if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break;
if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break;
if (process->rule.items.array[i].pid_file.used) {
for (;;) {
- status = controller_rule_execute_pid_with(process->rule.items.array[i].pid_file, process->rule.items.array[i].type, f_string_static_empty_s, process->rule.items.array[i].actions.array[j].parameters, options, process->rule.items.array[i].with, &execute_set, process);
+ status = controller_rule_execute_pid_with(process->rule.items.array[i].pid_file, process->rule.items.array[i].type, f_string_empty_s, process->rule.items.array[i].actions.array[j].parameters, options, process->rule.items.array[i].with, &execute_set, process);
if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break;
if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break;
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SAction type is unknown, ignoring.%]%q", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s);
+ fl_print_format("%q%[%QAction type is unknown, ignoring.%]%q", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->warning, process->cache.action, F_true);
// Lock failed, attempt to re-establish lock before returning.
if (F_status_set_fine(status) == F_lock) {
status = controller_lock_read(process, global.thread, &process->lock);
-
- if (F_status_is_error(status)) {
- return F_status_set_error(F_lock);
- }
+ if (F_status_is_error(status)) return F_status_set_error(F_lock);
success = F_false;
}
for (f_array_length_t i = program.used ? 0 : 1; i < arguments.used; ++i) {
if (program.used && i || !program.used && i > 1) {
- f_print_terminated(f_string_space_s, main->output.to.stream);
+ f_print_dynamic(f_string_space_s, main->output.to.stream);
}
f_print_dynamic_safely(arguments.array[i], main->output.to.stream);
}
if (F_status_set_fine(status) != F_interrupt) {
- const f_string_static_t simulated_program = macro_f_string_static_t_initialize(f_string_empty_s, 0);
const f_string_statics_t simulated_arguments = f_string_statics_t_initialize;
- fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &simulated_program);
+ fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &f_string_empty_s);
status = fll_execute_program(controller_default_program_script_s.string, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result);
}
for (f_array_length_t i = program.used ? 0 : 1; i < arguments.used; ++i) {
if (program.used && i || !program.used && i > 1) {
- f_print_terminated(f_string_space_s, main->error.to.stream);
+ f_print_dynamic(f_string_space_s, main->error.to.stream);
}
f_print_dynamic_safely(arguments.array[i], main->error.to.stream);
}
if (F_status_set_fine(status) != F_interrupt) {
- const f_string_static_t simulated_program = macro_f_string_static_t_initialize(f_string_empty_s, 0);
const f_string_statics_t simulated_arguments = f_string_statics_t_initialize;
- fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &simulated_program);
+ fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &f_string_empty_s);
status = fll_execute_program(controller_default_program_script_s.string, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result);
}
f_print_terminated("' '", main->output.to.stream);
fl_print_format("%[%q%]", main->output.to.stream, main->context.set.notable, controller_rule_action_type_execute_name(action), main->context.set.notable);
f_print_terminated("' with a ", main->output.to.stream);
- fl_print_format("%[%s%]", main->output.to.stream, main->context.set.notable, controller_delay_s, main->context.set.notable);
+ fl_print_format("%[%q%]", main->output.to.stream, main->context.set.notable, controller_delay_s, main->context.set.notable);
f_print_terminated(" of ", main->output.to.stream);
fl_print_format("%[%ul%] MegaTime", main->output.to.stream, main->context.set.notable, rerun_item->delay, main->context.set.notable);
f_print_terminated(" for ", main->output.to.stream);
fl_print_format("%[%ul%]", main->output.to.stream, main->context.set.notable, rerun_item->count, main->context.set.notable);
f_print_terminated(" of ", main->output.to.stream);
- fl_print_format("%[%s%] ", main->output.to.stream, main->context.set.notable, controller_max_s, main->context.set.notable);
+ fl_print_format("%[%q%] ", main->output.to.stream, main->context.set.notable, controller_max_s, main->context.set.notable);
fl_print_format("%[%ul%]", main->output.to.stream, main->context.set.notable, rerun_item->max, main->context.set.notable);
fl_print_format(".%q", main->output.to.stream, f_string_eol_s);
}
else {
- fl_print_format(" with no %[%s%].%q", main->output.to.stream, main->context.set.notable, controller_max_s, main->context.set.notable, f_string_eol_s);
+ fl_print_format(" with no %[%q%].%q", main->output.to.stream, main->context.set.notable, controller_max_s, main->context.set.notable, f_string_eol_s);
}
controller_unlock_print_flush(main->output.to, thread);
return status;
}
- status = f_string_append(f_path_separator_s, F_path_separator_s_length, alias);
+ status = f_string_dynamic_append(f_path_separator_s, alias);
if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_append", F_true);
+ controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
return status;
}
break;
}
- if (fl_string_dynamic_compare_string(controller_freeze_s, cache->action.name_action, controller_freeze_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_freeze_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_freeze_e;
}
- else if (fl_string_dynamic_compare_string(controller_group_s, cache->action.name_action, controller_group_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_group_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_group_e;
}
- else if (fl_string_dynamic_compare_string(controller_kill_s, cache->action.name_action, controller_kill_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_kill_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_kill_e;
}
- else if (fl_string_dynamic_compare_string(controller_pause_s, cache->action.name_action, controller_pause_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_pause_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_pause_e;
}
- else if (fl_string_dynamic_compare_string(controller_pid_file_s, cache->action.name_action, controller_pid_file_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_pid_file_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_pid_file_e;
}
- else if (fl_string_dynamic_compare_string(controller_reload_s, cache->action.name_action, controller_reload_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_reload_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_reload_e;
}
- else if (fl_string_dynamic_compare_string(controller_rerun_s, cache->action.name_action, controller_rerun_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_rerun_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_rerun_e;
}
- else if (fl_string_dynamic_compare_string(controller_restart_s, cache->action.name_action, controller_restart_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_restart_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_restart_e;
}
- else if (fl_string_dynamic_compare_string(controller_resume_s, cache->action.name_action, controller_resume_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_resume_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_resume_e;
}
- else if (fl_string_dynamic_compare_string(controller_start_s, cache->action.name_action, controller_start_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_start_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_start_e;
}
- else if (fl_string_dynamic_compare_string(controller_stop_s, cache->action.name_action, controller_stop_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_stop_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_stop_e;
}
- else if (fl_string_dynamic_compare_string(controller_thaw_s, cache->action.name_action, controller_thaw_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_thaw_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_thaw_e;
}
- else if (fl_string_dynamic_compare_string(controller_user_s, cache->action.name_action, controller_user_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_user_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_user_e;
}
- else if (fl_string_dynamic_compare_string(controller_with_s, cache->action.name_action, controller_with_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_with_s, cache->action.name_action) == F_equal_to) {
type = controller_rule_action_type_with_e;
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SUnknown rule item action '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_format("%q%[%QUnknown rule item action '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SFSS Extended List is not allowed for the rule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QFSS Extended List is not allowed for the rule item action '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
switch (type) {
case controller_rule_item_type_command_e:
- buffer.string = controller_command_s;
- buffer.used = controller_command_s_length;
+ buffer = controller_command_s;
break;
case controller_rule_item_type_script_e:
- buffer.string = controller_script_s;
- buffer.used = controller_script_s_length;
+ buffer = controller_script_s;
break;
case controller_rule_item_type_service_e:
- buffer.string = controller_service_s;
- buffer.used = controller_service_s_length;
+ buffer = controller_service_s;
break;
case controller_rule_item_type_setting_e:
- buffer.string = controller_setting_s;
- buffer.used = controller_setting_s_length;
+ buffer = controller_setting_s;
break;
case controller_rule_item_type_utility_e:
- buffer.string = controller_utility_s;
- buffer.used = controller_utility_s_length;
+ buffer = controller_utility_s;
break;
}
switch (type) {
case controller_resource_limit_type_as_e:
- buffer.string = controller_as_s;
- buffer.used = controller_as_s_length;
+ buffer = controller_as_s;
break;
case controller_resource_limit_type_core_e:
- buffer.string = controller_core_s;
- buffer.used = controller_core_s_length;
+ buffer = controller_core_s;
break;
case controller_resource_limit_type_cpu_e:
- buffer.string = controller_cpu_s;
- buffer.used = controller_cpu_s_length;
+ buffer = controller_cpu_s;
break;
case controller_resource_limit_type_data_e:
- buffer.string = controller_data_s;
- buffer.used = controller_data_s_length;
+ buffer = controller_data_s;
break;
case controller_resource_limit_type_fsize_e:
- buffer.string = controller_fsize_s;
- buffer.used = controller_fsize_s_length;
+ buffer = controller_fsize_s;
break;
case controller_resource_limit_type_locks_e:
- buffer.string = controller_locks_s;
- buffer.used = controller_locks_s_length;
+ buffer = controller_locks_s;
break;
case controller_resource_limit_type_memlock_e:
- buffer.string = controller_memlock_s;
- buffer.used = controller_memlock_s_length;
+ buffer = controller_memlock_s;
break;
case controller_resource_limit_type_msgqueue_e:
- buffer.string = controller_msgqueue_s;
- buffer.used = controller_msgqueue_s_length;
+ buffer = controller_msgqueue_s;
break;
case controller_resource_limit_type_nice_e:
- buffer.string = controller_nice_s;
- buffer.used = controller_nice_s_length;
+ buffer = controller_nice_s;
break;
case controller_resource_limit_type_nofile_e:
- buffer.string = controller_nofile_s;
- buffer.used = controller_nofile_s_length;
+ buffer = controller_nofile_s;
break;
case controller_resource_limit_type_nproc_e:
- buffer.string = controller_nproc_s;
- buffer.used = controller_nproc_s_length;
+ buffer = controller_nproc_s;
break;
case controller_resource_limit_type_rss_e:
- buffer.string = controller_rss_s;
- buffer.used = controller_rss_s_length;
+ buffer = controller_rss_s;
break;
case controller_resource_limit_type_rtprio_e:
- buffer.string = controller_rtprio_s;
- buffer.used = controller_rtprio_s_length;
+ buffer = controller_rtprio_s;
break;
case controller_resource_limit_type_rttime_e:
- buffer.string = controller_rttime_s;
- buffer.used = controller_rttime_s_length;
+ buffer = controller_rttime_s;
break;
case controller_resource_limit_type_sigpending_e:
- buffer.string = controller_sigpending_s;
- buffer.used = controller_sigpending_s_length;
+ buffer = controller_sigpending_s;
break;
case controller_resource_limit_type_stack_e:
- buffer.string = controller_stack_s;
- buffer.used = controller_stack_s_length;
+ buffer = controller_stack_s;
break;
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SUnsupported action type '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QUnsupported action type '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rule_action_type_name(process->action), global.main->error.notable);
fl_print_format("%[' while attempting to execute rule.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
process->cache.action.name_item.used = 0;
process->cache.action.name_file.used = 0;
- status = f_string_append(controller_rules_s, controller_rules_s_length, &process->cache.action.name_file);
+ status = f_string_dynamic_append(controller_rules_s, &process->cache.action.name_file);
if (F_status_is_error_not(status)) {
- status = f_string_append(f_path_separator_s, F_path_separator_s_length, &process->cache.action.name_file);
+ status = f_string_dynamic_append(f_path_separator_s, &process->cache.action.name_file);
}
if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, process->cache.action, F_status_set_fine(status), "f_string_append", F_true, F_true);
+ controller_rule_print_error(global.thread, global.main->error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
return status;
}
return status;
}
- status = f_string_append(F_path_extension_separator_s, F_path_extension_separator_s_length, &process->cache.action.name_file);
+ status = f_string_dynamic_append(f_path_extension_separator_s, &process->cache.action.name_file);
if (F_status_is_error_not(status)) {
- status = f_string_append(controller_rule_s, controller_rule_s_length, &process->cache.action.name_file);
+ status = f_string_dynamic_append(controller_rule_s, &process->cache.action.name_file);
}
if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, process->cache.action, F_status_set_fine(status), "f_string_append", F_true, F_true);
+ controller_rule_print_error(global.thread, global.main->error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
return status;
}
}
// i==0 is need, i==1 is want, i==2 is wish.
- // loop through all dependencies: wait for depedency, execute dependency, fail due to missing required dependency, or skip unrequired missing dependencies.
+ // Loop through all dependencies: wait for depedency, execute dependency, fail due to missing required dependency, or skip unrequired missing dependencies.
for (i = 0; i < 3 && controller_thread_is_enabled_process(process, global.thread); ++i) {
for (j = 0; j < dynamics[i]->used && controller_thread_is_enabled_process(process, global.thread); ++j) {
if (process->rule.items.array[i].actions.array[j].type == process->action) {
missing = F_false;
+
break;
}
} // for
controller_lock_print(global.main->error.to, global.thread);
if (process->rule.items.used) {
- fl_print_format("%q%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.name, global.main->error.notable);
fl_print_format("%[' has no '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rule_action_type_name(process->action), global.main->error.notable);
fl_print_format("%[' action to execute.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
}
else {
- fl_print_format("%q%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.name, global.main->error.notable);
fl_print_format("%[ has no known '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s %s%]", global.main->error.to.stream, global.main->error.notable, controller_rule_s, controller_type_s, global.main->error.notable);
+ fl_print_format("%[%q %q%]", global.main->error.to.stream, global.main->error.notable, controller_rule_s, controller_type_s, global.main->error.notable);
fl_print_format("%[' (such as '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_command_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_command_s, global.main->error.notable);
fl_print_format("%[', '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_service_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_service_s, global.main->error.notable);
fl_print_format("%[', '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_script_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_script_s, global.main->error.notable);
fl_print_format("%[', or '%]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
- fl_print_format("%[%s%]", global.main->error.to.stream, global.main->error.notable, controller_utility_s, global.main->error.notable);
+ fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_utility_s, global.main->error.notable);
fl_print_format("%[') to execute.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
}
if (F_status_set_fine(status) != F_interrupt) {
status = controller_lock_read_process(process, global.thread, &process->lock);
-
- if (F_status_is_error_not(status)) {
- return status_lock;
- }
+ if (F_status_is_error_not(status)) return status_lock;
}
return F_status_set_error(F_lock);
f_thread_unlock(&process->lock);
status = controller_lock_read_process(process, global.thread, &process->lock);
-
- if (F_status_is_error_not(status)) {
- return status_lock;
- }
+ if (F_status_is_error_not(status)) return status_lock;
return F_status_set_error(F_lock);
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QThe rule '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.alias, global.main->error.notable);
fl_print_format("%[' is already on the execution dependency stack, this recursion is prohibited.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
}
else {
- status = controller_file_load(global, F_true, controller_rules_s, rule->alias, controller_rule_s, controller_rules_s_length, controller_rule_s_length, cache);
+ status = controller_file_load(global, F_true, controller_rules_s, rule->alias, controller_rule_s, cache);
}
}
break;
}
- if (fl_string_dynamic_compare_string(controller_setting_s, cache->action.name_item, controller_setting_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_setting_s, cache->action.name_item) == F_equal_to) {
rule->items.array[rule->items.used].type = 0;
}
- else if (fl_string_dynamic_compare_string(controller_command_s, cache->action.name_item, controller_command_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_command_s, cache->action.name_item) == F_equal_to) {
rule->items.array[rule->items.used].type = controller_rule_item_type_command_e;
}
- else if (fl_string_dynamic_compare_string(controller_script_s, cache->action.name_item, controller_script_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_script_s, cache->action.name_item) == F_equal_to) {
rule->items.array[rule->items.used].type = controller_rule_item_type_script_e;
}
- else if (fl_string_dynamic_compare_string(controller_service_s, cache->action.name_item, controller_service_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_service_s, cache->action.name_item) == F_equal_to) {
rule->items.array[rule->items.used].type = controller_rule_item_type_service_e;
}
- else if (fl_string_dynamic_compare_string(controller_utility_s, cache->action.name_item, controller_utility_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_utility_s, cache->action.name_item) == F_equal_to) {
rule->items.array[rule->items.used].type = controller_rule_item_type_utility_e;
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SUnknown rule item '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_format("%q%[%QUnknown rule item '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_item, global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
empty_disallow = F_true;
- if (fl_string_dynamic_compare_string(controller_affinity_s, cache->action.name_item, controller_affinity_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(controller_affinity_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_affinity_e;
}
- else if (fl_string_dynamic_compare_string(controller_capability_s, cache->action.name_item, controller_capability_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_capability_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_capability_e;
}
- else if (fl_string_dynamic_compare_string(controller_cgroup_s, cache->action.name_item, controller_cgroup_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_cgroup_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_cgroup_e;
}
- else if (fl_string_dynamic_compare_string(controller_define_s, cache->action.name_item, controller_define_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_define_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_define_e;
}
- else if (fl_string_dynamic_compare_string(controller_environment_s, cache->action.name_item, controller_environment_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_environment_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_environment_e;
empty_disallow = F_false;
}
- else if (fl_string_dynamic_compare_string(controller_group_s, cache->action.name_item, controller_group_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_group_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_group_e;
}
- else if (fl_string_dynamic_compare_string(controller_limit_s, cache->action.name_item, controller_limit_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_limit_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_limit_e;
}
- else if (fl_string_dynamic_compare_string(controller_name_s, cache->action.name_item, controller_name_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_name_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_name_e;
}
- else if (fl_string_dynamic_compare_string(controller_nice_s, cache->action.name_item, controller_nice_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_nice_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_nice_e;
}
- else if (fl_string_dynamic_compare_string(controller_on_s, cache->action.name_item, controller_on_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_on_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_on_e;
}
- else if (fl_string_dynamic_compare_string(controller_parameter_s, cache->action.name_item, controller_parameter_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_parameter_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_parameter_e;
}
- else if (fl_string_dynamic_compare_string(controller_path_s, cache->action.name_item, controller_path_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_path_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_path_e;
}
- else if (fl_string_dynamic_compare_string(controller_scheduler_s, cache->action.name_item, controller_scheduler_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_scheduler_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_scheduler_e;
}
- else if (fl_string_dynamic_compare_string(controller_script_s, cache->action.name_item, controller_script_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_script_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_script_e;
}
- else if (fl_string_dynamic_compare_string(controller_timeout_s, cache->action.name_item, controller_timeout_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_timeout_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_timeout_e;
}
- else if (fl_string_dynamic_compare_string(controller_user_s, cache->action.name_item, controller_user_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(controller_user_s, cache->action.name_item) == F_equal_to) {
type = controller_rule_setting_type_user_e;
}
else {
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SUnknown rule setting '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
+ fl_print_format("%q%[%QUnknown rule setting '%]", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_item, global.main->warning.notable);
fl_print_format("%['.%]%q", global.main->warning.to.stream, global.main->warning.context, global.main->warning.context, f_string_eol_s);
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
controller_lock_print(global.main->warning.to, global.thread);
- fl_print_format("%q%[%SEmpty rule setting.%]%q", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s);
+ fl_print_format("%q%[%QEmpty rule setting.%]%q", global.main->warning.to.stream, f_string_eol_s, global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->warning, cache->action, F_false);
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "macro_f_int32s_t_resize", F_true, F_false);
+
break;
}
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
continue;
}
- controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_define_e ? controller_define_s : controller_parameter_s, 0, setting_maps->array[setting_maps->used].name, 0);
+ controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_define_e ? controller_define_s : controller_parameter_s, f_string_empty_s, setting_maps->array[setting_maps->used].name, 0);
++setting_maps->used;
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_existing_s, cache->buffer_item, controller_existing_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_existing_s.string, cache->buffer_item, controller_existing_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->cgroup.as_new = F_false;
}
- else if (fl_string_dynamic_partial_compare_string(controller_new_s, cache->buffer_item, controller_new_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_new_s.string, cache->buffer_item, controller_new_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->cgroup.as_new = F_true;
}
else {
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase", F_true, F_false);
+
break;
}
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_as_s, cache->buffer_item, controller_as_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_as_s.string, cache->buffer_item, controller_as_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_as_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_core_s, cache->buffer_item, controller_core_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_core_s.string, cache->buffer_item, controller_core_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_core_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_cpu_s, cache->buffer_item, controller_cpu_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_cpu_s.string, cache->buffer_item, controller_cpu_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_cpu_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_data_s, cache->buffer_item, controller_data_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_data_s.string, cache->buffer_item, controller_data_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_data_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_fsize_s, cache->buffer_item, controller_fsize_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_fsize_s.string, cache->buffer_item, controller_fsize_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_fsize_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_locks_s, cache->buffer_item, controller_locks_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_locks_s.string, cache->buffer_item, controller_locks_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_locks_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_memlock_s, cache->buffer_item, controller_memlock_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_memlock_s.string, cache->buffer_item, controller_memlock_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_memlock_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_msgqueue_s, cache->buffer_item, controller_msgqueue_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_msgqueue_s.string, cache->buffer_item, controller_msgqueue_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_msgqueue_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_nice_s, cache->buffer_item, controller_nice_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_nice_s.string, cache->buffer_item, controller_nice_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_nice_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_nofile_s, cache->buffer_item, controller_nofile_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_nofile_s.string, cache->buffer_item, controller_nofile_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_nofile_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_nproc_s, cache->buffer_item, controller_nproc_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_nproc_s.string, cache->buffer_item, controller_nproc_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_nproc_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_rss_s, cache->buffer_item, controller_rss_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_rss_s.string, cache->buffer_item, controller_rss_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_rss_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_rtprio_s, cache->buffer_item, controller_rtprio_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_rtprio_s.string, cache->buffer_item, controller_rtprio_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_rtprio_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_rttime_s, cache->buffer_item, controller_rttime_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_rttime_s.string, cache->buffer_item, controller_rttime_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_rttime_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_sigpending_s, cache->buffer_item, controller_sigpending_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_sigpending_s.string, cache->buffer_item, controller_sigpending_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_sigpending_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_stack_s, cache->buffer_item, controller_stack_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_stack_s.string, cache->buffer_item, controller_stack_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
type = controller_resource_limit_type_stack_e;
}
else {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SUnknown resource limit type '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QUnknown resource limit type '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting has an invalid name '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting has an invalid name '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, *setting_value, global.main->error.notable);
fl_print_format("%[', there must be at least 1 graph character.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
continue;
}
- controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_name_e ? controller_name_s : controller_script_s, 0, *setting_value, 0);
+ controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_name_e ? controller_name_s : controller_script_s, f_string_empty_s, *setting_value, 0);
}
else if (type == controller_rule_setting_type_path_e) {
status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
continue;
}
- controller_rule_setting_read_print_value(global, controller_path_s, 0, *setting_value, 0);
+ controller_rule_setting_read_print_value(global, controller_path_s, f_string_empty_s, *setting_value, 0);
}
continue;
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_batch_s, cache->buffer_item, controller_batch_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_batch_s.string, cache->buffer_item, controller_batch_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->scheduler.policy = SCHED_BATCH;
rule->scheduler.priority = 0;
}
- else if (fl_string_dynamic_partial_compare_string(controller_deadline_s, cache->buffer_item, controller_deadline_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_deadline_s.string, cache->buffer_item, controller_deadline_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->scheduler.policy = SCHED_DEADLINE;
rule->scheduler.priority = 49;
}
- else if (fl_string_dynamic_partial_compare_string(controller_fifo_s, cache->buffer_item, controller_fifo_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_fifo_s.string, cache->buffer_item, controller_fifo_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->scheduler.policy = SCHED_FIFO;
rule->scheduler.priority = 49;
}
- else if (fl_string_dynamic_partial_compare_string(controller_idle_s, cache->buffer_item, controller_idle_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_idle_s.string, cache->buffer_item, controller_idle_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->scheduler.policy = SCHED_IDLE;
rule->scheduler.priority = 0;
}
- else if (fl_string_dynamic_partial_compare_string(controller_other_s, cache->buffer_item, controller_other_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_other_s.string, cache->buffer_item, controller_other_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->scheduler.policy = SCHED_OTHER;
rule->scheduler.priority = 0;
}
- else if (fl_string_dynamic_partial_compare_string(controller_round_robin_s, cache->buffer_item, controller_round_robin_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_round_robin_s.string, cache->buffer_item, controller_round_robin_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
rule->scheduler.policy = SCHED_RR;
rule->scheduler.priority = 49;
}
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
if (zero_only) {
uint8_t timeout_code = 0;
- if (fl_string_dynamic_partial_compare_string(controller_kill_s, cache->buffer_item, controller_kill_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_kill_s.string, cache->buffer_item, controller_kill_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
timeout_code = controller_rule_timeout_code_kill_d;
}
- else if (fl_string_dynamic_partial_compare_string(controller_start_s, cache->buffer_item, controller_start_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_start_s.string, cache->buffer_item, controller_start_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
timeout_code = controller_rule_timeout_code_start_d;
}
- else if (fl_string_dynamic_partial_compare_string(controller_stop_s, cache->buffer_item, controller_stop_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_stop_s.string, cache->buffer_item, controller_stop_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
timeout_code = controller_rule_timeout_code_stop_d;
}
else {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting's first value has '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting's first value has '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
- fl_print_format("%[' but only supports %s, %s, and %s.%]%q", global.main->error.to.stream, global.main->error.context, controller_kill_s, controller_start_s, controller_stop_s, global.main->error.context, f_string_eol_s);
+ fl_print_format("%[' but only supports %q, %q, and %q.%]%q", global.main->error.to.stream, global.main->error.context, controller_kill_s, controller_start_s, controller_stop_s, global.main->error.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->error, cache->action, F_false);
}
if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) {
- f_string_t name_sub = controller_stop_s;
+ f_string_static_t name_sub = controller_stop_s;
if (timeout_code == controller_rule_timeout_code_kill_d) {
name_sub = controller_kill_s;
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
controller_unlock_print_flush(global.main->error.to, global.thread);
status_return = status;
+
break;
}
continue;
}
- controller_rule_setting_read_print_value(global, controller_capability_s, 0, cache->action.generic, 0);
+ controller_rule_setting_read_print_value(global, controller_capability_s, f_string_empty_s, cache->action.generic, 0);
}
else if (type == controller_rule_setting_type_nice_e) {
f_number_signed_t number = 0;
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
fl_print_format("%[', only the whole numbers inclusively between%] ", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[-20%]", global.main->error.to.stream, global.main->error.notable, global.main->error.notable);
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
}
if (F_status_is_error_not(status)) {
- controller_rule_setting_read_print_value(global, controller_nice_s, 0, cache->action.generic, 0);
+ controller_rule_setting_read_print_value(global, controller_nice_s, f_string_empty_s, cache->action.generic, 0);
}
}
}
status = f_string_dynamic_terminate_after(&cache->action.generic);
}
- controller_rule_setting_read_print_value(global, controller_user_s, 0, cache->action.generic, 0);
+ controller_rule_setting_read_print_value(global, controller_user_s, f_string_empty_s, cache->action.generic, 0);
}
}
}
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
+
break;
}
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting has an invalid environment variable name '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting has an invalid environment variable name '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, setting_values->array[setting_values->used], global.main->error.notable);
fl_print_format("%['.%]%q", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) {
controller_lock_print(global.main->output.to, global.thread);
- fl_print_format("%qProcessing rule item action '%[%s%]' setting value to an empty set.%q", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, controller_environment_s, global.main->context.set.title, f_string_eol_s);
+ fl_print_format("%qProcessing rule item action '%[%q%]' setting value to an empty set.%q", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, controller_environment_s, global.main->context.set.title, f_string_eol_s);
controller_unlock_print_flush(global.main->output.to, global.thread);
}
continue;
}
- if (fl_string_dynamic_partial_compare_string(controller_freeze_s, cache->buffer_item, controller_freeze_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_freeze_s.string, cache->buffer_item, controller_freeze_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_freeze_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_kill_s, cache->buffer_item, controller_kill_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_kill_s.string, cache->buffer_item, controller_kill_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_kill_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_pause_s, cache->buffer_item, controller_pause_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_pause_s.string, cache->buffer_item, controller_pause_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_pause_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_reload_s, cache->buffer_item, controller_reload_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_reload_s.string, cache->buffer_item, controller_reload_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_reload_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_restart_s, cache->buffer_item, controller_restart_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_restart_s.string, cache->buffer_item, controller_restart_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_restart_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_resume_s, cache->buffer_item, controller_resume_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_resume_s.string, cache->buffer_item, controller_resume_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_resume_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_start_s, cache->buffer_item, controller_start_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_start_s.string, cache->buffer_item, controller_start_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_start_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_stop_s, cache->buffer_item, controller_stop_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_stop_s.string, cache->buffer_item, controller_stop_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_stop_e;
}
- else if (fl_string_dynamic_partial_compare_string(controller_thaw_s, cache->buffer_item, controller_thaw_s_length, cache->content_actions.array[i].array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_thaw_s.string, cache->buffer_item, controller_thaw_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
action = controller_rule_action_type_thaw_e;
}
else {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting's second value has '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting's second value has '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
- fl_print_format("%[' but only supports %s, %s, %s, %s, %s", global.main->error.to.stream, global.main->error.context, controller_freeze_s, controller_kill_s, controller_pause_s, controller_reload_s, controller_restart_s);
- fl_print_format("%s, %s, %s, and %s.%]%q", global.main->error.to.stream, controller_resume_s, controller_start_s, controller_stop_s, controller_thaw_s, global.main->error.context, f_string_eol_s);
+ fl_print_format("%[' but only supports %q, %q, %q, %q, %q", global.main->error.to.stream, global.main->error.context, controller_freeze_s, controller_kill_s, controller_pause_s, controller_reload_s, controller_restart_s);
+ fl_print_format("%q, %q, %q, and %q.%]%q", global.main->error.to.stream, controller_resume_s, controller_start_s, controller_stop_s, controller_thaw_s, global.main->error.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->error, cache->action, F_false);
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "controller_rule_ons_increase", F_true, F_false);
}
else {
- if (fl_string_dynamic_partial_compare_string(controller_need_s, cache->buffer_item, controller_need_s_length, cache->content_actions.array[i].array[1]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(controller_need_s.string, cache->buffer_item, controller_need_s.used, cache->content_actions.array[i].array[1]) == F_equal_to) {
setting_values = &rule->ons.array[j].need;
}
- else if (fl_string_dynamic_partial_compare_string(controller_want_s, cache->buffer_item, controller_want_s_length, cache->content_actions.array[i].array[1]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_want_s.string, cache->buffer_item, controller_want_s.used, cache->content_actions.array[i].array[1]) == F_equal_to) {
setting_values = &rule->ons.array[j].want;
}
- else if (fl_string_dynamic_partial_compare_string(controller_wish_s, cache->buffer_item, controller_wish_s_length, cache->content_actions.array[i].array[1]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(controller_wish_s.string, cache->buffer_item, controller_wish_s.used, cache->content_actions.array[i].array[1]) == F_equal_to) {
setting_values = &rule->ons.array[j].wish;
}
else {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SRule setting's second value has '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QRule setting's second value has '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
- fl_print_format("%[' but only supports %s, %s, and %s.%]%q", global.main->error.to.stream, global.main->error.context, controller_need_s, controller_want_s, controller_wish_s, global.main->error.context, f_string_eol_s);
+ fl_print_format("%[' but only supports %q, %q, and %q.%]%q", global.main->error.to.stream, global.main->error.context, controller_need_s, controller_want_s, controller_wish_s, global.main->error.context, f_string_eol_s);
controller_rule_print_error_cache(global.main->error, cache->action, F_false);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- fl_print_format("%q%[%SThe rule item action third parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
+ fl_print_format("%q%[%QThe rule item action third parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[2], global.main->error.notable);
fl_print_format("%[' must be a base path name, such as %un '.%]", global.main->error.to.stream, global.main->error.context, cache->buffer_path.used, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, cache->buffer_path, global.main->error.notable);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, global.thread);
- fl_print_format("%q%[%SUnsupported action type '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QUnsupported action type '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, controller_rule_action_type_name(action), main->error.notable);
fl_print_format("%[' while attempting to validate rule execution.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
fl_print_format("%qRule '", main->output.to.stream, f_string_eol_s);
fl_print_format("%[%Q%]' has no '", main->output.to.stream, main->context.set.title, rule.name, main->context.set.title);
fl_print_format("%[%q%]' action to execute and would '", main->output.to.stream, main->context.set.title, controller_rule_action_type_name(action), main->context.set.title);
- fl_print_format("%[%s%]' because it is '", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_fail_s : controller_succeed_s, main->context.set.important);
- fl_print_format("%[%s%]'.%q", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_required_s : controller_optional_s, main->context.set.important, f_string_eol_s);
+ fl_print_format("%[%q%]' because it is '", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_fail_s : controller_succeed_s, main->context.set.important);
+ fl_print_format("%[%q%]'.%q", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_required_s : controller_optional_s, main->context.set.important, f_string_eol_s);
}
else {
fl_print_format("%qRule '", main->output.to.stream, f_string_eol_s);
fl_print_format("%[%Q%]' has no known '", main->output.to.stream, main->context.set.title, rule.name, main->context.set.title);
- fl_print_format("%[%s %s%]' (such as ", main->output.to.stream, main->context.set.title, controller_rule_s, controller_type_s, main->context.set.title);
- fl_print_format("'%[%s%]', ", main->output.to.stream, main->context.set.title, controller_command_s, main->context.set.title);
- fl_print_format("'%[%s%]', ", main->output.to.stream, main->context.set.title, controller_service_s, main->context.set.title);
- fl_print_format("'%[%s%]', or ", main->output.to.stream, main->context.set.title, controller_script_s, main->context.set.title);
- fl_print_format("'%[%s%]'", main->output.to.stream, main->context.set.title, controller_utility_s, main->context.set.title);
- fl_print_format(") and would '%[%s%]' because it is '", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_fail_s : controller_succeed_s, main->context.set.important);
- fl_print_format("%[%s%]'.%q", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_required_s : controller_optional_s, main->context.set.important, f_string_eol_s);
+ fl_print_format("%[%q %q%]' (such as ", main->output.to.stream, main->context.set.title, controller_rule_s, controller_type_s, main->context.set.title);
+ fl_print_format("'%[%q%]', ", main->output.to.stream, main->context.set.title, controller_command_s, main->context.set.title);
+ fl_print_format("'%[%q%]', ", main->output.to.stream, main->context.set.title, controller_service_s, main->context.set.title);
+ fl_print_format("'%[%q%]', or ", main->output.to.stream, main->context.set.title, controller_script_s, main->context.set.title);
+ fl_print_format("'%[%q%]'", main->output.to.stream, main->context.set.title, controller_utility_s, main->context.set.title);
+ fl_print_format(") and would '%[%q%]' because it is '", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_fail_s : controller_succeed_s, main->context.set.important);
+ fl_print_format("%[%q%]'.%q", main->output.to.stream, main->context.set.important, options & controller_process_option_require_d ? controller_required_s : controller_optional_s, main->context.set.important, f_string_eol_s);
}
controller_unlock_print_flush(main->output.to, global.thread);
fl_print_format("%qRule %[%Q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.title, rule.alias, main->context.set.title, f_string_eol_s);
// name.
- fl_print_format(" %[%s%] %Q%q", main->output.to.stream, main->context.set.important, controller_name_s, main->context.set.important, rule.name, f_string_eol_s);
+ fl_print_format(" %[%q%] %Q%q", main->output.to.stream, main->context.set.important, controller_name_s, main->context.set.important, rule.name, f_string_eol_s);
// capability.
- fl_print_format(" %[%s%] ", main->output.to.stream, main->context.set.important, controller_capability_s, main->context.set.important);
+ fl_print_format(" %[%q%] ", main->output.to.stream, main->context.set.important, controller_capability_s, main->context.set.important);
if (f_capability_supported()) {
if (rule.capability) {
}
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
}
else {
fl_print_format("%[(unsupported)%]%q", main->output.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
}
// control group.
- fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_cgroup_s, main->context.set.important);
+ fl_print_format(" %[%q%]", main->output.to.stream, main->context.set.important, controller_cgroup_s, main->context.set.important);
if (rule.has & controller_rule_has_cgroup_d) {
- fl_print_format(" %s", main->output.to.stream, rule.cgroup.as_new ? controller_new_s : controller_existing_s);
+ fl_print_format(" %q", main->output.to.stream, rule.cgroup.as_new ? controller_new_s : controller_existing_s);
for (i = 0; i < rule.cgroup.groups.used; ++i) {
} // for
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
- // how.
- fl_print_format(" %[%s%] %s%q", main->output.to.stream, main->context.set.important, controller_how_s, main->context.set.important, options & controller_process_option_asynchronous_d ? controller_asynchronous_s : controller_synchronous_s, f_string_eol_s);
+ // How.
+ fl_print_format(" %[%q%] %q%q", main->output.to.stream, main->context.set.important, controller_how_s, main->context.set.important, options & controller_process_option_asynchronous_d ? controller_asynchronous_s : controller_synchronous_s, f_string_eol_s);
- // nice.
- fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_nice_s, main->context.set.important);
+ // Nice.
+ fl_print_format(" %[%q%]", main->output.to.stream, main->context.set.important, controller_nice_s, main->context.set.important);
if (rule.has & controller_rule_has_nice_d) {
fl_print_format(" %i", main->output.to.stream, rule.nice);
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
- // scheduler.
- fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_scheduler_s, main->context.set.important);
+ // Scheduler.
+ fl_print_format(" %[%q%]", main->output.to.stream, main->context.set.important, controller_scheduler_s, main->context.set.important);
if (rule.has & controller_rule_has_scheduler_d) {
- f_string_t policy = "";
+ f_string_static_t policy = f_string_static_t_initialize;
if (rule.scheduler.policy == SCHED_BATCH) {
policy = controller_batch_s;
policy = controller_round_robin_s;
}
- fl_print_format(" %s %i", main->output.to.stream, policy, rule.scheduler.priority);
+ fl_print_format(" %q %i", main->output.to.stream, policy, rule.scheduler.priority);
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
// script.
- fl_print_format(" %[%s%] %Q%q", main->output.to.stream, main->context.set.important, controller_script_s, main->context.set.important, rule.script, f_string_eol_s);
+ fl_print_format(" %[%q%] %Q%q", main->output.to.stream, main->context.set.important, controller_script_s, main->context.set.important, rule.script, f_string_eol_s);
// user.
- fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_user_s, main->context.set.important);
+ fl_print_format(" %[%q%]", main->output.to.stream, main->context.set.important, controller_user_s, main->context.set.important);
if (rule.has & controller_rule_has_user_d) {
fl_print_format(" %i", main->output.to.stream, rule.user);
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
// wait.
- fl_print_format(" %[%s%] %s%q", main->output.to.stream, main->context.set.important, controller_wait_s, main->context.set.important, options & controller_process_option_wait_d ? controller_yes_s : controller_no_s, f_string_eol_s);
+ fl_print_format(" %[%q%] %q%q", main->output.to.stream, main->context.set.important, controller_wait_s, main->context.set.important, options & controller_process_option_wait_d ? controller_yes_s : controller_no_s, f_string_eol_s);
// affinity.
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_affinity_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_affinity_s, main->context.set.important, f_string_eol_s);
for (i = 0; i < rule.affinity.used; ++i) {
fl_print_format(" %i%q", main->output.to.stream, rule.affinity.array[i], f_string_eol_s);
} // for
// define.
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_define_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_define_s, main->context.set.important, f_string_eol_s);
for (i = 0; i < rule.define.used; ++i) {
} // for
// environment.
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_environment_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_environment_s, main->context.set.important, f_string_eol_s);
for (i = 0; i < rule.environment.used; ++i) {
}
} // for
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_parameter_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_parameter_s, main->context.set.important, f_string_eol_s);
// parameter.
for (i = 0; i < rule.parameter.used; ++i) {
} // for
// group.
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_group_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_group_s, main->context.set.important, f_string_eol_s);
if (rule.has & controller_rule_has_group_d) {
fl_print_format(" %i%q", main->output.to.stream, rule.group, f_string_eol_s);
}
// limit.
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_limit_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_limit_s, main->context.set.important, f_string_eol_s);
for (i = 0; i < rule.limits.used; ++i) {
fl_print_format(" %Q %[=%] %un %un%q", main->output.to.stream, controller_rule_setting_limit_type_name(rule.limits.array[i].type), main->context.set.important, main->context.set.important, rule.limits.array[i].value.rlim_cur, rule.limits.array[i].value.rlim_max, f_string_eol_s);
} // for
// on.
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_on_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_on_s, main->context.set.important, f_string_eol_s);
for (i = 0; i < rule.ons.used; ++i) {
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_action_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_action_s, main->context.set.important, f_string_eol_s);
{
- f_string_t action = "";
+ f_string_static_t action = f_string_static_t_initialize;
if (rule.ons.array[i].action == controller_rule_action_type_freeze_e) {
action = controller_freeze_s;
action = controller_thaw_s;
}
- fl_print_format(" %[%s%] %s%q", main->output.to.stream, main->context.set.important, controller_type_s, main->context.set.important, action, f_string_eol_s);
+ fl_print_format(" %[%q%] %q%q", main->output.to.stream, main->context.set.important, controller_type_s, main->context.set.important, action, f_string_eol_s);
}
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_need_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_need_s, main->context.set.important, f_string_eol_s);
for (j = 0; j < rule.ons.array[i].need.used; ++j) {
}
} // for
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_want_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_want_s, main->context.set.important, f_string_eol_s);
for (j = 0; j < rule.ons.array[i].want.used; ++j) {
}
} // for
- fl_print_format(" }%q %[%s%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_wish_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" }%q %[%q%] {%q", main->output.to.stream, f_string_eol_s, main->context.set.important, controller_wish_s, main->context.set.important, f_string_eol_s);
for (j = 0; j < rule.ons.array[i].wish.used; ++j) {
item = &rule.items.array[i];
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_item_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_item_s, main->context.set.important, f_string_eol_s);
// type.
- fl_print_format(" %[%s%] %Q%q", main->output.to.stream, main->context.set.important, controller_type_s, main->context.set.important, controller_rule_item_type_name(item->type), f_string_eol_s);
+ fl_print_format(" %[%q%] %Q%q", main->output.to.stream, main->context.set.important, controller_type_s, main->context.set.important, controller_rule_item_type_name(item->type), f_string_eol_s);
// pid_file.
- fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_pid_file_s, main->context.set.important);
+ fl_print_format(" %[%q%]", main->output.to.stream, main->context.set.important, controller_pid_file_s, main->context.set.important);
if (item->pid_file.used) {
fl_print_format(" %Q", main->output.to.stream, item->pid_file);
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
// with.
- fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_with_s, main->context.set.important);
+ fl_print_format(" %[%q%]", main->output.to.stream, main->context.set.important, controller_with_s, main->context.set.important);
if (item->with & controller_with_full_path_d) {
- fl_print_format(" %s", main->output.to.stream, controller_full_path_s);
+ fl_print_format(" %q", main->output.to.stream, controller_full_path_s);
}
if (item->with & controller_with_session_new_d) {
- fl_print_format(" %s", main->output.to.stream, controller_session_new_s);
+ fl_print_format(" %q", main->output.to.stream, controller_session_new_s);
}
if (item->with & controller_with_session_same_d) {
- fl_print_format(" %s", main->output.to.stream, controller_session_same_s);
+ fl_print_format(" %q", main->output.to.stream, controller_session_same_s);
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
// actions.
for (j = 0; j < item->actions.used; ++j) {
action = &item->actions.array[j];
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_action_s, main->context.set.important, f_string_eol_s);
- fl_print_format(" %[%s%] %q%q", main->output.to.stream, main->context.set.important, controller_type_s, main->context.set.important, controller_rule_action_type_name(action->type), f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_action_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] %q%q", main->output.to.stream, main->context.set.important, controller_type_s, main->context.set.important, controller_rule_action_type_name(action->type), f_string_eol_s);
if (item->type == controller_rule_item_type_script_e || item->type == controller_rule_item_type_utility_e) {
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_parameter_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_parameter_s, main->context.set.important, f_string_eol_s);
parameter = &action->parameters.array[0];
if (parameter->string[k] == f_fss_eol_s.string[0]) {
if (k + 1 < parameter->used) {
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
f_print_terminated(" ", main->output.to.stream);
}
}
}
} // for
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
}
fl_print_format(" }%q", main->output.to.stream, f_string_eol_s);
}
else {
for (k = 0; k < action->parameters.used; ++k) {
- fl_print_format(" %[%s%] %Q%q", main->output.to.stream, main->context.set.important, controller_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s);
+ fl_print_format(" %[%q%] %Q%q", main->output.to.stream, main->context.set.important, controller_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s);
} // for
}
} // for
// rerun.
- fl_print_format(" %[%s%] {%q", main->output.to.stream, main->context.set.important, controller_rerun_s, main->context.set.important, f_string_eol_s);
+ fl_print_format(" %[%q%] {%q", main->output.to.stream, main->context.set.important, controller_rerun_s, main->context.set.important, f_string_eol_s);
for (j = 0; j < controller_rule_action_type_execute__enum_size_e; ++j) {
for (k = 0; k < 2; ++k) {
fl_print_format(" %[", main->output.to.stream, main->context.set.important);
switch (j) {
case controller_rule_action_type_execute_freeze_e:
- f_print_terminated(controller_freeze_s, main->output.to.stream);
+ f_print_dynamic(controller_freeze_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_kill_e:
- f_print_terminated(controller_kill_s, main->output.to.stream);
+ f_print_dynamic(controller_kill_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_pause_e:
- f_print_terminated(controller_pause_s, main->output.to.stream);
+ f_print_dynamic(controller_pause_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_reload_e:
- f_print_terminated(controller_reload_s, main->output.to.stream);
+ f_print_dynamic(controller_reload_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_restart_e:
- f_print_terminated(controller_restart_s, main->output.to.stream);
+ f_print_dynamic(controller_restart_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_resume_e:
- f_print_terminated(controller_resume_s, main->output.to.stream);
+ f_print_dynamic(controller_resume_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_start_e:
- f_print_terminated(controller_start_s, main->output.to.stream);
+ f_print_dynamic(controller_start_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_stop_e:
- f_print_terminated(controller_stop_s, main->output.to.stream);
+ f_print_dynamic(controller_stop_s, main->output.to.stream);
break;
case controller_rule_action_type_execute_thaw_e:
- f_print_terminated(controller_thaw_s, main->output.to.stream);
+ f_print_dynamic(controller_thaw_s, main->output.to.stream);
break;
default:
break;
}
- fl_print_format("%] %s", main->output.to.stream, main->context.set.important, k ? controller_success_s : controller_failure_s);
- fl_print_format(" %s %ul %s %ul", main->output.to.stream, controller_delay_s, rerun_item->delay, controller_max_s, rerun_item->max);
+ fl_print_format("%] %q", main->output.to.stream, main->context.set.important, k ? controller_success_s : controller_failure_s);
+ fl_print_format(" %q %ul %q %ul", main->output.to.stream, controller_delay_s, rerun_item->delay, controller_max_s, rerun_item->max);
if (!k && (item->reruns[j].is & controller_rule_rerun_is_failure_reset_d) || k && (item->reruns[j].is & controller_rule_rerun_is_success_reset_d)) {
- fl_print_format(" %s", main->output.to.stream, controller_reset_s);
+ fl_print_format(" %q", main->output.to.stream, controller_reset_s);
}
- f_print_terminated(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic(f_string_eol_s, main->output.to.stream);
} // for
} // for
fl_print_format(" }%q", main->output.to.stream, f_string_eol_s);
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../rule/private-rule_print.h"
#include "../lock/private-lock_print.h"
fl_print_format("%q%[%QWhile processing ", print.to.stream, f_string_eol_s, print.context, print.prefix);
if (cache.name_action.used) {
- fl_print_format("%s '%]", print.to.stream, item ? controller_action_s : controller_value_s, print.context);
+ fl_print_format("%q '%]", print.to.stream, item ? controller_action_s : controller_value_s, print.context);
fl_print_format("%[%Q%]", print.to.stream, print.notable, cache.name_action, print.notable);
fl_print_format("%[' on line%] ", print.to.stream, print.context, print.context);
fl_print_format("%[%un%]", print.to.stream, print.notable, cache.line_action, print.notable);
}
if (cache.name_item.used) {
- fl_print_format("rule %s '%]", print.to.stream, item ? controller_item_s : controller_setting_s, print.context);
+ fl_print_format("rule %q '%]", print.to.stream, item ? controller_item_s : controller_setting_s, print.context);
fl_print_format("%[%Q%]", print.to.stream, print.notable, cache.name_item, print.notable);
fl_print_format("%[' on line%] ", print.to.stream, print.context, print.context);
fl_print_format("%[%un%]", print.to.stream, print.notable, cache.line_item, print.notable);
fl_print_format("%[' failed due to a failure to setup the '%]%[", print->to.stream, print->context, print->context, print->notable);
if (status == F_control_group) {
- f_print_terminated(controller_cgroup_s, print->to.stream);
+ f_print_dynamic(controller_cgroup_s, print->to.stream);
}
else if (status == F_limit) {
- f_print_terminated(controller_limit_s, print->to.stream);
+ f_print_dynamic(controller_limit_s, print->to.stream);
}
else if (status == F_processor) {
- f_print_terminated(controller_processor_s, print->to.stream);
+ f_print_dynamic(controller_processor_s, print->to.stream);
}
else if (status == F_schedule) {
- f_print_terminated(controller_scheduler_s, print->to.stream);
+ f_print_dynamic(controller_scheduler_s, print->to.stream);
}
fl_print_format("%]%['.%]%q", print->to.stream, print->notable, print->context, print->context, f_string_eol_s);
#endif // _di_controller_rule_setting_read_print_error_with_range_
#ifndef _di_controller_rule_setting_read_print_value_
- void controller_rule_setting_read_print_value(const controller_global_t global, const f_string_t name, const f_string_t name_sub, const f_string_static_t value, const f_string_t suffix) {
+ void controller_rule_setting_read_print_value(const controller_global_t global, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix) {
if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) {
return;
controller_lock_print(global.main->output.to, global.thread);
- fl_print_format("%qProcessing rule item action '%[%S%]' setting ", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, name, global.main->context.set.title);
+ fl_print_format("%qProcessing rule item action '%[%Q%]' setting ", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, name, global.main->context.set.title);
- if (name_sub) {
+ if (name_sub.used) {
fl_print_format("'%[%S%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable);
}
else {
#endif // _di_controller_rule_setting_read_print_value_
#ifndef _di_controller_rule_setting_read_print_values_
- void controller_rule_setting_read_print_values(const controller_global_t global, const f_string_t name, const f_array_length_t index, controller_cache_t * const cache) {
+ void controller_rule_setting_read_print_values(const controller_global_t global, const f_string_static_t name, const f_array_length_t index, controller_cache_t * const cache) {
if (global.main->error.verbosity != f_console_verbosity_debug_e && !(global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters[controller_parameter_simulate_e].result == f_console_result_found_e)) {
return;
controller_lock_print(global.main->output.to, global.thread);
- fl_print_format("%qProcessing rule item action '%[%S%]' setting value to", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, name, global.main->context.set.title);
+ fl_print_format("%qProcessing rule item action '%[%Q%]' setting value to", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, name, global.main->context.set.title);
for (f_array_length_t j = 0; j < cache->content_actions.array[index].used; ++j) {
* @param name
* The Object name of the setting being populated.
* @param name_sub
- * (optional) A sub-name associated with the setting being populated.
- * Set to NULL to disable.
+ * A sub-name associated with the setting being populated.
+ * Set to a string with used set to 0 to not use.
* @param value
* The value being set.
* @param suffix
* An additional message to append at the end (before the final period).
*/
#ifndef _di_controller_rule_setting_read_print_value_
- extern void controller_rule_setting_read_print_value(const controller_global_t global, const f_string_t name, const f_string_t name_sub, const f_string_static_t value, const f_string_t suffix) F_attribute_visibility_internal_d;
+ extern void controller_rule_setting_read_print_value(const controller_global_t global, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix) F_attribute_visibility_internal_d;
#endif // _di_controller_rule_setting_read_print_value_
/**
* A structure for containing and caching relevant data.
*/
#ifndef _di_controller_rule_setting_read_print_values_
- extern void controller_rule_setting_read_print_values(const controller_global_t global, const f_string_t name, const f_array_length_t index, controller_cache_t * const cache) F_attribute_visibility_internal_d;
+ extern void controller_rule_setting_read_print_values(const controller_global_t global, const f_string_static_t name, const f_array_length_t index, controller_cache_t * const cache) F_attribute_visibility_internal_d;
#endif // _di_controller_rule_setting_read_print_values_
#ifdef __cplusplus
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../task/private-task.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../task/private-task.h"
#include "../task/private-task_print.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "../controller/private-controller_print.h"
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, &thread);
- fl_print_format("%q%[%SThe pid file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, setting->path_pid.string, main->error.notable);
+ fl_print_format("%q%[%QThe pid file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, setting->path_pid, main->error.notable);
fl_print_format("%[' must not already exist.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
controller_unlock_print_flush(main->error.to, &thread);
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../control/private-control.h"
#include "../controller/private-controller_print.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../entry/private-entry.h"
#include "../lock/private-lock_print.h"
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, entry->global->thread);
- fl_print_format("%q%[%SThe pid file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QThe pid file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, entry->setting->path_pid, main->error.notable);
fl_print_format("%[' must not already exist.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, entry->global->thread);
- fl_print_format("%q%[%SFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_enabled].name, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, entry->global->thread);
- fl_print_format("%q%[%SFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
+ fl_print_format("%q%[%QFailed while processing requested failsafe item '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, entry->global->setting->entry.items.array[entry->global->setting->failsafe_enabled].name, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "../controller/private-controller_print.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "private-thread.h"
#include "private-thread_rule.h"
-#include "../controller/controller.h"
+#include "../controller.h"
#include "../common/private-common.h"
#include "../controller/private-controller.h"
#include "private-thread.h"
build_indexer_arguments rcs
build_language c
build_libraries -lc -lcap
-
build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_path -lfll_print -lfll_program
build_libraries-individual -lfl_console -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_print -lfl_string
build_libraries-individual -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_socket -lf_status_string -lf_string -lf_thread -lf_type_array -lf_utf
-
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
+build_sources_library controller.c common.c
build_sources_library common/private-common.c common/private-cache.c common/private-control.c common/private-entry.c common/private-lock.c common/private-process.c common/private-rule.c common/private-setting.c common/private-task.c common/private-thread.c
build_sources_library control/private-control.c control/private-control_print.c
-build_sources_library controller/controller.c controller/private-controller.c controller/private-controller_print.c
+build_sources_library controller/private-controller.c controller/private-controller_print.c
build_sources_library entry/private-entry.c entry/private-entry_print.c
build_sources_library rule/private-rule.c rule/private-rule_print.c
build_sources_library process/private-process.c
build_sources_library task/private-task.c task/private-task_print.c
build_sources_library lock/private-lock.c lock/private-lock_print.c
build_sources_library thread/private-thread.c thread/private-thread_control.c thread/private-thread_entry.c thread/private-thread_process.c thread/private-thread_rule.c thread/private-thread_signal.c
-build_sources_library
-build_sources_library
-build_sources_library
build_sources_library_shared
build_sources_library_static
build_sources_program main.c
build_sources_program_shared
build_sources_program_static
-build_sources_headers controller.h
+build_sources_headers controller.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fake.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fake_program_version_
+ const f_string_static_t fake_program_version_s = macro_f_string_static_t_initialize2(FAKE_program_version_s, 0, FAKE_program_version_s_length);
+#endif // _di_fake_program_version_
+
+#ifndef _di_fake_program_name_
+ const f_string_static_t fake_program_name_s = macro_f_string_static_t_initialize2(FAKE_program_name_s, 0, FAKE_program_name_s_length);
+ const f_string_static_t fake_program_name_long_s = macro_f_string_static_t_initialize2(FAKE_program_name_long_s, 0, FAKE_program_name_long_s_length);
+#endif // _di_fake_program_name_
+
+#ifndef _di_fake_program_help_parameters_
+ const f_string_static_t fake_program_help_parameters_s = macro_f_string_static_t_initialize2(FAKE_program_help_parameters_s, 0, FAKE_program_help_parameters_s_length);
+#endif // _di_fake_program_help_parameters_
+
+/**
+ * The build operation utilizes pre-defined path structures.
+ * These structures are hard-coded by their individual pieces to be constructed later on.
+ */
+#ifndef _di_fake_path_
+ const f_string_static_t fake_path_part_bash_s = macro_f_string_static_t_initialize2(FAKE_path_part_bash_s, 0, FAKE_path_part_bash_s_length);
+ const f_string_static_t fake_path_part_build_s = macro_f_string_static_t_initialize2(FAKE_path_part_build_s, 0, FAKE_path_part_build_s_length);
+ const f_string_static_t fake_path_part_c_s = macro_f_string_static_t_initialize2(FAKE_path_part_c_s, 0, FAKE_path_part_c_s_length);
+ const f_string_static_t fake_path_part_cpp_s = macro_f_string_static_t_initialize2(FAKE_path_part_cpp_s, 0, FAKE_path_part_cpp_s_length);
+ const f_string_static_t fake_path_part_data_s = macro_f_string_static_t_initialize2(FAKE_path_part_data_s, 0, FAKE_path_part_data_s_length);
+ const f_string_static_t fake_path_part_documents_s = macro_f_string_static_t_initialize2(FAKE_path_part_documents_s, 0, FAKE_path_part_documents_s_length);
+ const f_string_static_t fake_path_part_includes_s = macro_f_string_static_t_initialize2(FAKE_path_part_includes_s, 0, FAKE_path_part_includes_s_length);
+ const f_string_static_t fake_path_part_libraries_s = macro_f_string_static_t_initialize2(FAKE_path_part_libraries_s, 0, FAKE_path_part_libraries_s_length);
+ const f_string_static_t fake_path_part_licenses_s = macro_f_string_static_t_initialize2(FAKE_path_part_licenses_s, 0, FAKE_path_part_licenses_s_length);
+ const f_string_static_t fake_path_part_objects_s = macro_f_string_static_t_initialize2(FAKE_path_part_objects_s, 0, FAKE_path_part_objects_s_length);
+ const f_string_static_t fake_path_part_process_s = macro_f_string_static_t_initialize2(FAKE_path_part_process_s, 0, FAKE_path_part_process_s_length);
+ const f_string_static_t fake_path_part_programs_s = macro_f_string_static_t_initialize2(FAKE_path_part_programs_s, 0, FAKE_path_part_programs_s_length);
+ const f_string_static_t fake_path_part_script_s = macro_f_string_static_t_initialize2(FAKE_path_part_script_s, 0, FAKE_path_part_script_s_length);
+ const f_string_static_t fake_path_part_settings_s = macro_f_string_static_t_initialize2(FAKE_path_part_settings_s, 0, FAKE_path_part_settings_s_length);
+ const f_string_static_t fake_path_part_shared_s = macro_f_string_static_t_initialize2(FAKE_path_part_shared_s, 0, FAKE_path_part_shared_s_length);
+ const f_string_static_t fake_path_part_stage_s = macro_f_string_static_t_initialize2(FAKE_path_part_stage_s, 0, FAKE_path_part_stage_s_length);
+ const f_string_static_t fake_path_part_static_s = macro_f_string_static_t_initialize2(FAKE_path_part_static_s, 0, FAKE_path_part_static_s_length);
+#endif // _di_fake_path_
+
+#ifndef _di_fake_file_
+ const f_string_static_t fake_file_defines_s = macro_f_string_static_t_initialize2(FAKE_file_defines_s, 0, FAKE_file_defines_s_length);
+ const f_string_static_t fake_file_dependencies_s = macro_f_string_static_t_initialize2(FAKE_file_dependencies_s, 0, FAKE_file_dependencies_s_length);
+ const f_string_static_t fake_file_process_pre_s = macro_f_string_static_t_initialize2(FAKE_file_process_pre_s, 0, FAKE_file_process_pre_s_length);
+ const f_string_static_t fake_file_process_post_s = macro_f_string_static_t_initialize2(FAKE_file_process_post_s, 0, FAKE_file_process_post_s_length);
+ const f_string_static_t fake_file_readme_s = macro_f_string_static_t_initialize2(FAKE_file_readme_s, 0, FAKE_file_readme_s_length);
+#endif // _di_fake_file_
+
+/**
+ * Provide default settings.
+ */
+#ifndef _di_fake_defaults_
+ const f_string_static_t fake_default_path_build_s = macro_f_string_static_t_initialize2(FAKE_default_path_build_s, 0, FAKE_default_path_build_s_length);
+ const f_string_static_t fake_default_path_data_s = macro_f_string_static_t_initialize2(FAKE_default_path_data_s, 0, FAKE_default_path_data_s_length);
+ const f_string_static_t fake_default_path_sources_s = macro_f_string_static_t_initialize2(FAKE_default_path_sources_s, 0, FAKE_default_path_sources_s_length);
+ const f_string_static_t fake_default_path_work_s = macro_f_string_static_t_initialize2(FAKE_default_path_work_s, 0, FAKE_default_path_work_s_length);
+
+ const f_string_static_t fake_default_define_s = macro_f_string_static_t_initialize2(FAKE_default_define_s, 0, FAKE_default_define_s_length);
+ const f_string_static_t fake_default_fakefile_s = macro_f_string_static_t_initialize2(FAKE_default_fakefile_s, 0, FAKE_default_fakefile_s_length);
+ const f_string_static_t fake_default_mode_s = macro_f_string_static_t_initialize2(FAKE_default_mode_s, 0, FAKE_default_mode_s_length);
+ const f_string_static_t fake_default_process_s = macro_f_string_static_t_initialize2(FAKE_default_process_s, 0, FAKE_default_process_s_length);
+ const f_string_static_t fake_default_settings_s = macro_f_string_static_t_initialize2(FAKE_default_settings_s, 0, FAKE_default_settings_s_length);
+#endif // _di_fake_defaults_
+
+#ifndef _di_fake_build_language_
+ const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize2(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length);
+ const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize2(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length);
+ const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize2(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length);
+#endif // _di_fake_build_language_
+
+#ifndef _di_fake_build_version_
+ const f_string_static_t fake_build_version_major_s = macro_f_string_static_t_initialize2(FAKE_build_version_major_s, 0, FAKE_build_version_major_s_length);
+ const f_string_static_t fake_build_version_minor_s = macro_f_string_static_t_initialize2(FAKE_build_version_minor_s, 0, FAKE_build_version_minor_s_length);
+ const f_string_static_t fake_build_version_micro_s = macro_f_string_static_t_initialize2(FAKE_build_version_micro_s, 0, FAKE_build_version_micro_s_length);
+ const f_string_static_t fake_build_version_nano_s = macro_f_string_static_t_initialize2(FAKE_build_version_nano_s, 0, FAKE_build_version_nano_s_length);
+#endif // _di_fake_build_version_
+
+#ifndef _di_fake_defines_
+ const f_string_static_t fake_short_define_s = macro_f_string_static_t_initialize2(FAKE_short_define_s, 0, FAKE_short_define_s_length);
+ const f_string_static_t fake_short_fakefile_s = macro_f_string_static_t_initialize2(FAKE_short_fakefile_s, 0, FAKE_short_fakefile_s_length);
+ const f_string_static_t fake_short_mode_s = macro_f_string_static_t_initialize2(FAKE_short_mode_s, 0, FAKE_short_mode_s_length);
+ const f_string_static_t fake_short_process_s = macro_f_string_static_t_initialize2(FAKE_short_process_s, 0, FAKE_short_process_s_length);
+ const f_string_static_t fake_short_settings_s = macro_f_string_static_t_initialize2(FAKE_short_settings_s, 0, FAKE_short_settings_s_length);
+
+ const f_string_static_t fake_short_path_build_s = macro_f_string_static_t_initialize2(FAKE_short_path_build_s, 0, FAKE_short_path_build_s_length);
+ const f_string_static_t fake_short_path_data_s = macro_f_string_static_t_initialize2(FAKE_short_path_data_s, 0, FAKE_short_path_data_s_length);
+ const f_string_static_t fake_short_path_sources_s = macro_f_string_static_t_initialize2(FAKE_short_path_sources_s, 0, FAKE_short_path_sources_s_length);
+ const f_string_static_t fake_short_path_work_s = macro_f_string_static_t_initialize2(FAKE_short_path_work_s, 0, FAKE_short_path_work_s_length);
+
+ const f_string_static_t fake_long_define_s = macro_f_string_static_t_initialize2(FAKE_long_define_s, 0, FAKE_long_define_s_length);
+ const f_string_static_t fake_long_fakefile_s = macro_f_string_static_t_initialize2(FAKE_long_fakefile_s, 0, FAKE_long_fakefile_s_length);
+ const f_string_static_t fake_long_mode_s = macro_f_string_static_t_initialize2(FAKE_long_mode_s, 0, FAKE_long_mode_s_length);
+ const f_string_static_t fake_long_process_s = macro_f_string_static_t_initialize2(FAKE_long_process_s, 0, FAKE_long_process_s_length);
+ const f_string_static_t fake_long_settings_s = macro_f_string_static_t_initialize2(FAKE_long_settings_s, 0, FAKE_long_settings_s_length);
+
+ const f_string_static_t fake_long_path_build_s = macro_f_string_static_t_initialize2(FAKE_long_path_build_s, 0, FAKE_long_path_build_s_length);
+ const f_string_static_t fake_long_path_data_s = macro_f_string_static_t_initialize2(FAKE_long_path_data_s, 0, FAKE_long_path_data_s_length);
+ const f_string_static_t fake_long_path_sources_s = macro_f_string_static_t_initialize2(FAKE_long_path_sources_s, 0, FAKE_long_path_sources_s_length);
+ const f_string_static_t fake_long_path_work_s = macro_f_string_static_t_initialize2(FAKE_long_path_work_s, 0, FAKE_long_path_work_s_length);
+
+ const f_string_static_t fake_long_documents_disabled_s = macro_f_string_static_t_initialize2(FAKE_long_documents_disabled_s, 0, FAKE_long_documents_disabled_s_length);
+ const f_string_static_t fake_long_documents_enabled_s = macro_f_string_static_t_initialize2(FAKE_long_documents_enabled_s, 0, FAKE_long_documents_enabled_s_length);
+ const f_string_static_t fake_long_shared_disabled_s = macro_f_string_static_t_initialize2(FAKE_long_shared_disabled_s, 0, FAKE_long_shared_disabled_s_length);
+ const f_string_static_t fake_long_shared_enabled_s = macro_f_string_static_t_initialize2(FAKE_long_shared_enabled_s, 0, FAKE_long_shared_enabled_s_length);
+ const f_string_static_t fake_long_static_disabled_s = macro_f_string_static_t_initialize2(FAKE_long_static_disabled_s, 0, FAKE_long_static_disabled_s_length);
+ const f_string_static_t fake_long_static_enabled_s = macro_f_string_static_t_initialize2(FAKE_long_static_enabled_s, 0, FAKE_long_static_enabled_s_length);
+
+ const f_string_static_t fake_other_operation_build_s = macro_f_string_static_t_initialize2(FAKE_other_operation_build_s, 0, FAKE_other_operation_build_s_length);
+ const f_string_static_t fake_other_operation_clean_s = macro_f_string_static_t_initialize2(FAKE_other_operation_clean_s, 0, FAKE_other_operation_clean_s_length);
+ const f_string_static_t fake_other_operation_make_s = macro_f_string_static_t_initialize2(FAKE_other_operation_make_s, 0, FAKE_other_operation_make_s_length);
+ const f_string_static_t fake_other_operation_skeleton_s = macro_f_string_static_t_initialize2(FAKE_other_operation_skeleton_s, 0, FAKE_other_operation_skeleton_s_length);
+#endif // _di_fake_defines_
+
+#ifndef _di_fake_main_delete_
+ f_status_t fake_main_delete(fake_main_t * const main) {
+
+ for (f_array_length_t i = 0; i < fake_total_parameters_d; ++i) {
+
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
+ } // for
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ f_string_dynamics_resize(0, &main->define);
+ f_string_dynamic_resize(0, &main->fakefile);
+ f_string_dynamics_resize(0, &main->mode);
+ f_string_dynamic_resize(0, &main->process);
+ f_string_dynamic_resize(0, &main->settings);
+
+ f_string_dynamic_resize(0, &main->path_build);
+ f_string_dynamic_resize(0, &main->path_build_documents);
+ f_string_dynamic_resize(0, &main->path_build_includes);
+ f_string_dynamic_resize(0, &main->path_build_libraries);
+ f_string_dynamic_resize(0, &main->path_build_libraries_script);
+ f_string_dynamic_resize(0, &main->path_build_libraries_shared);
+ f_string_dynamic_resize(0, &main->path_build_libraries_static);
+ f_string_dynamic_resize(0, &main->path_build_objects);
+ f_string_dynamic_resize(0, &main->path_build_programs);
+ f_string_dynamic_resize(0, &main->path_build_programs_script);
+ f_string_dynamic_resize(0, &main->path_build_programs_shared);
+ f_string_dynamic_resize(0, &main->path_build_programs_static);
+ f_string_dynamic_resize(0, &main->path_build_settings);
+ f_string_dynamic_resize(0, &main->path_build_stage);
+ f_string_dynamic_resize(0, &main->path_work);
+
+ f_string_dynamic_resize(0, &main->path_data);
+ f_string_dynamic_resize(0, &main->path_data_build);
+
+ f_string_dynamic_resize(0, &main->path_data_settings);
+
+ f_string_dynamic_resize(0, &main->path_documents);
+
+ f_string_dynamic_resize(0, &main->path_licenses);
+
+ f_string_dynamic_resize(0, &main->path_sources);
+ f_string_dynamic_resize(0, &main->path_sources_bash);
+ f_string_dynamic_resize(0, &main->path_sources_c);
+ f_string_dynamic_resize(0, &main->path_sources_cpp);
+ f_string_dynamic_resize(0, &main->path_sources_script);
+
+ f_string_dynamic_resize(0, &main->path_work);
+ f_string_dynamic_resize(0, &main->path_work_includes);
+ f_string_dynamic_resize(0, &main->path_work_libraries);
+ f_string_dynamic_resize(0, &main->path_work_libraries_script);
+ f_string_dynamic_resize(0, &main->path_work_libraries_shared);
+ f_string_dynamic_resize(0, &main->path_work_libraries_static);
+ f_string_dynamic_resize(0, &main->path_work_programs);
+ f_string_dynamic_resize(0, &main->path_work_programs_script);
+ f_string_dynamic_resize(0, &main->path_work_programs_shared);
+ f_string_dynamic_resize(0, &main->path_work_programs_static);
+
+ f_string_dynamic_resize(0, &main->file_data_build_defines);
+ f_string_dynamic_resize(0, &main->file_data_build_dependencies);
+ f_string_dynamic_resize(0, &main->file_data_build_fakefile);
+ f_string_dynamic_resize(0, &main->file_data_build_settings);
+
+ f_string_dynamic_resize(0, &main->file_documents_readme);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fake_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Featureless Make
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fake_common_h
+#define _fake_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fake_program_version_
+ #define FAKE_program_version_major_s F_string_ascii_0_s
+ #define FAKE_program_version_minor_s F_string_ascii_5_s
+ #define FAKE_program_version_micro_s F_string_ascii_8_s
+
+ #define FAKE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FAKE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FAKE_program_version_micro_s_length F_string_ascii_8_s_length
+
+ #ifndef FAKE_program_version_nano_prefix_s
+ #define FAKE_program_version_nano_prefix_s
+ #define FAKE_program_version_nano_prefix_s_length 0
+ #endif
+
+ #ifndef FAKE_program_version_nano_s
+ #define FAKE_program_version_nano_s
+ #define FAKE_program_version_nano_s_length 0
+ #endif
+
+ #define FAKE_program_version_s FAKE_program_version_major_s F_string_ascii_period_s FAKE_program_version_minor_s F_string_ascii_period_s FAKE_program_version_micro_s FAKE_program_version_nano_prefix_s FAKE_program_version_nano_s
+
+ #define FAKE_program_version_s_length FAKE_program_version_major_s_length + F_string_ascii_period_s_length + FAKE_program_version_minor_s_length + F_string_ascii_period_s_length + FAKE_program_version_micro_s_length + FAKE_program_version_nano_prefix_s_length + FAKE_program_version_nano_s_length
+
+ const f_string_static_t fake_program_version_s;
+#endif // _di_fake_program_version_
+
+#ifndef _di_fake_program_name_
+ #define FAKE_program_name_s "fake"
+ #define FAKE_program_name_long_s "Featureless Make"
+
+ #define FAKE_program_name_s_length 4
+ #define FAKE_program_name_long_s_length 16
+
+ const f_string_static_t fake_program_name_s;
+ const f_string_static_t fake_program_name_long_s;
+#endif // _di_fake_program_name_
+
+#ifndef _di_fake_program_help_parameters_
+ #define FAKE_program_help_parameters_s "operation"
+ #define FAKE_program_help_parameters_s_length 9
+
+ extern const f_string_static_t fake_program_help_parameters_s;
+#endif // _di_fake_program_help_parameters_
+
+/***
+ * Default allocations.
+ *
+ * Set to at least 4 to provide a UTF-8 friendly allocation step.
+ */
+#ifndef _di_fake_default_allocation_step_
+ #define fake_default_allocation_small_d 4
+ #define fake_default_allocation_large_d 64
+#endif // _di_fake_default_allocation_step_
+
+/**
+ * The build operation utilizes pre-defined path structures.
+ * These structures are hard-coded by their individual pieces to be constructed later on.
+ */
+#ifndef _di_fake_path_
+ #define FAKE_path_part_bash_s "bash" F_path_separator_s
+ #define FAKE_path_part_build_s "build" F_path_separator_s
+ #define FAKE_path_part_c_s "c" F_path_separator_s
+ #define FAKE_path_part_cpp_s "c++" F_path_separator_s
+ #define FAKE_path_part_data_s "data" F_path_separator_s
+ #define FAKE_path_part_documents_s "documents" F_path_separator_s
+ #define FAKE_path_part_includes_s "includes" F_path_separator_s
+ #define FAKE_path_part_libraries_s "libraries" F_path_separator_s
+ #define FAKE_path_part_licenses_s "licenses" F_path_separator_s
+ #define FAKE_path_part_objects_s "objects" F_path_separator_s
+ #define FAKE_path_part_process_s "process" F_path_separator_s
+ #define FAKE_path_part_programs_s "programs" F_path_separator_s
+ #define FAKE_path_part_script_s "script" F_path_separator_s
+ #define FAKE_path_part_settings_s "settings" F_path_separator_s
+ #define FAKE_path_part_shared_s "shared" F_path_separator_s
+ #define FAKE_path_part_stage_s "stage" F_path_separator_s
+ #define FAKE_path_part_static_s "static" F_path_separator_s
+
+ #define FAKE_path_part_bash_s_length 5 + F_path_separator_s_length
+ #define FAKE_path_part_build_s_length 6 + F_path_separator_s_length
+ #define FAKE_path_part_c_s_length 2 + F_path_separator_s_length
+ #define FAKE_path_part_cpp_s_length 4 + F_path_separator_s_length
+ #define FAKE_path_part_data_s_length 5 + F_path_separator_s_length
+ #define FAKE_path_part_documents_s_length 10 + F_path_separator_s_length
+ #define FAKE_path_part_includes_s_length 9 + F_path_separator_s_length
+ #define FAKE_path_part_libraries_s_length 10 + F_path_separator_s_length
+ #define FAKE_path_part_licenses_s_length 9 + F_path_separator_s_length
+ #define FAKE_path_part_objects_s_length 8 + F_path_separator_s_length
+ #define FAKE_path_part_process_s_length 8 + F_path_separator_s_length
+ #define FAKE_path_part_programs_s_length 9 + F_path_separator_s_length
+ #define FAKE_path_part_script_s_length 7 + F_path_separator_s_length
+ #define FAKE_path_part_settings_s_length 9 + F_path_separator_s_length
+ #define FAKE_path_part_shared_s_length 7 + F_path_separator_s_length
+ #define FAKE_path_part_stage_s_length 6 + F_path_separator_s_length
+ #define FAKE_path_part_static_s_length 7 + F_path_separator_s_length
+
+ extern const f_string_static_t fake_path_part_bash_s;
+ extern const f_string_static_t fake_path_part_build_s;
+ extern const f_string_static_t fake_path_part_c_s;
+ extern const f_string_static_t fake_path_part_cpp_s;
+ extern const f_string_static_t fake_path_part_data_s;
+ extern const f_string_static_t fake_path_part_documents_s;
+ extern const f_string_static_t fake_path_part_includes_s;
+ extern const f_string_static_t fake_path_part_libraries_s;
+ extern const f_string_static_t fake_path_part_licenses_s;
+ extern const f_string_static_t fake_path_part_objects_s;
+ extern const f_string_static_t fake_path_part_process_s;
+ extern const f_string_static_t fake_path_part_programs_s;
+ extern const f_string_static_t fake_path_part_script_s;
+ extern const f_string_static_t fake_path_part_settings_s;
+ extern const f_string_static_t fake_path_part_shared_s;
+ extern const f_string_static_t fake_path_part_stage_s;
+ extern const f_string_static_t fake_path_part_static_s;
+#endif // _di_fake_path_
+
+#ifndef _di_fake_file_
+ #define FAKE_file_defines_s "defines"
+ #define FAKE_file_dependencies_s "dependencies"
+ #define FAKE_file_process_pre_s "process_pre.sh"
+ #define FAKE_file_process_post_s "process_post.sh"
+ #define FAKE_file_readme_s "readme"
+
+ #define FAKE_file_defines_s_length 7
+ #define FAKE_file_dependencies_s_length 12
+ #define FAKE_file_process_pre_s_length 14
+ #define FAKE_file_process_post_s_length 15
+ #define FAKE_file_readme_s_length 6
+
+ extern const f_string_static_t fake_file_defines_s;
+ extern const f_string_static_t fake_file_dependencies_s;
+ extern const f_string_static_t fake_file_process_pre_s;
+ extern const f_string_static_t fake_file_process_post_s;
+ extern const f_string_static_t fake_file_readme_s;
+#endif // _di_fake_file_
+
+/**
+ * Provide default settings.
+ */
+#ifndef _di_fake_defaults_
+ #define FAKE_default_path_build_s "build" F_path_separator_s
+ #define FAKE_default_path_data_s "data" F_path_separator_s
+ #define FAKE_default_path_sources_s "sources" F_path_separator_s
+ #define FAKE_default_path_work_s ""
+
+ #define FAKE_default_define_s ""
+ #define FAKE_default_fakefile_s "fakefile"
+ #define FAKE_default_mode_s ""
+ #define FAKE_default_process_s ""
+ #define FAKE_default_settings_s "settings"
+
+ #define FAKE_default_path_build_s_length 5 + F_path_separator_s_length
+ #define FAKE_default_path_data_s_length 4 + F_path_separator_s_length
+ #define FAKE_default_path_sources_s_length 7 + F_path_separator_s_length
+ #define FAKE_default_path_work_s_length 0
+
+ #define FAKE_default_define_s_length 0
+ #define FAKE_default_fakefile_s_length 8
+ #define FAKE_default_mode_s_length 0
+ #define FAKE_default_process_s_length 0
+ #define FAKE_default_settings_s_length 8
+
+ extern const f_string_static_t fake_default_path_build_s;
+ extern const f_string_static_t fake_default_path_data_s;
+ extern const f_string_static_t fake_default_path_sources_s;
+ extern const f_string_static_t fake_default_path_work_s;
+
+ extern const f_string_static_t fake_default_define_s;
+ extern const f_string_static_t fake_default_fakefile_s;
+ extern const f_string_static_t fake_default_mode_s;
+ extern const f_string_static_t fake_default_process_s;
+ extern const f_string_static_t fake_default_settings_s;
+#endif // _di_fake_defaults_
+
+#ifndef _di_fake_build_language_
+ enum {
+ fake_build_language_type_bash_e = 1,
+ fake_build_language_type_c_e,
+ fake_build_language_type_cpp_e,
+ };
+
+ #define FAKE_build_language_bash_s "bash"
+ #define FAKE_build_language_c_s "c"
+ #define FAKE_build_language_cpp_s "c++"
+
+ #define FAKE_build_language_bash_s_length 4
+ #define FAKE_build_language_c_s_length 1
+ #define FAKE_build_language_cpp_s_length 3
+
+ extern const f_string_static_t fake_build_language_bash_s;
+ extern const f_string_static_t fake_build_language_c_s;
+ extern const f_string_static_t fake_build_language_cpp_s;
+#endif // _di_fake_build_language_
+
+#ifndef _di_fake_build_version_
+ enum {
+ fake_build_version_type_major_e = 1,
+ fake_build_version_type_minor_e,
+ fake_build_version_type_micro_e,
+ fake_build_version_type_nano_e,
+ };
+
+ #define FAKE_build_version_major_s "major"
+ #define FAKE_build_version_minor_s "minor"
+ #define FAKE_build_version_micro_s "micro"
+ #define FAKE_build_version_nano_s "nano"
+
+ #define FAKE_build_version_major_s_length 5
+ #define FAKE_build_version_minor_s_length 5
+ #define FAKE_build_version_micro_s_length 5
+ #define FAKE_build_version_nano_s_length 4
+
+ extern const f_string_static_t fake_build_version_major_s;
+ extern const f_string_static_t fake_build_version_minor_s;
+ extern const f_string_static_t fake_build_version_micro_s;
+ extern const f_string_static_t fake_build_version_nano_s;
+#endif // _di_fake_build_version_
+
+#ifndef _di_fake_defines_
+ enum {
+ fake_operation_build_e = 1,
+ fake_operation_clean_e,
+ fake_operation_make_e,
+ fake_operation_skeleton_e,
+ };
+
+ #define fake_signal_check_d 10000
+ #define fake_signal_check_tiny_d 4
+ #define fake_signal_check_short_d 16
+
+ #define fake_operations_total_d 4
+ #define fake_operations_initialize { 0, 0, 0, 0 }
+
+ #define FAKE_short_define_s "d"
+ #define FAKE_short_fakefile_s "f"
+ #define FAKE_short_mode_s "m"
+ #define FAKE_short_process_s "p"
+ #define FAKE_short_settings_s "s"
+
+ #define FAKE_short_path_build_s "b"
+ #define FAKE_short_path_data_s "D"
+ #define FAKE_short_path_sources_s "S"
+ #define FAKE_short_path_work_s "w"
+
+ #define FAKE_long_define_s "define"
+ #define FAKE_long_fakefile_s "fakefile"
+ #define FAKE_long_mode_s "mode"
+ #define FAKE_long_process_s "process"
+ #define FAKE_long_settings_s "settings"
+
+ #define FAKE_long_path_build_s "build"
+ #define FAKE_long_path_data_s "data"
+ #define FAKE_long_path_sources_s "sources"
+ #define FAKE_long_path_work_s "work"
+
+ // These special parameters are provided in such a way that they mimic the traditional ./configure script.
+ #define FAKE_long_documents_disabled_s "disable-doc"
+ #define FAKE_long_documents_enabled_s "enable-doc"
+ #define FAKE_long_shared_disabled_s "disable-shared"
+ #define FAKE_long_shared_enabled_s "enable-shared"
+ #define FAKE_long_static_disabled_s "disable-static"
+ #define FAKE_long_static_enabled_s "enable-static"
+
+ #define FAKE_other_operation_build_s "build"
+ #define FAKE_other_operation_clean_s "clean"
+ #define FAKE_other_operation_make_s "make"
+ #define FAKE_other_operation_skeleton_s "skeleton"
+
+ #define FAKE_short_define_s_length 1
+ #define FAKE_short_fakefile_s_length 1
+ #define FAKE_short_mode_s_length 1
+ #define FAKE_short_process_s_length 1
+ #define FAKE_short_settings_s_length 1
+
+ #define FAKE_short_path_build_s_length 1
+ #define FAKE_short_path_data_s_length 1
+ #define FAKE_short_path_sources_s_length 1
+ #define FAKE_short_path_work_s_length 1
+
+ #define FAKE_long_define_s_length 6
+ #define FAKE_long_fakefile_s_length 8
+ #define FAKE_long_mode_s_length 4
+ #define FAKE_long_process_s_length 7
+ #define FAKE_long_settings_s_length 8
+
+ #define FAKE_long_path_build_s_length 5
+ #define FAKE_long_path_data_s_length 4
+ #define FAKE_long_path_sources_s_length 7
+ #define FAKE_long_path_work_s_length 4
+
+ #define FAKE_long_documents_disabled_s_length 11
+ #define FAKE_long_documents_enabled_s_length 10
+ #define FAKE_long_shared_disabled_s_length 14
+ #define FAKE_long_shared_enabled_s_length 13
+ #define FAKE_long_static_disabled_s_length 14
+ #define FAKE_long_static_enabled_s_length 13
+
+ #define FAKE_other_operation_build_s_length 5
+ #define FAKE_other_operation_clean_s_length 5
+ #define FAKE_other_operation_make_s_length 4
+ #define FAKE_other_operation_skeleton_s_length 8
+
+ extern const f_string_static_t fake_short_define_s;
+ extern const f_string_static_t fake_short_fakefile_s;
+ extern const f_string_static_t fake_short_mode_s;
+ extern const f_string_static_t fake_short_process_s;
+ extern const f_string_static_t fake_short_settings_s;
+
+ extern const f_string_static_t fake_short_path_build_s;
+ extern const f_string_static_t fake_short_path_data_s;
+ extern const f_string_static_t fake_short_path_sources_s;
+ extern const f_string_static_t fake_short_path_work_s;
+
+ extern const f_string_static_t fake_long_define_s;
+ extern const f_string_static_t fake_long_fakefile_s;
+ extern const f_string_static_t fake_long_mode_s;
+ extern const f_string_static_t fake_long_process_s;
+ extern const f_string_static_t fake_long_settings_s;
+
+ extern const f_string_static_t fake_long_path_build_s;
+ extern const f_string_static_t fake_long_path_data_s;
+ extern const f_string_static_t fake_long_path_sources_s;
+ extern const f_string_static_t fake_long_path_work_s;
+
+ extern const f_string_static_t fake_long_documents_disabled_s;
+ extern const f_string_static_t fake_long_documents_enabled_s;
+ extern const f_string_static_t fake_long_shared_disabled_s;
+ extern const f_string_static_t fake_long_shared_enabled_s;
+ extern const f_string_static_t fake_long_static_disabled_s;
+ extern const f_string_static_t fake_long_static_enabled_s;
+
+ extern const f_string_static_t fake_other_operation_build_s;
+ extern const f_string_static_t fake_other_operation_clean_s;
+ extern const f_string_static_t fake_other_operation_make_s;
+ extern const f_string_static_t fake_other_operation_skeleton_s;
+
+ enum {
+ fake_parameter_help_e,
+ fake_parameter_light_e,
+ fake_parameter_dark_e,
+ fake_parameter_no_color_e,
+ fake_parameter_verbosity_quiet_e,
+ fake_parameter_verbosity_normal_e,
+ fake_parameter_verbosity_verbose_e,
+ fake_parameter_verbosity_debug_e,
+ fake_parameter_version_e,
+
+ fake_parameter_define_e,
+ fake_parameter_fakefile_e,
+ fake_parameter_mode_e,
+ fake_parameter_process_e,
+ fake_parameter_settings_e,
+
+ fake_parameter_path_build_e,
+ fake_parameter_path_data_e,
+ fake_parameter_path_sources_e,
+ fake_parameter_path_work_e,
+
+ fake_parameter_documents_disabled_e,
+ fake_parameter_documents_enabled_e,
+ fake_parameter_shared_disabled_e,
+ fake_parameter_shared_enabled_e,
+ fake_parameter_static_disabled_e,
+ fake_parameter_static_enabled_e,
+
+ fake_parameter_operation_build_e,
+ fake_parameter_operation_clean_e,
+ fake_parameter_operation_make_e,
+ fake_parameter_operation_skeleton_e,
+ };
+
+ #define fake_console_parameter_t_initialize \
+ { \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(fake_short_define_s.string, fake_long_define_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_fakefile_s.string, fake_long_fakefile_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_mode_s.string, fake_long_mode_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_process_s.string, fake_long_process_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_settings_s.string, fake_long_settings_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_path_build_s.string, fake_long_path_build_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_path_data_s.string, fake_long_path_data_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_path_sources_s.string, fake_long_path_sources_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fake_short_path_work_s.string, fake_long_path_work_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, fake_long_documents_disabled_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, fake_long_documents_enabled_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, fake_long_shared_disabled_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, fake_long_shared_enabled_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, fake_long_static_disabled_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, fake_long_static_enabled_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_build_s.string, 0, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_clean_s.string, 0, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_make_s.string, 0, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_skeleton_s.string, 0, f_console_type_other_e), \
+ }
+
+ #define fake_total_parameters_d 28
+#endif // _di_fake_defines_
+
+#ifndef _di_fake_main_t_
+ typedef struct {
+ f_console_parameter_t parameters[fake_total_parameters_d];
+
+ f_array_lengths_t remaining;
+ bool process_pipe;
+
+ fl_print_t output;
+ fl_print_t error;
+ fl_print_t warning;
+
+ f_signal_t signal;
+
+ uint8_t operation;
+ uint16_t signal_check;
+
+ mode_t umask;
+ int child;
+
+ f_string_dynamics_t define;
+ f_string_dynamic_t fakefile;
+ f_string_dynamics_t mode;
+ f_string_dynamic_t process;
+ f_string_dynamic_t settings;
+
+ f_string_dynamic_t path_build;
+ f_string_dynamic_t path_build_documents;
+ f_string_dynamic_t path_build_includes;
+ f_string_dynamic_t path_build_libraries;
+ f_string_dynamic_t path_build_libraries_script;
+ f_string_dynamic_t path_build_libraries_shared;
+ f_string_dynamic_t path_build_libraries_static;
+ f_string_dynamic_t path_build_objects;
+ f_string_dynamic_t path_build_programs;
+ f_string_dynamic_t path_build_programs_script;
+ f_string_dynamic_t path_build_programs_shared;
+ f_string_dynamic_t path_build_programs_static;
+ f_string_dynamic_t path_build_settings;
+ f_string_dynamic_t path_build_stage;
+
+ f_string_dynamic_t path_data;
+ f_string_dynamic_t path_data_build;
+ f_string_dynamic_t path_data_settings;
+
+ f_string_dynamic_t path_documents;
+
+ f_string_dynamic_t path_licenses;
+
+ f_string_dynamic_t path_sources;
+ f_string_dynamic_t path_sources_bash;
+ f_string_dynamic_t path_sources_c;
+ f_string_dynamic_t path_sources_cpp;
+ f_string_dynamic_t path_sources_script;
+
+ f_string_dynamic_t path_work;
+ f_string_dynamic_t path_work_includes;
+ f_string_dynamic_t path_work_libraries;
+ f_string_dynamic_t path_work_libraries_script;
+ f_string_dynamic_t path_work_libraries_shared;
+ f_string_dynamic_t path_work_libraries_static;
+ f_string_dynamic_t path_work_programs;
+ f_string_dynamic_t path_work_programs_script;
+ f_string_dynamic_t path_work_programs_shared;
+ f_string_dynamic_t path_work_programs_static;
+
+ f_string_dynamic_t file_data_build_defines;
+ f_string_dynamic_t file_data_build_dependencies;
+ f_string_dynamic_t file_data_build_fakefile;
+ f_string_dynamic_t file_data_build_settings;
+
+ f_string_dynamic_t file_documents_readme;
+
+ f_color_context_t context;
+ } fake_main_t;
+
+ #define fake_main_t_initialize \
+ { \
+ fake_console_parameter_t_initialize, \
+ f_array_lengths_t_initialize, \
+ F_false, \
+ fl_print_t_initialize, \
+ macro_fl_print_t_initialize_error(), \
+ macro_fl_print_t_initialize_warning(), \
+ f_signal_t_initialize, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ f_string_dynamics_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamics_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fake_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fake_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fake_main()
+ */
+#ifndef _di_fake_main_delete_
+ extern f_status_t fake_main_delete(fake_main_t * const main);
+#endif // _di_fake_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fake_common_h
fll_program_print_help_header(file, context, fake_program_name_long_s, fake_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fake_short_define_s, fake_long_define_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Append an additional define after defines from settings file.");
- fll_program_print_help_option(file, context, fake_short_fakefile_s, fake_long_fakefile_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Use this fakefile.");
- fll_program_print_help_option(file, context, fake_short_mode_s, fake_long_mode_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use this mode when processing the build settings.");
- fll_program_print_help_option(file, context, fake_short_process_s, fake_long_process_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Process name for storing build states.");
- fll_program_print_help_option(file, context, fake_short_settings_s, fake_long_settings_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Use this settings file.");
+ fll_program_print_help_option(file, context, fake_short_define_s, fake_long_define_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Append an additional define after defines from settings file.");
+ fll_program_print_help_option(file, context, fake_short_fakefile_s, fake_long_fakefile_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this fakefile.");
+ fll_program_print_help_option(file, context, fake_short_mode_s, fake_long_mode_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use this mode when processing the build settings.");
+ fll_program_print_help_option(file, context, fake_short_process_s, fake_long_process_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Process name for storing build states.");
+ fll_program_print_help_option(file, context, fake_short_settings_s, fake_long_settings_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this settings file.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fake_short_path_build_s, fake_long_path_build_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a custom build directory.");
- fll_program_print_help_option(file, context, fake_short_path_data_s, fake_long_path_data_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a custom path to the data files.");
- fll_program_print_help_option(file, context, fake_short_path_sources_s, fake_long_path_sources_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Specify a custom path to the source files.");
- fll_program_print_help_option(file, context, fake_short_path_work_s, fake_long_path_work_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use includes/libraries/programs from this directory instead of system.");
+ fll_program_print_help_option(file, context, fake_short_path_build_s, fake_long_path_build_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom build directory.");
+ fll_program_print_help_option(file, context, fake_short_path_data_s, fake_long_path_data_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom path to the data files.");
+ fll_program_print_help_option(file, context, fake_short_path_sources_s, fake_long_path_sources_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Specify a custom path to the source files.");
+ fll_program_print_help_option(file, context, fake_short_path_work_s, fake_long_path_work_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use includes/libraries/programs from this directory instead of system.");
fl_print_format("%q%q %[Special Options:%] ", file.stream, f_string_eol_s, f_string_eol_s, context.set.important, context.set.important);
- fll_program_print_help_option_long(file, context, fake_long_documents_disabled_s, f_console_symbol_long_enable_s.string, " Forcibly do not build documents files.");
- fll_program_print_help_option_long(file, context, fake_long_documents_enabled_s, f_console_symbol_long_enable_s.string, " Forcibly do build documents files.");
- fll_program_print_help_option_long(file, context, fake_long_shared_disabled_s, f_console_symbol_long_enable_s.string, "Forcibly do not build shared files.");
- fll_program_print_help_option_long(file, context, fake_long_shared_enabled_s, f_console_symbol_long_enable_s.string, " Forcibly do build shared files.");
- fll_program_print_help_option_long(file, context, fake_long_static_disabled_s, f_console_symbol_long_enable_s.string, "Forcibly do not build static files.");
- fll_program_print_help_option_long(file, context, fake_long_static_enabled_s, f_console_symbol_long_enable_s.string, " Forcibly do build static files.");
+ fll_program_print_help_option_long(file, context, fake_long_documents_disabled_s, f_console_symbol_long_enable_s, " Forcibly do not build documents files.");
+ fll_program_print_help_option_long(file, context, fake_long_documents_enabled_s, f_console_symbol_long_enable_s, " Forcibly do build documents files.");
+ fll_program_print_help_option_long(file, context, fake_long_shared_disabled_s, f_console_symbol_long_enable_s, "Forcibly do not build shared files.");
+ fll_program_print_help_option_long(file, context, fake_long_shared_enabled_s, f_console_symbol_long_enable_s, " Forcibly do build shared files.");
+ fll_program_print_help_option_long(file, context, fake_long_static_disabled_s, f_console_symbol_long_enable_s, "Forcibly do not build static files.");
+ fll_program_print_help_option_long(file, context, fake_long_static_enabled_s, f_console_symbol_long_enable_s, " Forcibly do build static files.");
fl_print_format("%q%q %[Operations:%] ", file.stream, f_string_eol_s, f_string_eol_s, context.set.important, context.set.important);
fll_program_print_help_option_other(file, context, fake_other_operation_make_s, " Build or compile the code based on fakefile.");
fll_program_print_help_option_other(file, context, fake_other_operation_skeleton_s, "Build a skeleton directory structure.");
- fll_program_print_help_usage(file, context, fake_program_name_s, "operation");
+ fll_program_print_help_usage(file, context, fake_program_name_s, fake_program_help_parameters_s);
- fl_print_format(" When performing the %[%s%] operation, the", file.stream, context.set.notable, fake_other_operation_build_s, context.set.notable);
- fl_print_format(" %[%q%s%] parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_mode_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When performing the %[%q%] operation, the", file.stream, context.set.notable, fake_other_operation_build_s, context.set.notable);
+ fl_print_format(" %[%q%q%] parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.%q", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_mode_s, context.set.notable, f_string_eol_s);
- fl_print_format(" For example, when a %[%s%]", file.stream, context.set.notable, fake_make_parameter_variable_mode_s, context.set.notable);
+ fl_print_format(" For example, when a %[%q%]", file.stream, context.set.notable, fake_make_parameter_variable_mode_s, context.set.notable);
fl_print_format(" of 'fll_monolithic' is specified, build libraries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').%q%q", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying the %[%s%] or the %[%s%]", file.stream, context.set.notable, fake_make_parameter_variable_fakefile_s, context.set.notable, context.set.notable, fake_make_parameter_variable_settings_s, context.set.notable);
+ fl_print_format(" When specifying the %[%q%] or the %[%q%]", file.stream, context.set.notable, fake_make_parameter_variable_fakefile_s, context.set.notable, context.set.notable, fake_make_parameter_variable_settings_s, context.set.notable);
fl_print_format(" parameters, the filenames are relative to the data build directory, unless a path is used.%q", file.stream, f_string_eol_s);
- fl_print_format(" For example, with '%[%q%s my_fakefile%]' the fakefile at", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile_s, context.set.notable);
- fl_print_format(" '%[./%s%smy_fakefile%]' would be used, however with", file.stream, context.set.notable, fake_default_path_data_s, fake_default_path_build_s, context.set.notable);
- fl_print_format(" '%[%q%s ./my_fakefile%]' the fakefile at", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile_s, context.set.notable);
+ fl_print_format(" For example, with '%[%q%q my_fakefile%]' the fakefile at", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile_s, context.set.notable);
+ fl_print_format(" '%[./%q%qmy_fakefile%]' would be used, however with", file.stream, context.set.notable, fake_default_path_data_s, fake_default_path_build_s, context.set.notable);
+ fl_print_format(" '%[%q%q ./my_fakefile%]' the fakefile at", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile_s, context.set.notable);
fl_print_format(" '%[./my_fakefile%]' would be used.%q%q", file.stream, context.set.notable, context.set.notable, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
operations_length += main->parameters[fake_parameter_operation_skeleton_e].locations.used;
uint8_t operations[operations_length];
- f_string_t operations_name = 0;
+ f_string_static_t operations_name = f_string_static_t_initialize;
{
f_array_length_t locations[operations_length];
if (status == F_child) {
break;
}
- else if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d) && fake_signal_received(main)) {
+
+ if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d) && fake_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
- else if (F_status_is_error(status)) {
+
+ if (F_status_is_error(status)) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, operations_name, main->error.notable);
+ fl_print_format("%q%[%QThe operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, operations_name, main->error.notable);
fl_print_format("%[' failed.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%SYou failed to specify an operation.%]%q%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify an operation.%]%q%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s, f_string_eol_s);
}
status = F_status_set_error(F_parameter);
}
#endif // _di_fake_main_
-#ifndef _di_fake_main_delete_
- f_status_t fake_main_delete(fake_main_t * const main) {
-
- for (f_array_length_t i = 0; i < fake_total_parameters_d; ++i) {
-
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
- } // for
-
- macro_f_array_lengths_t_delete_simple(main->remaining);
-
- macro_f_string_dynamics_t_delete_simple(main->define);
- macro_f_string_dynamic_t_delete_simple(main->fakefile);
- macro_f_string_dynamics_t_delete_simple(main->mode);
- macro_f_string_dynamic_t_delete_simple(main->process);
- macro_f_string_dynamic_t_delete_simple(main->settings);
-
- macro_f_string_dynamic_t_delete_simple(main->path_build);
- macro_f_string_dynamic_t_delete_simple(main->path_build_documents);
- macro_f_string_dynamic_t_delete_simple(main->path_build_includes);
- macro_f_string_dynamic_t_delete_simple(main->path_build_libraries);
- macro_f_string_dynamic_t_delete_simple(main->path_build_libraries_script);
- macro_f_string_dynamic_t_delete_simple(main->path_build_libraries_shared);
- macro_f_string_dynamic_t_delete_simple(main->path_build_libraries_static);
- macro_f_string_dynamic_t_delete_simple(main->path_build_objects);
- macro_f_string_dynamic_t_delete_simple(main->path_build_programs);
- macro_f_string_dynamic_t_delete_simple(main->path_build_programs_script);
- macro_f_string_dynamic_t_delete_simple(main->path_build_programs_shared);
- macro_f_string_dynamic_t_delete_simple(main->path_build_programs_static);
- macro_f_string_dynamic_t_delete_simple(main->path_build_settings);
- macro_f_string_dynamic_t_delete_simple(main->path_build_stage);
- macro_f_string_dynamic_t_delete_simple(main->path_work);
-
- macro_f_string_dynamic_t_delete_simple(main->path_data);
- macro_f_string_dynamic_t_delete_simple(main->path_data_build);
-
- macro_f_string_dynamic_t_delete_simple(main->path_data_settings);
-
- macro_f_string_dynamic_t_delete_simple(main->path_documents);
-
- macro_f_string_dynamic_t_delete_simple(main->path_licenses);
-
- macro_f_string_dynamic_t_delete_simple(main->path_sources);
- macro_f_string_dynamic_t_delete_simple(main->path_sources_bash);
- macro_f_string_dynamic_t_delete_simple(main->path_sources_c);
- macro_f_string_dynamic_t_delete_simple(main->path_sources_cpp);
- macro_f_string_dynamic_t_delete_simple(main->path_sources_script);
-
- macro_f_string_dynamic_t_delete_simple(main->path_work);
- macro_f_string_dynamic_t_delete_simple(main->path_work_includes);
- macro_f_string_dynamic_t_delete_simple(main->path_work_libraries);
- macro_f_string_dynamic_t_delete_simple(main->path_work_libraries_script);
- macro_f_string_dynamic_t_delete_simple(main->path_work_libraries_shared);
- macro_f_string_dynamic_t_delete_simple(main->path_work_libraries_static);
- macro_f_string_dynamic_t_delete_simple(main->path_work_programs);
- macro_f_string_dynamic_t_delete_simple(main->path_work_programs_script);
- macro_f_string_dynamic_t_delete_simple(main->path_work_programs_shared);
- macro_f_string_dynamic_t_delete_simple(main->path_work_programs_static);
-
- macro_f_string_dynamic_t_delete_simple(main->file_data_build_defines);
- macro_f_string_dynamic_t_delete_simple(main->file_data_build_dependencies);
- macro_f_string_dynamic_t_delete_simple(main->file_data_build_fakefile);
- macro_f_string_dynamic_t_delete_simple(main->file_data_build_settings);
-
- macro_f_string_dynamic_t_delete_simple(main->file_documents_readme);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fake_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
* The "stage/" directory will contain build-time data.
*/
#ifndef _fake_h
+#define _fake_h
-// libc includes.
+// Libc includes.
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/directory.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/execute.h>
#include <fll/level_2/file.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// Featureless Make includes.
+#include <program/fake/common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fake_program_version_
- #define fake_program_version_major_s F_string_ascii_0_s
- #define fake_program_version_minor_s F_string_ascii_5_s
- #define fake_program_version_micro_s F_string_ascii_8_s
-
- #ifndef fake_program_version_nano_prefix_s
- #define fake_program_version_nano_prefix_s
- #endif
-
- #ifndef fake_program_version_nano_s
- #define fake_program_version_nano_s
- #endif
-
- #define fake_program_version_s fake_program_version_major_s F_string_ascii_period_s fake_program_version_minor_s F_string_ascii_period_s fake_program_version_micro_s fake_program_version_nano_prefix_s fake_program_version_nano_s
-#endif // _di_fake_program_version_
-
-#ifndef _di_fake_program_name_
- #define fake_program_name_s "fake"
- #define fake_program_name_long_s "Featureless Make"
-#endif // _di_fake_program_name_
-
-#ifndef _di_fake_default_allocation_step_
- // Set to at least 4 to provide a UTF-8 friendly allocation step.
- #define fake_default_allocation_small_d 4
- #define fake_default_allocation_large_d 64
-#endif // _di_fake_default_allocation_step_
-
-/**
- * The build operation utilizes pre-defined path structures.
- * These structures are hard-coded by their individual pieces to be constructed later on.
- */
-#ifndef _di_fake_path_
- #define fake_path_part_bash_s "bash" F_path_separator_s
- #define fake_path_part_build_s "build" F_path_separator_s
- #define fake_path_part_c_s "c" F_path_separator_s
- #define fake_path_part_cpp_s "c++" F_path_separator_s
- #define fake_path_part_data_s "data" F_path_separator_s
- #define fake_path_part_documents_s "documents" F_path_separator_s
- #define fake_path_part_includes_s "includes" F_path_separator_s
- #define fake_path_part_libraries_s "libraries" F_path_separator_s
- #define fake_path_part_licenses_s "licenses" F_path_separator_s
- #define fake_path_part_objects_s "objects" F_path_separator_s
- #define fake_path_part_process_s "process" F_path_separator_s
- #define fake_path_part_programs_s "programs" F_path_separator_s
- #define fake_path_part_script_s "script" F_path_separator_s
- #define fake_path_part_settings_s "settings" F_path_separator_s
- #define fake_path_part_shared_s "shared" F_path_separator_s
- #define fake_path_part_stage_s "stage" F_path_separator_s
- #define fake_path_part_static_s "static" F_path_separator_s
-
- #define fake_path_part_bash_s_length 5
- #define fake_path_part_build_s_length 6
- #define fake_path_part_c_s_length 2
- #define fake_path_part_cpp_s_length 4
- #define fake_path_part_data_s_length 5
- #define fake_path_part_documents_s_length 10
- #define fake_path_part_includes_s_length 9
- #define fake_path_part_libraries_s_length 10
- #define fake_path_part_licenses_s_length 9
- #define fake_path_part_objects_s_length 8
- #define fake_path_part_process_s_length 8
- #define fake_path_part_programs_s_length 9
- #define fake_path_part_script_s_length 7
- #define fake_path_part_settings_s_length 9
- #define fake_path_part_shared_s_length 7
- #define fake_path_part_stage_s_length 6
- #define fake_path_part_static_s_length 7
-#endif // _di_fake_path_
-
-#ifndef _di_fake_file_
- #define fake_file_defines_s "defines"
- #define fake_file_dependencies_s "dependencies"
- #define fake_file_readme_s "readme"
-
- #define fake_file_defines_s_length 7
- #define fake_file_dependencies_s_length 12
- #define fake_file_readme_s_length 6
-#endif // _di_fake_file_
-
-/**
- * Provide default settings.
- */
-#ifndef _di_fake_defaults_
- #define fake_default_path_build_s "build" F_path_separator_s
- #define fake_default_path_data_s "data" F_path_separator_s
- #define fake_default_path_sources_s "sources" F_path_separator_s
- #define fake_default_path_work_s ""
-
- #define fake_default_path_build_s_length 6
- #define fake_default_path_data_s_length 5
- #define fake_default_path_sources_s_length 8
- #define fake_default_path_work_s_length 0
-
- #define fake_default_define_s ""
- #define fake_default_fakefile_s "fakefile"
- #define fake_default_mode_s ""
- #define fake_default_process_s ""
- #define fake_default_settings_s "settings"
-
- #define fake_default_define_s_length 0
- #define fake_default_fakefile_s_length 8
- #define fake_default_mode_s_length 0
- #define fake_default_process_s_length 0
- #define fake_default_settings_s_length 8
-#endif // _di_fake_defaults_
-
-#ifndef _di_fake_build_language_
- enum {
- fake_build_language_type_bash_e = 1,
- fake_build_language_type_c_e,
- fake_build_language_type_cpp_e,
- };
-
- #define fake_build_language_bash_s "bash"
- #define fake_build_language_c_s "c"
- #define fake_build_language_cpp_s "c++"
-
- #define fake_build_language_bash_s_length 4
- #define fake_build_language_c_s_length 1
- #define fake_build_language_cpp_s_length 3
-#endif // _di_fake_build_language_
-
-#ifndef _di_fake_build_version_
- enum {
- fake_build_version_type_major_e = 1,
- fake_build_version_type_minor_e,
- fake_build_version_type_micro_e,
- fake_build_version_type_nano_e,
- };
-
- #define fake_build_version_major_s "major"
- #define fake_build_version_minor_s "minor"
- #define fake_build_version_micro_s "micro"
- #define fake_build_version_nano_s "nano"
-
- #define fake_build_version_major_s_length 5
- #define fake_build_version_minor_s_length 5
- #define fake_build_version_micro_s_length 5
- #define fake_build_version_nano_s_length 4
-#endif // _di_fake_build_version_
-
-#ifndef _di_fake_defines_
- enum {
- fake_operation_build_e = 1,
- fake_operation_clean_e,
- fake_operation_make_e,
- fake_operation_skeleton_e,
- };
-
- #define fake_signal_check_d 10000
- #define fake_signal_check_tiny_d 4
- #define fake_signal_check_short_d 16
-
- #define fake_operations_total_d 4
- #define fake_operations_initialize { 0, 0, 0, 0 }
-
- #define fake_short_define_s "d"
- #define fake_short_fakefile_s "f"
- #define fake_short_mode_s "m"
- #define fake_short_process_s "p"
- #define fake_short_settings_s "s"
-
- #define fake_short_define_s_length 1
- #define fake_short_fakefile_s_length 1
- #define fake_short_mode_s_length 1
- #define fake_short_process_s_length 1
- #define fake_short_settings_s_length 1
-
- #define fake_short_path_build_s "b"
- #define fake_short_path_data_s "D"
- #define fake_short_path_sources_s "S"
- #define fake_short_path_work_s "w"
-
- #define fake_short_path_build_s_length 1
- #define fake_short_path_data_s_length 1
- #define fake_short_path_sources_s_length 1
- #define fake_short_path_work_s_length 1
-
- #define fake_long_define_s "define"
- #define fake_long_fakefile_s "fakefile"
- #define fake_long_mode_s "mode"
- #define fake_long_process_s "process"
- #define fake_long_settings_s "settings"
-
- #define fake_long_define_s_length 6
- #define fake_long_fakefile_s_length 8
- #define fake_long_mode_s_length 4
- #define fake_long_process_s_length 7
- #define fake_long_settings_s_length 8
-
- #define fake_long_path_build_s "build"
- #define fake_long_path_data_s "data"
- #define fake_long_path_sources_s "sources"
- #define fake_long_path_work_s "work"
-
- #define fake_long_path_build_s_length 5
- #define fake_long_path_data_s_length 4
- #define fake_long_path_sources_s_length 7
- #define fake_long_path_work_s_length 4
-
- // these special parameters are provided in such a way that they mimic the traditional ./configure script.
- #define fake_long_documents_disabled_s "disable-doc"
- #define fake_long_documents_enabled_s "enable-doc"
- #define fake_long_shared_disabled_s "disable-shared"
- #define fake_long_shared_enabled_s "enable-shared"
- #define fake_long_static_disabled_s "disable-static"
- #define fake_long_static_enabled_s "enable-static"
-
- #define fake_long_documents_disabled_s_length 11
- #define fake_long_documents_enabled_s_length 10
- #define fake_long_shared_disabled_s_length 14
- #define fake_long_shared_enabled_s_length 13
- #define fake_long_static_disabled_s_length 14
- #define fake_long_static_enabled_s_length 13
-
- #define fake_other_operation_build_s "build"
- #define fake_other_operation_clean_s "clean"
- #define fake_other_operation_make_s "make"
- #define fake_other_operation_skeleton_s "skeleton"
-
- #define fake_other_operation_build_s_length 5
- #define fake_other_operation_clean_s_length 5
- #define fake_other_operation_make_s_length 4
- #define fake_other_operation_skeleton_s_length 8
-
- enum {
- fake_parameter_help_e,
- fake_parameter_light_e,
- fake_parameter_dark_e,
- fake_parameter_no_color_e,
- fake_parameter_verbosity_quiet_e,
- fake_parameter_verbosity_normal_e,
- fake_parameter_verbosity_verbose_e,
- fake_parameter_verbosity_debug_e,
- fake_parameter_version_e,
-
- fake_parameter_define_e,
- fake_parameter_fakefile_e,
- fake_parameter_mode_e,
- fake_parameter_process_e,
- fake_parameter_settings_e,
-
- fake_parameter_path_build_e,
- fake_parameter_path_data_e,
- fake_parameter_path_sources_e,
- fake_parameter_path_work_e,
-
- fake_parameter_documents_disabled_e,
- fake_parameter_documents_enabled_e,
- fake_parameter_shared_disabled_e,
- fake_parameter_shared_enabled_e,
- fake_parameter_static_disabled_e,
- fake_parameter_static_enabled_e,
-
- fake_parameter_operation_build_e,
- fake_parameter_operation_clean_e,
- fake_parameter_operation_make_e,
- fake_parameter_operation_skeleton_e,
- };
-
- #define fake_console_parameter_t_initialize \
- { \
- macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fake_short_define_s, fake_long_define_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_fakefile_s, fake_long_fakefile_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_mode_s, fake_long_mode_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_process_s, fake_long_process_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_settings_s, fake_long_settings_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_path_build_s, fake_long_path_build_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_path_data_s, fake_long_path_data_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_path_sources_s, fake_long_path_sources_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fake_short_path_work_s, fake_long_path_work_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, fake_long_documents_disabled_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, fake_long_documents_enabled_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, fake_long_shared_disabled_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, fake_long_shared_enabled_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, fake_long_static_disabled_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, fake_long_static_enabled_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_build_s, 0, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_clean_s, 0, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_make_s, 0, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_skeleton_s, 0, f_console_type_other_e), \
- }
-
- #define fake_total_parameters_d 28
-#endif // _di_fake_defines_
-
-#ifndef _di_fake_main_t_
- typedef struct {
- f_console_parameter_t parameters[fake_total_parameters_d];
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- uint8_t operation;
- uint16_t signal_check;
-
- mode_t umask;
- int child;
-
- f_string_dynamics_t define;
- f_string_dynamic_t fakefile;
- f_string_dynamics_t mode;
- f_string_dynamic_t process;
- f_string_dynamic_t settings;
-
- f_string_dynamic_t path_build;
- f_string_dynamic_t path_build_documents;
- f_string_dynamic_t path_build_includes;
- f_string_dynamic_t path_build_libraries;
- f_string_dynamic_t path_build_libraries_script;
- f_string_dynamic_t path_build_libraries_shared;
- f_string_dynamic_t path_build_libraries_static;
- f_string_dynamic_t path_build_objects;
- f_string_dynamic_t path_build_programs;
- f_string_dynamic_t path_build_programs_script;
- f_string_dynamic_t path_build_programs_shared;
- f_string_dynamic_t path_build_programs_static;
- f_string_dynamic_t path_build_settings;
- f_string_dynamic_t path_build_stage;
-
- f_string_dynamic_t path_data;
- f_string_dynamic_t path_data_build;
- f_string_dynamic_t path_data_settings;
-
- f_string_dynamic_t path_documents;
-
- f_string_dynamic_t path_licenses;
-
- f_string_dynamic_t path_sources;
- f_string_dynamic_t path_sources_bash;
- f_string_dynamic_t path_sources_c;
- f_string_dynamic_t path_sources_cpp;
- f_string_dynamic_t path_sources_script;
-
- f_string_dynamic_t path_work;
- f_string_dynamic_t path_work_includes;
- f_string_dynamic_t path_work_libraries;
- f_string_dynamic_t path_work_libraries_script;
- f_string_dynamic_t path_work_libraries_shared;
- f_string_dynamic_t path_work_libraries_static;
- f_string_dynamic_t path_work_programs;
- f_string_dynamic_t path_work_programs_script;
- f_string_dynamic_t path_work_programs_shared;
- f_string_dynamic_t path_work_programs_static;
-
- f_string_dynamic_t file_data_build_defines;
- f_string_dynamic_t file_data_build_dependencies;
- f_string_dynamic_t file_data_build_fakefile;
- f_string_dynamic_t file_data_build_settings;
-
- f_string_dynamic_t file_documents_readme;
-
- f_color_context_t context;
- } fake_main_t;
-
- #define fake_main_t_initialize \
- { \
- fake_console_parameter_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- 0, \
- 0, \
- 0, \
- 0, \
- f_string_dynamics_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamics_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fake_main_t_
-
/**
* Print help.
*
const f_console_arguments_t arguments = { argc, argv };
fake_main_t data = fake_main_t_initialize;
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
+ fll_program_standard_setup(&data.signal);
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
-
- // @fixme bad design in POSIX where there is no get umask without setting it.
- data.umask = umask(0);
-
- // restore umask.
- umask(data.umask);
+ f_file_umask_get(&data.umask);
const f_status_t status = fake_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
-
- f_signal_close(&data.signal);
+ fll_program_standard_setdown(&data.signal);
if (status == F_child) {
exit(data.child);
}
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
+
return 0;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return 0;
}
{
const int result = fake_execute(main, data_build.environment, data_build.setting.build_compiler, arguments, status);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
if (F_status_is_error(*status)) return 0;
if (*status == F_child) return result;
result = fake_execute(main, data_build.environment, data_build.setting.build_indexer, arguments, status);
}
- macro_f_string_dynamic_t_delete_simple(file_name);
- macro_f_string_dynamic_t_delete_simple(source_path);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamic_resize(0, &file_name);
+ f_string_dynamic_resize(0, &source_path);
+ f_string_dynamics_resize(0, &arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
fake_build_touch(main, file_stage, status);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe values for the setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, fake_build_setting_name_environment_s, main->error.notable);
+ fl_print_format("%q%[%QThe values for the setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, fake_build_setting_name_environment_s, main->error.notable);
fl_print_format("%[' of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, fake_build_setting_name_environment_s, main->error.notable);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, fake_build_setting_name_environment_s, main->error.notable);
fl_print_format("%[' is too large.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
flockfile(main->error.to.stream);
macro_f_fss_delimits_t_delete_simple(delimits);
}
- macro_f_string_dynamic_t_delete_simple(buffer);
+ f_string_dynamic_resize(0, &buffer);
+
macro_f_fss_objects_t_delete_simple(objects);
macro_f_fss_contents_t_delete_simple(contents);
}
&setting->project_name,
};
- f_string_t names[] = {
+ f_string_static_t names[] = {
fake_build_setting_name_project_name_s,
};
if (!settings[i]->used) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, names[i], main->error.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, names[i], main->error.notable);
fl_print_format("%[' is required but is not specified in the settings file '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, setting_file.used ? path_file : main->file_data_build_settings.string, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
f_string_dynamics_t version_nano_prefix = f_string_dynamics_t_initialize;
f_string_dynamics_t version_target = f_string_dynamics_t_initialize;
- const f_string_t settings_name[] = {
+ const f_string_static_t settings_name[] = {
fake_build_setting_name_build_compiler_s,
fake_build_setting_name_build_indexer_s,
fake_build_setting_name_build_indexer_arguments_s,
fake_build_setting_name_version_target_s,
};
- const f_array_length_t settings_length[] = {
- fake_build_setting_name_build_compiler_s_length,
- fake_build_setting_name_build_indexer_s_length,
- fake_build_setting_name_build_indexer_arguments_s_length,
- fake_build_setting_name_build_language_s_length,
- fake_build_setting_name_build_libraries_s_length,
- fake_build_setting_name_build_libraries_shared_s_length,
- fake_build_setting_name_build_libraries_static_s_length,
- fake_build_setting_name_build_script_s_length,
- fake_build_setting_name_build_shared_s_length,
- fake_build_setting_name_build_sources_headers_s_length,
- fake_build_setting_name_build_sources_headers_shared_s_length,
- fake_build_setting_name_build_sources_headers_static_s_length,
- fake_build_setting_name_build_sources_library_s_length,
- fake_build_setting_name_build_sources_library_shared_s_length,
- fake_build_setting_name_build_sources_library_static_s_length,
- fake_build_setting_name_build_sources_program_s_length,
- fake_build_setting_name_build_sources_program_shared_s_length,
- fake_build_setting_name_build_sources_program_static_s_length,
- fake_build_setting_name_build_sources_script_s_length,
- fake_build_setting_name_build_sources_settings_s_length,
- fake_build_setting_name_build_static_s_length,
- fake_build_setting_name_defines_s_length,
- fake_build_setting_name_defines_library_s_length,
- fake_build_setting_name_defines_library_shared_s_length,
- fake_build_setting_name_defines_library_static_s_length,
- fake_build_setting_name_defines_program_s_length,
- fake_build_setting_name_defines_program_shared_s_length,
- fake_build_setting_name_defines_program_static_s_length,
- fake_build_setting_name_defines_shared_s_length,
- fake_build_setting_name_defines_static_s_length,
- fake_build_setting_name_environment_length_s,
- fake_build_setting_name_flags_s_length,
- fake_build_setting_name_flags_library_s_length,
- fake_build_setting_name_flags_library_shared_s_length,
- fake_build_setting_name_flags_library_static_s_length,
- fake_build_setting_name_flags_program_s_length,
- fake_build_setting_name_flags_program_shared_s_length,
- fake_build_setting_name_flags_program_static_s_length,
- fake_build_setting_name_flags_shared_s_length,
- fake_build_setting_name_flags_static_s_length,
- fake_build_setting_name_modes_s_length,
- fake_build_setting_name_modes_default_s_length,
- fake_build_setting_name_path_headers_s_length,
- fake_build_setting_name_path_headers_preserve_s_length,
- fake_build_setting_name_path_language_s_length,
- fake_build_setting_name_path_library_script_s_length,
- fake_build_setting_name_path_library_shared_s_length,
- fake_build_setting_name_path_library_static_s_length,
- fake_build_setting_name_path_program_script_s_length,
- fake_build_setting_name_path_program_shared_s_length,
- fake_build_setting_name_path_program_static_s_length,
- fake_build_setting_name_path_sources_s_length,
- fake_build_setting_name_path_standard_s_length,
- fake_build_setting_name_process_post_s_length,
- fake_build_setting_name_process_pre_s_length,
- fake_build_setting_name_project_name_s_length,
- fake_build_setting_name_search_exclusive_s_length,
- fake_build_setting_name_search_shared_s_length,
- fake_build_setting_name_search_static_s_length,
- fake_build_setting_name_version_file_s_length,
- fake_build_setting_name_version_major_s_length,
- fake_build_setting_name_version_major_prefix_s_length,
- fake_build_setting_name_version_micro_s_length,
- fake_build_setting_name_version_micro_prefix_s_length,
- fake_build_setting_name_version_minor_s_length,
- fake_build_setting_name_version_minor_prefix_s_length,
- fake_build_setting_name_version_nano_s_length,
- fake_build_setting_name_version_nano_prefix_s_length,
- fake_build_setting_name_version_target_s_length,
- };
-
f_string_dynamics_t *settings_value[] = {
&build_compiler,
&build_indexer,
f_string_t function = "fll_fss_snatch_apart";
- *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, fake_build_setting_total_d, settings_value, settings_matches, 0);
+ *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, fake_build_setting_total_d, settings_value, settings_matches, 0);
if (*status == F_none) {
const int total_build_libraries = setting->build_libraries.used;
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe specified mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe specified mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, modes->array[i], main->error.notable);
fl_print_format("%[' is not a valid mode, according to '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
}
for (j = 0; j < fake_build_setting_total_d; ++j) {
- macro_f_string_dynamic_t_delete_simple(settings_mode_name_dynamic[j]);
+ f_string_dynamic_resize(0, &settings_mode_name_dynamic[j]);
} // for
if (F_status_is_error(*status)) break;
if (main->error.verbosity != f_console_verbosity_quiet_e) {
funlockfile(main->error.to.stream);
- fl_print_format("%q%[%SA setting in the file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QA setting in the file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
fl_print_format("%[' is too long.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
}
}
else {
- const f_string_t settings_single_name[] = {
+ const f_string_static_t settings_single_name[] = {
fake_build_setting_name_build_compiler_s,
fake_build_setting_name_build_indexer_s,
fake_build_setting_name_build_language_s,
if (main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' may only have a single property, only using the first: '%]", main->warning.to.stream, main->warning.context, main->warning.context);
if (main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' may be either '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_yes_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_yes_s, main->warning.notable);
fl_print_format("%[' or '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_no_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_no_s, main->warning.notable);
fl_print_format("%[', defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_yes_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_yes_s, main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
if (main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' may only be one of '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_language_bash_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_language_bash_s, main->warning.notable);
fl_print_format("%[', '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_language_c_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_language_c_s, main->warning.notable);
fl_print_format("%[', or '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_language_cpp_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_language_cpp_s, main->warning.notable);
fl_print_format("%[', defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_language_c_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_language_c_s, main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
if (main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' may only be one of '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_version_major_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_version_major_s, main->warning.notable);
fl_print_format("%[', '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_version_minor_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_version_minor_s, main->warning.notable);
fl_print_format("%[', '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_version_micro_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_version_micro_s, main->warning.notable);
fl_print_format("%[', or '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_version_nano_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_version_nano_s, main->warning.notable);
fl_print_format("%[', defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, settings_single_version_default_name[i], main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_single_version_default_name[i], main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
if (main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, fake_build_setting_name_version_file_s, main->warning.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_setting_name_version_file_s, main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' is required, defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_version_micro_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_version_micro_s, main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
if (main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, fake_build_setting_name_version_target_s, main->warning.notable);
+ fl_print_format("%q%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_setting_name_version_target_s, main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' is required, defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%s%]", main->warning.to.stream, main->warning.notable, fake_build_version_major_s, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, fake_build_version_major_s, main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
settings_matches[67], // version_nano_prefix
};
- const char *name_target[] = {
+ const f_string_static_t name_target[] = {
fake_build_version_major_s,
fake_build_version_minor_s,
fake_build_version_micro_s,
fake_build_version_nano_s,
};
- const char *name_object[] = {
+ const f_string_static_t name_object[] = {
fake_build_setting_name_version_major_s,
fake_build_setting_name_version_minor_s,
fake_build_setting_name_version_micro_s,
fake_build_setting_name_version_nano_s,
};
- const char *setting_name[] = {
+ const f_string_static_t setting_name[] = {
fake_build_setting_name_version_file_s,
fake_build_setting_name_version_target_s,
};
if (!has_prefix_object[i]) {
prefix[i]->used = 0;
- *status = f_string_append(fake_build_setting_default_version_prefix_s, fake_build_setting_default_version_prefix_s_length, prefix[i]);
+ *status = f_string_dynamic_append(fake_build_setting_default_version_prefix_s, prefix[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
+
break;
}
}
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SWhen the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, setting_name[j], main->error.notable);
+ fl_print_format("%q%[%QWhen the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, setting_name[j], main->error.notable);
fl_print_format("%[' is set to '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, name_target[setting_target[j] - 1], main->error.notable);
+ fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, name_target[setting_target[j] - 1], main->error.notable);
fl_print_format("%[' then the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, name_object[i], main->error.notable);
+ fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, name_object[i], main->error.notable);
fl_print_format("%[' Object must have Content.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
*status = F_status_set_error(F_failure);
+
break;
}
} // for
}
}
- macro_f_string_dynamics_t_delete_simple(build_compiler);
- macro_f_string_dynamics_t_delete_simple(build_indexer);
- macro_f_string_dynamics_t_delete_simple(build_language);
- macro_f_string_dynamics_t_delete_simple(build_script);
- macro_f_string_dynamics_t_delete_simple(build_shared);
- macro_f_string_dynamics_t_delete_simple(build_static);
- macro_f_string_dynamics_t_delete_simple(path_headers);
- macro_f_string_dynamics_t_delete_simple(path_headers_preserve);
- macro_f_string_dynamics_t_delete_simple(path_language);
- macro_f_string_dynamics_t_delete_simple(path_library_script);
- macro_f_string_dynamics_t_delete_simple(path_library_shared);
- macro_f_string_dynamics_t_delete_simple(path_library_static);
- macro_f_string_dynamics_t_delete_simple(path_program_script);
- macro_f_string_dynamics_t_delete_simple(path_program_shared);
- macro_f_string_dynamics_t_delete_simple(path_program_static);
- macro_f_string_dynamics_t_delete_simple(path_sources);
- macro_f_string_dynamics_t_delete_simple(path_standard);
- macro_f_string_dynamics_t_delete_simple(process_post);
- macro_f_string_dynamics_t_delete_simple(process_pre);
- macro_f_string_dynamics_t_delete_simple(project_name);
- macro_f_string_dynamics_t_delete_simple(search_exclusive);
- macro_f_string_dynamics_t_delete_simple(search_shared);
- macro_f_string_dynamics_t_delete_simple(search_static);
- macro_f_string_dynamics_t_delete_simple(version_file);
- macro_f_string_dynamics_t_delete_simple(version_major);
- macro_f_string_dynamics_t_delete_simple(version_major_prefix);
- macro_f_string_dynamics_t_delete_simple(version_micro);
- macro_f_string_dynamics_t_delete_simple(version_micro_prefix);
- macro_f_string_dynamics_t_delete_simple(version_minor);
- macro_f_string_dynamics_t_delete_simple(version_minor_prefix);
- macro_f_string_dynamics_t_delete_simple(version_nano);
- macro_f_string_dynamics_t_delete_simple(version_nano_prefix);
- macro_f_string_dynamics_t_delete_simple(version_target);
+ f_string_dynamics_resize(0, &build_compiler);
+ f_string_dynamics_resize(0, &build_indexer);
+ f_string_dynamics_resize(0, &build_language);
+ f_string_dynamics_resize(0, &build_script);
+ f_string_dynamics_resize(0, &build_shared);
+ f_string_dynamics_resize(0, &build_static);
+ f_string_dynamics_resize(0, &path_headers);
+ f_string_dynamics_resize(0, &path_headers_preserve);
+ f_string_dynamics_resize(0, &path_language);
+ f_string_dynamics_resize(0, &path_library_script);
+ f_string_dynamics_resize(0, &path_library_shared);
+ f_string_dynamics_resize(0, &path_library_static);
+ f_string_dynamics_resize(0, &path_program_script);
+ f_string_dynamics_resize(0, &path_program_shared);
+ f_string_dynamics_resize(0, &path_program_static);
+ f_string_dynamics_resize(0, &path_sources);
+ f_string_dynamics_resize(0, &path_standard);
+ f_string_dynamics_resize(0, &process_post);
+ f_string_dynamics_resize(0, &process_pre);
+ f_string_dynamics_resize(0, &project_name);
+ f_string_dynamics_resize(0, &search_exclusive);
+ f_string_dynamics_resize(0, &search_shared);
+ f_string_dynamics_resize(0, &search_static);
+ f_string_dynamics_resize(0, &version_file);
+ f_string_dynamics_resize(0, &version_major);
+ f_string_dynamics_resize(0, &version_major_prefix);
+ f_string_dynamics_resize(0, &version_micro);
+ f_string_dynamics_resize(0, &version_micro_prefix);
+ f_string_dynamics_resize(0, &version_minor);
+ f_string_dynamics_resize(0, &version_minor_prefix);
+ f_string_dynamics_resize(0, &version_nano);
+ f_string_dynamics_resize(0, &version_nano_prefix);
+ f_string_dynamics_resize(0, &version_target);
}
#endif // _di_fake_build_load_setting_process_
}
{
- const f_string_t sources[] = {
+ const f_string_static_t sources[] = {
fake_build_setting_default_version_s,
fake_build_setting_default_version_s,
fake_build_setting_default_version_s,
};
- const f_array_length_t lengths[] = {
- fake_build_setting_default_version_s_length,
- fake_build_setting_default_version_s_length,
- fake_build_setting_default_version_s_length,
- };
-
f_string_dynamic_t * const destinations[] = {
&setting->version_major,
&setting->version_minor,
if (destinations[i]->used) continue;
- *status = f_string_append_assure(sources[i], lengths[i], destinations[i]);
+ *status = f_string_dynamic_append_assure(sources[i], destinations[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append_assure", F_true);
+ fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
break;
}
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_disabled_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_disabled_s, main->error.notable);
fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_enabled_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_enabled_s, main->error.notable);
fl_print_format("%[' contradict, defaulting to '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_static_disabled_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_static_disabled_s, main->error.notable);
fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_static_enabled_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_static_enabled_s, main->error.notable);
fl_print_format("%[' contradict, defaulting to '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe build settings '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, fake_build_setting_name_build_shared_s, main->error.notable);
+ fl_print_format("%q%[%QThe build settings '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, fake_build_setting_name_build_shared_s, main->error.notable);
fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, fake_build_setting_name_build_static_s, main->error.notable);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, fake_build_setting_name_build_static_s, main->error.notable);
fl_print_format("%[' cannot both be false when using the language '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, setting->build_language == fake_build_language_type_c_e ? fake_build_language_c_s : fake_build_language_cpp_s, main->error.notable);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, setting->build_language == fake_build_language_type_c_e ? fake_build_language_c_s : fake_build_language_cpp_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fake_build_stage_sources_settings_s,
};
- const f_array_length_t lengths[] = {
- fake_build_stage_libraries_script_s_length,
- fake_build_stage_libraries_shared_s_length,
- fake_build_stage_libraries_static_s_length,
- fake_build_stage_objects_static_s_length,
- fake_build_stage_process_post_s_length,
- fake_build_stage_process_pre_s_length,
- fake_build_stage_programs_script_s_length,
- fake_build_stage_programs_shared_s_length,
- fake_build_stage_programs_static_s_length,
- fake_build_stage_skeleton_s_length,
- fake_build_stage_sources_headers_s_length,
- fake_build_stage_sources_script_s_length,
- fake_build_stage_sources_settings_s_length,
- };
-
f_string_dynamic_t * const values[] = {
&stage->file_libraries_script,
&stage->file_libraries_shared,
}
if (main->process.used) {
- *status = f_string_append(main->process.string, main->process.used, values[i]);
+ *status = f_string_dynamic_append_nulless(main->process, values[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
- *status = f_string_append(fake_build_stage_separate_s, fake_build_stage_separate_s_length, values[i]);
+ *status = f_string_dynamic_append(fake_build_stage_separate_s, values[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
break;
}
}
- *status = f_string_append_nulless(names[i], lengths[i], values[i]);
+ *status = f_string_dynamic_append(names[i], values[i]);
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
-
- break;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(fake_build_stage_separate_s, values[i]);
}
- *status = f_string_append(fake_build_stage_separate_s, fake_build_stage_separate_s_length, values[i]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
-
- break;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(settings_file_base, values[i]);
}
- *status = f_string_dynamic_append(settings_file_base, values[i]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
-
- break;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(fake_build_stage_built_s, values[i]);
}
- *status = f_string_append(fake_build_stage_built_s, fake_build_stage_built_s_length, values[i]);
-
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
break;
}
}
} // for
- macro_f_string_dynamic_t_delete_simple(settings_file_base);
+ f_string_dynamic_resize(0, &settings_file_base);
}
#endif // _di_fake_build_load_stage_
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination_path, main->error.notable);
fl_print_format("%[' exists but is not a directory.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_set_fine(*status) == F_file_found_not) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination_path, main->error.notable);
fl_print_format("%[' could not be created, a parent directory does not exist.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_is_error(*status) || *status == F_child) break;
} // for
- macro_f_string_dynamic_t_delete_simple(file_name);
- macro_f_string_dynamic_t_delete_simple(destination_path);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamic_resize(0, &file_name);
+ f_string_dynamic_resize(0, &destination_path);
+ f_string_dynamics_resize(0, &arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
fake_build_touch(main, file_stage, status);
memcpy(build_includes, fake_build_parameter_library_include_s, fake_build_parameter_library_include_s_length);
memcpy(build_includes + fake_build_parameter_library_include_s_length, main->path_build_includes.string, main->path_build_includes.used);
- const f_string_t values[] = {
- build_libraries,
- build_includes,
- };
-
- const f_array_length_t lengths[] = {
- build_libraries_length,
- build_includes_length,
+ const f_string_static_t values[] = {
+ macro_f_string_static_t_initialize2(build_libraries, 0, build_includes_length),
+ macro_f_string_static_t_initialize2(build_includes, 0, build_includes_length),
};
for (uint8_t i = 0; i < 2; ++i) {
if (!lengths[i]) continue;
- *status = fll_execute_arguments_add(values[i], lengths[i], arguments);
+ *status = fll_execute_arguments_add(values[i].string, values[i].used, arguments);
if (F_status_is_error(*status)) break;
} // for
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), " macro_f_string_dynamic_t_resize", F_true);
- macro_f_string_dynamic_t_delete_simple(path_source);
+ f_string_dynamic_resize(0, &path_source);
+
return;
}
} // for
macro_f_directory_statuss_t_delete_simple(failures);
- macro_f_string_dynamic_t_delete_simple(path_source);
- macro_f_string_dynamic_t_delete_simple(destination_file);
- macro_f_string_dynamic_t_delete_simple(destination_directory);
+
+ f_string_dynamic_resize(0, &path_source);
+ f_string_dynamic_resize(0, &destination_file);
+ f_string_dynamic_resize(0, &destination_directory);
if (F_status_is_error_not(*status)) {
fake_build_touch(main, file_stage, status);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
+
return 0;
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_mash", F_true);
- macro_f_string_dynamic_t_delete_simple(defines);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamic_resize(0, &defines);
+ f_string_dynamics_resize(0, &arguments);
+
return 0;
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
- macro_f_string_dynamic_t_delete_simple(defines);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamic_resize(0, &defines);
+ f_string_dynamics_resize(0, &arguments);
+
return 0;
}
}
const f_string_t parameters_prefix[] = {
- f_console_symbol_short_enable_s.string,
- f_console_symbol_short_enable_s.string,
- f_console_symbol_short_enable_s.string,
- f_console_symbol_short_enable_s.string,
- f_console_symbol_short_enable_s.string,
- f_console_symbol_short_enable_s.string,
- f_console_symbol_short_enable_s.string,
+ f_console_symbol_short_enable_s,
+ f_console_symbol_short_enable_s,
+ f_console_symbol_short_enable_s,
+ f_console_symbol_short_enable_s,
+ f_console_symbol_short_enable_s,
+ f_console_symbol_short_enable_s,
+ f_console_symbol_short_enable_s,
};
const f_array_length_t parameters_prefix_length[] = {
*status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments);
- macro_f_string_dynamic_t_delete_simple(defines);
+ f_string_dynamic_resize(0, &defines);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
+
return 0;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), function, F_true);
- macro_f_string_dynamic_t_delete_simple(path);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamic_resize(0, &path);
+ f_string_dynamics_resize(0, &arguments);
+
return 0;
}
}
*status = fll_execute_program(path.string, arguments, ¶meter, 0, (void *) &return_code);
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
if (fake_signal_received(main)) {
*status = F_status_set_error(F_interrupt);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to execute script: '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QFailed to execute script: '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
}
}
- macro_f_string_dynamic_t_delete_simple(path);
+ f_string_dynamic_resize(0, &path);
return return_code;
}
#endif
#ifndef _di_fake_build_setting_t_
- const f_string_t fake_build_setting_name_build_compiler_s = FAKE_build_setting_name_build_compiler_s;
- const f_string_t fake_build_setting_name_build_language_s = FAKE_build_setting_name_build_language_s;
- const f_string_t fake_build_setting_name_build_libraries_s = FAKE_build_setting_name_build_libraries_s;
- const f_string_t fake_build_setting_name_build_libraries_shared_s = FAKE_build_setting_name_build_libraries_shared_s;
- const f_string_t fake_build_setting_name_build_libraries_static_s = FAKE_build_setting_name_build_libraries_static_s;
- const f_string_t fake_build_setting_name_build_indexer_s = FAKE_build_setting_name_build_indexer_s;
- const f_string_t fake_build_setting_name_build_indexer_arguments_s = FAKE_build_setting_name_build_indexer_arguments_s;
- const f_string_t fake_build_setting_name_build_script_s = FAKE_build_setting_name_build_script_s;
- const f_string_t fake_build_setting_name_build_shared_s = FAKE_build_setting_name_build_shared_s;
- const f_string_t fake_build_setting_name_build_sources_headers_s = FAKE_build_setting_name_build_sources_headers_s;
- const f_string_t fake_build_setting_name_build_sources_headers_shared_s = FAKE_build_setting_name_build_sources_headers_shared_s;
- const f_string_t fake_build_setting_name_build_sources_headers_static_s = FAKE_build_setting_name_build_sources_headers_static_s;
- const f_string_t fake_build_setting_name_build_sources_library_s = FAKE_build_setting_name_build_sources_library_s;
- const f_string_t fake_build_setting_name_build_sources_library_shared_s = FAKE_build_setting_name_build_sources_library_shared_s;
- const f_string_t fake_build_setting_name_build_sources_library_static_s = FAKE_build_setting_name_build_sources_library_static_s;
- const f_string_t fake_build_setting_name_build_sources_program_s = FAKE_build_setting_name_build_sources_program_s;
- const f_string_t fake_build_setting_name_build_sources_program_shared_s = FAKE_build_setting_name_build_sources_program_shared_s;
- const f_string_t fake_build_setting_name_build_sources_program_static_s = FAKE_build_setting_name_build_sources_program_static_s;
- const f_string_t fake_build_setting_name_build_sources_script_s = FAKE_build_setting_name_build_sources_script_s;
- const f_string_t fake_build_setting_name_build_sources_settings_s = FAKE_build_setting_name_build_sources_settings_s;
- const f_string_t fake_build_setting_name_build_static_s = FAKE_build_setting_name_build_static_s;
- const f_string_t fake_build_setting_name_defines_s = FAKE_build_setting_name_defines_s;
- const f_string_t fake_build_setting_name_defines_library_s = FAKE_build_setting_name_defines_library_s;
- const f_string_t fake_build_setting_name_defines_library_shared_s = FAKE_build_setting_name_defines_library_shared_s;
- const f_string_t fake_build_setting_name_defines_library_static_s = FAKE_build_setting_name_defines_library_static_s;
- const f_string_t fake_build_setting_name_defines_program_s = FAKE_build_setting_name_defines_program_s;
- const f_string_t fake_build_setting_name_defines_program_shared_s = FAKE_build_setting_name_defines_program_shared_s;
- const f_string_t fake_build_setting_name_defines_program_static_s = FAKE_build_setting_name_defines_program_static_s;
- const f_string_t fake_build_setting_name_defines_shared_s = FAKE_build_setting_name_defines_shared_s;
- const f_string_t fake_build_setting_name_defines_static_s = FAKE_build_setting_name_defines_static_s;
- const f_string_t fake_build_setting_name_environment_s = FAKE_build_setting_name_environment_s;
- const f_string_t fake_build_setting_name_flags_s = FAKE_build_setting_name_flags_s;
- const f_string_t fake_build_setting_name_flags_library_s = FAKE_build_setting_name_flags_library_s;
- const f_string_t fake_build_setting_name_flags_library_shared_s = FAKE_build_setting_name_flags_library_shared_s;
- const f_string_t fake_build_setting_name_flags_library_static_s = FAKE_build_setting_name_flags_library_static_s;
- const f_string_t fake_build_setting_name_flags_program_s = FAKE_build_setting_name_flags_program_s;
- const f_string_t fake_build_setting_name_flags_program_shared_s = FAKE_build_setting_name_flags_program_shared_s;
- const f_string_t fake_build_setting_name_flags_program_static_s = FAKE_build_setting_name_flags_program_static_s;
- const f_string_t fake_build_setting_name_flags_shared_s = FAKE_build_setting_name_flags_shared_s;
- const f_string_t fake_build_setting_name_flags_static_s = FAKE_build_setting_name_flags_static_s;
- const f_string_t fake_build_setting_name_modes_s = FAKE_build_setting_name_modes_s;
- const f_string_t fake_build_setting_name_modes_default_s = FAKE_build_setting_name_modes_default_s;
- const f_string_t fake_build_setting_name_path_headers_s = FAKE_build_setting_name_path_headers_s;
- const f_string_t fake_build_setting_name_path_headers_preserve_s = FAKE_build_setting_name_path_headers_preserve_s;
- const f_string_t fake_build_setting_name_path_language_s = FAKE_build_setting_name_path_language_s;
- const f_string_t fake_build_setting_name_path_library_script_s = FAKE_build_setting_name_path_library_script_s;
- const f_string_t fake_build_setting_name_path_library_shared_s = FAKE_build_setting_name_path_library_shared_s;
- const f_string_t fake_build_setting_name_path_library_static_s = FAKE_build_setting_name_path_library_static_s;
- const f_string_t fake_build_setting_name_path_program_script_s = FAKE_build_setting_name_path_program_script_s;
- const f_string_t fake_build_setting_name_path_program_shared_s = FAKE_build_setting_name_path_program_shared_s;
- const f_string_t fake_build_setting_name_path_program_static_s = FAKE_build_setting_name_path_program_static_s;
- const f_string_t fake_build_setting_name_path_sources_s = FAKE_build_setting_name_path_sources_s;
- const f_string_t fake_build_setting_name_path_standard_s = FAKE_build_setting_name_path_standard_s;
- const f_string_t fake_build_setting_name_process_post_s = FAKE_build_setting_name_process_post_s;
- const f_string_t fake_build_setting_name_process_pre_s = FAKE_build_setting_name_process_pre_s;
- const f_string_t fake_build_setting_name_project_name_s = FAKE_build_setting_name_project_name_s;
- const f_string_t fake_build_setting_name_search_exclusive_s = FAKE_build_setting_name_search_exclusive_s;
- const f_string_t fake_build_setting_name_search_shared_s = FAKE_build_setting_name_search_shared_s;
- const f_string_t fake_build_setting_name_search_static_s = FAKE_build_setting_name_search_static_s;
- const f_string_t fake_build_setting_name_version_file_s = FAKE_build_setting_name_version_file_s;
- const f_string_t fake_build_setting_name_version_major_s = FAKE_build_setting_name_version_major_s;
- const f_string_t fake_build_setting_name_version_major_prefix_s = FAKE_build_setting_name_version_major_prefix_s;
- const f_string_t fake_build_setting_name_version_micro_s = FAKE_build_setting_name_version_micro_s;
- const f_string_t fake_build_setting_name_version_micro_prefix_s = FAKE_build_setting_name_version_micro_prefix_s;
- const f_string_t fake_build_setting_name_version_minor_s = FAKE_build_setting_name_version_minor_s;
- const f_string_t fake_build_setting_name_version_minor_prefix_s = FAKE_build_setting_name_version_minor_prefix_s;
- const f_string_t fake_build_setting_name_version_nano_s = FAKE_build_setting_name_version_nano_s;
- const f_string_t fake_build_setting_name_version_nano_prefix_s = FAKE_build_setting_name_version_nano_prefix_s;
- const f_string_t fake_build_setting_name_version_target_s = FAKE_build_setting_name_version_target_s;
+ const f_string_static_t fake_build_setting_name_build_compiler_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_compiler_s, 0, FAKE_build_setting_name_build_compiler_s_length);
+ const f_string_static_t fake_build_setting_name_build_language_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_language_s, 0, FAKE_build_setting_name_build_language_s_length);
+ const f_string_static_t fake_build_setting_name_build_libraries_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_libraries_s, 0, FAKE_build_setting_name_build_libraries_s_length);
+ const f_string_static_t fake_build_setting_name_build_libraries_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_libraries_shared_s, 0, FAKE_build_setting_name_build_libraries_shared_s_length);
+ const f_string_static_t fake_build_setting_name_build_libraries_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_libraries_static_s, 0, FAKE_build_setting_name_build_libraries_static_s_length);
+ const f_string_static_t fake_build_setting_name_build_indexer_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_indexer_s, 0, FAKE_build_setting_name_build_indexer_s_length);
+ const f_string_static_t fake_build_setting_name_build_indexer_arguments_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_indexer_arguments_s, 0, FAKE_build_setting_name_build_indexer_arguments_s_length);
+ const f_string_static_t fake_build_setting_name_build_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_script_s, 0, FAKE_build_setting_name_build_script_s_length);
+ const f_string_static_t fake_build_setting_name_build_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_shared_s, 0, FAKE_build_setting_name_build_shared_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_headers_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_headers_s, 0, FAKE_build_setting_name_build_sources_headers_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_headers_shared_s, 0, FAKE_build_setting_name_build_sources_headers_shared_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_headers_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_headers_static_s, 0, FAKE_build_setting_name_build_sources_headers_static_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_library_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_library_s, 0, FAKE_build_setting_name_build_sources_library_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_library_shared_s, 0, FAKE_build_setting_name_build_sources_library_shared_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_library_static_s, 0, FAKE_build_setting_name_build_sources_library_static_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_program_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_program_s, 0, FAKE_build_setting_name_build_sources_program_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_program_shared_s, 0, FAKE_build_setting_name_build_sources_program_shared_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_program_static_s, 0, FAKE_build_setting_name_build_sources_program_static_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_script_s, 0, FAKE_build_setting_name_build_sources_script_s_length);
+ const f_string_static_t fake_build_setting_name_build_sources_settings_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_sources_settings_s, 0, FAKE_build_setting_name_build_sources_settings_s_length);
+ const f_string_static_t fake_build_setting_name_build_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_build_static_s, 0, FAKE_build_setting_name_build_static_s_length);
+ const f_string_static_t fake_build_setting_name_defines_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_s, 0, FAKE_build_setting_name_defines_s_length);
+ const f_string_static_t fake_build_setting_name_defines_library_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_library_s, 0, FAKE_build_setting_name_defines_library_s_length);
+ const f_string_static_t fake_build_setting_name_defines_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_library_shared_s, 0, FAKE_build_setting_name_defines_library_shared_s_length);
+ const f_string_static_t fake_build_setting_name_defines_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_library_static_s, 0, FAKE_build_setting_name_defines_library_static_s_length);
+ const f_string_static_t fake_build_setting_name_defines_program_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_program_s, 0, FAKE_build_setting_name_defines_program_s_length);
+ const f_string_static_t fake_build_setting_name_defines_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_program_shared_s, 0, FAKE_build_setting_name_defines_program_shared_s_length);
+ const f_string_static_t fake_build_setting_name_defines_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_program_static_s, 0, FAKE_build_setting_name_defines_program_static_s_length);
+ const f_string_static_t fake_build_setting_name_defines_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_shared_s, 0, FAKE_build_setting_name_defines_shared_s_length);
+ const f_string_static_t fake_build_setting_name_defines_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_defines_static_s, 0, FAKE_build_setting_name_defines_static_s_length);
+ const f_string_static_t fake_build_setting_name_environment_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_environment_s, 0, FAKE_build_setting_name_environment_s_length);
+ const f_string_static_t fake_build_setting_name_flags_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_s, 0, FAKE_build_setting_name_flags_s_length);
+ const f_string_static_t fake_build_setting_name_flags_library_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_library_s, 0, FAKE_build_setting_name_flags_library_s_length);
+ const f_string_static_t fake_build_setting_name_flags_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_library_shared_s, 0, FAKE_build_setting_name_flags_library_shared_s_length);
+ const f_string_static_t fake_build_setting_name_flags_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_library_static_s, 0, FAKE_build_setting_name_flags_library_static_s_length);
+ const f_string_static_t fake_build_setting_name_flags_program_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_program_s, 0, FAKE_build_setting_name_flags_program_s_length);
+ const f_string_static_t fake_build_setting_name_flags_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_program_shared_s, 0, FAKE_build_setting_name_flags_program_shared_s_length);
+ const f_string_static_t fake_build_setting_name_flags_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_program_static_s, 0, FAKE_build_setting_name_flags_program_static_s_length);
+ const f_string_static_t fake_build_setting_name_flags_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_shared_s, 0, FAKE_build_setting_name_flags_shared_s_length);
+ const f_string_static_t fake_build_setting_name_flags_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_flags_static_s, 0, FAKE_build_setting_name_flags_static_s_length);
+ const f_string_static_t fake_build_setting_name_modes_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_modes_s, 0, FAKE_build_setting_name_modes_s_length);
+ const f_string_static_t fake_build_setting_name_modes_default_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_modes_default_s, 0, FAKE_build_setting_name_modes_default_s_length);
+ const f_string_static_t fake_build_setting_name_path_headers_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_headers_s, 0, FAKE_build_setting_name_path_headers_s_length);
+ const f_string_static_t fake_build_setting_name_path_headers_preserve_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_headers_preserve_s, 0, FAKE_build_setting_name_path_headers_preserve_s_length);
+ const f_string_static_t fake_build_setting_name_path_language_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_language_s, 0, FAKE_build_setting_name_path_language_s_length);
+ const f_string_static_t fake_build_setting_name_path_library_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_library_script_s, 0, FAKE_build_setting_name_path_library_script_s_length);
+ const f_string_static_t fake_build_setting_name_path_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_library_shared_s, 0, FAKE_build_setting_name_path_library_shared_s_length);
+ const f_string_static_t fake_build_setting_name_path_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_library_static_s, 0, FAKE_build_setting_name_path_library_static_s_length);
+ const f_string_static_t fake_build_setting_name_path_program_script_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_program_script_s, 0, FAKE_build_setting_name_path_program_script_s_length);
+ const f_string_static_t fake_build_setting_name_path_program_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_program_shared_s, 0, FAKE_build_setting_name_path_program_shared_s_length);
+ const f_string_static_t fake_build_setting_name_path_program_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_program_static_s, 0, FAKE_build_setting_name_path_program_static_s_length);
+ const f_string_static_t fake_build_setting_name_path_sources_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_sources_s, 0, FAKE_build_setting_name_path_sources_s_length);
+ const f_string_static_t fake_build_setting_name_path_standard_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_path_standard_s, 0, FAKE_build_setting_name_path_standard_s_length);
+ const f_string_static_t fake_build_setting_name_process_post_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_process_post_s, 0, FAKE_build_setting_name_process_post_s_length);
+ const f_string_static_t fake_build_setting_name_process_pre_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_process_pre_s, 0, FAKE_build_setting_name_process_pre_s_length);
+ const f_string_static_t fake_build_setting_name_project_name_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_project_name_s, 0, FAKE_build_setting_name_project_name_s_length);
+ const f_string_static_t fake_build_setting_name_search_exclusive_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_search_exclusive_s, 0, FAKE_build_setting_name_search_exclusive_s_length);
+ const f_string_static_t fake_build_setting_name_search_shared_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_search_shared_s, 0, FAKE_build_setting_name_search_shared_s_length);
+ const f_string_static_t fake_build_setting_name_search_static_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_search_static_s, 0, FAKE_build_setting_name_search_static_s_length);
+ const f_string_static_t fake_build_setting_name_version_file_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_file_s, 0, FAKE_build_setting_name_version_file_s_length);
+ const f_string_static_t fake_build_setting_name_version_major_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_major_s, 0, FAKE_build_setting_name_version_major_s_length);
+ const f_string_static_t fake_build_setting_name_version_major_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_major_prefix_s, 0, FAKE_build_setting_name_version_major_prefix_s_length);
+ const f_string_static_t fake_build_setting_name_version_micro_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_micro_s, 0, FAKE_build_setting_name_version_micro_s_length);
+ const f_string_static_t fake_build_setting_name_version_micro_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_micro_prefix_s, 0, FAKE_build_setting_name_version_micro_prefix_s_length);
+ const f_string_static_t fake_build_setting_name_version_minor_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_minor_s, 0, FAKE_build_setting_name_version_minor_s_length);
+ const f_string_static_t fake_build_setting_name_version_minor_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_minor_prefix_s, 0, FAKE_build_setting_name_version_minor_prefix_s_length);
+ const f_string_static_t fake_build_setting_name_version_nano_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_nano_s, 0, FAKE_build_setting_name_version_nano_s_length);
+ const f_string_static_t fake_build_setting_name_version_nano_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_nano_prefix_s, 0, FAKE_build_setting_name_version_nano_prefix_s_length);
+ const f_string_static_t fake_build_setting_name_version_target_s = macro_f_string_static_t_initialize2(FAKE_build_setting_name_version_target_s, 0, FAKE_build_setting_name_version_target_s_length);
- const f_string_t fake_build_setting_default_version_s = FAKE_build_setting_default_version_s;
- const f_string_t fake_build_setting_default_version_prefix_s = FAKE_build_setting_default_version_prefix_s;
+ const f_string_static_t fake_build_setting_default_version_s = macro_f_string_static_t_initialize2(FAKE_build_setting_default_version_s, 0, FAKE_build_setting_default_version_s_length);
+ const f_string_static_t fake_build_setting_default_version_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_setting_default_version_prefix_s, 0, FAKE_build_setting_default_version_prefix_s_length);
#endif // _di_fake_build_setting_t_
#ifndef _di_fake_build_stage_t_
- const f_string_t fake_build_stage_built_s = FAKE_build_stage_built_s;
- const f_string_t fake_build_stage_libraries_script_s = FAKE_build_stage_libraries_script_s;
- const f_string_t fake_build_stage_libraries_shared_s = FAKE_build_stage_libraries_shared_s;
- const f_string_t fake_build_stage_libraries_static_s = FAKE_build_stage_libraries_static_s;
- const f_string_t fake_build_stage_objects_static_s = FAKE_build_stage_objects_static_s;
- const f_string_t fake_build_stage_process_post_s = FAKE_build_stage_process_post_s;
- const f_string_t fake_build_stage_process_pre_s = FAKE_build_stage_process_pre_s;
- const f_string_t fake_build_stage_programs_script_s = FAKE_build_stage_programs_script_s;
- const f_string_t fake_build_stage_programs_shared_s = FAKE_build_stage_programs_shared_s;
- const f_string_t fake_build_stage_programs_static_s = FAKE_build_stage_programs_static_s;
- const f_string_t fake_build_stage_separate_s = FAKE_build_stage_separate_s;
- const f_string_t fake_build_stage_skeleton_s = FAKE_build_stage_skeleton_s;
- const f_string_t fake_build_stage_sources_headers_s = FAKE_build_stage_sources_headers_s;
- const f_string_t fake_build_stage_sources_script_s = FAKE_build_stage_sources_script_s;
- const f_string_t fake_build_stage_sources_settings_s = FAKE_build_stage_sources_settings_s;
+ const f_string_static_t fake_build_stage_built_s = macro_f_string_static_t_initialize2(FAKE_build_stage_built_s, 0, FAKE_build_stage_built_s_length);
+ const f_string_static_t fake_build_stage_libraries_script_s = macro_f_string_static_t_initialize2(FAKE_build_stage_libraries_script_s, 0, FAKE_build_stage_libraries_script_s_length);
+ const f_string_static_t fake_build_stage_libraries_shared_s = macro_f_string_static_t_initialize2(FAKE_build_stage_libraries_shared_s, 0, FAKE_build_stage_libraries_shared_s_length);
+ const f_string_static_t fake_build_stage_libraries_static_s = macro_f_string_static_t_initialize2(FAKE_build_stage_libraries_static_s, 0, FAKE_build_stage_libraries_static_s_length);
+ const f_string_static_t fake_build_stage_objects_static_s = macro_f_string_static_t_initialize2(FAKE_build_stage_objects_static_s, 0, FAKE_build_stage_objects_static_s_length);
+ const f_string_static_t fake_build_stage_process_post_s = macro_f_string_static_t_initialize2(FAKE_build_stage_process_post_s, 0, FAKE_build_stage_process_post_s_length);
+ const f_string_static_t fake_build_stage_process_pre_s = macro_f_string_static_t_initialize2(FAKE_build_stage_process_pre_s, 0, FAKE_build_stage_process_pre_s_length);
+ const f_string_static_t fake_build_stage_programs_script_s = macro_f_string_static_t_initialize2(FAKE_build_stage_programs_script_s, 0, FAKE_build_stage_programs_script_s_length);
+ const f_string_static_t fake_build_stage_programs_shared_s = macro_f_string_static_t_initialize2(FAKE_build_stage_programs_shared_s, 0, FAKE_build_stage_programs_shared_s_length);
+ const f_string_static_t fake_build_stage_programs_static_s = macro_f_string_static_t_initialize2(FAKE_build_stage_programs_static_s, 0, FAKE_build_stage_programs_static_s_length);
+ const f_string_static_t fake_build_stage_separate_s = macro_f_string_static_t_initialize2(FAKE_build_stage_separate_s, 0, FAKE_build_stage_separate_s_length);
+ const f_string_static_t fake_build_stage_skeleton_s = macro_f_string_static_t_initialize2(FAKE_build_stage_skeleton_s, 0, FAKE_build_stage_skeleton_s_length);
+ const f_string_static_t fake_build_stage_sources_headers_s = macro_f_string_static_t_initialize2(FAKE_build_stage_sources_headers_s, 0, FAKE_build_stage_sources_headers_s_length);
+ const f_string_static_t fake_build_stage_sources_script_s = macro_f_string_static_t_initialize2(FAKE_build_stage_sources_script_s, 0, FAKE_build_stage_sources_script_s_length);
+ const f_string_static_t fake_build_stage_sources_settings_s = macro_f_string_static_t_initialize2(FAKE_build_stage_sources_settings_s, 0, FAKE_build_stage_sources_settings_s_length);
#endif // _di_fake_build_stage_t_
#ifndef _di_fake_build_parameter_
- const f_string_t fake_build_parameter_library_include_s = FAKE_build_parameter_library_include_s;
- const f_string_t fake_build_parameter_library_link_file_s = FAKE_build_parameter_library_link_file_s;
- const f_string_t fake_build_parameter_library_link_path_s = FAKE_build_parameter_library_link_path_s;
- const f_string_t fake_build_parameter_library_name_prefix_s = FAKE_build_parameter_library_name_prefix_s;
- const f_string_t fake_build_parameter_library_name_suffix_shared_s = FAKE_build_parameter_library_name_suffix_shared_s;
- const f_string_t fake_build_parameter_library_name_suffix_static_s = FAKE_build_parameter_library_name_suffix_static_s;
- const f_string_t fake_build_parameter_library_output_s = FAKE_build_parameter_library_output_s;
- const f_string_t fake_build_parameter_library_shared_s = FAKE_build_parameter_library_shared_s;
- const f_string_t fake_build_parameter_library_static_s = FAKE_build_parameter_library_static_s;
- const f_string_t fake_build_parameter_library_shared_prefix_s = FAKE_build_parameter_library_shared_prefix_s;
+ const f_string_static_t fake_build_parameter_library_include_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_include_s, 0, FAKE_build_parameter_library_include_s_length);
+ const f_string_static_t fake_build_parameter_library_link_file_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_link_file_s, 0, FAKE_build_parameter_library_link_file_s_length);
+ const f_string_static_t fake_build_parameter_library_link_path_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_link_path_s, 0, FAKE_build_parameter_library_link_path_s_length);
+ const f_string_static_t fake_build_parameter_library_name_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_name_prefix_s, 0, FAKE_build_parameter_library_name_prefix_s_length);
+ const f_string_static_t fake_build_parameter_library_name_suffix_shared_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_name_suffix_shared_s, 0, FAKE_build_parameter_library_name_suffix_shared_s_length);
+ const f_string_static_t fake_build_parameter_library_name_suffix_static_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_name_suffix_static_s, 0, FAKE_build_parameter_library_name_suffix_static_s_length);
+ const f_string_static_t fake_build_parameter_library_output_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_output_s, 0, FAKE_build_parameter_library_output_s_length);
+ const f_string_static_t fake_build_parameter_library_shared_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_shared_s, 0, FAKE_build_parameter_library_shared_s_length);
+ const f_string_static_t fake_build_parameter_library_static_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_static_s, 0, FAKE_build_parameter_library_static_s_length);
+ const f_string_static_t fake_build_parameter_library_shared_prefix_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_library_shared_prefix_s, 0, FAKE_build_parameter_library_shared_prefix_s_length);
- const f_string_t fake_build_parameter_object_compile_s = FAKE_build_parameter_object_compile_s;
- const f_string_t fake_build_parameter_object_name_suffix_s = FAKE_build_parameter_object_name_suffix_s;
- const f_string_t fake_build_parameter_object_output_s = FAKE_build_parameter_object_output_s;
- const f_string_t fake_build_parameter_object_static_s = FAKE_build_parameter_object_static_s;
+ const f_string_static_t fake_build_parameter_object_compile_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_compile_s, 0, FAKE_build_parameter_object_compile_s_length);
+ const f_string_static_t fake_build_parameter_object_name_suffix_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_name_suffix_s, 0, FAKE_build_parameter_object_name_suffix_s_length);
+ const f_string_static_t fake_build_parameter_object_output_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_output_s, 0, FAKE_build_parameter_object_output_s_length);
+ const f_string_static_t fake_build_parameter_object_static_s = macro_f_string_static_t_initialize2(FAKE_build_parameter_object_static_s, 0, FAKE_build_parameter_object_static_s_length);
#endif // _di_fake_build_parameter_
#ifndef _di_fake_common_
- const f_string_t fake_common_setting_bool_yes_s = FAKE_common_setting_bool_yes_s;
- const f_string_t fake_common_setting_bool_no_s = FAKE_common_setting_bool_no_s;
+ const f_string_static_t fake_common_setting_bool_yes_s = macro_f_string_static_t_initialize2(FAKE_common_setting_bool_yes_s, 0, FAKE_common_setting_bool_yes_s_length);
+ const f_string_static_t fake_common_setting_bool_no_s = macro_f_string_static_t_initialize2(FAKE_common_setting_bool_no_s, 0, FAKE_common_setting_bool_no_s_length);
+ const f_string_static_t fake_common_setting_list_s = macro_f_string_static_t_initialize2(FAKE_common_setting_list_s, 0, FAKE_common_setting_list_s_length);
#endif // _di_fake_common_
#ifndef _di_fake_make_section_
- const f_string_t fake_make_section_main_s = FAKE_make_section_main_s;
- const f_string_t fake_make_section_settings_s = FAKE_make_section_settings_s;
+ const f_string_static_t fake_make_section_main_s = macro_f_string_static_t_initialize2(FAKE_make_section_main_s, 0, FAKE_make_section_main_s_length);
+ const f_string_static_t fake_make_section_settings_s = macro_f_string_static_t_initialize2(FAKE_make_section_settings_s, 0, FAKE_make_section_settings_s_length);
#endif // _di_fake_make_section_
#ifndef _di_fake_make_setting_t_
- const f_string_t fake_make_setting_compiler_s = FAKE_make_setting_compiler_s;
- const f_string_t fake_make_setting_define_s = FAKE_make_setting_define_s;
- const f_string_t fake_make_setting_environment_s = FAKE_make_setting_environment_s;
- const f_string_t fake_make_setting_fail_s = FAKE_make_setting_fail_s;
- const f_string_t fake_make_setting_indexer_s = FAKE_make_setting_indexer_s;
- const f_string_t fake_make_setting_indexer_arguments_s = FAKE_make_setting_indexer_arguments_s;
- const f_string_t fake_make_setting_load_build_s = FAKE_make_setting_load_build_s;
- const f_string_t fake_make_setting_parameter_s = FAKE_make_setting_parameter_s;
- const f_string_t fake_make_setting_return_s = FAKE_make_setting_return_s;
+ const f_string_static_t fake_make_setting_compiler_s = macro_f_string_static_t_initialize2(FAKE_make_setting_compiler_s, 0, FAKE_make_setting_compiler_s_length);
+ const f_string_static_t fake_make_setting_define_s = macro_f_string_static_t_initialize2(FAKE_make_setting_define_s, 0, FAKE_make_setting_define_s_length);
+ const f_string_static_t fake_make_setting_environment_s = macro_f_string_static_t_initialize2(FAKE_make_setting_environment_s, 0, FAKE_make_setting_environment_s_length);
+ const f_string_static_t fake_make_setting_fail_s = macro_f_string_static_t_initialize2(FAKE_make_setting_fail_s, 0, FAKE_make_setting_fail_s_length);
+ const f_string_static_t fake_make_setting_indexer_s = macro_f_string_static_t_initialize2(FAKE_make_setting_indexer_s, 0, FAKE_make_setting_indexer_s_length);
+ const f_string_static_t fake_make_setting_indexer_arguments_s = macro_f_string_static_t_initialize2(FAKE_make_setting_indexer_arguments_s, 0, FAKE_make_setting_indexer_arguments_s_length);
+ const f_string_static_t fake_make_setting_load_build_s = macro_f_string_static_t_initialize2(FAKE_make_setting_load_build_s, 0, FAKE_make_setting_load_build_s_length);
+ const f_string_static_t fake_make_setting_parameter_s = macro_f_string_static_t_initialize2(FAKE_make_setting_parameter_s, 0, FAKE_make_setting_parameter_s_length);
+ const f_string_static_t fake_make_setting_return_s = macro_f_string_static_t_initialize2(FAKE_make_setting_return_s, 0, FAKE_make_setting_return_s_length);
#endif // _di_fake_make_setting_t_
#ifndef _di_fake_make_operation_
- const f_string_t fake_make_operation_and_s = FAKE_make_operation_and_s;
- const f_string_t fake_make_operation_break_s = FAKE_make_operation_break_s;
- const f_string_t fake_make_operation_build_s = FAKE_make_operation_build_s;
- const f_string_t fake_make_operation_clean_s = FAKE_make_operation_clean_s;
- const f_string_t fake_make_operation_clone_s = FAKE_make_operation_clone_s;
- const f_string_t fake_make_operation_compile_s = FAKE_make_operation_compile_s;
- const f_string_t fake_make_operation_copy_s = FAKE_make_operation_copy_s;
- const f_string_t fake_make_operation_define_s = FAKE_make_operation_define_s;
- const f_string_t fake_make_operation_delete_s = FAKE_make_operation_delete_s;
- const f_string_t fake_make_operation_deletes_s = FAKE_make_operation_deletes_s;
- const f_string_t fake_make_operation_else_s = FAKE_make_operation_else_s;
- const f_string_t fake_make_operation_exit_s = FAKE_make_operation_exit_s;
- const f_string_t fake_make_operation_fail_s = FAKE_make_operation_fail_s;
- const f_string_t fake_make_operation_group_s = FAKE_make_operation_group_s;
- const f_string_t fake_make_operation_groups_s = FAKE_make_operation_groups_s;
- const f_string_t fake_make_operation_if_s = FAKE_make_operation_if_s;
- const f_string_t fake_make_operation_index_s = FAKE_make_operation_index_s;
- const f_string_t fake_make_operation_link_s = FAKE_make_operation_link_s;
- const f_string_t fake_make_operation_mode_s = FAKE_make_operation_mode_s;
- const f_string_t fake_make_operation_modes_s = FAKE_make_operation_modes_s;
- const f_string_t fake_make_operation_move_s = FAKE_make_operation_move_s;
- const f_string_t fake_make_operation_operate_s = FAKE_make_operation_operate_s;
- const f_string_t fake_make_operation_or_s = FAKE_make_operation_or_s;
- const f_string_t fake_make_operation_owner_s = FAKE_make_operation_owner_s;
- const f_string_t fake_make_operation_owners_s = FAKE_make_operation_owners_s;
- const f_string_t fake_make_operation_parameter_s = FAKE_make_operation_parameter_s;
- const f_string_t fake_make_operation_pop_s = FAKE_make_operation_pop_s;
- const f_string_t fake_make_operation_print_s = FAKE_make_operation_print_s;
- const f_string_t fake_make_operation_run_s = FAKE_make_operation_run_s;
- const f_string_t fake_make_operation_shell_s = FAKE_make_operation_shell_s;
- const f_string_t fake_make_operation_skeleton_s = FAKE_make_operation_skeleton_s;
- const f_string_t fake_make_operation_to_s = FAKE_make_operation_to_s;
- const f_string_t fake_make_operation_top_s = FAKE_make_operation_top_s;
- const f_string_t fake_make_operation_touch_s = FAKE_make_operation_touch_s;
+ const f_string_static_t fake_make_operation_and_s = macro_f_string_static_t_initialize2(FAKE_make_operation_and_s, 0, FAKE_make_operation_and_s_length);
+ const f_string_static_t fake_make_operation_break_s = macro_f_string_static_t_initialize2(FAKE_make_operation_break_s, 0, FAKE_make_operation_break_s_length);
+ const f_string_static_t fake_make_operation_build_s = macro_f_string_static_t_initialize2(FAKE_make_operation_build_s, 0, FAKE_make_operation_build_s_length);
+ const f_string_static_t fake_make_operation_clean_s = macro_f_string_static_t_initialize2(FAKE_make_operation_clean_s, 0, FAKE_make_operation_clean_s_length);
+ const f_string_static_t fake_make_operation_clone_s = macro_f_string_static_t_initialize2(FAKE_make_operation_clone_s, 0, FAKE_make_operation_clone_s_length);
+ const f_string_static_t fake_make_operation_compile_s = macro_f_string_static_t_initialize2(FAKE_make_operation_compile_s, 0, FAKE_make_operation_compile_s_length);
+ const f_string_static_t fake_make_operation_copy_s = macro_f_string_static_t_initialize2(FAKE_make_operation_copy_s, 0, FAKE_make_operation_copy_s_length);
+ const f_string_static_t fake_make_operation_define_s = macro_f_string_static_t_initialize2(FAKE_make_operation_define_s, 0, FAKE_make_operation_define_s_length);
+ const f_string_static_t fake_make_operation_delete_s = macro_f_string_static_t_initialize2(FAKE_make_operation_delete_s, 0, FAKE_make_operation_delete_s_length);
+ const f_string_static_t fake_make_operation_deletes_s = macro_f_string_static_t_initialize2(FAKE_make_operation_deletes_s, 0, FAKE_make_operation_deletes_s_length);
+ const f_string_static_t fake_make_operation_else_s = macro_f_string_static_t_initialize2(FAKE_make_operation_else_s, 0, FAKE_make_operation_else_s_length);
+ const f_string_static_t fake_make_operation_exit_s = macro_f_string_static_t_initialize2(FAKE_make_operation_exit_s, 0, FAKE_make_operation_exit_s_length);
+ const f_string_static_t fake_make_operation_fail_s = macro_f_string_static_t_initialize2(FAKE_make_operation_fail_s, 0, FAKE_make_operation_fail_s_length);
+ const f_string_static_t fake_make_operation_group_s = macro_f_string_static_t_initialize2(FAKE_make_operation_group_s, 0, FAKE_make_operation_group_s_length);
+ const f_string_static_t fake_make_operation_groups_s = macro_f_string_static_t_initialize2(FAKE_make_operation_groups_s, 0, FAKE_make_operation_groups_s_length);
+ const f_string_static_t fake_make_operation_if_s = macro_f_string_static_t_initialize2(FAKE_make_operation_if_s, 0, FAKE_make_operation_if_s_length);
+ const f_string_static_t fake_make_operation_index_s = macro_f_string_static_t_initialize2(FAKE_make_operation_index_s, 0, FAKE_make_operation_index_s_length);
+ const f_string_static_t fake_make_operation_link_s = macro_f_string_static_t_initialize2(FAKE_make_operation_link_s, 0, FAKE_make_operation_link_s_length);
+ const f_string_static_t fake_make_operation_mode_s = macro_f_string_static_t_initialize2(FAKE_make_operation_mode_s, 0, FAKE_make_operation_mode_s_length);
+ const f_string_static_t fake_make_operation_modes_s = macro_f_string_static_t_initialize2(FAKE_make_operation_modes_s, 0, FAKE_make_operation_modes_s_length);
+ const f_string_static_t fake_make_operation_move_s = macro_f_string_static_t_initialize2(FAKE_make_operation_move_s, 0, FAKE_make_operation_move_s_length);
+ const f_string_static_t fake_make_operation_operate_s = macro_f_string_static_t_initialize2(FAKE_make_operation_operate_s, 0, FAKE_make_operation_operate_s_length);
+ const f_string_static_t fake_make_operation_or_s = macro_f_string_static_t_initialize2(FAKE_make_operation_or_s, 0, FAKE_make_operation_or_s_length);
+ const f_string_static_t fake_make_operation_owner_s = macro_f_string_static_t_initialize2(FAKE_make_operation_owner_s, 0, FAKE_make_operation_owner_s_length);
+ const f_string_static_t fake_make_operation_owners_s = macro_f_string_static_t_initialize2(FAKE_make_operation_owners_s, 0, FAKE_make_operation_owners_s_length);
+ const f_string_static_t fake_make_operation_parameter_s = macro_f_string_static_t_initialize2(FAKE_make_operation_parameter_s, 0, FAKE_make_operation_parameter_s_length);
+ const f_string_static_t fake_make_operation_pop_s = macro_f_string_static_t_initialize2(FAKE_make_operation_pop_s, 0, FAKE_make_operation_pop_s_length);
+ const f_string_static_t fake_make_operation_print_s = macro_f_string_static_t_initialize2(FAKE_make_operation_print_s, 0, FAKE_make_operation_print_s_length);
+ const f_string_static_t fake_make_operation_run_s = macro_f_string_static_t_initialize2(FAKE_make_operation_run_s, 0, FAKE_make_operation_run_s_length);
+ const f_string_static_t fake_make_operation_shell_s = macro_f_string_static_t_initialize2(FAKE_make_operation_shell_s, 0, FAKE_make_operation_shell_s_length);
+ const f_string_static_t fake_make_operation_skeleton_s = macro_f_string_static_t_initialize2(FAKE_make_operation_skeleton_s, 0, FAKE_make_operation_skeleton_s_length);
+ const f_string_static_t fake_make_operation_to_s = macro_f_string_static_t_initialize2(FAKE_make_operation_to_s, 0, FAKE_make_operation_to_s_length);
+ const f_string_static_t fake_make_operation_top_s = macro_f_string_static_t_initialize2(FAKE_make_operation_top_s, 0, FAKE_make_operation_top_s_length);
+ const f_string_static_t fake_make_operation_touch_s = macro_f_string_static_t_initialize2(FAKE_make_operation_touch_s, 0, FAKE_make_operation_touch_s_length);
- const f_string_t fake_make_operation_argument_environment_s = FAKE_make_operation_argument_environment_s;
- const f_string_t fake_make_operation_argument_failure_s = FAKE_make_operation_argument_failure_s;
- const f_string_t fake_make_operation_argument_file_s = FAKE_make_operation_argument_file_s;
- const f_string_t fake_make_operation_argument_directory_s = FAKE_make_operation_argument_directory_s;
- const f_string_t fake_make_operation_argument_error_s = FAKE_make_operation_argument_error_s;
- const f_string_t fake_make_operation_argument_exit_s = FAKE_make_operation_argument_exit_s;
- const f_string_t fake_make_operation_argument_has_s = FAKE_make_operation_argument_has_s;
- const f_string_t fake_make_operation_argument_ignore_s = FAKE_make_operation_argument_ignore_s;
- const f_string_t fake_make_operation_argument_is_s = FAKE_make_operation_argument_is_s;
- const f_string_t fake_make_operation_argument_parameter_s = FAKE_make_operation_argument_parameter_s;
- const f_string_t fake_make_operation_argument_point_s = FAKE_make_operation_argument_point_s;
- const f_string_t fake_make_operation_argument_recursive_s = FAKE_make_operation_argument_recursive_s;
- const f_string_t fake_make_operation_argument_success_s = FAKE_make_operation_argument_success_s;
- const f_string_t fake_make_operation_argument_target_s = FAKE_make_operation_argument_target_s;
- const f_string_t fake_make_operation_argument_warn_s = FAKE_make_operation_argument_warn_s;
+ const f_string_static_t fake_make_operation_argument_environment_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_environment_s, 0, FAKE_make_operation_argument_environment_s_length);
+ const f_string_static_t fake_make_operation_argument_failure_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_failure_s, 0, FAKE_make_operation_argument_failure_s_length);
+ const f_string_static_t fake_make_operation_argument_file_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_file_s, 0, FAKE_make_operation_argument_file_s_length);
+ const f_string_static_t fake_make_operation_argument_directory_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_directory_s, 0, FAKE_make_operation_argument_directory_s_length);
+ const f_string_static_t fake_make_operation_argument_error_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_error_s, 0, FAKE_make_operation_argument_error_s_length);
+ const f_string_static_t fake_make_operation_argument_exit_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_exit_s, 0, FAKE_make_operation_argument_exit_s_length);
+ const f_string_static_t fake_make_operation_argument_has_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_has_s, 0, FAKE_make_operation_argument_has_s_length);
+ const f_string_static_t fake_make_operation_argument_ignore_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_ignore_s, 0, FAKE_make_operation_argument_ignore_s_length);
+ const f_string_static_t fake_make_operation_argument_is_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_is_s, 0, FAKE_make_operation_argument_is_s_length);
+ const f_string_static_t fake_make_operation_argument_parameter_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_parameter_s, 0, FAKE_make_operation_argument_parameter_s_length);
+ const f_string_static_t fake_make_operation_argument_point_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_point_s, 0, FAKE_make_operation_argument_point_s_length);
+ const f_string_static_t fake_make_operation_argument_recursive_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_recursive_s, 0, FAKE_make_operation_argument_recursive_s_length);
+ const f_string_static_t fake_make_operation_argument_success_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_success_s, 0, FAKE_make_operation_argument_success_s_length);
+ const f_string_static_t fake_make_operation_argument_target_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_target_s, 0, FAKE_make_operation_argument_target_s_length);
+ const f_string_static_t fake_make_operation_argument_warn_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_warn_s, 0, FAKE_make_operation_argument_warn_s_length);
- const f_string_t fake_make_operation_argument_if_defined_s = FAKE_make_operation_argument_if_defined_s;
- const f_string_t fake_make_operation_argument_if_equal_s = FAKE_make_operation_argument_if_equal_s;
- const f_string_t fake_make_operation_argument_if_equal_not_s = FAKE_make_operation_argument_if_equal_not_s;
- const f_string_t fake_make_operation_argument_if_exists_s = FAKE_make_operation_argument_if_exists_s;
- const f_string_t fake_make_operation_argument_if_failure_s = FAKE_make_operation_argument_if_failure_s;
- const f_string_t fake_make_operation_argument_if_greater_s = FAKE_make_operation_argument_if_greater_s;
- const f_string_t fake_make_operation_argument_if_greater_equal_s = FAKE_make_operation_argument_if_greater_equal_s;
- const f_string_t fake_make_operation_argument_if_group_s = FAKE_make_operation_argument_if_group_s;
- const f_string_t fake_make_operation_argument_if_is_s = FAKE_make_operation_argument_if_is_s;
- const f_string_t fake_make_operation_argument_if_is_for_s = FAKE_make_operation_argument_if_is_for_s;
- const f_string_t fake_make_operation_argument_if_less_s = FAKE_make_operation_argument_if_less_s;
- const f_string_t fake_make_operation_argument_if_less_equal_s = FAKE_make_operation_argument_if_less_equal_s;
- const f_string_t fake_make_operation_argument_if_mode_s = FAKE_make_operation_argument_if_mode_s;
- const f_string_t fake_make_operation_argument_if_not_s = FAKE_make_operation_argument_if_not_s;
- const f_string_t fake_make_operation_argument_if_owner_s = FAKE_make_operation_argument_if_owner_s;
- const f_string_t fake_make_operation_argument_if_success_s = FAKE_make_operation_argument_if_success_s;
+ const f_string_static_t fake_make_operation_argument_if_defined_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_defined_s, 0, FAKE_make_operation_argument_if_defined_s_length);
+ const f_string_static_t fake_make_operation_argument_if_equal_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_equal_s, 0, FAKE_make_operation_argument_if_equal_s_length);
+ const f_string_static_t fake_make_operation_argument_if_equal_not_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_equal_not_s, 0, FAKE_make_operation_argument_if_equal_not_s_length);
+ const f_string_static_t fake_make_operation_argument_if_exists_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_exists_s, 0, FAKE_make_operation_argument_if_exists_s_length);
+ const f_string_static_t fake_make_operation_argument_if_failure_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_failure_s, 0, FAKE_make_operation_argument_if_failure_s_length);
+ const f_string_static_t fake_make_operation_argument_if_greater_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_greater_s, 0, FAKE_make_operation_argument_if_greater_s_length);
+ const f_string_static_t fake_make_operation_argument_if_greater_equal_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_greater_equal_s, 0, FAKE_make_operation_argument_if_greater_equal_s_length);
+ const f_string_static_t fake_make_operation_argument_if_group_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_group_s, 0, FAKE_make_operation_argument_if_group_s_length);
+ const f_string_static_t fake_make_operation_argument_if_is_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_is_s, 0, FAKE_make_operation_argument_if_is_s_length);
+ const f_string_static_t fake_make_operation_argument_if_is_for_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_is_for_s, 0, FAKE_make_operation_argument_if_is_for_s_length);
+ const f_string_static_t fake_make_operation_argument_if_less_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_less_s, 0, FAKE_make_operation_argument_if_less_s_length);
+ const f_string_static_t fake_make_operation_argument_if_less_equal_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_less_equal_s, 0, FAKE_make_operation_argument_if_less_equal_s_length);
+ const f_string_static_t fake_make_operation_argument_if_mode_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_mode_s, 0, FAKE_make_operation_argument_if_mode_s_length);
+ const f_string_static_t fake_make_operation_argument_if_not_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_not_s, 0, FAKE_make_operation_argument_if_not_s_length);
+ const f_string_static_t fake_make_operation_argument_if_owner_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_owner_s, 0, FAKE_make_operation_argument_if_owner_s_length);
+ const f_string_static_t fake_make_operation_argument_if_success_s = macro_f_string_static_t_initialize2(FAKE_make_operation_argument_if_success_s, 0, FAKE_make_operation_argument_if_success_s_length);
#endif // _di_fake_make_operation_
#ifndef _di_fake_make_parameter_t_
- const f_string_t fake_make_parameter_variable_build_s = FAKE_make_parameter_variable_build_s;
- const f_string_t fake_make_parameter_variable_color_s = FAKE_make_parameter_variable_color_s;
- const f_string_t fake_make_parameter_variable_data_s = FAKE_make_parameter_variable_data_s;
- const f_string_t fake_make_parameter_variable_define_s = FAKE_make_parameter_variable_define_s;
- const f_string_t fake_make_parameter_variable_fakefile_s = FAKE_make_parameter_variable_fakefile_s;
- const f_string_t fake_make_parameter_variable_mode_s = FAKE_make_parameter_variable_mode_s;
- const f_string_t fake_make_parameter_variable_process_s = FAKE_make_parameter_variable_process_s;
- const f_string_t fake_make_parameter_variable_return_s = FAKE_make_parameter_variable_return_s;
- const f_string_t fake_make_parameter_variable_settings_s = FAKE_make_parameter_variable_settings_s;
- const f_string_t fake_make_parameter_variable_sources_s = FAKE_make_parameter_variable_sources_s;
- const f_string_t fake_make_parameter_variable_verbosity_s = FAKE_make_parameter_variable_verbosity_s;
- const f_string_t fake_make_parameter_variable_work_s = FAKE_make_parameter_variable_work_s;
+ const f_string_static_t fake_make_parameter_iki_option_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_iki_option_s, 0, FAKE_make_parameter_iki_option_s_length);
+ const f_string_static_t fake_make_parameter_iki_value_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_iki_value_s, 0, FAKE_make_parameter_iki_value_s_length);
- const f_string_t fake_make_parameter_variable_option_build_s = FAKE_make_parameter_variable_build_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_color_s = FAKE_make_parameter_variable_color_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_data_s = FAKE_make_parameter_variable_data_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_define_s = FAKE_make_parameter_variable_define_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_fakefile_s = FAKE_make_parameter_variable_fakefile_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_mode_s = FAKE_make_parameter_variable_mode_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_process_s = FAKE_make_parameter_variable_process_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_return_s = FAKE_make_parameter_variable_return_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_settings_s = FAKE_make_parameter_variable_settings_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_sources_s = FAKE_make_parameter_variable_sources_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_verbosity_s = FAKE_make_parameter_variable_verbosity_s fake_make_parameter_iki_option_s;
- const f_string_t fake_make_parameter_variable_option_work_s = FAKE_make_parameter_variable_work_s fake_make_parameter_iki_option_s;
+ const f_string_static_t fake_make_parameter_variable_build_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length);
+ const f_string_static_t fake_make_parameter_variable_color_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_color_s, 0, FAKE_make_parameter_variable_color_s_length);
+ const f_string_static_t fake_make_parameter_variable_data_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_data_s, 0, FAKE_make_parameter_variable_data_s_length);
+ const f_string_static_t fake_make_parameter_variable_define_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_define_s, 0, FAKE_make_parameter_variable_define_s_length);
+ const f_string_static_t fake_make_parameter_variable_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_fakefile_s, 0, FAKE_make_parameter_variable_fakefile_s_length);
+ const f_string_static_t fake_make_parameter_variable_mode_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_mode_s, 0, FAKE_make_parameter_variable_mode_s_length);
+ const f_string_static_t fake_make_parameter_variable_process_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_process_s, 0, FAKE_make_parameter_variable_process_s_length);
+ const f_string_static_t fake_make_parameter_variable_return_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_return_s, 0, FAKE_make_parameter_variable_return_s_length);
+ const f_string_static_t fake_make_parameter_variable_settings_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_settings_s, 0, FAKE_make_parameter_variable_settings_s_length);
+ const f_string_static_t fake_make_parameter_variable_sources_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_sources_s, 0, FAKE_make_parameter_variable_sources_s_length);
+ const f_string_static_t fake_make_parameter_variable_verbosity_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_verbosity_s, 0, FAKE_make_parameter_variable_verbosity_s_length);
+ const f_string_static_t fake_make_parameter_variable_work_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_work_s, 0, FAKE_make_parameter_variable_work_s_length);
- const f_string_t fake_make_parameter_variable_value_build_s = FAKE_make_parameter_variable_build_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_color_s = FAKE_make_parameter_variable_color_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_data_s = FAKE_make_parameter_variable_data_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_define_s = FAKE_make_parameter_variable_define_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_fakefile_s = FAKE_make_parameter_variable_fakefile_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_mode_s = FAKE_make_parameter_variable_mode_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_process_s = FAKE_make_parameter_variable_process_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_return_s = FAKE_make_parameter_variable_return_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_settings_s = FAKE_make_parameter_variable_settings_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_sources_s = FAKE_make_parameter_variable_sources_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_verbosity_s = FAKE_make_parameter_variable_verbosity_s fake_make_parameter_iki_value_s;
- const f_string_t fake_make_parameter_variable_value_work_s = FAKE_make_parameter_variable_work_s fake_make_parameter_iki_value_s;
+ const f_string_static_t fake_make_parameter_variable_option_build_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_color_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_color_s, 0, FAKE_make_parameter_variable_option_color_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_data_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_data_s, 0, FAKE_make_parameter_variable_option_data_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_define_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_define_s, 0, FAKE_make_parameter_variable_option_define_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_fakefile_s, 0, FAKE_make_parameter_variable_option_fakefile_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_mode_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_mode_s, 0, FAKE_make_parameter_variable_option_mode_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_process_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_process_s, 0, FAKE_make_parameter_variable_option_process_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_return_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_return_s, 0, FAKE_make_parameter_variable_option_return_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_settings_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_settings_s, 0, FAKE_make_parameter_variable_option_settings_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_sources_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_sources_s, 0, FAKE_make_parameter_variable_option_sources_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_verbosity_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_verbosity_s, 0, FAKE_make_parameter_variable_option_verbosity_s_length);
+ const f_string_static_t fake_make_parameter_variable_option_work_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_option_work_s, 0, FAKE_make_parameter_variable_option_work_s_length);
+
+ const f_string_static_t fake_make_parameter_variable_value_build_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_build_s, 0, FAKE_make_parameter_variable_value_build_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_color_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_color_s, 0, FAKE_make_parameter_variable_value_color_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_data_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_data_s, 0, FAKE_make_parameter_variable_value_data_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_define_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_define_s, 0, FAKE_make_parameter_variable_value_define_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_fakefile_s, 0, FAKE_make_parameter_variable_value_fakefile_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_mode_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_mode_s, 0, FAKE_make_parameter_variable_value_mode_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_process_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_process_s, 0, FAKE_make_parameter_variable_value_process_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_return_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_return_s, 0, FAKE_make_parameter_variable_value_return_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_settings_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_settings_s, 0, FAKE_make_parameter_variable_value_settings_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_sources_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_sources_s, 0, FAKE_make_parameter_variable_value_sources_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_verbosity_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_verbosity_s, 0, FAKE_make_parameter_variable_value_verbosity_s_length);
+ const f_string_static_t fake_make_parameter_variable_value_work_s = macro_f_string_static_t_initialize2(FAKE_make_parameter_variable_value_work_s, 0, FAKE_make_parameter_variable_value_work_s_length);
#endif // _di_fake_make_parameter_t_
#ifndef _di_fake_skeleton_content_
- const f_string_t fake_make_skeleton_content_defines_s = FAKE_make_skeleton_content_defines_s;
- const f_string_t fake_make_skeleton_content_dependencies_s = FAKE_make_skeleton_content_dependencies_s;
- const f_string_t fake_make_skeleton_content_fakefile_s = FAKE_make_skeleton_content_fakefile_s;
- const f_string_t fake_make_skeleton_content_settings_s = FAKE_make_skeleton_content_settings_s;
+ const f_string_static_t fake_make_skeleton_content_defines_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_defines_s, 0, FAKE_make_skeleton_content_defines_s_length);
+ const f_string_static_t fake_make_skeleton_content_dependencies_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_dependencies_s, 0, FAKE_make_skeleton_content_dependencies_s_length);
+ const f_string_static_t fake_make_skeleton_content_fakefile_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_fakefile_s, 0, FAKE_make_skeleton_content_fakefile_s_length);
+ const f_string_static_t fake_make_skeleton_content_process_post_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_process_post_s, 0, FAKE_make_skeleton_content_process_post_s_length);
+ const f_string_static_t fake_make_skeleton_content_process_pre_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_process_pre_s, 0, FAKE_make_skeleton_content_process_pre_s_length);
+ const f_string_static_t fake_make_skeleton_content_settings_s = macro_f_string_static_t_initialize2(FAKE_make_skeleton_content_settings_s, 0, FAKE_make_skeleton_content_settings_s_length);
#endif // _di_fake_skeleton_content_
#ifndef _di_fake_make_context_
- const f_string_t fake_make_context_reset_s = FAKE_make_context_reset_s;
- const f_string_t fake_make_context_warning_s = FAKE_make_context_warning_s;
- const f_string_t fake_make_context_error_s = FAKE_make_context_error_s;
- const f_string_t fake_make_context_title_s = FAKE_make_context_title_s;
- const f_string_t fake_make_context_notable_s = FAKE_make_context_notable_s;
- const f_string_t fake_make_context_important_s = FAKE_make_context_important_s;
- const f_string_t fake_make_context_standout_s = FAKE_make_context_standout_s;
- const f_string_t fake_make_context_success_s = FAKE_make_context_success_s;
- const f_string_t fake_make_context_normal_s = FAKE_make_context_normal_s;
+ const f_string_static_t fake_make_context_reset_s = macro_f_string_static_t_initialize2(FAKE_make_context_reset_s, 0, FAKE_make_context_reset_s_length);
+ const f_string_static_t fake_make_context_warning_s = macro_f_string_static_t_initialize2(FAKE_make_context_warning_s, 0, FAKE_make_context_warning_s_length);
+ const f_string_static_t fake_make_context_error_s = macro_f_string_static_t_initialize2(FAKE_make_context_error_s, 0, FAKE_make_context_error_s_length);
+ const f_string_static_t fake_make_context_title_s = macro_f_string_static_t_initialize2(FAKE_make_context_title_s, 0, FAKE_make_context_title_s_length);
+ const f_string_static_t fake_make_context_notable_s = macro_f_string_static_t_initialize2(FAKE_make_context_notable_s, 0, FAKE_make_context_notable_s_length);
+ const f_string_static_t fake_make_context_important_s = macro_f_string_static_t_initialize2(FAKE_make_context_important_s, 0, FAKE_make_context_important_s_length);
+ const f_string_static_t fake_make_context_standout_s = macro_f_string_static_t_initialize2(FAKE_make_context_standout_s, 0, FAKE_make_context_standout_s_length);
+ const f_string_static_t fake_make_context_success_s = macro_f_string_static_t_initialize2(FAKE_make_context_success_s, 0, FAKE_make_context_success_s_length);
+ const f_string_static_t fake_make_context_normal_s = macro_f_string_static_t_initialize2(FAKE_make_context_normal_s, 0, FAKE_make_context_normal_s_length);
#endif // _di_fake_make_context_
+#ifndef _di_fake_file_data_build_strings_
+ const f_string_static_t fake_file_data_build_process_post_s = macro_f_string_static_t_initialize2(FAKE_file_data_build_process_post_s, 0, FAKE_file_data_build_process_post_s_length);
+ const f_string_static_t fake_file_data_build_process_pre_s = macro_f_string_static_t_initialize2(FAKE_file_data_build_process_pre_s, 0, FAKE_file_data_build_process_pre_s_length);
+#endif // _di_fake_file_data_build_strings_
+
#ifndef _di_fake_signal_received_
f_status_t fake_signal_received(fake_main_t * const main) {
#define FAKE_build_setting_name_version_nano_prefix_s "version_nano_prefix"
#define FAKE_build_setting_name_version_target_s "version_target"
- #define fake_build_setting_name_build_compiler_s_length 14
- #define fake_build_setting_name_build_language_s_length 14
- #define fake_build_setting_name_build_libraries_s_length 15
- #define fake_build_setting_name_build_libraries_shared_s_length 22
- #define fake_build_setting_name_build_libraries_static_s_length 22
- #define fake_build_setting_name_build_indexer_s_length 13
- #define fake_build_setting_name_build_indexer_arguments_s_length 23
- #define fake_build_setting_name_build_script_s_length 12
- #define fake_build_setting_name_build_shared_s_length 12
- #define fake_build_setting_name_build_sources_headers_s_length 21
- #define fake_build_setting_name_build_sources_headers_shared_s_length 28
- #define fake_build_setting_name_build_sources_headers_static_s_length 28
- #define fake_build_setting_name_build_sources_library_s_length 21
- #define fake_build_setting_name_build_sources_library_shared_s_length 28
- #define fake_build_setting_name_build_sources_library_static_s_length 28
- #define fake_build_setting_name_build_sources_program_s_length 21
- #define fake_build_setting_name_build_sources_program_shared_s_length 28
- #define fake_build_setting_name_build_sources_program_static_s_length 28
- #define fake_build_setting_name_build_sources_script_s_length 20
- #define fake_build_setting_name_build_sources_settings_s_length 22
- #define fake_build_setting_name_build_static_s_length 12
- #define fake_build_setting_name_environment_length_s 11
- #define fake_build_setting_name_defines_s_length 7
- #define fake_build_setting_name_defines_library_s_length 15
- #define fake_build_setting_name_defines_library_shared_s_length 22
- #define fake_build_setting_name_defines_library_static_s_length 22
- #define fake_build_setting_name_defines_program_s_length 15
- #define fake_build_setting_name_defines_program_shared_s_length 22
- #define fake_build_setting_name_defines_program_static_s_length 22
- #define fake_build_setting_name_defines_shared_s_length 14
- #define fake_build_setting_name_defines_static_s_length 14
- #define fake_build_setting_name_flags_s_length 5
- #define fake_build_setting_name_flags_library_s_length 13
- #define fake_build_setting_name_flags_library_shared_s_length 20
- #define fake_build_setting_name_flags_library_static_s_length 20
- #define fake_build_setting_name_flags_program_s_length 13
- #define fake_build_setting_name_flags_program_shared_s_length 20
- #define fake_build_setting_name_flags_program_static_s_length 20
- #define fake_build_setting_name_flags_shared_s_length 12
- #define fake_build_setting_name_flags_static_s_length 12
- #define fake_build_setting_name_modes_s_length 5
- #define fake_build_setting_name_modes_default_s_length 13
- #define fake_build_setting_name_path_headers_s_length 12
- #define fake_build_setting_name_path_headers_preserve_s_length 21
- #define fake_build_setting_name_path_language_s_length 13
- #define fake_build_setting_name_path_library_script_s_length 19
- #define fake_build_setting_name_path_library_shared_s_length 19
- #define fake_build_setting_name_path_library_static_s_length 19
- #define fake_build_setting_name_path_program_script_s_length 19
- #define fake_build_setting_name_path_program_shared_s_length 19
- #define fake_build_setting_name_path_program_static_s_length 19
- #define fake_build_setting_name_path_sources_s_length 12
- #define fake_build_setting_name_path_standard_s_length 13
- #define fake_build_setting_name_process_post_s_length 12
- #define fake_build_setting_name_process_pre_s_length 11
- #define fake_build_setting_name_project_name_s_length 12
- #define fake_build_setting_name_search_exclusive_s_length 16
- #define fake_build_setting_name_search_shared_s_length 13
- #define fake_build_setting_name_search_static_s_length 13
- #define fake_build_setting_name_version_file_s_length 12
- #define fake_build_setting_name_version_major_s_length 13
- #define fake_build_setting_name_version_major_prefix_s_length 20
- #define fake_build_setting_name_version_micro_s_length 13
- #define fake_build_setting_name_version_micro_prefix_s_length 20
- #define fake_build_setting_name_version_minor_s_length 13
- #define fake_build_setting_name_version_minor_prefix_s_length 20
- #define fake_build_setting_name_version_nano_s_length 12
- #define fake_build_setting_name_version_nano_prefix_s_length 19
- #define fake_build_setting_name_version_target_s_length 14
-
- extern const f_string_t fake_build_setting_name_build_compiler_s;
- extern const f_string_t fake_build_setting_name_build_language_s;
- extern const f_string_t fake_build_setting_name_build_libraries_s;
- extern const f_string_t fake_build_setting_name_build_libraries_shared_s;
- extern const f_string_t fake_build_setting_name_build_libraries_static_s;
- extern const f_string_t fake_build_setting_name_build_indexer_s;
- extern const f_string_t fake_build_setting_name_build_indexer_arguments_s;
- extern const f_string_t fake_build_setting_name_build_script_s;
- extern const f_string_t fake_build_setting_name_build_shared_s;
- extern const f_string_t fake_build_setting_name_build_sources_headers_s;
- extern const f_string_t fake_build_setting_name_build_sources_headers_shared_s;
- extern const f_string_t fake_build_setting_name_build_sources_headers_static_s;
- extern const f_string_t fake_build_setting_name_build_sources_library_s;
- extern const f_string_t fake_build_setting_name_build_sources_library_shared_s;
- extern const f_string_t fake_build_setting_name_build_sources_library_static_s;
- extern const f_string_t fake_build_setting_name_build_sources_program_s;
- extern const f_string_t fake_build_setting_name_build_sources_program_shared_s;
- extern const f_string_t fake_build_setting_name_build_sources_program_static_s;
- extern const f_string_t fake_build_setting_name_build_sources_script_s;
- extern const f_string_t fake_build_setting_name_build_sources_settings_s;
- extern const f_string_t fake_build_setting_name_build_static_s;
- extern const f_string_t fake_build_setting_name_defines_s;
- extern const f_string_t fake_build_setting_name_defines_library_s;
- extern const f_string_t fake_build_setting_name_defines_library_shared_s;
- extern const f_string_t fake_build_setting_name_defines_library_static_s;
- extern const f_string_t fake_build_setting_name_defines_program_s;
- extern const f_string_t fake_build_setting_name_defines_program_shared_s;
- extern const f_string_t fake_build_setting_name_defines_program_static_s;
- extern const f_string_t fake_build_setting_name_defines_shared_s;
- extern const f_string_t fake_build_setting_name_defines_static_s;
- extern const f_string_t fake_build_setting_name_environment_s;
- extern const f_string_t fake_build_setting_name_flags_s;
- extern const f_string_t fake_build_setting_name_flags_library_s;
- extern const f_string_t fake_build_setting_name_flags_library_shared_s;
- extern const f_string_t fake_build_setting_name_flags_library_static_s;
- extern const f_string_t fake_build_setting_name_flags_program_s;
- extern const f_string_t fake_build_setting_name_flags_program_shared_s;
- extern const f_string_t fake_build_setting_name_flags_program_static_s;
- extern const f_string_t fake_build_setting_name_flags_shared_s;
- extern const f_string_t fake_build_setting_name_flags_static_s;
- extern const f_string_t fake_build_setting_name_modes_s;
- extern const f_string_t fake_build_setting_name_modes_default_s;
- extern const f_string_t fake_build_setting_name_path_headers_s;
- extern const f_string_t fake_build_setting_name_path_headers_preserve_s;
- extern const f_string_t fake_build_setting_name_path_language_s;
- extern const f_string_t fake_build_setting_name_path_library_script_s;
- extern const f_string_t fake_build_setting_name_path_library_shared_s;
- extern const f_string_t fake_build_setting_name_path_library_static_s;
- extern const f_string_t fake_build_setting_name_path_program_script_s;
- extern const f_string_t fake_build_setting_name_path_program_shared_s;
- extern const f_string_t fake_build_setting_name_path_program_static_s;
- extern const f_string_t fake_build_setting_name_path_sources_s;
- extern const f_string_t fake_build_setting_name_path_standard_s;
- extern const f_string_t fake_build_setting_name_process_post_s;
- extern const f_string_t fake_build_setting_name_process_pre_s;
- extern const f_string_t fake_build_setting_name_project_name_s;
- extern const f_string_t fake_build_setting_name_search_exclusive_s;
- extern const f_string_t fake_build_setting_name_search_shared_s;
- extern const f_string_t fake_build_setting_name_search_static_s;
- extern const f_string_t fake_build_setting_name_version_file_s;
- extern const f_string_t fake_build_setting_name_version_major_s;
- extern const f_string_t fake_build_setting_name_version_major_prefix_s;
- extern const f_string_t fake_build_setting_name_version_micro_s;
- extern const f_string_t fake_build_setting_name_version_micro_prefix_s;
- extern const f_string_t fake_build_setting_name_version_minor_s;
- extern const f_string_t fake_build_setting_name_version_minor_prefix_s;
- extern const f_string_t fake_build_setting_name_version_nano_s;
- extern const f_string_t fake_build_setting_name_version_nano_prefix_s;
- extern const f_string_t fake_build_setting_name_version_target_s;
+ #define FAKE_build_setting_name_build_compiler_s_length 14
+ #define FAKE_build_setting_name_build_language_s_length 14
+ #define FAKE_build_setting_name_build_libraries_s_length 15
+ #define FAKE_build_setting_name_build_libraries_shared_s_length 22
+ #define FAKE_build_setting_name_build_libraries_static_s_length 22
+ #define FAKE_build_setting_name_build_indexer_s_length 13
+ #define FAKE_build_setting_name_build_indexer_arguments_s_length 23
+ #define FAKE_build_setting_name_build_script_s_length 12
+ #define FAKE_build_setting_name_build_shared_s_length 12
+ #define FAKE_build_setting_name_build_sources_headers_s_length 21
+ #define FAKE_build_setting_name_build_sources_headers_shared_s_length 28
+ #define FAKE_build_setting_name_build_sources_headers_static_s_length 28
+ #define FAKE_build_setting_name_build_sources_library_s_length 21
+ #define FAKE_build_setting_name_build_sources_library_shared_s_length 28
+ #define FAKE_build_setting_name_build_sources_library_static_s_length 28
+ #define FAKE_build_setting_name_build_sources_program_s_length 21
+ #define FAKE_build_setting_name_build_sources_program_shared_s_length 28
+ #define FAKE_build_setting_name_build_sources_program_static_s_length 28
+ #define FAKE_build_setting_name_build_sources_script_s_length 20
+ #define FAKE_build_setting_name_build_sources_settings_s_length 22
+ #define FAKE_build_setting_name_build_static_s_length 12
+ #define FAKE_build_setting_name_environment_length_s 11
+ #define FAKE_build_setting_name_defines_s_length 7
+ #define FAKE_build_setting_name_defines_library_s_length 15
+ #define FAKE_build_setting_name_defines_library_shared_s_length 22
+ #define FAKE_build_setting_name_defines_library_static_s_length 22
+ #define FAKE_build_setting_name_defines_program_s_length 15
+ #define FAKE_build_setting_name_defines_program_shared_s_length 22
+ #define FAKE_build_setting_name_defines_program_static_s_length 22
+ #define FAKE_build_setting_name_defines_shared_s_length 14
+ #define FAKE_build_setting_name_defines_static_s_length 14
+ #define FAKE_build_setting_name_flags_s_length 5
+ #define FAKE_build_setting_name_flags_library_s_length 13
+ #define FAKE_build_setting_name_flags_library_shared_s_length 20
+ #define FAKE_build_setting_name_flags_library_static_s_length 20
+ #define FAKE_build_setting_name_flags_program_s_length 13
+ #define FAKE_build_setting_name_flags_program_shared_s_length 20
+ #define FAKE_build_setting_name_flags_program_static_s_length 20
+ #define FAKE_build_setting_name_flags_shared_s_length 12
+ #define FAKE_build_setting_name_flags_static_s_length 12
+ #define FAKE_build_setting_name_modes_s_length 5
+ #define FAKE_build_setting_name_modes_default_s_length 13
+ #define FAKE_build_setting_name_path_headers_s_length 12
+ #define FAKE_build_setting_name_path_headers_preserve_s_length 21
+ #define FAKE_build_setting_name_path_language_s_length 13
+ #define FAKE_build_setting_name_path_library_script_s_length 19
+ #define FAKE_build_setting_name_path_library_shared_s_length 19
+ #define FAKE_build_setting_name_path_library_static_s_length 19
+ #define FAKE_build_setting_name_path_program_script_s_length 19
+ #define FAKE_build_setting_name_path_program_shared_s_length 19
+ #define FAKE_build_setting_name_path_program_static_s_length 19
+ #define FAKE_build_setting_name_path_sources_s_length 12
+ #define FAKE_build_setting_name_path_standard_s_length 13
+ #define FAKE_build_setting_name_process_post_s_length 12
+ #define FAKE_build_setting_name_process_pre_s_length 11
+ #define FAKE_build_setting_name_project_name_s_length 12
+ #define FAKE_build_setting_name_search_exclusive_s_length 16
+ #define FAKE_build_setting_name_search_shared_s_length 13
+ #define FAKE_build_setting_name_search_static_s_length 13
+ #define FAKE_build_setting_name_version_file_s_length 12
+ #define FAKE_build_setting_name_version_major_s_length 13
+ #define FAKE_build_setting_name_version_major_prefix_s_length 20
+ #define FAKE_build_setting_name_version_micro_s_length 13
+ #define FAKE_build_setting_name_version_micro_prefix_s_length 20
+ #define FAKE_build_setting_name_version_minor_s_length 13
+ #define FAKE_build_setting_name_version_minor_prefix_s_length 20
+ #define FAKE_build_setting_name_version_nano_s_length 12
+ #define FAKE_build_setting_name_version_nano_prefix_s_length 19
+ #define FAKE_build_setting_name_version_target_s_length 14
+
+ extern const f_string_static_t fake_build_setting_name_build_compiler_s;
+ extern const f_string_static_t fake_build_setting_name_build_language_s;
+ extern const f_string_static_t fake_build_setting_name_build_libraries_s;
+ extern const f_string_static_t fake_build_setting_name_build_libraries_shared_s;
+ extern const f_string_static_t fake_build_setting_name_build_libraries_static_s;
+ extern const f_string_static_t fake_build_setting_name_build_indexer_s;
+ extern const f_string_static_t fake_build_setting_name_build_indexer_arguments_s;
+ extern const f_string_static_t fake_build_setting_name_build_script_s;
+ extern const f_string_static_t fake_build_setting_name_build_shared_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_headers_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_headers_static_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_library_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_library_shared_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_library_static_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_program_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_program_shared_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_program_static_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_script_s;
+ extern const f_string_static_t fake_build_setting_name_build_sources_settings_s;
+ extern const f_string_static_t fake_build_setting_name_build_static_s;
+ extern const f_string_static_t fake_build_setting_name_defines_s;
+ extern const f_string_static_t fake_build_setting_name_defines_library_s;
+ extern const f_string_static_t fake_build_setting_name_defines_library_shared_s;
+ extern const f_string_static_t fake_build_setting_name_defines_library_static_s;
+ extern const f_string_static_t fake_build_setting_name_defines_program_s;
+ extern const f_string_static_t fake_build_setting_name_defines_program_shared_s;
+ extern const f_string_static_t fake_build_setting_name_defines_program_static_s;
+ extern const f_string_static_t fake_build_setting_name_defines_shared_s;
+ extern const f_string_static_t fake_build_setting_name_defines_static_s;
+ extern const f_string_static_t fake_build_setting_name_environment_s;
+ extern const f_string_static_t fake_build_setting_name_flags_s;
+ extern const f_string_static_t fake_build_setting_name_flags_library_s;
+ extern const f_string_static_t fake_build_setting_name_flags_library_shared_s;
+ extern const f_string_static_t fake_build_setting_name_flags_library_static_s;
+ extern const f_string_static_t fake_build_setting_name_flags_program_s;
+ extern const f_string_static_t fake_build_setting_name_flags_program_shared_s;
+ extern const f_string_static_t fake_build_setting_name_flags_program_static_s;
+ extern const f_string_static_t fake_build_setting_name_flags_shared_s;
+ extern const f_string_static_t fake_build_setting_name_flags_static_s;
+ extern const f_string_static_t fake_build_setting_name_modes_s;
+ extern const f_string_static_t fake_build_setting_name_modes_default_s;
+ extern const f_string_static_t fake_build_setting_name_path_headers_s;
+ extern const f_string_static_t fake_build_setting_name_path_headers_preserve_s;
+ extern const f_string_static_t fake_build_setting_name_path_language_s;
+ extern const f_string_static_t fake_build_setting_name_path_library_script_s;
+ extern const f_string_static_t fake_build_setting_name_path_library_shared_s;
+ extern const f_string_static_t fake_build_setting_name_path_library_static_s;
+ extern const f_string_static_t fake_build_setting_name_path_program_script_s;
+ extern const f_string_static_t fake_build_setting_name_path_program_shared_s;
+ extern const f_string_static_t fake_build_setting_name_path_program_static_s;
+ extern const f_string_static_t fake_build_setting_name_path_sources_s;
+ extern const f_string_static_t fake_build_setting_name_path_standard_s;
+ extern const f_string_static_t fake_build_setting_name_process_post_s;
+ extern const f_string_static_t fake_build_setting_name_process_pre_s;
+ extern const f_string_static_t fake_build_setting_name_project_name_s;
+ extern const f_string_static_t fake_build_setting_name_search_exclusive_s;
+ extern const f_string_static_t fake_build_setting_name_search_shared_s;
+ extern const f_string_static_t fake_build_setting_name_search_static_s;
+ extern const f_string_static_t fake_build_setting_name_version_file_s;
+ extern const f_string_static_t fake_build_setting_name_version_major_s;
+ extern const f_string_static_t fake_build_setting_name_version_major_prefix_s;
+ extern const f_string_static_t fake_build_setting_name_version_micro_s;
+ extern const f_string_static_t fake_build_setting_name_version_micro_prefix_s;
+ extern const f_string_static_t fake_build_setting_name_version_minor_s;
+ extern const f_string_static_t fake_build_setting_name_version_minor_prefix_s;
+ extern const f_string_static_t fake_build_setting_name_version_nano_s;
+ extern const f_string_static_t fake_build_setting_name_version_nano_prefix_s;
+ extern const f_string_static_t fake_build_setting_name_version_target_s;
#define fake_build_setting_total_d 69
#define FAKE_build_setting_default_version_s "0"
#define FAKE_build_setting_default_version_prefix_s "."
- #define fake_build_setting_default_version_s_length 1
- #define fake_build_setting_default_version_prefix_s_length 1
+ #define FAKE_build_setting_default_version_s_length 1
+ #define FAKE_build_setting_default_version_prefix_s_length 1
- extern const f_string_t fake_build_setting_default_version_s;
- extern const f_string_t fake_build_setting_default_version_prefix_s;
+ extern const f_string_static_t fake_build_setting_default_version_s;
+ extern const f_string_static_t fake_build_setting_default_version_prefix_s;
#endif // _di_fake_build_setting_t_
#ifndef _di_fake_build_stage_t_
#define FAKE_build_stage_sources_script_s "sources_script"
#define FAKE_build_stage_sources_settings_s "sources_settings"
- #define fake_build_stage_built_s_length 6
- #define fake_build_stage_libraries_script_s_length 16
- #define fake_build_stage_libraries_shared_s_length 16
- #define fake_build_stage_libraries_static_s_length 16
- #define fake_build_stage_objects_static_s_length 14
- #define fake_build_stage_process_post_s_length 12
- #define fake_build_stage_process_pre_s_length 11
- #define fake_build_stage_programs_script_s_length 15
- #define fake_build_stage_programs_shared_s_length 15
- #define fake_build_stage_programs_static_s_length 15
- #define fake_build_stage_separate_s_length 1
- #define fake_build_stage_skeleton_s_length 8
- #define fake_build_stage_sources_headers_s_length 15
- #define fake_build_stage_sources_script_s_length 14
- #define fake_build_stage_sources_settings_s_length 16
-
- extern const f_string_t fake_build_stage_built_s;
- extern const f_string_t fake_build_stage_libraries_script_s;
- extern const f_string_t fake_build_stage_libraries_shared_s;
- extern const f_string_t fake_build_stage_libraries_static_s;
- extern const f_string_t fake_build_stage_objects_static_s;
- extern const f_string_t fake_build_stage_process_post_s;
- extern const f_string_t fake_build_stage_process_pre_s;
- extern const f_string_t fake_build_stage_programs_script_s;
- extern const f_string_t fake_build_stage_programs_shared_s;
- extern const f_string_t fake_build_stage_programs_static_s;
- extern const f_string_t fake_build_stage_separate_s;
- extern const f_string_t fake_build_stage_skeleton_s;
- extern const f_string_t fake_build_stage_sources_headers_s;
- extern const f_string_t fake_build_stage_sources_script_s;
- extern const f_string_t fake_build_stage_sources_settings_s;
+ #define FAKE_build_stage_built_s_length 6
+ #define FAKE_build_stage_libraries_script_s_length 16
+ #define FAKE_build_stage_libraries_shared_s_length 16
+ #define FAKE_build_stage_libraries_static_s_length 16
+ #define FAKE_build_stage_objects_static_s_length 14
+ #define FAKE_build_stage_process_post_s_length 12
+ #define FAKE_build_stage_process_pre_s_length 11
+ #define FAKE_build_stage_programs_script_s_length 15
+ #define FAKE_build_stage_programs_shared_s_length 15
+ #define FAKE_build_stage_programs_static_s_length 15
+ #define FAKE_build_stage_separate_s_length 1
+ #define FAKE_build_stage_skeleton_s_length 8
+ #define FAKE_build_stage_sources_headers_s_length 15
+ #define FAKE_build_stage_sources_script_s_length 14
+ #define FAKE_build_stage_sources_settings_s_length 16
+
+ extern const f_string_static_t fake_build_stage_built_s;
+ extern const f_string_static_t fake_build_stage_libraries_script_s;
+ extern const f_string_static_t fake_build_stage_libraries_shared_s;
+ extern const f_string_static_t fake_build_stage_libraries_static_s;
+ extern const f_string_static_t fake_build_stage_objects_static_s;
+ extern const f_string_static_t fake_build_stage_process_post_s;
+ extern const f_string_static_t fake_build_stage_process_pre_s;
+ extern const f_string_static_t fake_build_stage_programs_script_s;
+ extern const f_string_static_t fake_build_stage_programs_shared_s;
+ extern const f_string_static_t fake_build_stage_programs_static_s;
+ extern const f_string_static_t fake_build_stage_separate_s;
+ extern const f_string_static_t fake_build_stage_skeleton_s;
+ extern const f_string_static_t fake_build_stage_sources_headers_s;
+ extern const f_string_static_t fake_build_stage_sources_script_s;
+ extern const f_string_static_t fake_build_stage_sources_settings_s;
#endif // _di_fake_build_stage_t_
#ifndef _di_fake_build_data_t_
#define FAKE_build_parameter_library_static_s "-static"
#define FAKE_build_parameter_library_shared_prefix_s "-Wl,-soname,"
- #define fake_build_parameter_library_include_s_length 2
- #define fake_build_parameter_library_link_file_s_length 2
- #define fake_build_parameter_library_link_path_s_length 2
- #define fake_build_parameter_library_name_prefix_s_length 3
- #define fake_build_parameter_library_name_suffix_shared_s_length 3
- #define fake_build_parameter_library_name_suffix_static_s_length 2
- #define fake_build_parameter_library_output_s_length 2
- #define fake_build_parameter_library_shared_s_length 7
- #define fake_build_parameter_library_static_s_length 7
- #define fake_build_parameter_library_shared_prefix_s_length 12
-
- extern const f_string_t fake_build_parameter_library_include_s;
- extern const f_string_t fake_build_parameter_library_link_file_s;
- extern const f_string_t fake_build_parameter_library_link_path_s;
- extern const f_string_t fake_build_parameter_library_name_prefix_s;
- extern const f_string_t fake_build_parameter_library_name_suffix_shared_s;
- extern const f_string_t fake_build_parameter_library_name_suffix_static_s;
- extern const f_string_t fake_build_parameter_library_output_s;
- extern const f_string_t fake_build_parameter_library_shared_s;
- extern const f_string_t fake_build_parameter_library_static_s;
- extern const f_string_t fake_build_parameter_library_shared_prefix_s;
+ #define FAKE_build_parameter_library_include_s_length 2
+ #define FAKE_build_parameter_library_link_file_s_length 2
+ #define FAKE_build_parameter_library_link_path_s_length 2
+ #define FAKE_build_parameter_library_name_prefix_s_length 3
+ #define FAKE_build_parameter_library_name_suffix_shared_s_length 3
+ #define FAKE_build_parameter_library_name_suffix_static_s_length 2
+ #define FAKE_build_parameter_library_output_s_length 2
+ #define FAKE_build_parameter_library_shared_s_length 7
+ #define FAKE_build_parameter_library_static_s_length 7
+ #define FAKE_build_parameter_library_shared_prefix_s_length 12
+
+ extern const f_string_static_t fake_build_parameter_library_include_s;
+ extern const f_string_static_t fake_build_parameter_library_link_file_s;
+ extern const f_string_static_t fake_build_parameter_library_link_path_s;
+ extern const f_string_static_t fake_build_parameter_library_name_prefix_s;
+ extern const f_string_static_t fake_build_parameter_library_name_suffix_shared_s;
+ extern const f_string_static_t fake_build_parameter_library_name_suffix_static_s;
+ extern const f_string_static_t fake_build_parameter_library_output_s;
+ extern const f_string_static_t fake_build_parameter_library_shared_s;
+ extern const f_string_static_t fake_build_parameter_library_static_s;
+ extern const f_string_static_t fake_build_parameter_library_shared_prefix_s;
#define FAKE_build_parameter_object_compile_s "-c"
#define FAKE_build_parameter_object_name_suffix_s ".o"
#define FAKE_build_parameter_object_output_s "-o"
#define FAKE_build_parameter_object_static_s "-static"
- #define fake_build_parameter_object_compile_s_length 2
- #define fake_build_parameter_object_name_suffix_s_length 2
- #define fake_build_parameter_object_output_s_length 2
- #define fake_build_parameter_object_static_s_length 7
+ #define FAKE_build_parameter_object_compile_s_length 2
+ #define FAKE_build_parameter_object_name_suffix_s_length 2
+ #define FAKE_build_parameter_object_output_s_length 2
+ #define FAKE_build_parameter_object_static_s_length 7
- extern const f_string_t fake_build_parameter_object_compile_s;
- extern const f_string_t fake_build_parameter_object_name_suffix_s;
- extern const f_string_t fake_build_parameter_object_output_s;
- extern const f_string_t fake_build_parameter_object_static_s;
+ extern const f_string_static_t fake_build_parameter_object_compile_s;
+ extern const f_string_static_t fake_build_parameter_object_name_suffix_s;
+ extern const f_string_static_t fake_build_parameter_object_output_s;
+ extern const f_string_static_t fake_build_parameter_object_static_s;
#endif // _di_fake_build_parameter_
/**
* fake_common_setting_bool_*:
* - yes: A representation of yes or true.
* - no: A representation of no or false.
+ *
+ * fake_common_setting_*:
+ * - list: A generic name referring to a setting as a list.
*/
#ifndef _di_fake_common_
#define fake_common_allocation_large_d 256
#define FAKE_common_setting_bool_yes_s "yes"
#define FAKE_common_setting_bool_no_s "no"
- #define fake_common_setting_bool_yes_s_length 3
- #define fake_common_setting_bool_no_s_length 2
+ #define FAKE_common_setting_list_s "list"
+
+ #define FAKE_common_setting_bool_yes_s_length 3
+ #define FAKE_common_setting_bool_no_s_length 2
- extern const f_string_t fake_common_setting_bool_yes_s;
- extern const f_string_t fake_common_setting_bool_no_s;
+ #define FAKE_common_setting_list_s_length 4
+
+ extern const f_string_static_t fake_common_setting_bool_yes_s;
+ extern const f_string_static_t fake_common_setting_bool_no_s;
+ extern const f_string_static_t fake_common_setting_list_s;
#define fake_common_initial_buffer_max_d 131072 // 128k max default initial buffer size.
#endif // _di_fake_common_
#define FAKE_make_section_main_s "main"
#define FAKE_make_section_settings_s "settings"
- #define fake_make_section_main_s_length 4
- #define fake_make_section_settings_s_length 8
+ #define FAKE_make_section_main_s_length 4
+ #define FAKE_make_section_settings_s_length 8
- extern const f_string_t fake_make_section_main_s;
- extern const f_string_t fake_make_section_settings_s;
+ extern const f_string_static_t fake_make_section_main_s;
+ extern const f_string_static_t fake_make_section_settings_s;
#define fake_make_section_stack_max_d 8192 // maximum stack call depth.
#endif // _di_fake_make_section_
#define FAKE_make_setting_parameter_s "parameter"
#define FAKE_make_setting_return_s "return"
- #define fake_make_setting_compiler_s_length 8
- #define fake_make_setting_define_s_length 6
- #define fake_make_setting_environment_s_length 11
- #define fake_make_setting_fail_s_length 4
- #define fake_make_setting_indexer_s_length 7
- #define fake_make_setting_indexer_arguments_s_length 17
- #define fake_make_setting_load_build_s_length 10
- #define fake_make_setting_parameter_s_length 9
- #define fake_make_setting_return_s_length 6
-
- extern const f_string_t fake_make_setting_compiler_s;
- extern const f_string_t fake_make_setting_define_s;
- extern const f_string_t fake_make_setting_environment_s;
- extern const f_string_t fake_make_setting_fail_s;
- extern const f_string_t fake_make_setting_indexer_s;
- extern const f_string_t fake_make_setting_indexer_arguments_s;
- extern const f_string_t fake_make_setting_load_build_s;
- extern const f_string_t fake_make_setting_parameter_s;
- extern const f_string_t fake_make_setting_return_s;
+ #define FAKE_make_setting_compiler_s_length 8
+ #define FAKE_make_setting_define_s_length 6
+ #define FAKE_make_setting_environment_s_length 11
+ #define FAKE_make_setting_fail_s_length 4
+ #define FAKE_make_setting_indexer_s_length 7
+ #define FAKE_make_setting_indexer_arguments_s_length 17
+ #define FAKE_make_setting_load_build_s_length 10
+ #define FAKE_make_setting_parameter_s_length 9
+ #define FAKE_make_setting_return_s_length 6
+
+ extern const f_string_static_t fake_make_setting_compiler_s;
+ extern const f_string_static_t fake_make_setting_define_s;
+ extern const f_string_static_t fake_make_setting_environment_s;
+ extern const f_string_static_t fake_make_setting_fail_s;
+ extern const f_string_static_t fake_make_setting_indexer_s;
+ extern const f_string_static_t fake_make_setting_indexer_arguments_s;
+ extern const f_string_static_t fake_make_setting_load_build_s;
+ extern const f_string_static_t fake_make_setting_parameter_s;
+ extern const f_string_static_t fake_make_setting_return_s;
#endif // _di_fake_make_setting_t_
#ifndef _di_fake_make_operation_
#define FAKE_make_operation_top_s "top"
#define FAKE_make_operation_touch_s "touch"
- #define fake_make_operation_and_s_length 3
- #define fake_make_operation_break_s_length 5
- #define fake_make_operation_build_s_length 5
- #define fake_make_operation_clean_s_length 5
- #define fake_make_operation_clone_s_length 5
- #define fake_make_operation_compile_s_length 7
- #define fake_make_operation_copy_s_length 4
- #define fake_make_operation_define_s_length 6
- #define fake_make_operation_delete_s_length 6
- #define fake_make_operation_deletes_s_length 7
- #define fake_make_operation_else_s_length 4
- #define fake_make_operation_exit_s_length 4
- #define fake_make_operation_fail_s_length 4
- #define fake_make_operation_group_s_length 5
- #define fake_make_operation_groups_s_length 6
- #define fake_make_operation_if_s_length 2
- #define fake_make_operation_index_s_length 5
- #define fake_make_operation_link_s_length 4
- #define fake_make_operation_mode_s_length 4
- #define fake_make_operation_modes_s_length 5
- #define fake_make_operation_move_s_length 4
- #define fake_make_operation_operate_s_length 7
- #define fake_make_operation_or_s_length 2
- #define fake_make_operation_owner_s_length 5
- #define fake_make_operation_owners_s_length 6
- #define fake_make_operation_parameter_s_length 9
- #define fake_make_operation_pop_s_length 3
- #define fake_make_operation_print_s_length 5
- #define fake_make_operation_run_s_length 3
- #define fake_make_operation_shell_s_length 5
- #define fake_make_operation_skeleton_s_length 8
- #define fake_make_operation_to_s_length 2
- #define fake_make_operation_top_s_length 3
- #define fake_make_operation_touch_s_length 5
-
- extern const f_string_t fake_make_operation_and_s;
- extern const f_string_t fake_make_operation_break_s;
- extern const f_string_t fake_make_operation_build_s;
- extern const f_string_t fake_make_operation_clean_s;
- extern const f_string_t fake_make_operation_clone_s;
- extern const f_string_t fake_make_operation_compile_s;
- extern const f_string_t fake_make_operation_copy_s;
- extern const f_string_t fake_make_operation_define_s;
- extern const f_string_t fake_make_operation_delete_s;
- extern const f_string_t fake_make_operation_deletes_s;
- extern const f_string_t fake_make_operation_else_s;
- extern const f_string_t fake_make_operation_exit_s;
- extern const f_string_t fake_make_operation_fail_s;
- extern const f_string_t fake_make_operation_group_s;
- extern const f_string_t fake_make_operation_groups_s;
- extern const f_string_t fake_make_operation_if_s;
- extern const f_string_t fake_make_operation_index_s;
- extern const f_string_t fake_make_operation_link_s;
- extern const f_string_t fake_make_operation_mode_s;
- extern const f_string_t fake_make_operation_modes_s;
- extern const f_string_t fake_make_operation_move_s;
- extern const f_string_t fake_make_operation_operate_s;
- extern const f_string_t fake_make_operation_or_s;
- extern const f_string_t fake_make_operation_owner_s;
- extern const f_string_t fake_make_operation_owners_s;
- extern const f_string_t fake_make_operation_parameter_s;
- extern const f_string_t fake_make_operation_pop_s;
- extern const f_string_t fake_make_operation_print_s;
- extern const f_string_t fake_make_operation_run_s;
- extern const f_string_t fake_make_operation_shell_s;
- extern const f_string_t fake_make_operation_skeleton_s;
- extern const f_string_t fake_make_operation_to_s;
- extern const f_string_t fake_make_operation_top_s;
- extern const f_string_t fake_make_operation_touch_s;
+ #define FAKE_make_operation_and_s_length 3
+ #define FAKE_make_operation_break_s_length 5
+ #define FAKE_make_operation_build_s_length 5
+ #define FAKE_make_operation_clean_s_length 5
+ #define FAKE_make_operation_clone_s_length 5
+ #define FAKE_make_operation_compile_s_length 7
+ #define FAKE_make_operation_copy_s_length 4
+ #define FAKE_make_operation_define_s_length 6
+ #define FAKE_make_operation_delete_s_length 6
+ #define FAKE_make_operation_deletes_s_length 7
+ #define FAKE_make_operation_else_s_length 4
+ #define FAKE_make_operation_exit_s_length 4
+ #define FAKE_make_operation_fail_s_length 4
+ #define FAKE_make_operation_group_s_length 5
+ #define FAKE_make_operation_groups_s_length 6
+ #define FAKE_make_operation_if_s_length 2
+ #define FAKE_make_operation_index_s_length 5
+ #define FAKE_make_operation_link_s_length 4
+ #define FAKE_make_operation_mode_s_length 4
+ #define FAKE_make_operation_modes_s_length 5
+ #define FAKE_make_operation_move_s_length 4
+ #define FAKE_make_operation_operate_s_length 7
+ #define FAKE_make_operation_or_s_length 2
+ #define FAKE_make_operation_owner_s_length 5
+ #define FAKE_make_operation_owners_s_length 6
+ #define FAKE_make_operation_parameter_s_length 9
+ #define FAKE_make_operation_pop_s_length 3
+ #define FAKE_make_operation_print_s_length 5
+ #define FAKE_make_operation_run_s_length 3
+ #define FAKE_make_operation_shell_s_length 5
+ #define FAKE_make_operation_skeleton_s_length 8
+ #define FAKE_make_operation_to_s_length 2
+ #define FAKE_make_operation_top_s_length 3
+ #define FAKE_make_operation_touch_s_length 5
+
+ extern const f_string_static_t fake_make_operation_and_s;
+ extern const f_string_static_t fake_make_operation_break_s;
+ extern const f_string_static_t fake_make_operation_build_s;
+ extern const f_string_static_t fake_make_operation_clean_s;
+ extern const f_string_static_t fake_make_operation_clone_s;
+ extern const f_string_static_t fake_make_operation_compile_s;
+ extern const f_string_static_t fake_make_operation_copy_s;
+ extern const f_string_static_t fake_make_operation_define_s;
+ extern const f_string_static_t fake_make_operation_delete_s;
+ extern const f_string_static_t fake_make_operation_deletes_s;
+ extern const f_string_static_t fake_make_operation_else_s;
+ extern const f_string_static_t fake_make_operation_exit_s;
+ extern const f_string_static_t fake_make_operation_fail_s;
+ extern const f_string_static_t fake_make_operation_group_s;
+ extern const f_string_static_t fake_make_operation_groups_s;
+ extern const f_string_static_t fake_make_operation_if_s;
+ extern const f_string_static_t fake_make_operation_index_s;
+ extern const f_string_static_t fake_make_operation_link_s;
+ extern const f_string_static_t fake_make_operation_mode_s;
+ extern const f_string_static_t fake_make_operation_modes_s;
+ extern const f_string_static_t fake_make_operation_move_s;
+ extern const f_string_static_t fake_make_operation_operate_s;
+ extern const f_string_static_t fake_make_operation_or_s;
+ extern const f_string_static_t fake_make_operation_owner_s;
+ extern const f_string_static_t fake_make_operation_owners_s;
+ extern const f_string_static_t fake_make_operation_parameter_s;
+ extern const f_string_static_t fake_make_operation_pop_s;
+ extern const f_string_static_t fake_make_operation_print_s;
+ extern const f_string_static_t fake_make_operation_run_s;
+ extern const f_string_static_t fake_make_operation_shell_s;
+ extern const f_string_static_t fake_make_operation_skeleton_s;
+ extern const f_string_static_t fake_make_operation_to_s;
+ extern const f_string_static_t fake_make_operation_top_s;
+ extern const f_string_static_t fake_make_operation_touch_s;
enum {
fake_make_operation_type_and_e = 1,
#define FAKE_make_operation_argument_target_s "target"
#define FAKE_make_operation_argument_warn_s "warn"
- #define fake_make_operation_argument_environment_s_length 11
- #define fake_make_operation_argument_failure_s_length 7
- #define fake_make_operation_argument_file_s_length 4
- #define fake_make_operation_argument_directory_s_length 9
- #define fake_make_operation_argument_error_s_length 5
- #define fake_make_operation_argument_exit_s_length 4
- #define fake_make_operation_argument_has_s_length 3
- #define fake_make_operation_argument_ignore_s_length 6
- #define fake_make_operation_argument_is_s_length 2
- #define fake_make_operation_argument_parameter_s_length 9
- #define fake_make_operation_argument_point_s_length 5
- #define fake_make_operation_argument_recursive_s_length 9
- #define fake_make_operation_argument_success_s_length 7
- #define fake_make_operation_argument_target_s_length 6
- #define fake_make_operation_argument_warn_s_length 4
-
- extern const f_string_t fake_make_operation_argument_environment_s;
- extern const f_string_t fake_make_operation_argument_failure_s;
- extern const f_string_t fake_make_operation_argument_file_s;
- extern const f_string_t fake_make_operation_argument_directory_s;
- extern const f_string_t fake_make_operation_argument_error_s;
- extern const f_string_t fake_make_operation_argument_exit_s;
- extern const f_string_t fake_make_operation_argument_has_s;
- extern const f_string_t fake_make_operation_argument_ignore_s;
- extern const f_string_t fake_make_operation_argument_is_s;
- extern const f_string_t fake_make_operation_argument_parameter_s;
- extern const f_string_t fake_make_operation_argument_point_s;
- extern const f_string_t fake_make_operation_argument_recursive_s;
- extern const f_string_t fake_make_operation_argument_success_s;
- extern const f_string_t fake_make_operation_argument_target_s;
- extern const f_string_t fake_make_operation_argument_warn_s;
+ #define FAKE_make_operation_argument_environment_s_length 11
+ #define FAKE_make_operation_argument_failure_s_length 7
+ #define FAKE_make_operation_argument_file_s_length 4
+ #define FAKE_make_operation_argument_directory_s_length 9
+ #define FAKE_make_operation_argument_error_s_length 5
+ #define FAKE_make_operation_argument_exit_s_length 4
+ #define FAKE_make_operation_argument_has_s_length 3
+ #define FAKE_make_operation_argument_ignore_s_length 6
+ #define FAKE_make_operation_argument_is_s_length 2
+ #define FAKE_make_operation_argument_parameter_s_length 9
+ #define FAKE_make_operation_argument_point_s_length 5
+ #define FAKE_make_operation_argument_recursive_s_length 9
+ #define FAKE_make_operation_argument_success_s_length 7
+ #define FAKE_make_operation_argument_target_s_length 6
+ #define FAKE_make_operation_argument_warn_s_length 4
+
+ extern const f_string_static_t fake_make_operation_argument_environment_s;
+ extern const f_string_static_t fake_make_operation_argument_failure_s;
+ extern const f_string_static_t fake_make_operation_argument_file_s;
+ extern const f_string_static_t fake_make_operation_argument_directory_s;
+ extern const f_string_static_t fake_make_operation_argument_error_s;
+ extern const f_string_static_t fake_make_operation_argument_exit_s;
+ extern const f_string_static_t fake_make_operation_argument_has_s;
+ extern const f_string_static_t fake_make_operation_argument_ignore_s;
+ extern const f_string_static_t fake_make_operation_argument_is_s;
+ extern const f_string_static_t fake_make_operation_argument_parameter_s;
+ extern const f_string_static_t fake_make_operation_argument_point_s;
+ extern const f_string_static_t fake_make_operation_argument_recursive_s;
+ extern const f_string_static_t fake_make_operation_argument_success_s;
+ extern const f_string_static_t fake_make_operation_argument_target_s;
+ extern const f_string_static_t fake_make_operation_argument_warn_s;
#define FAKE_make_operation_argument_if_defined_s "defined"
#define FAKE_make_operation_argument_if_equal_s "=="
#define FAKE_make_operation_argument_if_owner_s "owner"
#define FAKE_make_operation_argument_if_success_s "success"
- #define fake_make_operation_argument_if_defined_s_length 7
- #define fake_make_operation_argument_if_equal_s_length 2
- #define fake_make_operation_argument_if_equal_not_s_length 2
- #define fake_make_operation_argument_if_exists_s_length 6
- #define fake_make_operation_argument_if_failure_s_length 7
- #define fake_make_operation_argument_if_greater_s_length 1
- #define fake_make_operation_argument_if_greater_equal_s_length 2
- #define fake_make_operation_argument_if_group_s_length 5
- #define fake_make_operation_argument_if_is_s_length 2
- #define fake_make_operation_argument_if_is_for_s_length 3
- #define fake_make_operation_argument_if_less_s_length 1
- #define fake_make_operation_argument_if_less_equal_s_length 2
- #define fake_make_operation_argument_if_mode_s_length 4
- #define fake_make_operation_argument_if_not_s_length 3
- #define fake_make_operation_argument_if_owner_s_length 5
- #define fake_make_operation_argument_if_success_s_length 7
-
- extern const f_string_t fake_make_operation_argument_if_defined_s;
- extern const f_string_t fake_make_operation_argument_if_equal_s;
- extern const f_string_t fake_make_operation_argument_if_equal_not_s;
- extern const f_string_t fake_make_operation_argument_if_exists_s;
- extern const f_string_t fake_make_operation_argument_if_failure_s;
- extern const f_string_t fake_make_operation_argument_if_greater_s;
- extern const f_string_t fake_make_operation_argument_if_greater_equal_s;
- extern const f_string_t fake_make_operation_argument_if_group_s;
- extern const f_string_t fake_make_operation_argument_if_is_s;
- extern const f_string_t fake_make_operation_argument_if_is_for_s;
- extern const f_string_t fake_make_operation_argument_if_less_s;
- extern const f_string_t fake_make_operation_argument_if_less_equal_s;
- extern const f_string_t fake_make_operation_argument_if_mode_s;
- extern const f_string_t fake_make_operation_argument_if_not_s;
- extern const f_string_t fake_make_operation_argument_if_owner_s;
- extern const f_string_t fake_make_operation_argument_if_success_s;
+ #define FAKE_make_operation_argument_if_defined_s_length 7
+ #define FAKE_make_operation_argument_if_equal_s_length 2
+ #define FAKE_make_operation_argument_if_equal_not_s_length 2
+ #define FAKE_make_operation_argument_if_exists_s_length 6
+ #define FAKE_make_operation_argument_if_failure_s_length 7
+ #define FAKE_make_operation_argument_if_greater_s_length 1
+ #define FAKE_make_operation_argument_if_greater_equal_s_length 2
+ #define FAKE_make_operation_argument_if_group_s_length 5
+ #define FAKE_make_operation_argument_if_is_s_length 2
+ #define FAKE_make_operation_argument_if_is_for_s_length 3
+ #define FAKE_make_operation_argument_if_less_s_length 1
+ #define FAKE_make_operation_argument_if_less_equal_s_length 2
+ #define FAKE_make_operation_argument_if_mode_s_length 4
+ #define FAKE_make_operation_argument_if_not_s_length 3
+ #define FAKE_make_operation_argument_if_owner_s_length 5
+ #define FAKE_make_operation_argument_if_success_s_length 7
+
+ extern const f_string_static_t fake_make_operation_argument_if_defined_s;
+ extern const f_string_static_t fake_make_operation_argument_if_equal_s;
+ extern const f_string_static_t fake_make_operation_argument_if_equal_not_s;
+ extern const f_string_static_t fake_make_operation_argument_if_exists_s;
+ extern const f_string_static_t fake_make_operation_argument_if_failure_s;
+ extern const f_string_static_t fake_make_operation_argument_if_greater_s;
+ extern const f_string_static_t fake_make_operation_argument_if_greater_equal_s;
+ extern const f_string_static_t fake_make_operation_argument_if_group_s;
+ extern const f_string_static_t fake_make_operation_argument_if_is_s;
+ extern const f_string_static_t fake_make_operation_argument_if_is_for_s;
+ extern const f_string_static_t fake_make_operation_argument_if_less_s;
+ extern const f_string_static_t fake_make_operation_argument_if_less_equal_s;
+ extern const f_string_static_t fake_make_operation_argument_if_mode_s;
+ extern const f_string_static_t fake_make_operation_argument_if_not_s;
+ extern const f_string_static_t fake_make_operation_argument_if_owner_s;
+ extern const f_string_static_t fake_make_operation_argument_if_success_s;
enum {
fake_make_operation_if_type_else_e = 1,
#endif // _di_fake_make_operation_
#ifndef _di_fake_make_parameter_t_
+ #define FAKE_make_parameter_iki_option_s ":option"
+ #define FAKE_make_parameter_iki_value_s ":value"
+
#define FAKE_make_parameter_variable_build_s "build"
#define FAKE_make_parameter_variable_color_s "color"
#define FAKE_make_parameter_variable_data_s "data"
#define FAKE_make_parameter_variable_verbosity_s "verbosity"
#define FAKE_make_parameter_variable_work_s "work"
- #define fake_make_parameter_iki_option_s ":option"
- #define fake_make_parameter_iki_value_s ":value"
-
- #define fake_make_parameter_variable_build_s_length 5
- #define fake_make_parameter_variable_color_s_length 5
- #define fake_make_parameter_variable_data_s_length 4
- #define fake_make_parameter_variable_define_s_length 6
- #define fake_make_parameter_variable_fakefile_s_length 8
- #define fake_make_parameter_variable_mode_s_length 4
- #define fake_make_parameter_variable_process_s_length 7
- #define fake_make_parameter_variable_return_s_length 6
- #define fake_make_parameter_variable_settings_s_length 8
- #define fake_make_parameter_variable_sources_s_length 7
- #define fake_make_parameter_variable_verbosity_s_length 9
- #define fake_make_parameter_variable_work_s_length 4
-
- #define fake_make_parameter_iki_option_s_length 7
- #define fake_make_parameter_iki_value_s_length 6
-
- extern const f_string_t fake_make_parameter_variable_build_s;
- extern const f_string_t fake_make_parameter_variable_color_s;
- extern const f_string_t fake_make_parameter_variable_data_s;
- extern const f_string_t fake_make_parameter_variable_define_s;
- extern const f_string_t fake_make_parameter_variable_fakefile_s;
- extern const f_string_t fake_make_parameter_variable_mode_s;
- extern const f_string_t fake_make_parameter_variable_process_s;
- extern const f_string_t fake_make_parameter_variable_return_s;
- extern const f_string_t fake_make_parameter_variable_settings_s;
- extern const f_string_t fake_make_parameter_variable_sources_s;
- extern const f_string_t fake_make_parameter_variable_verbosity_s;
- extern const f_string_t fake_make_parameter_variable_work_s;
-
- extern const f_string_t fake_make_parameter_variable_option_build_s;
- extern const f_string_t fake_make_parameter_variable_option_color_s;
- extern const f_string_t fake_make_parameter_variable_option_data_s;
- extern const f_string_t fake_make_parameter_variable_option_define_s;
- extern const f_string_t fake_make_parameter_variable_option_fakefile_s;
- extern const f_string_t fake_make_parameter_variable_option_mode_s;
- extern const f_string_t fake_make_parameter_variable_option_process_s;
- extern const f_string_t fake_make_parameter_variable_option_return_s;
- extern const f_string_t fake_make_parameter_variable_option_settings_s;
- extern const f_string_t fake_make_parameter_variable_option_sources_s;
- extern const f_string_t fake_make_parameter_variable_option_verbosity_s;
- extern const f_string_t fake_make_parameter_variable_option_work_s;
-
- extern const f_string_t fake_make_parameter_variable_value_build_s;
- extern const f_string_t fake_make_parameter_variable_value_color_s;
- extern const f_string_t fake_make_parameter_variable_value_data_s;
- extern const f_string_t fake_make_parameter_variable_value_define_s;
- extern const f_string_t fake_make_parameter_variable_value_fakefile_s;
- extern const f_string_t fake_make_parameter_variable_value_mode_s;
- extern const f_string_t fake_make_parameter_variable_value_process_s;
- extern const f_string_t fake_make_parameter_variable_value_return_s;
- extern const f_string_t fake_make_parameter_variable_value_settings_s;
- extern const f_string_t fake_make_parameter_variable_value_sources_s;
- extern const f_string_t fake_make_parameter_variable_value_verbosity_s;
- extern const f_string_t fake_make_parameter_variable_value_work_s;
+ #define FAKE_make_parameter_iki_option_s_length 7
+ #define FAKE_make_parameter_iki_value_s_length 6
+
+ #define FAKE_make_parameter_variable_build_s_length 5
+ #define FAKE_make_parameter_variable_color_s_length 5
+ #define FAKE_make_parameter_variable_data_s_length 4
+ #define FAKE_make_parameter_variable_define_s_length 6
+ #define FAKE_make_parameter_variable_fakefile_s_length 8
+ #define FAKE_make_parameter_variable_mode_s_length 4
+ #define FAKE_make_parameter_variable_process_s_length 7
+ #define FAKE_make_parameter_variable_return_s_length 6
+ #define FAKE_make_parameter_variable_settings_s_length 8
+ #define FAKE_make_parameter_variable_sources_s_length 7
+ #define FAKE_make_parameter_variable_verbosity_s_length 9
+ #define FAKE_make_parameter_variable_work_s_length 4
+
+ extern const f_string_static_t fake_make_parameter_iki_option_s;
+ extern const f_string_static_t fake_make_parameter_iki_value_s;
+
+ extern const f_string_static_t fake_make_parameter_variable_build_s;
+ extern const f_string_static_t fake_make_parameter_variable_color_s;
+ extern const f_string_static_t fake_make_parameter_variable_data_s;
+ extern const f_string_static_t fake_make_parameter_variable_define_s;
+ extern const f_string_static_t fake_make_parameter_variable_fakefile_s;
+ extern const f_string_static_t fake_make_parameter_variable_mode_s;
+ extern const f_string_static_t fake_make_parameter_variable_process_s;
+ extern const f_string_static_t fake_make_parameter_variable_return_s;
+ extern const f_string_static_t fake_make_parameter_variable_settings_s;
+ extern const f_string_static_t fake_make_parameter_variable_sources_s;
+ extern const f_string_static_t fake_make_parameter_variable_verbosity_s;
+ extern const f_string_static_t fake_make_parameter_variable_work_s;
+
+ extern const f_string_static_t fake_make_parameter_variable_option_build_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_color_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_data_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_define_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_fakefile_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_mode_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_process_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_return_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_settings_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_sources_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_verbosity_s;
+ extern const f_string_static_t fake_make_parameter_variable_option_work_s;
+
+ extern const f_string_static_t fake_make_parameter_variable_value_build_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_color_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_data_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_define_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_fakefile_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_mode_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_process_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_return_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_settings_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_sources_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_verbosity_s;
+ extern const f_string_static_t fake_make_parameter_variable_value_work_s;
typedef struct {
f_string_dynamics_t build;
#define FAKE_make_skeleton_content_defines_s "# fss-0000\n\n"
#define FAKE_make_skeleton_content_dependencies_s "# fss-0000\n\n"
#define FAKE_make_skeleton_content_fakefile_s "# fss-0005 iki-0002\n\nsettings:\n fail exit\n\nmain:\n\n"
+ #define FAKE_make_skeleton_content_process_post_s "#!/bin/bash\n\n"
+ #define FAKE_make_skeleton_content_process_pre_s "#!/bin/bash\n\n"
#define FAKE_make_skeleton_content_settings_s "# fss-0001\n\n"
- #define fake_make_skeleton_content_defines_s_length 12
- #define fake_make_skeleton_content_dependencies_s_length 12
- #define fake_make_skeleton_content_fakefile_s_length 51
- #define fake_make_skeleton_content_settings_s_length 12
-
- extern const f_string_t fake_make_skeleton_content_defines_s;
- extern const f_string_t fake_make_skeleton_content_dependencies_s;
- extern const f_string_t fake_make_skeleton_content_fakefile_s;
- extern const f_string_t fake_make_skeleton_content_settings_s;
+ #define FAKE_make_skeleton_content_defines_s_length 12
+ #define FAKE_make_skeleton_content_dependencies_s_length 12
+ #define FAKE_make_skeleton_content_fakefile_s_length 51
+ #define FAKE_make_skeleton_content_process_post_s_length 13
+ #define FAKE_make_skeleton_content_process_pre_s_length 13
+ #define FAKE_make_skeleton_content_settings_s_length 12
+
+ extern const f_string_static_t fake_make_skeleton_content_defines_s;
+ extern const f_string_static_t fake_make_skeleton_content_dependencies_s;
+ extern const f_string_static_t fake_make_skeleton_content_fakefile_s;
+ extern const f_string_static_t fake_make_skeleton_content_process_post_s;
+ extern const f_string_static_t fake_make_skeleton_content_process_pre_s;
+ extern const f_string_static_t fake_make_skeleton_content_settings_s;
#endif // _di_fake_skeleton_content_
#ifndef _di_fake_make_context_
#define FAKE_make_context_success_s "success"
#define FAKE_make_context_normal_s "normal"
- #define fake_make_context_reset_s_length 5
- #define fake_make_context_warning_s_length 7
- #define fake_make_context_error_s_length 5
- #define fake_make_context_title_s_length 5
- #define fake_make_context_notable_s_length 7
- #define fake_make_context_important_s_length 9
- #define fake_make_context_standout_s_length 8
- #define fake_make_context_success_s_length 7
- #define fake_make_context_normal_s_length 5
-
- extern const f_string_t fake_make_context_reset_s;
- extern const f_string_t fake_make_context_warning_s;
- extern const f_string_t fake_make_context_error_s;
- extern const f_string_t fake_make_context_title_s;
- extern const f_string_t fake_make_context_notable_s;
- extern const f_string_t fake_make_context_important_s;
- extern const f_string_t fake_make_context_standout_s;
- extern const f_string_t fake_make_context_success_s;
- extern const f_string_t fake_make_context_normal_s;
+ #define FAKE_make_context_reset_s_length 5
+ #define FAKE_make_context_warning_s_length 7
+ #define FAKE_make_context_error_s_length 5
+ #define FAKE_make_context_title_s_length 5
+ #define FAKE_make_context_notable_s_length 7
+ #define FAKE_make_context_important_s_length 9
+ #define FAKE_make_context_standout_s_length 8
+ #define FAKE_make_context_success_s_length 7
+ #define FAKE_make_context_normal_s_length 5
+
+ extern const f_string_static_t fake_make_context_reset_s;
+ extern const f_string_static_t fake_make_context_warning_s;
+ extern const f_string_static_t fake_make_context_error_s;
+ extern const f_string_static_t fake_make_context_title_s;
+ extern const f_string_static_t fake_make_context_notable_s;
+ extern const f_string_static_t fake_make_context_important_s;
+ extern const f_string_static_t fake_make_context_standout_s;
+ extern const f_string_static_t fake_make_context_success_s;
+ extern const f_string_static_t fake_make_context_normal_s;
#endif // _di_fake_make_context_
+#ifndef _di_fake_file_data_build_strings_
+ #define FAKE_file_data_build_process_post_s "process_post.sh"
+ #define FAKE_file_data_build_process_pre_s "process_pre.sh"
+
+ #define FAKE_file_data_build_process_post_s_length 15
+ #define FAKE_file_data_build_process_pre_s_length 14
+
+ extern const f_string_static_t fake_file_data_build_process_post_s;
+ extern const f_string_static_t fake_file_data_build_process_pre_s;
+#endif // _di_fake_file_data_build_strings_
+
/**
* Check to see if a process signal is received.
*
&main->path_sources,
};
- const uint8_t parameters_length[] = {
+ const uint8_t parameters_size[] = {
7,
2,
4,
for (i = 0; i < 3; ++i) {
- status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_length[i]);
+ status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_size[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
}
{
- const f_string_t parameters_source[] = {
+ const f_string_static_t parameters_source[] = {
fake_path_part_documents_s,
fake_path_part_includes_s,
fake_path_part_libraries_s,
fake_path_part_script_s,
};
- const f_array_length_t parameters_length[] = {
- fake_path_part_documents_s_length,
- fake_path_part_includes_s_length,
- fake_path_part_libraries_s_length,
- fake_path_part_objects_s_length,
- fake_path_part_programs_s_length,
- fake_path_part_settings_s_length,
- fake_path_part_stage_s_length,
- fake_path_part_build_s_length,
- fake_path_part_settings_s_length,
- fake_path_part_documents_s_length,
- fake_path_part_licenses_s_length,
- fake_path_part_bash_s_length,
- fake_path_part_c_s_length,
- fake_path_part_cpp_s_length,
- fake_path_part_script_s_length,
- };
-
f_string_dynamic_t * const parameters_value[] = {
&main->path_build_documents,
&main->path_build_includes,
for (i = 0; i < 15; ++i) {
- status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
+ status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
&main->path_documents,
};
- const uint8_t parameters_length[] = {
+ const uint8_t parameters_size[] = {
3,
3,
4,
for (i = 0; i < 4; ++i) {
- status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_length[i]);
+ status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_size[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
}
{
- const f_string_t parameters_source[] = {
+ const f_string_static_t parameters_source[] = {
fake_path_part_script_s,
fake_path_part_shared_s,
fake_path_part_static_s,
fake_path_part_static_s,
fake_file_defines_s,
fake_file_dependencies_s,
- main->fakefile.string,
- main->settings.string,
+ main->fakefile,
+ main->settings,
fake_file_readme_s,
};
- const f_array_length_t parameters_length[] = {
- fake_path_part_script_s_length,
- fake_path_part_shared_s_length,
- fake_path_part_static_s_length,
- fake_path_part_script_s_length,
- fake_path_part_shared_s_length,
- fake_path_part_static_s_length,
- fake_file_defines_s_length,
- fake_file_dependencies_s_length,
- main->fakefile.used,
- main->settings.used,
- fake_file_readme_s_length,
- };
-
f_string_dynamic_t * const parameters_value[] = {
&main->path_build_libraries_script,
&main->path_build_libraries_shared,
for (i = 0; i < 11; ++i) {
- status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
+ status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
}
{
- const f_string_t parameters_source[] = {
+ const f_string_static_t parameters_source[] = {
fake_path_part_includes_s,
fake_path_part_libraries_s,
fake_path_part_programs_s,
};
- const f_array_length_t parameters_length[] = {
- fake_path_part_includes_s_length,
- fake_path_part_libraries_s_length,
- fake_path_part_programs_s_length,
- };
-
f_string_dynamic_t * const parameters_value[] = {
&main->path_work_includes,
&main->path_work_libraries,
for (i = 0; i < 3; ++i) {
- status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
+ status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
&main->path_work_programs,
};
- const uint8_t parameters_length[] = {
+ const uint8_t parameters_size[] = {
3,
3,
};
for (i = 0; i < 2; ++i) {
- status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_length[i]);
+ status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_size[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
}
{
- const f_string_t parameters_source[] = {
+ const f_string_static_t parameters_source[] = {
fake_path_part_script_s,
fake_path_part_shared_s,
fake_path_part_static_s,
fake_path_part_static_s,
};
- const f_array_length_t parameters_length[] = {
- fake_path_part_script_s_length,
- fake_path_part_shared_s_length,
- fake_path_part_static_s_length,
- fake_path_part_script_s_length,
- fake_path_part_shared_s_length,
- fake_path_part_static_s_length,
- };
-
f_string_dynamic_t * const parameters_value[] = {
&main->path_work_libraries_script,
&main->path_work_libraries_shared,
for (i = 0; i < 6; ++i) {
- status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
+ status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to find program '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QFailed to find program '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, program, main->error.notable);
fl_print_format("%[' for executing.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, "allocate buffer size for", fll_error_file_type_file_e);
- macro_f_string_dynamic_t_delete_simple((*buffer));
+ f_string_dynamic_resize(0, buffer);
return status;
}
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, "read", fll_error_file_type_file_e);
- macro_f_string_dynamic_t_delete_simple((*buffer));
+ f_string_dynamic_resize(0, buffer);
}
return status;
fake_parameter_settings_e,
};
- const f_string_t parameters_name[] = {
+ const f_string_static_t parameters_name[] = {
fake_long_fakefile_s,
fake_long_process_s,
fake_long_settings_s,
};
- const f_string_t parameter_defaults[] = {
+ const f_string_static_t parameter_defaults[] = {
fake_default_fakefile_s,
fake_default_process_s,
fake_default_settings_s,
};
- const f_array_length_t parameter_default_lengths[] = {
- fake_default_fakefile_s_length,
- fake_default_process_s_length,
- fake_default_settings_s_length,
- };
-
f_string_dynamic_t * const parameters_value[] = {
&main->fakefile,
&main->process,
}
f_array_length_t location = main->parameters[parameters_id[i]].values.array[0];
- f_array_length_t length = strnlen(arguments->argv[location], f_console_parameter_size);
+ f_array_length_t length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (length > 0) {
if (parameters_validate_word[i]) {
if (fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, main->error.notable);
+ fl_print_format("%q%[%QFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, main->error.notable);
fl_print_format("%[' parameters value '%]", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, arguments->argv[location], main->error.notable);
fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%S%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%Q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
fl_print_format("%[' is too long.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%S%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
fl_print_format("%[' must not be empty and must not contain only whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
}
- else if (parameter_default_lengths[i] > 0) {
- macro_f_string_dynamic_t_resize(status, (*parameters_value[i]), parameter_default_lengths[i]);
+ else if (parameter_defaults[i].used) {
+ parameters_value[i]->used = 0;
+
+ status = f_string_dynamic_append(parameter_defaults[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "macro_f_string_dynamic_t_resize", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
return status;
}
-
- memcpy(parameters_value[i]->string, parameter_defaults[i], parameter_default_lengths[i]);
- parameters_value[i]->used = parameter_default_lengths[i];
}
} // for
}
fake_parameter_path_work_e,
};
- const f_string_t parameters_name[] = {
+ const f_string_static_t parameters_name[] = {
fake_long_path_build_s,
fake_long_path_data_s,
fake_long_path_sources_s,
fake_long_path_work_s,
};
- const f_string_t parameter_defaults[] = {
+ const f_string_static_t parameter_defaults[] = {
fake_default_path_build_s,
fake_default_path_data_s,
fake_default_path_sources_s,
fake_default_path_work_s,
};
- const f_array_length_t parameter_default_lengths[] = {
- fake_default_path_build_s_length,
- fake_default_path_data_s_length,
- fake_default_path_sources_s_length,
- fake_default_path_work_s_length,
- };
-
f_string_dynamic_t * const parameters_value[] = {
&main->path_build,
&main->path_data,
if (fll_error_print(main->error, F_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to process parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%S%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
+ fl_print_format("%q%[%QFailed to process parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
return status;
}
}
- else if (parameter_default_lengths[i] > 0) {
- macro_f_string_dynamic_t_resize(status, (*parameters_value[i]), parameter_default_lengths[i]);
+ else if (parameter_defaults[i].used) {
+ parameters_value[i]->used = 0;
+
+ status = f_string_dynamic_append(parameter_defaults[i], parameters_value[i]);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), " macro_f_string_dynamic_t_resize", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
+ if (fll_error_print(main->error, F_status_set_fine(status), " f_string_dynamic_append", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to load default for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%S%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
+ fl_print_format("%q%[%QFailed to load default for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
return status;
}
-
- memcpy(parameters_value[i]->string, parameter_defaults[i], parameter_default_lengths[i]);
- parameters_value[i]->used = parameter_default_lengths[i];
}
} // for
}
if (fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_define_s, main->error.notable);
+ fl_print_format("%q%[%QFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_define_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
fl_print_format("%q%[%SFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
+ fl_print_format("%q%[%QFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
fl_print_format("%[' parameters value '%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, main->mode.array[i], main->error.notable);
fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
return F_status_set_error(F_interrupt);
}
- const f_string_t parameters_name[] = {
+ const f_string_static_t parameters_name[] = {
fake_long_path_build_s,
fake_long_path_data_s,
fake_long_path_work_s,
};
- const f_string_t parameter_defaults[] = {
- fake_default_path_build_s,
- fake_default_path_data_s,
- fake_default_path_work_s,
- };
-
- const f_array_length_t parameter_default_lengths[] = {
- fake_default_path_build_s_length,
- fake_default_path_data_s_length,
- fake_default_path_work_s_length,
- };
-
const f_string_dynamic_t *parameters_value[] = {
&main->path_build,
&main->path_data,
else if (parameters_required[i]) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SNo valid path for the (required) directory parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
+ fl_print_format("%q%[%QNo valid path for the (required) directory parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
fl_print_format("%[' was found.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->warning.to.stream);
- fl_print_format("%q%[%SThe fakefile '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
+ fl_print_format("%q%[%QThe fakefile '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
fl_print_format("%[%Q%]", data_make->main->warning.to.stream, data_make->main->warning.notable, data_make->main->file_data_build_fakefile, data_make->main->warning.notable);
fl_print_format("%[' is empty.%]%q", data_make->main->warning.to.stream, data_make->main->warning.context, data_make->main->warning.context, f_string_eol_s);
f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->main, 0);
- const f_string_static_t name_settings = macro_f_string_static_t_initialize(fake_make_section_settings_s, fake_make_section_settings_s_length);
- const f_string_static_t name_main = macro_f_string_static_t_initialize(fake_make_section_main_s, fake_make_section_main_s_length);
-
- const f_string_range_t name_settings_range = macro_f_string_range_t_initialize(fake_make_section_settings_s_length);
- const f_string_range_t name_main_range = macro_f_string_range_t_initialize(fake_make_section_main_s_length);
-
if (list_objects.used > data_make->fakefile.size) {
macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used);
}
break;
}
- if (fl_string_dynamic_partial_compare(name_settings, data_make->buffer, name_settings_range, list_objects.array[i]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(fake_make_section_settings_s.string, data_make->buffer, fake_make_section_settings_s.used, list_objects.array[i]) == F_equal_to) {
if (!missing_settings) {
- fake_print_warning_settings_object_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, "list", name_settings.string);
+ fake_print_warning_settings_object_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_common_setting_list_s, fake_make_section_settings_s);
continue;
}
continue;
}
- else if (fl_string_dynamic_partial_compare(name_main, data_make->buffer, name_main_range, list_objects.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_section_main_s.string, data_make->buffer, fake_make_section_main_s.used, list_objects.array[i]) == F_equal_to) {
if (!missing_main) {
- fake_print_warning_settings_object_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, "list", name_main.string);
+ fake_print_warning_settings_object_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_common_setting_list_s, fake_make_section_main_s);
continue;
}
if (data_make->main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(data_make->main->error.to.stream);
- fl_print_format("%q%[%SThe fakefile '%]", data_make->main->error.to.stream, f_string_eol_s, data_make->main->error.context, data_make->main->error.prefix, data_make->main->error.context);
+ fl_print_format("%q%[%QThe fakefile '%]", data_make->main->error.to.stream, f_string_eol_s, data_make->main->error.context, data_make->main->error.prefix, data_make->main->error.context);
fl_print_format("%[%Q%]", data_make->main->error.to.stream, data_make->main->error.notable, data_make->main->file_data_build_fakefile, data_make->main->error.notable);
fl_print_format("%[' is missing the required '%]", data_make->main->error.to.stream, data_make->main->error.context, data_make->main->error.context);
- fl_print_format("%[%s%]", data_make->main->error.to.stream, data_make->main->error.notable, fake_make_section_main_s, data_make->main->error.notable);
+ fl_print_format("%[%q%]", data_make->main->error.to.stream, data_make->main->error.notable, fake_make_section_main_s, data_make->main->error.notable);
fl_print_format("%[' object.%]%q", data_make->main->error.to.stream, data_make->main->error.context, data_make->main->error.context, f_string_eol_s);
funlockfile(data_make->main->error.to.stream);
if (F_status_is_error_not(*status)) {
data_make->setting_make.parameter.used = 1;
- function_name = "f_string_append";
- *status = f_string_append(fake_make_setting_return_s, fake_make_setting_return_s_length, &data_make->setting_make.parameter.array[0].name);
+ function_name = "f_string_dynamic_append";
+ *status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].name);
}
if (F_status_is_error_not(*status)) {
for (f_array_length_t i = 0; i < settings.objects.used; ++i) {
- if (fl_string_dynamic_partial_compare_string(fake_make_setting_load_build_s, data_make->buffer, fake_make_setting_load_build_s_length, settings.objects.array[i]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(fake_make_setting_load_build_s.string, data_make->buffer, fake_make_setting_load_build_s.used, settings.objects.array[i]) == F_equal_to) {
fake_make_load_fakefile_setting_build(data_make, &settings.objects.array[i], &settings.contents.array[i], &unmatched_build);
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_setting_compiler_s, data_make->buffer, fake_make_setting_compiler_s_length, settings.objects.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_setting_compiler_s.string, data_make->buffer, fake_make_setting_compiler_s.used, settings.objects.array[i]) == F_equal_to) {
fake_make_load_fakefile_setting_compiler(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_compiler);
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_setting_environment_s, data_make->buffer, fake_make_setting_environment_s_length, settings.objects.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_setting_environment_s.string, data_make->buffer, fake_make_setting_environment_s.used, settings.objects.array[i]) == F_equal_to) {
*status = fake_make_load_fakefile_setting_environment(data_make, &settings.contents.array[i]);
if (F_status_is_error(*status)) break;
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_setting_fail_s, data_make->buffer, fake_make_setting_fail_s_length, settings.objects.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_setting_fail_s.string, data_make->buffer, fake_make_setting_fail_s.used, settings.objects.array[i]) == F_equal_to) {
fake_make_load_fakefile_setting_fail(data_make, &settings.objects.array[i], &settings.contents.array[i], &unmatched_fail);
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_setting_indexer_s, data_make->buffer, fake_make_setting_indexer_s_length, settings.objects.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_setting_indexer_s.string, data_make->buffer, fake_make_setting_indexer_s.used, settings.objects.array[i]) == F_equal_to) {
fake_make_load_fakefile_setting_indexer(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_indexer);
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_setting_parameter_s, data_make->buffer, fake_make_setting_parameter_s_length, settings.objects.array[i]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_setting_parameter_s.string, data_make->buffer, fake_make_setting_parameter_s.used, settings.objects.array[i]) == F_equal_to) {
*status = fake_make_load_fakefile_setting_parameter(data_make, &settings.objects.array[i], &settings.contents.array[i]);
if (F_status_is_error(*status)) break;
}
if (*unmatched_build) {
if (content->used) {
- if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_yes_s, data_make->buffer, fake_common_setting_bool_yes_s_length, content->array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_yes_s.string, data_make->buffer, fake_common_setting_bool_yes_s.used, content->array[0]) == F_equal_to) {
data_make->setting_make.load_build = F_true;
}
- else if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_no_s, data_make->buffer, fake_common_setting_bool_no_s_length, content->array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_no_s.string, data_make->buffer, fake_common_setting_bool_no_s.used, content->array[0]) == F_equal_to) {
data_make->setting_make.load_build = F_false;
}
else {
- fake_print_warning_settings_content_invalid(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, content->array[0], fake_make_section_settings_s);
+ fake_print_warning_settings_content_invalid(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, content->array[0], fake_make_section_settings_s);
}
*unmatched_build = F_false;
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_load_build_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_load_build_s);
}
return;
}
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, fake_make_section_settings_s);
+ fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_section_settings_s);
}
else {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_load_build_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_load_build_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_build_
void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_compiler) {
if (*range_compiler) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_compiler_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_compiler_s);
return;
}
*range_compiler = &content->array[0];
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_compiler_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_compiler_s);
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, fake_make_section_settings_s);
+ fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_section_settings_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_compiler_
fake_build_load_setting_process(main, F_false, main->file_data_build_fakefile.string, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build, &status);
if (F_status_is_error_not(status) && settings->objects.used) {
- const f_string_t settings_name[] = {
+ const f_string_static_t settings_name[] = {
fake_make_setting_define_s,
fake_make_setting_parameter_s,
};
- const f_array_length_t settings_length[] = {
- fake_make_setting_define_s_length,
- fake_make_setting_parameter_s_length,
- };
f_string_map_multis_t *settings_value[] = {
&define,
&data_make->setting_make.parameter,
};
- status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, settings_length, 2, settings_value, 0, 0);
+ status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_fss_snatch_map_apart", F_true);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SInvalid characters in the define setting name '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QInvalid characters in the define setting name '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, define.array[i].name, main->error.notable);
fl_print_format("%[', only alpha-numeric ASCII characters and underscore (without a leading digit) are allowed.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
}
} // for
- macro_f_string_dynamic_t_delete_simple(combined);
+ f_string_dynamic_resize(0, &combined);
}
- macro_f_string_map_multis_t_delete_simple(define);
+ f_string_map_multis_resize(0, &define);
if (F_status_is_error(status)) return status;
else if (data_make->main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->warning.to.stream);
- fl_print_format("%q%[%SThe environment name '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
+ fl_print_format("%q%[%QThe environment name '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
fl_print_format("%[%Q%]", data_make->main->warning.to.stream, data_make->main->warning.notable, name_define, data_make->main->warning.notable);
fl_print_format("%[' is already added.%]%q", data_make->main->warning.to.stream, data_make->main->warning.context, data_make->main->warning.context, f_string_eol_s);
else if (data_make->main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->warning.to.stream);
- fl_print_format("%q%[%SThe environment name '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
+ fl_print_format("%q%[%QThe environment name '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
fl_print_format("%[%Q%]", data_make->main->warning.to.stream, data_make->main->warning.notable, name_define, data_make->main->warning.notable);
fl_print_format("%[' is invalid, ignoring.%]%q", data_make->main->warning.to.stream, data_make->main->warning.context, data_make->main->warning.context, f_string_eol_s);
name_define.used = 0;
} // for
- macro_f_string_dynamic_t_delete_simple(name_define);
+ f_string_dynamic_resize(0, &name_define);
if (F_status_is_error(status)) return status;
if (*unmatched_fail) {
if (content->used) {
- if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_exit_s, data_make->buffer, fake_make_operation_argument_exit_s_length, content->array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_exit_s.string, data_make->buffer, fake_make_operation_argument_exit_s.used, content->array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_exit_e;
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_warn_s, data_make->buffer, fake_make_operation_argument_warn_s_length, content->array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_warn_s.string, data_make->buffer, fake_make_operation_argument_warn_s.used, content->array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_warn_e;
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_ignore_s, data_make->buffer, fake_make_operation_argument_ignore_s_length, content->array[0]) == F_equal_to) {
+ else if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_ignore_s.string, data_make->buffer, fake_make_operation_argument_ignore_s.used, content->array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_ignore_e;
}
else {
- fake_print_warning_settings_content_invalid(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, content->array[0], fake_make_section_settings_s);
+ fake_print_warning_settings_content_invalid(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, content->array[0], fake_make_section_settings_s);
}
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_fail_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_fail_s);
}
*unmatched_fail = F_false;
return;
}
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, fake_make_section_settings_s);
+ fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_section_settings_s);
}
else {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_fail_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_fail_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_fail_
void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_indexer) {
if (*range_indexer) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_indexer_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_indexer_s);
return;
}
*range_indexer = &content->array[0];
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile.string, fake_make_setting_indexer_s);
+ fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_indexer_s);
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, fake_make_section_settings_s);
+ fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_section_settings_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_indexer_
if (content->used) {
f_status_t status = F_none;
- if (fl_string_dynamic_partial_compare_string(fake_make_setting_return_s, data_make->buffer, fake_make_setting_return_s_length, content->array[0]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(fake_make_setting_return_s.string, data_make->buffer, fake_make_setting_return_s.used, content->array[0]) == F_equal_to) {
if (content->used > 1) {
// Each "return" define replaces the previous "return" define.
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile.string, data_make->buffer, *object, fake_make_section_settings_s);
+ fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_section_settings_s);
}
return F_none;
}
{
- const f_string_t parameter[] = {
+ const f_string_static_t parameter[] = {
fake_short_define_s,
fake_short_mode_s,
};
}
if (F_status_is_error_not(*status)) {
- *status = f_string_append(parameter[i], 1, &destination[i]->array[destination[i]->used]);
+ *status = f_string_dynamic_append(parameter[i], &destination[i]->array[destination[i]->used]);
}
- if (F_status_is_error(*status)) {
- fll_error_print(data_make->main->error, F_status_set_fine(*status), "f_string_append", F_true);
-
- return;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]);
}
- *status = f_string_dynamic_append(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]);
-
if (F_status_is_error(*status)) {
fll_error_print(data_make->main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
}
{
- const f_string_t parameter[] = {
+ const f_string_static_t parameter[] = {
fake_short_fakefile_s,
fake_short_path_build_s,
fake_short_path_data_s,
}
if (F_status_is_error_not(*status)) {
- *status = f_string_append(parameter[i], 1, &destination[i]->array[destination[i]->used]);
+ *status = f_string_dynamic_append(parameter[i], &destination[i]->array[destination[i]->used]);
}
- if (F_status_is_error(*status)) {
- fll_error_print(data_make->main->error, F_status_set_fine(*status), "f_string_append", F_true);
-
- return;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]);
}
- *status = f_string_dynamic_append(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]);
-
if (F_status_is_error(*status)) {
fll_error_print(data_make->main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
if (F_status_is_error(status_path) && main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SFailed change back to orignal path '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%q%[%QFailed change back to orignal path '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, data_make.path.stack.array[0], main->warning.notable);
fl_print_format("%[', status code =%] ", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%ui%]", main->warning.to.stream, main->warning.notable, F_status_set_fine(status_path), main->warning.notable);
f_file_stream_close(F_true, &data_make.path.top);
- macro_f_array_lengths_t_delete_simple(section_stack)
+ f_type_array_lengths_resize(0, §ion_stack);
macro_fake_make_data_t_delete_simple(data_make)
return status;
f_array_length_t used_content = 0;
- const f_string_t reserved_name[] = {
+ const f_string_static_t reserved_name[] = {
fake_make_parameter_variable_build_s,
fake_make_parameter_variable_color_s,
fake_make_parameter_variable_data_s,
fake_make_parameter_variable_value_work_s,
};
- const f_array_length_t reserved_length[] = {
- fake_make_parameter_variable_build_s_length,
- fake_make_parameter_variable_color_s_length,
- fake_make_parameter_variable_data_s_length,
- fake_make_parameter_variable_define_s_length,
- fake_make_parameter_variable_fakefile_s_length,
- fake_make_parameter_variable_mode_s_length,
- fake_make_parameter_variable_process_s_length,
- fake_make_parameter_variable_settings_s_length,
- fake_make_parameter_variable_sources_s_length,
- fake_make_parameter_variable_verbosity_s_length,
- fake_make_parameter_variable_work_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_value_s_length,
- };
-
f_string_dynamics_t * const reserved_value[] = {
&data_make->parameter.build,
&data_make->parameter.color,
unmatched = F_true;
// Check against reserved parameter names and if matches use them instead.
- if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_return_s, data_make->buffer, fake_make_parameter_variable_return_s_length, iki_content.array[j]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_return_s.string, data_make->buffer, fake_make_parameter_variable_return_s.used, iki_content.array[j]) == F_equal_to) {
if (data_make->setting_make.parameter.array[0].value.array[0].used) {
*status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &arguments->array[arguments->used]);
else {
for (k = 0; k < 33; ++k) {
- if (fl_string_dynamic_partial_compare_string(reserved_name[k], data_make->buffer, reserved_length[k], iki_content.array[j]) != F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(reserved_name[k].string, data_make->buffer, reserved_name[k].used, iki_content.array[j]) != F_equal_to) {
continue;
}
bool unmatched = F_true;
{
- const f_string_t uint8_name[] = {
+ const f_string_static_t uint8_name[] = {
fake_build_setting_name_build_language_s,
fake_build_setting_name_version_file_s,
fake_build_setting_name_version_target_s,
};
- const f_array_length_t uint8_length[] = {
- fake_build_setting_name_build_language_s_length,
- fake_build_setting_name_version_file_s_length,
- fake_build_setting_name_version_target_s_length,
- };
-
const uint8_t uint8_value[] = {
data_make->setting_build.build_language,
data_make->setting_build.version_file,
for (uint8_t i = 0; i < 3; ++i) {
- status = fl_string_dynamic_partial_compare_string(uint8_name[i], data_make->buffer, uint8_length[i], range_name);
+ status = fl_string_dynamic_partial_compare_string(uint8_name[i].string, data_make->buffer, uint8_name[i].used, range_name);
if (status == F_equal_to) {
unmatched = F_false;
status = f_conversion_number_unsigned_to_string(uint8_value[i], f_conversion_data_base_10_s, &value);
+
break;
}
} // for
}
if (unmatched) {
- const f_string_t bool_name[] = {
+ const f_string_static_t bool_name[] = {
fake_build_setting_name_build_script_s,
fake_build_setting_name_build_shared_s,
fake_build_setting_name_build_static_s,
fake_build_setting_name_search_static_s,
};
- const f_array_length_t bool_length[] = {
- fake_build_setting_name_build_script_s_length,
- fake_build_setting_name_build_shared_s_length,
- fake_build_setting_name_build_static_s_length,
- fake_build_setting_name_path_standard_s_length,
- fake_build_setting_name_search_exclusive_s_length,
- fake_build_setting_name_search_shared_s_length,
- fake_build_setting_name_search_static_s_length,
- };
-
const bool bool_value[] = {
data_make->setting_build.build_script,
data_make->setting_build.build_shared,
for (uint8_t i = 0; i < 7; ++i) {
- status = fl_string_dynamic_partial_compare_string(bool_name[i], data_make->buffer, bool_length[i], range_name);
+ status = fl_string_dynamic_partial_compare_string(bool_name[i].string, data_make->buffer, bool_name[i].used, range_name);
if (status == F_equal_to) {
unmatched = F_false;
if (bool_value[i]) {
- status = f_string_append(fake_common_setting_bool_yes_s, fake_common_setting_bool_yes_s_length, &value);
+ status = f_string_dynamic_append(fake_common_setting_bool_yes_s, &value);
}
else {
- status = f_string_append(fake_common_setting_bool_no_s, fake_common_setting_bool_no_s_length, &value);
+ status = f_string_dynamic_append(fake_common_setting_bool_no_s, &value);
}
break;
}
if (unmatched) {
- const f_string_t dynamic_name[] = {
+ const f_string_static_t dynamic_name[] = {
fake_build_setting_name_build_compiler_s,
fake_build_setting_name_build_indexer_s,
fake_build_setting_name_path_headers_s,
fake_build_setting_name_version_minor_s,
};
- const f_array_length_t dynamic_length[] = {
- fake_build_setting_name_build_compiler_s_length,
- fake_build_setting_name_build_indexer_s_length,
- fake_build_setting_name_path_headers_s_length,
- fake_build_setting_name_path_language_s_length,
- fake_build_setting_name_path_library_script_s_length,
- fake_build_setting_name_path_library_shared_s_length,
- fake_build_setting_name_path_library_static_s_length,
- fake_build_setting_name_path_program_script_s_length,
- fake_build_setting_name_path_program_shared_s_length,
- fake_build_setting_name_path_program_static_s_length,
- fake_build_setting_name_path_sources_s_length,
- fake_build_setting_name_process_post_s_length,
- fake_build_setting_name_process_pre_s_length,
- fake_build_setting_name_project_name_s_length,
- fake_build_setting_name_version_major_s_length,
- fake_build_setting_name_version_micro_s_length,
- fake_build_setting_name_version_minor_s_length,
- };
-
const f_string_dynamic_t dynamic_value[] = {
data_make->setting_build.build_compiler,
data_make->setting_build.build_indexer,
for (uint8_t i = 0; i < 17; ++i) {
- status = fl_string_dynamic_partial_compare_string(dynamic_name[i], data_make->buffer, dynamic_length[i], range_name);
+ status = fl_string_dynamic_partial_compare_string(dynamic_name[i].string, data_make->buffer, dynamic_name[i].used, range_name);
if (status == F_equal_to) {
unmatched = F_false;
status = f_string_dynamic_append(dynamic_value[i], &value);
+
break;
}
} // for
}
if (unmatched) {
- const f_string_t dynamics_name[] = {
+ const f_string_static_t dynamics_name[] = {
fake_build_setting_name_build_libraries_s,
fake_build_setting_name_build_libraries_shared_s,
fake_build_setting_name_build_libraries_static_s,
fake_build_setting_name_modes_default_s,
};
- const f_array_length_t dynamics_length[] = {
- fake_build_setting_name_build_libraries_s_length,
- fake_build_setting_name_build_libraries_shared_s_length,
- fake_build_setting_name_build_libraries_static_s_length,
- fake_build_setting_name_build_sources_headers_s_length,
- fake_build_setting_name_build_sources_headers_shared_s_length,
- fake_build_setting_name_build_sources_headers_static_s_length,
- fake_build_setting_name_build_sources_library_s_length,
- fake_build_setting_name_build_sources_library_shared_s_length,
- fake_build_setting_name_build_sources_library_static_s_length,
- fake_build_setting_name_build_sources_program_s_length,
- fake_build_setting_name_build_sources_program_shared_s_length,
- fake_build_setting_name_build_sources_program_static_s_length,
- fake_build_setting_name_build_sources_settings_s_length,
- fake_build_setting_name_build_sources_script_s_length,
- fake_build_setting_name_defines_s_length,
- fake_build_setting_name_defines_library_s_length,
- fake_build_setting_name_defines_library_shared_s_length,
- fake_build_setting_name_defines_library_static_s_length,
- fake_build_setting_name_defines_program_s_length,
- fake_build_setting_name_defines_program_shared_s_length,
- fake_build_setting_name_defines_program_static_s_length,
- fake_build_setting_name_defines_shared_s_length,
- fake_build_setting_name_defines_static_s_length,
- fake_build_setting_name_environment_length_s,
- fake_build_setting_name_flags_s_length,
- fake_build_setting_name_flags_library_s_length,
- fake_build_setting_name_flags_library_shared_s_length,
- fake_build_setting_name_flags_library_static_s_length,
- fake_build_setting_name_flags_program_s_length,
- fake_build_setting_name_flags_program_shared_s_length,
- fake_build_setting_name_flags_program_static_s_length,
- fake_build_setting_name_flags_shared_s_length,
- fake_build_setting_name_flags_static_s_length,
- fake_build_setting_name_modes_s_length,
- fake_build_setting_name_modes_default_s_length,
- };
-
const f_string_dynamics_t dynamics_value[] = {
data_make->setting_build.build_libraries,
data_make->setting_build.build_libraries_shared,
for (uint8_t i = 0; i < 35; ++i) {
- status = fl_string_dynamic_partial_compare_string(dynamics_name[i], data_make->buffer, dynamics_length[i], range_name);
+ status = fl_string_dynamic_partial_compare_string(dynamics_name[i].string, data_make->buffer, dynamics_name[i].used, range_name);
if (status == F_equal_to) {
unmatched = F_false;
}
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(value);
+ f_string_dynamic_resize(0, &value);
return status;
}
if (unmatched) {
- macro_f_string_dynamic_t_delete_simple(value);
+ f_string_dynamic_resize(0, &value);
return F_false;
}
}
}
- macro_f_string_dynamic_t_delete_simple(value);
+ f_string_dynamic_resize(0, &value);
if (F_status_is_error(status)) return status;
f_status_t status = F_none;
const f_string_static_t *context = 0;
- const f_string_t context_name[] = {
+ const f_string_static_t context_name[] = {
fake_make_context_reset_s,
fake_make_context_warning_s,
fake_make_context_error_s,
fake_make_context_normal_s,
};
- const f_array_length_t context_length[] = {
- fake_make_context_reset_s_length,
- fake_make_context_warning_s_length,
- fake_make_context_error_s_length,
- fake_make_context_title_s_length,
- fake_make_context_notable_s_length,
- fake_make_context_important_s_length,
- fake_make_context_standout_s_length,
- fake_make_context_success_s_length,
- fake_make_context_normal_s_length,
- };
-
const f_color_set_t context_value[] = {
data_make->main->context.set.reset,
data_make->main->context.set.warning,
for (f_array_length_t i = 0; i < 9; ++i) {
- if (fl_string_dynamic_partial_compare_string(context_name[i], data_make->buffer, context_length[i], range_name) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(context_name[i].string, data_make->buffer, context_name[i].used, range_name) == F_equal_to) {
context = context_value[i].before;
break;
status = f_environment_get(name.string, &value);
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
}
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(value);
+ f_string_dynamic_resize(0, &value);
return status;
}
- else if (status == F_exist_not) {
- macro_f_string_dynamic_t_delete_simple(value);
+
+ if (status == F_exist_not) {
+ f_string_dynamic_resize(0, &value);
return F_false;
}
}
}
- macro_f_string_dynamic_t_delete_simple(value);
+ f_string_dynamic_resize(0, &value);
if (F_status_is_error(status)) return status;
return 0;
}
- const f_string_t operations_name[] = {
+ const f_string_static_t operations_name[] = {
fake_make_operation_and_s,
fake_make_operation_break_s,
fake_make_operation_build_s,
fake_make_operation_touch_s,
};
- const f_array_length_t operations_length[] = {
- fake_make_operation_and_s_length,
- fake_make_operation_break_s_length,
- fake_make_operation_build_s_length,
- fake_make_operation_clean_s_length,
- fake_make_operation_clone_s_length,
- fake_make_operation_compile_s_length,
- fake_make_operation_copy_s_length,
- fake_make_operation_define_s_length,
- fake_make_operation_delete_s_length,
- fake_make_operation_deletes_s_length,
- fake_make_operation_else_s_length,
- fake_make_operation_exit_s_length,
- fake_make_operation_fail_s_length,
- fake_make_operation_group_s_length,
- fake_make_operation_groups_s_length,
- fake_make_operation_if_s_length,
- fake_make_operation_index_s_length,
- fake_make_operation_link_s_length,
- fake_make_operation_mode_s_length,
- fake_make_operation_modes_s_length,
- fake_make_operation_move_s_length,
- fake_make_operation_operate_s_length,
- fake_make_operation_or_s_length,
- fake_make_operation_owner_s_length,
- fake_make_operation_owners_s_length,
- fake_make_operation_parameter_s_length,
- fake_make_operation_pop_s_length,
- fake_make_operation_print_s_length,
- fake_make_operation_run_s_length,
- fake_make_operation_shell_s_length,
- fake_make_operation_skeleton_s_length,
- fake_make_operation_to_s_length,
- fake_make_operation_top_s_length,
- fake_make_operation_touch_s_length,
- };
-
const uint8_t operations_type[] = {
fake_make_operation_type_and_e,
fake_make_operation_type_break_e,
for (j = 0; j < fake_make_operation_total_d; ++j) {
- if (fl_string_dynamic_partial_compare_string(operations_name[j], data_make->buffer, operations_length[j], section->objects.array[i]) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare_string(operations_name[j].string, data_make->buffer, operations_name[j].used, section->objects.array[i]) == F_equal_to) {
state_process.operation = operations_type[j];
break;
if (data_make->main->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SIncomplete '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QIncomplete '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
if (state_process.block == fake_state_process_block_else_e) {
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_else_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_else_s, data_make->error.notable);
}
else {
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
}
fl_print_format("%[' at end of section.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
}
if (state_process->operation == fake_make_operation_type_break_e) {
- if (!arguments.used || fl_string_dynamic_compare_string(fake_make_operation_argument_success_s, arguments.array[0], fake_make_operation_argument_success_s_length) == F_equal_to) {
+ if (!arguments.used || fl_string_dynamic_compare(fake_make_operation_argument_success_s, arguments.array[0]) == F_equal_to) {
*status = F_signal_abort;
}
- else if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure_s, arguments.array[0], fake_make_operation_argument_failure_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, arguments.array[0]) == F_equal_to) {
*status = F_status_set_error(F_signal_abort);
}
else {
flockfile(data_make->main->output.to.stream);
fl_print_format("%qBreaking as '", data_make->main->output.to.stream, f_string_eol_s);
- fl_print_format("%[%S%]", data_make->main->output.to.stream, data_make->main->context.set.notable, arguments.used ? arguments.array[0].string : fake_make_operation_argument_success_s, data_make->main->context.set.notable);
+ fl_print_format("%[%Q%]", data_make->main->output.to.stream, data_make->main->context.set.notable, arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, data_make->main->context.set.notable);
fl_print_format("'.%q", data_make->main->output.to.stream, f_string_eol_s);
funlockfile(data_make->main->output.to.stream);
}
if (state_process->operation == fake_make_operation_type_exit_e) {
- if (!arguments.used || fl_string_dynamic_compare_string(fake_make_operation_argument_success_s, arguments.array[0], fake_make_operation_argument_success_s_length) == F_equal_to) {
+ if (!arguments.used || fl_string_dynamic_compare(fake_make_operation_argument_success_s, arguments.array[0]) == F_equal_to) {
*status = F_signal_quit;
}
- else if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure_s, arguments.array[0], fake_make_operation_argument_failure_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, arguments.array[0]) == F_equal_to) {
*status = F_status_set_error(F_signal_quit);
// Forcing exit forces fail mode.
}
if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
- fll_print_format("%qExiting as '%[%S%]'.%q", data_make->main->output.to.stream, f_string_eol_s, data_make->main->context.set.notable, arguments.used ? arguments.array[0].string : fake_make_operation_argument_success_s, data_make->main->context.set.notable, f_string_eol_s);
+ fll_print_format("%qExiting as '%[%Q%]'.%q", data_make->main->output.to.stream, f_string_eol_s, data_make->main->context.set.notable, arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, data_make->main->context.set.notable, f_string_eol_s);
}
return 0;
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find program '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find program '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, program, data_make->error.notable);
fl_print_format("%[' for executing.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed with return code %]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed with return code %]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%i%]", data_make->error.to.stream, data_make->error.notable, return_code, data_make->error.notable);
fl_print_format("%[.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->output.to.stream);
- fl_print_format("%q%s '%[%Q%]' to '", data_make->main->output.to.stream, f_string_eol_s, clone ? "Cloned" : "Copied", data_make->main->context.set.notable, arguments.array[i], data_make->main->context.set.notable);
+ fl_print_format("%q%q '%[%Q%]' to '", data_make->main->output.to.stream, f_string_eol_s, clone ? "Cloned" : "Copied", data_make->main->context.set.notable, arguments.array[i], data_make->main->context.set.notable);
fl_print_format("%[%S%]'.%q", data_make->main->output.to.stream, f_string_eol_s, data_make->main->context.set.notable, destination, data_make->main->context.set.notable, f_string_eol_s);
funlockfile(data_make->main->output.to.stream);
if (data_make->main->warning.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->warning.to.stream);
- fl_print_format("%q%[%SThe file '%]", data_make->main->warning.to.stream, data_make->main->warning.prefix, f_string_eol_s);
+ fl_print_format("%q%[%QThe file '%]", data_make->main->warning.to.stream, data_make->main->warning.prefix, f_string_eol_s);
fl_print_format("%[%Q%]", data_make->main->warning.to.stream, data_make->main->warning.notable, arguments.array[i], data_make->main->warning.notable);
fl_print_format("%[' cannot be found.%]%q", data_make->main->warning.to.stream, f_string_eol_s);
#ifndef _di_fake_make_operate_process_type_fail_
void fake_make_operate_process_type_fail(fake_make_data_t * const data_make, const f_string_dynamics_t arguments) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_exit_s, arguments.array[0], fake_make_operation_argument_exit_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, arguments.array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_exit_e;
data_make->error.prefix = fl_print_error_s;
data_make->error.suffix = f_string_empty_s;
data_make->error.to.id = F_type_descriptor_error_d;
data_make->error.set = &data_make->main->context.set;
}
- else if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn_s, arguments.array[0], fake_make_operation_argument_warn_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fake_make_operation_argument_warn_s, arguments.array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_warn_e;
data_make->error.prefix = fl_print_warning_s;
data_make->error.suffix = f_string_empty_s;
f_print_terminated("Set failure state to '", data_make->main->output.to.stream);
if (data_make->setting_make.fail == fake_make_operation_fail_type_exit_e) {
- fl_print_format("%[%s%]", data_make->main->output.to.stream, data_make->main->context.set.notable, fake_make_operation_argument_exit_s, data_make->main->context.set.notable);
+ fl_print_format("%[%q%]", data_make->main->output.to.stream, data_make->main->context.set.notable, fake_make_operation_argument_exit_s, data_make->main->context.set.notable);
}
else if (data_make->setting_make.fail == fake_make_operation_fail_type_warn_e) {
- fl_print_format("%[%s%]", data_make->main->output.to.stream, data_make->main->context.set.notable, fake_make_operation_argument_warn_s, data_make->main->context.set.notable);
+ fl_print_format("%[%q%]", data_make->main->output.to.stream, data_make->main->context.set.notable, fake_make_operation_argument_warn_s, data_make->main->context.set.notable);
}
else {
- fl_print_format("%[%s%]", data_make->main->output.to.stream, data_make->main->context.set.notable, fake_make_operation_argument_ignore_s, data_make->main->context.set.notable);
+ fl_print_format("%[%q%]", data_make->main->output.to.stream, data_make->main->context.set.notable, fake_make_operation_argument_ignore_s, data_make->main->context.set.notable);
}
fl_print_format("'.%q", data_make->main->output.to.stream, f_string_eol_s);
else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->output.to.stream);
- fl_print_format("%s group of '%[%s%]", data_make->main->output.to.stream, all ? "Recursively changed" : "Changed", data_make->main->context.set.notable, arguments.array[i], data_make->main->context.set.notable);
+ fl_print_format("%q group of '%[%q%]", data_make->main->output.to.stream, all ? "Recursively changed" : "Changed", data_make->main->context.set.notable, arguments.array[i], data_make->main->context.set.notable);
fl_print_format("' to %[%ul%].%q", data_make->main->output.to.stream, data_make->main->context.set.notable, id, data_make->main->context.set.notable, f_string_eol_s);
funlockfile(data_make->main->output.to.stream);
const f_string_static_t argument = if_not ? arguments.array[2] : arguments.array[1];
- const f_string_t reserved_name[] = {
+ const f_string_static_t reserved_name[] = {
fake_make_parameter_variable_build_s,
fake_make_parameter_variable_color_s,
fake_make_parameter_variable_data_s,
fake_make_parameter_variable_value_work_s,
};
- const f_array_length_t reserved_length[] = {
- fake_make_parameter_variable_build_s_length,
- fake_make_parameter_variable_color_s_length,
- fake_make_parameter_variable_data_s_length,
- fake_make_parameter_variable_define_s_length,
- fake_make_parameter_variable_fakefile_s_length,
- fake_make_parameter_variable_mode_s_length,
- fake_make_parameter_variable_process_s_length,
- fake_make_parameter_variable_settings_s_length,
- fake_make_parameter_variable_sources_s_length,
- fake_make_parameter_variable_verbosity_s_length,
- fake_make_parameter_variable_work_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_value_s_length,
- };
-
const bool reserved_defined[] = {
data_make->main->path_build.used,
F_true,
data_make->parameter_value.work.used,
};
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment_s, argument, fake_make_operation_argument_environment_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_environment_s, argument) == F_equal_to) {
state_process->condition_result = fake_condition_result_true_e;
if (if_not) {
for (j = 0; j < 33; ++j) {
- if (fl_string_dynamic_compare_string(reserved_name[j], arguments.array[i], reserved_length[j]) == F_equal_to) {
+ if (fl_string_dynamic_compare(reserved_name[j], arguments.array[i]) == F_equal_to) {
result = reserved_defined[j] ? 2 : 1;
break;
for (; i < arguments.used; ++i) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_if_is_for_s, arguments.array[i], fake_make_operation_argument_if_is_for_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_if_is_for_s, arguments.array[i]) == F_equal_to) {
++i;
break;
}
- if (fl_string_dynamic_compare_string(F_file_type_name_block_s, arguments.array[i], F_file_type_name_block_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(f_file_type_name_block_s, arguments.array[i]) == F_equal_to) {
type |= 0x1;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_character_s, arguments.array[i], F_file_type_name_character_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_character_s, arguments.array[i]) == F_equal_to) {
type |= 0x2;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_directory_s, arguments.array[i], F_file_type_name_directory_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_directory_s, arguments.array[i]) == F_equal_to) {
type |= 0x4;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_fifo_s, arguments.array[i], F_file_type_name_fifo_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_fifo_s, arguments.array[i]) == F_equal_to) {
type |= 0x8;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_link_s, arguments.array[i], F_file_type_name_link_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_link_s, arguments.array[i]) == F_equal_to) {
type |= 0x10;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_regular_s, arguments.array[i], F_file_type_name_regular_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_regular_s, arguments.array[i]) == F_equal_to) {
type |= 0x20;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_socket_s, arguments.array[i], F_file_type_name_socket_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_socket_s, arguments.array[i]) == F_equal_to) {
type |= 0x40;
}
} // for
flockfile(data_make->error.to.stream);
if ((i == 1 && number_left > F_number_t_size_unsigned_d) || (i > 1 && number_right > F_number_t_size_unsigned_d)) {
- fl_print_format("%q%[%SThe number '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe number '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%[' may only be between the ranges -%un to %un.%]%q", data_make->error.to.stream, data_make->error.context, F_number_t_size_unsigned_d, F_number_t_size_unsigned_d, data_make->error.context, f_string_eol_s);
}
else {
- fl_print_format("%q%[%SInvalid or unsupported number provided '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QInvalid or unsupported number provided '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, F_number_t_size_unsigned_d, F_number_t_size_unsigned_d, data_make->error.context, f_string_eol_s);
}
mode_t mode_match = 0;
bool is = F_false;
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_is_s, arguments.array[if_not ? 2 : 1], fake_make_operation_argument_is_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_is_s, arguments.array[if_not ? 2 : 1]) == F_equal_to) {
is = F_true;
}
for (f_array_length_t i = 1; i < arguments.used; ++i) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_file_s, arguments.array[0], fake_make_operation_argument_file_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_file_s, arguments.array[0]) == F_equal_to) {
status = f_file_touch(arguments.array[i].string, mode.regular, F_false);
if (F_status_is_error(status)) {
break;
}
}
- else if (fl_string_dynamic_compare_string(fake_make_operation_argument_directory_s, arguments.array[0], fake_make_operation_argument_directory_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fake_make_operation_argument_directory_s, arguments.array[0]) == F_equal_to) {
status = f_directory_touch(arguments.array[i].string, mode.directory);
if (F_status_is_error(status)) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SNo indexer has been specified, cannot perform '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_index_s, data_make->error.notable);
+ fl_print_format("%q%[%QNo indexer has been specified, cannot perform '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_index_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
*status = F_status_set_error(F_failure);
}
else if (arguments.used) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_success_s, arguments.array[0], fake_make_operation_argument_success_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure_s, arguments.array[0], fake_make_operation_argument_failure_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_success_s, arguments.array[0]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, arguments.array[0]) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported break type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QUnsupported break type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%S%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
+ fl_print_format("%q%[%QThe file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%S%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
fl_print_format("%[' must be a regular file.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
}
else {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_print_format("%q%[%SFilename argument must not be an empty string.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ fll_print_format("%q%[QFilename argument must not be an empty string.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
}
*status = F_status_set_error(F_failure);
if (data_make->path.stack.used == 1) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_print_format("%q%[%SMust not attempt to pop project root off of path stack.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QMust not attempt to pop project root off of path stack.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
}
*status = F_status_set_error(F_failure);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[arguments.used - 1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SNo compiler has been specified, cannot perform '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_compile_s, data_make->error.notable);
+ fl_print_format("%q%[%QNo compiler has been specified, cannot perform '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_compile_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[arguments.used - 1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (*status == F_none) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_print_format("%q%[%SDefine name must not be an empty string.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QDefine name must not be an empty string.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
}
*status = F_status_set_error(F_failure);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SInvalid characters in the define setting name '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QInvalid characters in the define setting name '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%[', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SMust not be used immediately after another '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_else_s, data_make->error.notable);
+ fl_print_format("%q%[%QMust not be used immediately after another '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_else_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SMust not be used immediately after an '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
+ fl_print_format("%q%[%QMust not be used immediately after an '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
fl_print_format("%[', '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
fl_print_format("%[', or '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
if (!state_process->block) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fl_print_format("%q%[%SHas no preceding '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
+ fl_print_format("%q%[%QHas no preceding '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
fl_print_format("%[', '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
fl_print_format("%[', or '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
}
*status = F_status_set_error(F_failure);
}
else if (arguments.used) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_success_s, arguments.array[0], fake_make_operation_argument_success_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure_s, arguments.array[0], fake_make_operation_argument_failure_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_success_s, arguments.array[0]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, arguments.array[0]) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported exit type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QUnsupported exit type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (state_process->operation == fake_make_operation_type_fail_e) {
if (arguments.used) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_exit_s, arguments.array[0], fake_make_operation_argument_exit_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn_s, arguments.array[0], fake_make_operation_argument_warn_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore_s, arguments.array[0], fake_make_operation_argument_ignore_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, arguments.array[0]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_warn_s, arguments.array[0]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_ignore_s, arguments.array[0]) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported fail type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QUnsupported fail type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SMust not be used immediately after another '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
+ fl_print_format("%q%[%QMust not be used immediately after another '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
fl_print_format("%[', '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
fl_print_format("%[', or '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SMay only be used immediately after another '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
+ fl_print_format("%q%[%QMay only be used immediately after another '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_if_s, data_make->error.notable);
fl_print_format("%[', '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_and_s, data_make->error.notable);
fl_print_format("%[', or '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, fake_make_operation_or_s, data_make->error.notable);
fl_print_format("%[' section operation.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
}
if (arguments.used) {
- const f_string_t if_type_strings[] = {
+ const f_string_static_t if_type_strings[] = {
fake_make_operation_argument_if_defined_s,
fake_make_operation_argument_if_equal_s,
fake_make_operation_argument_if_equal_not_s,
fake_make_operation_argument_if_success_s,
};
- const f_array_length_t if_type_lengths[] = {
- fake_make_operation_argument_if_defined_s_length,
- fake_make_operation_argument_if_equal_s_length,
- fake_make_operation_argument_if_equal_not_s_length,
- fake_make_operation_argument_if_exists_s_length,
- fake_make_operation_argument_if_failure_s_length,
- fake_make_operation_argument_if_greater_s_length,
- fake_make_operation_argument_if_greater_equal_s_length,
- fake_make_operation_argument_if_group_s_length,
- fake_make_operation_argument_if_is_s_length,
- fake_make_operation_argument_if_less_s_length,
- fake_make_operation_argument_if_less_equal_s_length,
- fake_make_operation_argument_if_mode_s_length,
- fake_make_operation_argument_if_not_s_length,
- fake_make_operation_argument_if_defined_s_length, // if not defined, represented by just "defined".
- fake_make_operation_argument_if_exists_s_length, // if not exists, represented by just "exists".
- fake_make_operation_argument_if_group_s_length, // if not group, represented by just "group".
- fake_make_operation_argument_if_is_s_length, // if not is, represented by just "is".
- fake_make_operation_argument_if_mode_s_length, // if not mode, represented by just "mode".
- fake_make_operation_argument_if_owner_s_length, // if not owner, represented by just "owner".
- fake_make_operation_argument_if_owner_s_length,
- fake_make_operation_argument_if_success_s_length,
- };
-
const uint8_t if_type_codes[] = {
fake_make_operation_if_type_if_defined_e,
fake_make_operation_if_type_if_equal_e,
1, // If success.
};
- const f_string_t if_not_type_strings[] = {
+ const f_string_static_t if_not_type_strings[] = {
fake_make_operation_argument_if_defined_s,
fake_make_operation_argument_if_exists_s,
fake_make_operation_argument_if_group_s,
fake_make_operation_argument_if_owner_s,
};
- const f_array_length_t if_not_type_lengths[] = {
- fake_make_operation_argument_if_defined_s_length,
- fake_make_operation_argument_if_exists_s_length,
- fake_make_operation_argument_if_group_s_length,
- fake_make_operation_argument_if_is_s_length,
- fake_make_operation_argument_if_mode_s_length,
- fake_make_operation_argument_if_owner_s_length,
- };
-
const uint8_t if_not_type_codes[] = {
fake_make_operation_if_type_if_not_defined_e,
fake_make_operation_if_type_if_not_exists_e,
f_array_length_t i = 0;
f_array_length_t j = 0;
- f_string_t if_and_or;
+ f_string_static_t if_and_or;
if (state_process->operation == fake_make_operation_type_and_e) {
if_and_or = fake_make_operation_and_s;
// Skip the "if not XXX" types as they are determined later on.
if (i > 12 && i < 19) continue;
- if (fl_string_dynamic_compare_string(if_type_strings[i], arguments.array[0], if_type_lengths[i]) == F_equal_to) {
+ if (fl_string_dynamic_compare(if_type_strings[i], arguments.array[0]) == F_equal_to) {
state_process->condition = if_type_codes[i];
break;
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, if_and_or, data_make->error.notable);
+ fl_print_format("%q%[%QUnsupported '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, if_and_or, data_make->error.notable);
fl_print_format("%[' type '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
for (; j < 6; ++j) {
- if (fl_string_dynamic_compare_string(if_not_type_strings[j], arguments.array[1], if_not_type_lengths[j]) == F_equal_to) {
+ if (fl_string_dynamic_compare(if_not_type_strings[j], arguments.array[1]) == F_equal_to) {
state_process->condition = if_not_type_codes[j];
break;
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%s%]", data_make->error.to.stream, data_make->error.notable, if_and_or, data_make->error.notable);
+ fl_print_format("%q%[%QUnsupported '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%q%]", data_make->error.to.stream, data_make->error.notable, if_and_or, data_make->error.notable);
fl_print_format("%[' not type '%]", data_make->error.to.stream, data_make->error.context, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
}
if (state_process->condition == fake_make_operation_if_type_if_defined_e || state_process->condition == fake_make_operation_if_type_if_not_defined_e) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment_s, j == 6 ? arguments.array[1] : arguments.array[2], fake_make_operation_argument_environment_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_parameter_s, j == 6 ? arguments.array[1] : arguments.array[2], fake_make_operation_argument_parameter_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_environment_s, j == 6 ? arguments.array[1] : arguments.array[2]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_parameter_s, j == 6 ? arguments.array[1] : arguments.array[2]) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported define type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QUnsupported define type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, j == 6 ? arguments.array[1] : arguments.array[2], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
else if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_is_e || state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition > fake_make_operation_if_type_if_not_exists_e && state_process->condition < fake_make_operation_if_type_if_success_e) {
if (state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition == fake_make_operation_if_type_if_not_mode_e) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_is_s, arguments.array[1], fake_make_operation_argument_is_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_has_s, arguments.array[1], fake_make_operation_argument_has_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_is_s, arguments.array[1]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_has_s, arguments.array[1]) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported %smode type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, j == 6 ? "" : "not ", data_make->error.context);
+ fl_print_format("%q%[%QUnsupported %smode type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, j == 6 ? "" : "not ", data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
for (i = j == 6 ? 1 : 2; i < arguments.used; ++i) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_if_is_for_s, arguments.array[i], fake_make_operation_argument_if_is_for_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_if_is_for_s, arguments.array[i]) == F_equal_to) {
++i;
break;
}
- if (fl_string_dynamic_compare_string(F_file_type_name_block_s, arguments.array[i], F_file_type_name_block_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(f_file_type_name_block_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x1;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_character_s, arguments.array[i], F_file_type_name_character_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_character_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x2;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_directory_s, arguments.array[i], F_file_type_name_directory_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_directory_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x4;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_fifo_s, arguments.array[i], F_file_type_name_fifo_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_fifo_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x8;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_link_s, arguments.array[i], F_file_type_name_link_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_link_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x10;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_regular_s, arguments.array[i], F_file_type_name_regular_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_regular_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x20;
}
- else if (fl_string_dynamic_compare_string(F_file_type_name_socket_s, arguments.array[i], F_file_type_name_socket_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(f_file_type_name_socket_s, arguments.array[i]) == F_equal_to) {
type_file |= 0x40;
}
else {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported file type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QUnsupported file type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
flockfile(data_make->error.to.stream);
if (number > F_number_t_size_unsigned_d) {
- fl_print_format("%q%[%SThe number '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe number '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%[' may only be between the ranges -%un to %un.%]%q", data_make->error.to.stream, data_make->error.context, F_number_t_size_unsigned_d, F_number_t_size_unsigned_d, data_make->error.context, f_string_eol_s);
}
else {
- fl_print_format("%q%[%SInvalid or unsupported number provided '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QInvalid or unsupported number provided '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
}
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[i], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[arguments.used - 1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[arguments.used - 1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (id_section == data_make->fakefile.used) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SNo operation section named '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QNo operation section named '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%[' was found.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe section operation '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe section operation '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, data_make->fakefile.array[id_section].name, data_make->error.notable);
fl_print_format("%[' is already in the operation stack, recursion is not allowed.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (state_process->operation == fake_make_operation_type_parameter_e) {
if (arguments.used) {
- const f_string_t reserved_name[] = {
+ const f_string_static_t reserved_name[] = {
fake_make_parameter_variable_build_s,
fake_make_parameter_variable_color_s,
fake_make_parameter_variable_data_s,
fake_make_parameter_variable_value_work_s,
};
- const f_array_length_t reserved_length[] = {
- fake_make_parameter_variable_build_s_length,
- fake_make_parameter_variable_color_s_length,
- fake_make_parameter_variable_data_s_length,
- fake_make_parameter_variable_define_s_length,
- fake_make_parameter_variable_fakefile_s_length,
- fake_make_parameter_variable_mode_s_length,
- fake_make_parameter_variable_process_s_length,
- fake_make_parameter_variable_settings_s_length,
- fake_make_parameter_variable_sources_s_length,
- fake_make_parameter_variable_verbosity_s_length,
- fake_make_parameter_variable_work_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_value_s_length,
- };
-
for (f_array_length_t i = 0; i < 33; ++i) {
- if (fl_string_dynamic_compare_string(reserved_name[i], arguments.array[0], reserved_length[i]) == F_equal_to) {
- fll_print_format("%q%[%SCannot assign a value to the parameter name '%s' because it is a reserved parameter name.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ if (fl_string_dynamic_compare(reserved_name[i], arguments.array[0]) == F_equal_to) {
+ fll_print_format("%q%[%QCannot assign a value to the parameter name '%q' because it is a reserved parameter name.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, reserved_name[i], data_make->error.context, f_string_eol_s);
*status = F_status_set_error(F_failure);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SThe file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QThe file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%[' must be a directory file.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
}
else {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_print_format("%q%[%SFilename argument must not be an empty string.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QFilename argument must not be an empty string.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
}
}
}
if (state_process->operation == fake_make_operation_type_touch_e) {
if (arguments.used > 1) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_file_s, arguments.array[0], fake_make_operation_argument_file_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_directory_s, arguments.array[0], fake_make_operation_argument_directory_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_file_s, arguments.array[0]) == F_equal_to_not) {
+ if (fl_string_dynamic_compare(fake_make_operation_argument_directory_s, arguments.array[0]) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%q%[%SUnsupported file type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%q%[%QUnsupported file type '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
fl_print_format("%['.%]%q", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
*status = F_status_set_error(F_failure);
}
-
- return;
}
// Note: there is nothing to validate for fake_make_operation_type_print_e.
- return;
}
#endif // _di_fake_make_operate_validate_
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe group name '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe group name '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, buffer, main->error.notable);
fl_print_format("%[' was not found.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe number '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe number '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, number, main->error.notable);
fl_print_format("%[' is too large.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_set_fine(status) == F_syntax) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, buffer, main->error.notable);
fl_print_format("%[' is invalid.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe user '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe user '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, buffer, main->error.notable);
fl_print_format("%[' was not found.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe number '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe number '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, number, main->error.notable);
fl_print_format("%[' is too large.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
#endif
#ifndef _di_fake_print_error_build_operation_file_
- bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_t operation, const f_string_t how, const f_string_t source, const f_string_t destination, const bool fallback) {
+ bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_t how, const f_string_t source, const f_string_t destination, const bool fallback) {
if (status == F_file_found_not) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to find '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, f_file_exists(source) == F_true ? destination : source, main->error.notable);
- fl_print_format("%[while trying to %S '%]", main->error.to.stream, main->error.context, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QFailed to find '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, f_file_exists(source) == F_true ? destination : source, main->error.notable);
+ }
+
+ fl_print_format("%[while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SInvalid parameter when calling '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QInvalid parameter when calling '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, function, main->error.notable);
- fl_print_format("%[() to %s '%]", main->error.to.stream, main->error.context, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%[() to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SInvalid name for '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QInvalid name for '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' or '%]", main->error.to.stream, main->error.context, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SUnable to allocate memory, while trying to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QUnable to allocate memory, while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SOverflow while trying to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QOverflow while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SInvalid directory while trying to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QInvalid directory while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SAccess denied while trying to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QAccess denied while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SLoop while trying to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QLoop while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SProhibited by system while trying to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QProhibited by system while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QFailed to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SFailed to %S '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%q%[%QFailed to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (fll_error_print(main->error, status, function, F_false) == F_known_not && fallback && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[UNKNOWN %s(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%q%[UNKNOWN %Q(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ui%]", main->error.to.stream, main->error.notable, status, main->error.notable);
- fl_print_format("%[) occurred while trying to %S '%]", main->error.to.stream, main->error.context, operation, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%[) occurred while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context);
+
+ if (source) {
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ }
if (destination) {
fl_print_format("%[' %S '%]", main->error.to.stream, main->error.context, how, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SOccurred on invalid UTF-8 character at stop position (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QOccurred on invalid UTF-8 character at stop position (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable);
fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SOccurred on invalid UTF-8 character at %s (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", main->error.context);
+ fl_print_format("%q%[%QOccurred on invalid UTF-8 character at %s (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", main->error.context);
fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable);
fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SOccurred on invalid UTF-8 character at stop point of string (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QOccurred on invalid UTF-8 character at stop point of string (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable);
fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
if (fll_error_print(main->error, status, function, F_false) == F_known_not && fallback && main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[UNKNOWN %s(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[UNKNOWN %Q(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ui%]", main->error.to.stream, main->error.notable, status, main->error.notable);
fl_print_format("%[) in function '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, function, main->error.notable);
#endif // _di_fake_print_error_fss
#ifndef _di_fake_print_error_parameter_missing_value_
- void fake_print_error_parameter_missing_value(fake_main_t * const main, const f_string_t parameter) {
+ void fake_print_error_parameter_missing_value(fake_main_t * const main, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
#endif // _di_fake_print_error_parameter_missing_value_
#ifndef _di_fake_print_error_parameter_too_many_
- void fake_print_error_parameter_too_many(fake_main_t * const main, const f_string_t parameter) {
+ void fake_print_error_parameter_too_many(fake_main_t * const main, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter, main->error.notable);
fl_print_format("%[' was specified too many times.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (data_make->error.verbosity == f_console_verbosity_quiet_e) return;
if (!data_make->error.to.stream) return;
- fll_print_format("%q%[%SRequires more arguments.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QRequires more arguments.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
}
#endif // _di_fake_print_error_requires_more_arguments_
if (data_make->error.verbosity == f_console_verbosity_quiet_e) return;
if (!data_make->error.to.stream) return;
- fll_print_format("%q%[%SHas too many arguments.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QHas too many arguments.%]%q", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s);
}
#endif // _di_fake_print_error_too_many_arguments_
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, operation_name, main->error.notable);
fl_print_format("%[' from section '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, section_name, main->error.notable);
flockfile(main->error.to.stream);
if (F_status_set_fine(status) == F_false) {
- fl_print_format("%q%[%SThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path, main->error.notable);
fl_print_format("%[' is outside the project root.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
}
if (status == F_array_too_large) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SMaximum stack size reached while processing path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QMaximum stack size reached while processing path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, path, main->error.notable);
fl_print_format("%['", main->error.to.stream, main->error.context);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, operation_name, main->error.notable);
fl_print_format("%[' from section '%]", main->error.to.stream, main->error.context, buffer, main->error.context);
fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, section_name, main->error.notable);
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
#endif // _di_fake_print_signal_received_
#ifndef _di_fake_print_warning_settings_content_empty_
- void fake_print_warning_settings_content_empty(fake_main_t * const main, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) {
+ void fake_print_warning_settings_content_empty(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_static_t settings_name) {
if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
+ fl_print_format("%q%[%QThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' has empty content for the '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, settings_name, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_name, main->warning.notable);
fl_print_format("%[' object '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%/Q%]", main->warning.to.stream, main->warning.notable, buffer, range_object, main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
#endif // _di_fake_print_warning_settings_content_empty_
#ifndef _di_fake_print_warning_settings_content_invalid_
- void fake_print_warning_settings_content_invalid(fake_main_t * const main, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) {
+ void fake_print_warning_settings_content_invalid(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_static_t settings_name) {
if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
+ fl_print_format("%q%[%QThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' has invalid content '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%/Q%]", main->warning.to.stream, main->warning.notable, buffer, range_content, main->warning.notable);
fl_print_format("%[' for the '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, settings_name, main->warning.notable);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, settings_name, main->warning.notable);
fl_print_format("%[' object '%]", main->warning.to.stream, main->warning.context, main->warning.context);
fl_print_format("%[%/Q%]", main->warning.to.stream, main->warning.notable, buffer, range_object, main->warning.notable);
fl_print_format("%['.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
#endif // _di_fake_print_warning_settings_content_invalid_
#ifndef _di_fake_print_warning_settings_content_multiple_
- void fake_print_warning_settings_content_multiple(fake_main_t * const main, const f_string_t path_file, const f_string_t name_object) {
+ void fake_print_warning_settings_content_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t name_object) {
if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, name_object, main->warning.notable);
+ fl_print_format("%q%[%QThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, name_object, main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
+ fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' may only have a single property, only using the first.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
#endif // _di_fake_print_warning_settings_content_multiple_
#ifndef _di_fake_print_warning_settings_object_multiple_
- void fake_print_warning_settings_object_multiple(fake_main_t * const main, const f_string_t path_file, const f_string_t label, const f_string_t name_object) {
+ void fake_print_warning_settings_object_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t label, const f_string_static_t name_object) {
if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%SThe object '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, name_object, main->warning.notable);
+ fl_print_format("%q%[%QThe object '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%[%q%]", main->warning.to.stream, main->warning.notable, name_object, main->warning.notable);
fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
+ fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
fl_print_format("%[' may only be specified once, only using the first.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_operation_file_
- extern bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_t operation, const f_string_t source, const f_string_t destination, const f_string_t how, const bool fallback) F_attribute_visibility_internal_d;
+ extern bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_t source, const f_string_t destination, const f_string_t how, const bool fallback) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_operation_file_
/**
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_parameter_missing_value_
- extern void fake_print_error_parameter_missing_value(fake_main_t * const main, const f_string_t parameter) F_attribute_visibility_internal_d;
+ extern void fake_print_error_parameter_missing_value(fake_main_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_parameter_missing_value_
/**
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_parameter_too_many_
- extern void fake_print_error_parameter_too_many(fake_main_t * const main, const f_string_t parameter) F_attribute_visibility_internal_d;
+ extern void fake_print_error_parameter_too_many(fake_main_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_parameter_too_many_
/**
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_content_empty_
- extern void fake_print_warning_settings_content_empty(fake_main_t * const main, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_content_empty(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_static_t settings_name) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_content_empty_
/**
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_content_invalid_
- extern void fake_print_warning_settings_content_invalid(fake_main_t * const main, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_content_invalid(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_static_t settings_name) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_content_invalid_
/**
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_content_multiple_
- extern void fake_print_warning_settings_content_multiple(fake_main_t * const main, const f_string_t path_file, const f_string_t name_object) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_content_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t name_object) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_content_multiple_
/**
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_object_multiple_
- extern void fake_print_warning_settings_object_multiple(fake_main_t * const main, const f_string_t path_file, const f_string_t label, const f_string_t name_object) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_object_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t label, const f_string_static_t name_object) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_object_multiple_
#ifdef __cplusplus
f_string_dynamic_t file_data_build_process_post = f_string_dynamic_t_initialize;
f_string_dynamic_t file_data_build_process_pre = f_string_dynamic_t_initialize;
- f_string_dynamic_t content = f_string_dynamic_t_initialize;
if (F_status_is_error_not(status)) {
- content.string = fake_make_skeleton_content_defines_s;
- content.used = fake_make_skeleton_content_defines_s_length;
- content.size = content.used;
-
- status = fake_skeleton_operate_file_create(main, main->file_data_build_defines, F_false, content);
-
- content.used = 0;
+ status = fake_skeleton_operate_file_create(main, main->file_data_build_defines, F_false, fake_make_skeleton_content_defines_s);
}
if (F_status_is_error_not(status)) {
- content.string = fake_make_skeleton_content_dependencies_s;
- content.used = fake_make_skeleton_content_dependencies_s_length;
- content.size = content.used;
-
- status = fake_skeleton_operate_file_create(main, main->file_data_build_dependencies, F_false, content);
-
- content.used = 0;
+ status = fake_skeleton_operate_file_create(main, main->file_data_build_dependencies, F_false, fake_make_skeleton_content_dependencies_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, file_data_build_process_post, F_true, content);
+ status = fake_skeleton_operate_file_create(main, fake_file_data_build_process_post_s, F_true, fake_make_skeleton_content_process_post_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, file_data_build_process_pre, F_true, content);
+ status = fake_skeleton_operate_file_create(main, fake_file_data_build_process_pre_s, F_true, fake_make_skeleton_content_process_pre_s);
}
if (F_status_is_error_not(status)) {
- content.string = fake_make_skeleton_content_settings_s;
- content.used = fake_make_skeleton_content_settings_s_length;
- content.size = content.used;
-
- status = fake_skeleton_operate_file_create(main, main->file_data_build_settings, F_false, content);
-
- content.used = 0;
+ status = fake_skeleton_operate_file_create(main, main->file_data_build_settings, F_false, fake_make_skeleton_content_settings_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_documents_readme, F_false, content);
+ status = fake_skeleton_operate_file_create(main, main->file_documents_readme, F_false, f_string_empty_s);
}
if (F_status_is_error_not(status)) {
- content.string = fake_make_skeleton_content_fakefile_s;
- content.used = fake_make_skeleton_content_fakefile_s_length;
- content.size = content.used;
-
- status = fake_skeleton_operate_file_create(main, main->file_data_build_fakefile, F_false, content);
-
- content.used = 0;
+ status = fake_skeleton_operate_file_create(main, main->file_data_build_fakefile, F_false, fake_make_skeleton_content_fakefile_s);
}
- if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(file_data_build_process_post);
- macro_f_string_dynamic_t_delete_simple(file_data_build_process_pre);
-
- return status;
- }
+ if (F_status_is_error(status)) return status;
return F_none;
}
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
fl_print_format("%[' exists but is not a directory.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_set_fine(status) == F_file_found_not) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
fl_print_format("%[' could not be created, a parent directory does not exist.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (F_status_set_fine(status) == F_file_found_not) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%SThe file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
fl_print_format("%[' could not be created, a parent directory does not exist.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fake.c private-build.c private-build-library.c private-build-load.c private-build-objects.c private-build-program.c private-build-skeleton.c private-clean.c private-common.c private-make.c private-fake.c private-fake-path_generate.c private-make-load_fakefile.c private-make-load_parameters.c private-make-operate.c private-make-operate_process.c private-make-operate_process_type.c private-make-operate_validate.c private-print.c private-skeleton.c
+build_sources_library fake.c common.c private-build.c private-build-library.c private-build-load.c private-build-objects.c private-build-program.c private-build-skeleton.c private-clean.c private-common.c private-make.c private-fake.c private-fake-path_generate.c private-make-load_fakefile.c private-make-load_parameters.c private-make-operate.c private-make-operate_process.c private-make-operate_process_type.c private-make-operate_validate.c private-print.c private-skeleton.c
build_sources_library_shared
build_sources_library_static
build_sources_program main.c
build_sources_program_shared
build_sources_program_static
-build_sources_headers fake.h
+build_sources_headers fake.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
extern "C" {
#endif
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize2(FIREWALL_program_version_s, 0, FIREWALL_program_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+ const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize2(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+ const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize2(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
#ifndef _di_firewall_print_help_
f_status_t firewall_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, firewall_program_name_long_s, firewall_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
fl_print_format("%q%q %[Available Commands:%] ", file.stream, f_string_eol_s, f_string_eol_s, context.set.important, context.set.important);
fl_print_format("%q %[%s%] Turn on the firewall.", file.stream, f_string_eol_s, context.set.standout, firewall_command_start_s, context.set.standout);
if (strncmp("ports", arguments->argv[main->remaining.array[counter]], 6) != 0) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%S'%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
+ fl_print_format("%q%[%Q'%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, arguments->argv[main->remaining.array[counter]], main->warning.notable);
fl_print_format("%[' is not a valid show option.%]%q", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
parameters.array[5].used = 0;
parameters.array[6].used = 0;
- macro_f_string_dynamics_t_delete_simple( parameters);
+ f_string_dynamics_resize(0, & parameters);
firewall_delete_local_data(&local);
firewall_main_delete(main);
firewall_print_error_on_allocation_failure(main->error);
}
else if (status == F_data_not) {
- fll_print_format("%q%[%sCould not find any network devices.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QCould not find any network devices.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
else if (status == F_failure) {
- fll_print_format("%q%[%sFailed to read the device directory '%s'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_devices_s, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QFailed to read the device directory '%s'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_devices_s, main->error.context, f_string_eol_s);
}
}
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sFailed to perform lock request because the lock instructions are missing from: %s.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_path_s firewall_file_other_s, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QFailed to perform lock request because the lock instructions are missing from: %s.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_path_s firewall_file_other_s, main->error.context, f_string_eol_s);
}
firewall_delete_local_data(&local);
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sFailed to perform stop request because the lock instructions are missing from: %s.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_path_s firewall_file_other_s, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QFailed to perform stop request because the lock instructions are missing from: %s.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_path_s firewall_file_other_s, main->error.context, f_string_eol_s);
}
firewall_delete_local_data(&local);
status = firewall_buffer_rules(main, file_path.string, F_true, &local);
- macro_f_string_dynamic_t_delete_simple(file_path);
+ f_string_dynamic_resize(0, &file_path);
}
if (F_status_is_error(status)) {
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sYou did not pass a command.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou did not pass a command.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_parameter);
for (f_array_length_t i = 0; i < firewall_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_string_dynamics_t_delete_simple(main->chains);
- macro_f_array_lengths_t_delete_simple(main->remaining);
- macro_f_string_dynamics_t_delete_simple(main->devices);
+ f_string_dynamics_resize(0, &main->chains);
+ f_type_array_lengths_resize(0, &main->remaining);
+ f_string_dynamics_resize(0, &main->devices);
macro_f_color_context_t_delete_simple(main->context);
* This program processes firewall commands and passes them to iptables from netfiler.org.
*/
#ifndef _firewall_h
+#define _firewall_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/string.h>
#include <fll/level_1/print.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/execute.h>
#include <fll/level_2/fss_basic.h>
#endif
#ifndef _di_firewall_program_version_
- #define firewall_program_version_major_s F_string_ascii_0_s
- #define firewall_program_version_minor_s F_string_ascii_5_s
- #define firewall_program_version_micro_s F_string_ascii_8_s
+ #define FIREWALL_program_version_major_s F_string_ascii_0_s
+ #define FIREWALL_program_version_minor_s F_string_ascii_5_s
+ #define FIREWALL_program_version_micro_s F_string_ascii_8_s
- #ifndef firewall_program_version_nano_prefix_s
- #define firewall_program_version_nano_prefix_s
- #endif
+ #define FIREWALL_program_version_major_s_length F_string_ascii_0_s_length
+ #define FIREWALL_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FIREWALL_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef firewall_program_version_nano_s
- #define firewall_program_version_nano_s
- #endif
+ #if !(defined(FIREWALL_program_version_nano_prefix_s) && defined(FIREWALL_program_version_nano_prefix_s_length))
+ #define FIREWALL_program_version_nano_prefix_s
+ #define FIREWALL_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FIREWALL_program_version_nano_prefix_s) && defined(FIREWALL_program_version_nano_prefix_s_length))
- #define firewall_version_s firewall_program_version_major_s F_string_ascii_period_s firewall_program_version_minor_s F_string_ascii_period_s firewall_program_version_micro_s firewall_program_version_nano_prefix_s firewall_program_version_nano_s
+ #if !(defined(FIREWALL_program_version_nano_s) && defined(FIREWALL_program_version_nano_s_length))
+ #define FIREWALL_program_version_nano_s
+ #define FIREWALL_program_version_nano_s_length 0
+ #endif // !(defined(FIREWALL_program_version_nano_s) && defined(FIREWALL_program_version_nano_s_length))
+
+ #define FIREWALL_version_s FIREWALL_program_version_major_s F_string_ascii_period_s FIREWALL_program_version_minor_s F_string_ascii_period_s FIREWALL_program_version_micro_s FIREWALL_program_version_nano_prefix_s FIREWALL_program_version_nano_s
+
+ #define FIREWALL_version_s_length FIREWALL_program_version_major_s_length + F_string_ascii_period_s_length + FIREWALL_program_version_minor_s_length + F_string_ascii_period_s_length + FIREWALL_program_version_micro_s_length + FIREWALL_program_version_nano_prefix_s_length + FIREWALL_program_version_nano_s_length
+
+ extern const f_string_static_t firewall_program_version_s;
#endif // _di_firewall_program_version_
#ifndef _di_firewall_program_name_
- #define firewall_program_name_s "firewall"
- #define firewall_program_name_long_s "Kevux Firewall Manager"
+ #define FIREWALL_program_name_s "firewall"
+ #define FIREWALL_program_name_long_s "Kevux Firewall Manager"
+
+ #define FIREWALL_program_name_s_length 8
+ #define FIREWALL_program_name_long_s_length 22
+
+ extern const f_string_static_t firewall_program_name_s;
+ extern const f_string_static_t firewall_program_name_long_s;
#endif // _di_firewall_program_name_
#ifndef _di_firewall_paths_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = firewall_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
macro_f_string_dynamic_t_resize(status, device, main->devices.array[local.device].used);
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(device);
+ f_string_dynamic_resize(0, &device);
return status;
}
if (!((++signal_check) % firewall_signal_check_d)) {
if (firewall_signal_received(main)) {
- macro_f_string_dynamic_t_delete_simple(ip_list);
- macro_f_string_dynamic_t_delete_simple(argument);
- macro_f_string_dynamics_t_delete_simple(arguments);
- macro_f_string_dynamic_t_delete_simple(device);
- macro_f_string_dynamic_t_delete_simple(protocol);
+ f_string_dynamic_resize(0, &ip_list);
+ f_string_dynamic_resize(0, &argument);
+ f_string_dynamics_resize(0, &arguments);
+ f_string_dynamic_resize(0, &device);
+ f_string_dynamic_resize(0, &protocol);
return F_status_set_error(F_interrupt);
}
is_ip_list = F_false;
ip_list_direction = F_false;
- macro_f_string_dynamic_t_delete_simple(ip_list);
+ f_string_dynamic_resize(0, &ip_list);
// process chain rule
if (length >= firewall_chain_length_s && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_chain_s, length, firewall_chain_length_s) == F_equal_to) {
if (chain == firewall_chain_custom_id_e) {
// custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain.
- fll_print_format("%q%[%sAt line %ul, the chain option is meaningless inside of a custom chain.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
+ fll_print_format("%q%[%QAt line %ul, the chain option is meaningless inside of a custom chain.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
continue;
}
invalid = F_true;
}
else if (length >= firewall_device_all_s_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_all_s, length, firewall_device_all_s_length) == F_equal_to) {
- macro_f_string_dynamic_t_delete_simple(device);
+ f_string_dynamic_resize(0, &device);
+
device_all = F_true;
+
continue;
}
else if (length >= firewall_device_this_s_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_this_s, length, firewall_device_this_s_length) == F_equal_to) {
device.used = main->devices.array[local.device].used;
}
else {
- macro_f_string_dynamic_t_delete_simple(device);
+ f_string_dynamic_resize(0, &device);
}
device_all = F_false;
+
continue;
}
if (!invalid) {
if (length > 0) {
if (length > device.size) {
- macro_f_string_dynamic_t_resize(status, device, length);
-
+ status = f_string_dynamic_resize(length, &device);
if (F_status_is_error(status)) break;
}
device.used = length;
}
else {
- macro_f_string_dynamic_t_delete_simple(device);
+ f_string_dynamic_resize(0, &device);
}
device_all = F_false;
+
continue;
}
}
use_protocol = F_false;
}
else if (length > 0) {
- macro_f_string_dynamic_t_delete_simple(protocol);
- macro_f_string_dynamic_t_resize(status, protocol, length);
+ status = f_string_dynamic_resize(length, &potocol);
if (F_status_is_error(status)) break;
if (length) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%sAt line %ul, the object '%]%[", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, main->warning.notable);
+ fl_print_format("%q%[%QAt line %ul, the object '%]%[", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, main->warning.notable);
f_print(local.buffer.string + local.rule_objects.array[i].start, length, main->warning.to.stream);
fl_print_format("%]%[' is invalid.%]%q", main->warning.to.stream, main->warning.notable, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
else {
- fll_print_format("%q%[%sAt line %ul, the object is missing.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
+ fll_print_format("%q%[%QAt line %ul, the object is missing.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
}
continue;
if (length) {
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%sAt line %ul, the object '%]%[", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, main->warning.notable);
+ fl_print_format("%q%[%QAt line %ul, the object '%]%[", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, main->warning.notable);
f_print(local.buffer.string + local.rule_objects.array[i].start, length, main->warning.to.stream);
fl_print_format("%]%[' has invalid content '%]%[", main->warning.to.stream, main->warning.notable, main->warning.context, main->warning.context, main->warning.notable);
f_print(local.buffer.string + local.rule_contents.array[i].array[0].start, macro_firewall_structure_size(local.rule_contents.array[i], 0), main->warning.to.stream);
funlockfile(main->warning.to.stream);
}
else {
- fll_print_format("%q%[%sAt line %ul, the object has no content.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
+ fll_print_format("%q%[%QAt line %ul, the object has no content.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
}
continue;
}
}
- macro_f_string_dynamic_t_delete_simple(argument);
+ f_string_dynamic_resize(0, &argument);
if (F_status_is_error(status)) break;
if (argument.used > 0) {
macro_firewall_append_argument_to_arguments(status, arguments, argument)
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(argument);
+ f_string_dynamic_resize(0, &argument);
+
break;
}
flockfile(main->warning.to.stream);
- fl_print_format("%q%[%sAt line %ul, the object '%]%[", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, main->warning.notable);
+ fl_print_format("%q%[%QAt line %ul, the object '%]%[", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, main->warning.notable);
f_print(local.buffer.string + local.rule_objects.array[i].start, length, main->warning.to.stream);
fl_print_format("%]%[' has no content.%]%q", main->warning.to.stream, main->warning.notable, main->warning.context, main->warning.context, f_string_eol_s);
// the file does not have to exist
if (main->error.verbosity != f_console_verbosity_verbose_e || main->error.verbosity == f_console_verbosity_debug_e) {
- fll_print_format("%q%[%sCannot find the file '%Q'.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, file_path, main->warning.context, f_string_eol_s);
+ fll_print_format("%q%[%QCannot find the file '%Q'.%]%q", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, file_path, main->warning.context, f_string_eol_s);
}
status = F_none;
}
else if (status == F_file_open) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sUnable to open the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QUnable to open the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
}
}
else if (status == F_file_descriptor) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sFile descriptor error while trying to open the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QFile descriptor error while trying to open the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
}
}
else if (status == F_memory_not) {
firewall_print_error_on_invalid_parameter(main->error, "f_file_read");
}
else if (status == F_number_overflow) {
- fll_print_format("%q%[%sInteger overflow while trying to buffer the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QInteger overflow while trying to buffer the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
}
else if (status == F_file_closed) {
- fll_print_format("%q%[%sThe file '%Q' is no longer open.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe file '%Q' is no longer open.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
}
else if (status == F_file_seek) {
- fll_print_format("%q%[%sA seek error occurred while accessing the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QA seek error occurred while accessing the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
}
else if (status == F_file_read) {
- fll_print_format("%q%[%sA read error occurred while accessing the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QA read error occurred while accessing the file '%Q'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, file_path, main->error.context, f_string_eol_s);
}
else if (status == F_memory_not) {
firewall_print_error_on_allocation_failure(main->error);
if (F_status_is_error(status)) {
firewall_print_error_on_allocation_failure(main->error);
- macro_f_string_dynamic_t_delete_simple(ip_list_action);
+ f_string_dynamic_resize(0, &ip_list_action);
}
else {
f_string_dynamic_t ip_argument = f_string_dynamic_t_initialize;
macro_firewall_append_argument_to_arguments(status, arguments, ip_list_action)
if (F_status_is_error(status)) {
- macro_f_string_dynamic_t_delete_simple(ip_argument);
+ f_string_dynamic_resize(0, &ip_argument);
+
break;
}
status = fll_execute_program((f_string_t) current_tool, arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
+ // Immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- macro_f_string_dynamic_t_delete_simple(ip_list);
- macro_f_string_dynamic_t_delete_simple(argument);
- macro_f_string_dynamics_t_delete_simple(arguments);
- macro_f_string_dynamic_t_delete_simple(device);
- macro_f_string_dynamic_t_delete_simple(protocol);
+ f_string_dynamic_resize(0, &ip_list);
+ f_string_dynamic_resize(0, &argument);
+ f_string_dynamics_resize(0, &arguments);
+ f_string_dynamic_resize(0, &device);
+ f_string_dynamic_resize(0, &protocol);
exit(return_code);
}
firewall_print_error_on_unhandled(main->error, "fll_execute_program", status);
}
- // remove ip_argument from arguments string.
- macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]);
+ // Remove ip_argument from arguments string.
+ f_string_dynamic_resize(0, &arguments.array[arguments.used--]);
break;
}
- // remove ip_argument from arguments string.
- macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]);
+ // Remove ip_argument from arguments string.
+ f_string_dynamic_resize(0, &arguments.array[arguments.used--]);
} // for
- macro_f_string_dynamic_t_delete_simple(ip_argument);
+ f_string_dynamic_resize(0, &ip_argument);
- // remove ip_list_action from arguments string.
- macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]);
+ // Remove ip_list_action from arguments string.
+ f_string_dynamic_resize(0, &arguments.array[arguments.used--]);
}
}
}
}
- macro_f_string_dynamic_t_delete_simple(local_buffer);
- macro_f_string_dynamic_t_delete_simple(file_path);
+ f_string_dynamic_resize(0, &local_buffer);
+ f_string_dynamic_resize(0, &file_path);
macro_f_fss_objects_t_delete_simple(basic_objects);
macro_f_fss_contents_t_delete_simple(basic_contents);
// immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- macro_f_string_dynamic_t_delete_simple(ip_list);
- macro_f_string_dynamic_t_delete_simple(argument);
- macro_f_string_dynamics_t_delete_simple(arguments);
- macro_f_string_dynamic_t_delete_simple(device);
- macro_f_string_dynamic_t_delete_simple(protocol);
+ f_string_dynamic_resize(0, &ip_list);
+ f_string_dynamic_resize(0, &argument);
+ f_string_dynamics_resize(0, &arguments);
+ f_string_dynamic_resize(0, &device);
+ f_string_dynamic_resize(0, &protocol);
exit(return_code);
}
} // for
} // for
- macro_f_string_dynamic_t_delete_simple(ip_list);
- macro_f_string_dynamic_t_delete_simple(argument);
- macro_f_string_dynamics_t_delete_simple(arguments);
- macro_f_string_dynamic_t_delete_simple(device);
- macro_f_string_dynamic_t_delete_simple(protocol);
+ f_string_dynamic_resize(0, &ip_list);
+ f_string_dynamic_resize(0, &argument);
+ f_string_dynamics_resize(0, &arguments);
+ f_string_dynamic_resize(0, &device);
+ f_string_dynamic_resize(0, &protocol);
return status;
}
f_string_dynamic_t fixed_string = f_string_dynamic_t_initialize;
- macro_f_array_lengths_t_delete_simple(local->chain_ids);
+ f_type_array_lengths_resize(0, &local->chain_ids);
macro_f_array_lengths_t_resize(status, local->chain_ids, local->chain_objects.used);
if (F_status_is_error(status)) {
status = f_string_dynamic_resize(firewall_chain_create_command_s_length + 1, &arguments.array[0]);
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
if (F_status_is_error(status)) {
arguments.used = 1;
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
if (!((++signal_check) % firewall_signal_check_d)) {
if (firewall_signal_received(main)) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return F_status_set_error(F_interrupt);
}
macro_f_string_dynamics_t_resize(status, main->chains, main->chains.used + firewall_default_allocation_step_d);
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
macro_f_string_dynamic_t_resize(status, arguments.array[1], length + 1);
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
macro_f_string_dynamic_t_resize(status, main->chains.array[main->chains.used], length + 1);
if (F_status_is_error(status)) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
// immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
exit(return_code);
}
status = firewall_signal_received(main);
if (status) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return F_status_set_error(F_interrupt);
}
// immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
exit(return_code);
}
firewall_print_error_on_unhandled(main->error, "fll_execute_program", status);
}
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
}
++i;
} // while
- macro_f_string_dynamics_t_delete_simple(arguments);
+ f_string_dynamics_resize(0, &arguments);
return status;
}
firewall_print_error_on_invalid_parameter(main->error, "f_file_open");
}
else if (status == F_file_found_not) {
- fll_print_format("%q%[%sUnable to find the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QUnable to find the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_file_open) {
- fll_print_format("%q%[%sUnable to open the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QUnable to open the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_file_descriptor) {
- fll_print_format("%q%[%sFile descriptor error while trying to open the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QFile descriptor error while trying to open the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else {
firewall_print_error_on_unhandled(main->error, "f_file_open", status);
firewall_print_error_on_invalid_parameter(main->error, "f_file_read");
}
else if (status == F_number_overflow) {
- fll_print_format("%q%[%sInteger overflow while trying to buffer the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QInteger overflow while trying to buffer the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_file_closed) {
- fll_print_format("%q%[%sThe file '%S' is no longer open.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe file '%S' is no longer open.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_file_seek) {
- fll_print_format("%q%[%sA seek error occurred while accessing the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QA seek error occurred while accessing the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_file_read) {
- fll_print_format("%q%[%sA read error occurred while accessing the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QA read error occurred while accessing the file '%S'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_memory_not) {
firewall_print_error_on_allocation_failure(main->error);
firewall_print_error_on_invalid_parameter_for_file(main->error, "fll_fss_basic_list_read", filename);
}
else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
- fll_print_format("%q%[%sNo relevant main was found within the file '%s'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QNo relevant main was found within the file '%s'.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
}
else if (status == F_memory_not) {
firewall_print_error_on_allocation_failure(main->error);
macro_f_fss_objects_t_delete_simple(local->rule_objects);
macro_f_fss_contents_t_delete_simple(local->rule_contents);
+
return status;
}
local->device = 0;
local->chain = 0;
- macro_f_string_dynamic_t_delete_simple(local->buffer);
- macro_f_array_lengths_t_delete_simple(local->chain_ids);
+ f_string_dynamic_resize(0, &local->buffer);
+ f_type_array_lengths_resize(0, &local->chain_ids);
macro_f_fss_objects_t_delete_simple(local->chain_objects);
macro_f_fss_contents_t_delete_simple(local->chain_contents);
macro_f_fss_objects_t_delete_simple(local->rule_objects);
extern "C" {
#endif
+#ifndef _di_fss_basic_list_program_version_
+ const f_string_static_t fss_basic_list_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_program_version_s, 0, FSS_BASIC_LIST_program_version_s_length);
+#endif // _di_fss_basic_list_program_version_
+
+#ifndef _di_fss_basic_list_program_name_
+ const f_string_static_t fss_basic_list_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_program_name_s, 0, FSS_BASIC_LIST_program_name_s_length);
+ const f_string_static_t fss_basic_list_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_program_name_long_s, 0, FSS_BASIC_LIST_program_name_long_s_length);
+#endif // _di_fss_basic_list_program_name_
+
#ifndef _di_fss_basic_list_read_print_help_
f_status_t fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_list_program_name_long_s, fss_basic_list_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric index.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Content (default).");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of columns.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate how to handle applying delimits.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric depth.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include empty Content when processing.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Content at the given line.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Object.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print using the special pipe format.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print with the original quotes and escapes.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select sub-Content at this index.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of lines.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names on select or print.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
fll_program_print_help_usage(file, context, fss_basic_list_program_name_s, "filename(s)");
fss_basic_list_read_parameter_delimit_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_basic_list_read_long_at_s,
fss_basic_list_read_long_depth_s,
fss_basic_list_read_long_line_s,
if (main->parameters[parameter_code[i]].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' requires a %s.%]%q", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_line_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_line_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
location = main->parameters[fss_basic_list_read_parameter_delimit_e].values.array[i];
- length = strnlen(arguments->argv[location], f_console_parameter_size);
+ length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (!length) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, main->error.notable);
fl_print_format("%[' must not be empty.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, main->error.notable);
fl_print_format("%[' parameter requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_basic_list_read_data_delete_simple(&data);
}
else {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
for (f_array_length_t i = 0; i < fss_basic_list_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
return F_none;
* This processes in accordance to the FSS-0002 Basic List specification.
*/
#ifndef _fss_basic_list_read_h
+#define _fss_basic_list_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/fss_basic_list.h>
#endif
#ifndef _di_fss_basic_list_read_program_version_
- #define fss_basic_list_program_version_major_s F_string_ascii_0_s
- #define fss_basic_list_program_version_minor_s F_string_ascii_5_s
- #define fss_basic_list_program_version_micro_s F_string_ascii_8_s
+ #define FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_0_s
+ #define FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_5_s
+ #define FSS_BASIC_LIST_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_basic_list_program_version_nano_prefix_s
- #define fss_basic_list_program_version_nano_prefix_s
- #endif
+ #define FSS_BASIC_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_BASIC_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_BASIC_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_basic_list_program_version_nano_s
- #define fss_basic_list_program_version_nano_s
- #endif
+ #if !(defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length))
+ #define FSS_BASIC_LIST_READ_program_version_nano_prefix_s
+ #define FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length))
- #define fss_basic_list_program_version_s fss_basic_list_program_version_major_s F_string_ascii_period_s fss_basic_list_program_version_minor_s F_string_ascii_period_s fss_basic_list_program_version_micro_s fss_basic_list_program_version_nano_prefix_s fss_basic_list_program_version_nano_s
+ #if !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
+ #define FSS_BASIC_LIST_READ_program_version_nano_s
+ #define FSS_BASIC_LIST_READ_program_version_nano_s_length 0
+ #endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
+
+ #define FSS_BASIC_LIST_READ_program_version_s FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_micro_s fss_basic_list_program_version_nano_prefix_s FSS_BASIC_LIST_READ_program_version_nano_s
+
+ #define FSS_BASIC_LIST_READ_program_version_s_length FSS_BASIC_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_micro_s_length + fss_basic_list_program_version_nano_prefix_s_length + FSS_BASIC_LIST_READ_program_version_nano_s_length
+
+ extern const f_string_static_t fss_basic_list_program_version_s;
#endif // _di_fss_basic_list_read_program_version_
#ifndef _di_fss_basic_list_read_program_name_
- #define fss_basic_list_program_name_s "fss_basic_list_read"
- #define fss_basic_list_program_name_long_s "FSS Basic List Read"
+ #define FSS_BASIC_LIST_READ_program_name_s "fss_basic_list_read"
+ #define FSS_BASIC_LIST_READ_program_name_long_s "FSS Basic List Read"
+
+ #define FSS_BASIC_LIST_READ_program_name_s_length 19
+ #define FSS_BASIC_LIST_READ_program_name_long_s_length 19
+
+ extern const f_string_static_t fss_basic_list_program_name_s;
+ extern const f_string_static_t fss_basic_list_program_name_long_s;
#endif // _di_fss_basic_list_read_program_name_
#ifndef _di_fss_basic_list_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_basic_list_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
fss_basic_list_read_depths_resize(0, &data->depths);
- macro_f_string_dynamic_t_delete_simple(data->buffer);
+ f_string_dynamic_resize(0, &data->buffer);
macro_f_fss_contents_t_delete_simple(data->contents);
macro_f_fss_objects_t_delete_simple(data->objects);
macro_f_fss_delimits_t_delete_simple(data->delimits_object);
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, main->error.notable);
fl_print_format("%[' may not have the value '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' before the value '%]", main->error.to.stream, main->error.context, main->error.context);
if (main->parameters[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], f_console_parameter_size));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
extern "C" {
#endif
+#ifndef _di_fss_basic_list_write_program_version_
+ const f_string_static_t fss_basic_list_write_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_WRITE_program_version_s, 0, FSS_BASIC_LIST_WRITE_program_version_s_length);
+#endif // _di_fss_basic_list_write_program_version_
+
+#ifndef _di_fss_basic_list_write_program_name_
+ const f_string_static_t fss_basic_list_write_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_WRITE_program_name_s, 0, FSS_BASIC_LIST_WRITE_program_name_s_length);
+ const f_string_static_t fss_basic_list_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_LIST_WRITE_program_name_long_s, 0, FSS_BASIC_LIST_WRITE_program_name_long_s_length);
+#endif // _di_fss_basic_list_write_program_name_
+
#ifndef _di_fss_basic_list_write_print_help_
f_status_t fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_list_write_program_name_long_s, fss_basic_list_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The Content to file.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Ignore a given range within a Content.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The Object to file.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Do not file end of Object/Content character.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Prepend the given whitespace characters to the start of each multi-line Content.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
- fll_program_print_help_option(file, context, fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names.");
fll_program_print_help_usage(file, context, fss_basic_list_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
else if (main->parameters[fss_basic_list_write_parameter_file_e].result == f_console_result_found_e) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_list_write_long_file_s);
+ fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used || main->parameters[fss_basic_list_write_parameter_content_e].locations.used) {
if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used) {
if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used != main->parameters[fss_basic_list_write_parameter_object_e].values.used) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_list_write_long_object_s);
+ fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used != main->parameters[fss_basic_list_write_parameter_content_e].values.used) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_list_write_long_content_s);
+ fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_basic_list_write_parameter_object_e].locations.used != main->parameters[fss_basic_list_write_parameter_content_e].locations.used && main->parameters[fss_basic_list_write_parameter_partial_e].result == f_console_result_none_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter only allows either the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter or the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter, but not both.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must be specified before a '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used) {
if (main->parameters[fss_basic_list_write_parameter_content_e].locations.used != main->parameters[fss_basic_list_write_parameter_content_e].values.used) {
- fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_list_write_long_content_s);
+ fss_basic_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_basic_list_write_parameter_partial_e].locations.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter cannot be used when processing a pipe.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_basic_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_basic_list_write_parameter_prepend_e].values.array[main->parameters[fss_basic_list_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
if (length) {
f_string_range_t range = macro_f_string_range_t_initialize(length);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must only contain whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, main->error.notable);
fl_print_format("%[' was specified, but no values were given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (total_locations * 2 > total_arguments) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, main->error.notable);
fl_print_format("%[' requires two values.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
object.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
status = fss_basic_list_write_process(main, output, quote, &object, 0, &buffer);
}
content.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_basic_list_write_process(main, output, quote, 0, &content, &buffer);
}
object.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
content.string = arguments->argv[main->parameters[fss_basic_list_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_basic_list_write_process(main, output, quote, &object, &content, &buffer);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
// Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
object.string = 0;
}
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
fss_basic_list_write_main_delete(main);
return status;
for (f_array_length_t i = 0; i < fss_basic_list_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides fss basic list write functionality.
*/
#ifndef _fss_basic_list_write_h
+#define _fss_basic_list_write_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/fss_basic_list.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#endif
#ifndef _di_fss_basic_list_write_program_version_
- #define fss_basic_list_write_program_version_major_s F_string_ascii_0_s
- #define fss_basic_list_write_program_version_minor_s F_string_ascii_5_s
- #define fss_basic_list_write_program_version_micro_s F_string_ascii_8_s
+ #define FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_0_s
+ #define FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define FSS_BASIC_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_basic_list_write_program_version_nano_prefix_s
- #define fss_basic_list_write_program_version_nano_prefix_s
- #endif
+ #define FSS_BASIC_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_BASIC_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_BASIC_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_basic_list_write_program_version_nano_s
- #define fss_basic_list_write_program_version_nano_s
- #endif
+ #if !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length))
+ #define FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s
+ #define FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length))
- #define fss_basic_list_write_program_version_s fss_basic_list_write_program_version_major_s F_string_ascii_period_s fss_basic_list_write_program_version_minor_s F_string_ascii_period_s fss_basic_list_write_program_version_micro_s fss_basic_list_write_program_version_nano_prefix_s fss_basic_list_write_program_version_nano_s
+ #if !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_s_length))
+ #define FSS_BASIC_LIST_WRITE_program_version_nano_s
+ #define FSS_BASIC_LIST_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_s_length))
+
+ #define FSS_BASIC_LIST_WRITE_program_version_s FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_WRITE_program_version_micro_s FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s FSS_BASIC_LIST_WRITE_program_version_nano_s
+
+ #define FSS_BASIC_LIST_WRITE_program_version_s_length FSS_BASIC_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_WRITE_program_version_micro_s_length + FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length + FSS_BASIC_LIST_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t fss_basic_list_write_program_version_s;
#endif // _di_fss_basic_list_write_program_version_
#ifndef _di_fss_basic_list_write_program_name_
- #define fss_basic_list_write_program_name_s "fss_basic_list_write"
- #define fss_basic_list_write_program_name_long_s "FSS Basic List Write"
+ #define FSS_BASIC_LIST_WRITE_program_name_s "fss_basic_list_write"
+ #define FSS_BASIC_LIST_WRITE_program_name_long_s "FSS Basic List Write"
+
+ #define FSS_BASIC_LIST_WRITE_program_name_s_length 20
+ #define FSS_BASIC_LIST_WRITE_program_name_long_s_length 20
+
+ extern const f_string_static_t fss_basic_list_write_program_name_s;
+ extern const f_string_static_t fss_basic_list_write_program_name_long_s;
#endif // _di_fss_basic_list_write_program_name_
#ifndef _di_fss_basic_list_write_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_basic_list_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[' in objects.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
#endif // _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_basic_list_write_error_parameter_value_missing_print_
- void fss_basic_list_write_error_parameter_value_missing_print(fss_basic_list_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_basic_list_write_error_parameter_value_missing_print(fss_basic_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
status = fss_basic_list_write_process(main, output, quote, &object, &content, buffer);
}
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
return status;
}
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_basic_list_write_error_parameter_value_missing_print_
- void fss_basic_list_write_error_parameter_value_missing_print(fss_basic_list_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_basic_list_write_error_parameter_value_missing_print(fss_basic_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_error_parameter_value_missing_print_
/**
extern "C" {
#endif
+#ifndef _di_fss_basic_read_program_version_
+ const f_string_static_t fss_basic_read_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_READ_program_version_s, 0, FSS_BASIC_READ_program_version_s_length);
+#endif // _di_fss_basic_read_program_version_
+
+#ifndef _di_fss_basic_read_program_name_
+ const f_string_static_t fss_basic_read_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_READ_program_name_s, 0, FSS_BASIC_READ_program_name_s_length);
+ const f_string_static_t fss_basic_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_READ_program_name_long_s, 0, FSS_BASIC_READ_program_name_long_s_length);
+#endif // _di_fss_basic_read_program_name_
+
#ifndef _di_fss_basic_read_print_help_
f_status_t fss_basic_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_read_program_name_long_s, fss_basic_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_basic_read_short_at_s, fss_basic_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric index.");
- fll_program_print_help_option(file, context, fss_basic_read_short_content_s, fss_basic_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Content (default).");
- fll_program_print_help_option(file, context, fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of columns.");
- fll_program_print_help_option(file, context, fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate how to handle applying delimits.");
- fll_program_print_help_option(file, context, fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric depth.");
- fll_program_print_help_option(file, context, fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include empty Content when processing.");
- fll_program_print_help_option(file, context, fss_basic_read_short_line_s, fss_basic_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Content at the given line.");
- fll_program_print_help_option(file, context, fss_basic_read_short_name_s, fss_basic_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_basic_read_short_object_s, fss_basic_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Object.");
- fll_program_print_help_option(file, context, fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print using the special pipe format.");
- fll_program_print_help_option(file, context, fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print with the original quotes and escapes.");
- fll_program_print_help_option(file, context, fss_basic_read_short_select_s, fss_basic_read_long_select_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select sub-Content at this index.");
- fll_program_print_help_option(file, context, fss_basic_read_short_total_s, fss_basic_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of lines.");
- fll_program_print_help_option(file, context, fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names on select or print.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_at_s, fss_basic_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_content_s, fss_basic_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(file, context, fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_line_s, fss_basic_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_name_s, fss_basic_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_object_s, fss_basic_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_select_s, fss_basic_read_long_select_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_total_s, fss_basic_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
fll_program_print_help_usage(file, context, fss_basic_read_program_name_s, "filename(s)");
if (main->parameters[parameter_code[i]].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
- fl_print_format("%[' requires a %s.%]%q", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%[' requires a %q.%]%q", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_columns_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_columns_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_basic_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_line_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_line_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
location = main->parameters[fss_basic_read_parameter_delimit_e].values.array[i];
- length = strnlen(arguments->argv[location], f_console_parameter_size);
+ length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (!length) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, main->error.notable);
fl_print_format("%[' must not be empty.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, main->error.notable);
fl_print_format("%[' parameter requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_basic_read_data_delete_simple(&data);
}
else {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
for (f_array_length_t i = 0; i < fss_basic_read_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
return F_none;
* This processes in accordance to the FSS-0000 Basic specification.
*/
#ifndef _fss_basic_read_h
+#define _fss_basic_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/fss_basic.h>
#endif
#ifndef _di_fss_basic_read_program_version_
- #define fss_basic_read_program_version_major_s F_string_ascii_0_s
- #define fss_basic_read_program_version_minor_s F_string_ascii_5_s
- #define fss_basic_read_program_version_micro_s F_string_ascii_8_s
+ #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s
+ #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s
+ #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_basic_read_program_version_nano_prefix_s
- #define fss_basic_read_program_version_nano_prefix_s
- #endif
+ #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s_length
+ #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s_length
+ #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s_length
- #ifndef fss_basic_read_program_version_nano_s
- #define fss_basic_read_program_version_nano_s
- #endif
+ #if !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
+ #define FSS_BASIC_READ_program_version_nano_prefix_s
+ #define FSS_BASIC_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
- #define fss_basic_read_program_version_s fss_basic_read_program_version_major_s F_string_ascii_period_s fss_basic_read_program_version_minor_s F_string_ascii_period_s fss_basic_read_program_version_micro_s fss_basic_read_program_version_nano_prefix_s fss_basic_read_program_version_nano_s
+ #if !(defined(FSS_BASIC_READ_program_version_nano_s) && defined(FSS_BASIC_READ_program_version_nano_s_length))
+ #define FSS_BASIC_READ_program_version_nano_s
+ #define FSS_BASIC_READ_program_version_nano_s_length 0
+ #endif // !(defined(FSS_BASIC_READ_program_version_nano_s) && defined(FSS_BASIC_READ_program_version_nano_s_length))
+
+ #define FSS_BASIC_READ_program_version_s FSS_BASIC_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_READ_program_version_micro_s FSS_BASIC_READ_program_version_nano_prefix_s FSS_BASIC_READ_program_version_nano_s
+
+ #define FSS_BASIC_READ_program_version_s_length FSS_BASIC_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_READ_program_version_micro_s_length + FSS_BASIC_READ_program_version_nano_prefix_s_length + FSS_BASIC_READ_program_version_nano_s_length
+
+ extern const f_string_static_t fss_basic_read_program_version_s;
#endif // _di_fss_basic_read_program_version_
#ifndef _di_fss_basic_read_program_name_
- #define fss_basic_read_program_name_s "fss_basic_read"
- #define fss_basic_read_program_name_long_s "FSS Basic Read"
+ #define FSS_BASIC_READ_program_name_s "fss_basic_read"
+ #define FSS_BASIC_READ_program_name_long_s "FSS Basic Read"
+
+ #define FSS_BASIC_READ_program_name_s_length 14
+ #define FSS_BASIC_READ_program_name_long_s_length 14
+
+ extern const f_string_static_t fss_basic_read_program_name_s;
+ extern const f_string_static_t fss_basic_read_program_name_long_s;
#endif // _di_fss_basic_read_program_name_
#ifndef _di_fss_basic_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_basic_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
fss_basic_read_depths_resize(0, &data->depths);
- macro_f_string_dynamic_t_delete_simple(data->buffer);
+ f_string_dynamic_resize(0, &data->buffer);
macro_f_fss_contents_t_delete_simple(data->contents);
macro_f_fss_objects_t_delete_simple(data->objects);
macro_f_fss_delimits_t_delete_simple(data->delimits);
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, main->error.notable);
fl_print_format("%[' may not have the value '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' before the value '%]", main->error.to.stream, main->error.context, main->error.context);
if (main->parameters[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], f_console_parameter_size));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
extern "C" {
#endif
+#ifndef _di_byte_dump_program_version_
+ const f_string_static_t fss_basic_write_program_version_s = macro_f_string_static_t_initialize2(FSS_BASIC_WRITE_program_version_s, 0, FSS_BASIC_WRITE_program_version_s_length);
+#endif // _di_byte_dump_program_version_
+
+#ifndef _di_byte_dump_program_name_
+ const f_string_static_t fss_basic_write_program_name_s = macro_f_string_static_t_initialize2(FSS_BASIC_WRITE_program_name_s, 0, FSS_BASIC_WRITE_program_name_s_length);
+ const f_string_static_t fss_basic_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_BASIC_WRITE_program_name_long_s, 0, FSS_BASIC_WRITE_program_name_long_s_length);
+#endif // _di_byte_dump_program_name_
+
#ifndef _di_fss_basic_write_print_help_
f_status_t fss_basic_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_write_program_name_long_s, fss_basic_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_basic_write_short_file_s, fss_basic_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, fss_basic_write_short_content_s, fss_basic_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The Content to file.");
- fll_program_print_help_option(file, context, fss_basic_write_short_double_s, fss_basic_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Ignore a given range within a Content.");
- fll_program_print_help_option(file, context, fss_basic_write_short_object_s, fss_basic_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The Object to file.");
- fll_program_print_help_option(file, context, fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Do not file end of Object/Content character.");
- fll_program_print_help_option(file, context, fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Prepend the given whitespace characters to the start of each multi-line Content.");
- fll_program_print_help_option(file, context, fss_basic_write_short_single_s, fss_basic_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
- fll_program_print_help_option(file, context, fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_file_s, fss_basic_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_content_s, fss_basic_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_double_s, fss_basic_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_object_s, fss_basic_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_single_s, fss_basic_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names.");
fll_program_print_help_usage(file, context, fss_basic_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
else if (main->parameters[fss_basic_write_parameter_file_e].result == f_console_result_found_e) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_write_long_file_s);
+ fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
if (main->parameters[fss_basic_write_parameter_object_e].locations.used || main->parameters[fss_basic_write_parameter_content_e].locations.used) {
if (main->parameters[fss_basic_write_parameter_object_e].locations.used) {
if (main->parameters[fss_basic_write_parameter_object_e].locations.used != main->parameters[fss_basic_write_parameter_object_e].values.used) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_write_long_object_s);
+ fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_object_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_basic_write_parameter_content_e].locations.used != main->parameters[fss_basic_write_parameter_content_e].values.used) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_write_long_content_s);
+ fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_basic_write_parameter_object_e].locations.used != main->parameters[fss_basic_write_parameter_content_e].locations.used && main->parameters[fss_basic_write_parameter_partial_e].result == f_console_result_none_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter only allows either the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter or the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter, but not both.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must be specified before a '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_basic_write_parameter_content_e].locations.used) {
if (main->parameters[fss_basic_write_parameter_content_e].locations.used != main->parameters[fss_basic_write_parameter_content_e].values.used) {
- fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_basic_write_long_content_s);
+ fss_basic_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_basic_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_basic_write_parameter_partial_e].locations.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter cannot be used when processing a pipe.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_basic_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_basic_write_parameter_prepend_e].values.array[main->parameters[fss_basic_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
// Even though this standard does not utilize this parameter, provide the validation for consistency.
if (length) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must only contain whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, main->error.notable);
fl_print_format("%[' was specified, but no values were given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (total_locations * 2 > total_arguments) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, main->error.notable);
fl_print_format("%[' requires two values.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
object.string = arguments->argv[main->parameters[fss_basic_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
status = fss_basic_write_process(main, output, quote, &object, 0, &buffer);
}
content.string = arguments->argv[main->parameters[fss_basic_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_basic_write_process(main, output, quote, 0, &content, &buffer);
}
object.string = arguments->argv[main->parameters[fss_basic_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
content.string = arguments->argv[main->parameters[fss_basic_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_basic_write_process(main, output, quote, &object, &content, &buffer);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
// Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
object.string = 0;
}
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
fss_basic_write_main_delete(main);
return status;
for (f_array_length_t i = 0; i < fss_basic_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides fss basic write functionality.
*/
#ifndef _fss_basic_write_h
+#define _fss_basic_write_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/fss_basic.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/fss_basic.h>
#include <fll/level_2/print.h>
#endif
#ifndef _di_fss_basic_write_program_version_
- #define fss_basic_write_program_version_major_s F_string_ascii_0_s
- #define fss_basic_write_program_version_minor_s F_string_ascii_5_s
- #define fss_basic_write_program_version_micro_s F_string_ascii_8_s
+ #define FSS_BASIC_WRITE_program_version_major_s F_string_ascii_0_s
+ #define FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define FSS_BASIC_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_basic_write_program_version_nano_prefix_s
- #define fss_basic_write_program_version_nano_prefix_s
- #endif
+ #define FSS_BASIC_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_BASIC_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_BASIC_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_basic_write_program_version_nano_s
- #define fss_basic_write_program_version_nano_s
- #endif
+ #if !(defined(FSS_BASIC_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_WRITE_program_version_nano_prefix_s_length))
+ #define FSS_BASIC_WRITE_program_version_nano_prefix_s
+ #define FSS_BASIC_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_BASIC_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_WRITE_program_version_nano_prefix_s_length))
- #define fss_basic_write_program_version_s fss_basic_write_program_version_major_s F_string_ascii_period_s fss_basic_write_program_version_minor_s F_string_ascii_period_s fss_basic_write_program_version_micro_s fss_basic_write_program_version_nano_prefix_s fss_basic_write_program_version_nano_s
+ #if !(defined(FSS_BASIC_WRITE_program_version_nano_s) && defined(FSS_BASIC_WRITE_program_version_nano_s_length))
+ #define FSS_BASIC_WRITE_program_version_nano_s
+ #define FSS_BASIC_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(FSS_BASIC_WRITE_program_version_nano_s) && defined(FSS_BASIC_WRITE_program_version_nano_s_length))
+
+ #define FSS_BASIC_WRITE_program_version_s FSS_BASIC_WRITE_program_version_major_s F_string_ascii_period_s FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_period_s FSS_BASIC_WRITE_program_version_micro_s FSS_BASIC_WRITE_program_version_nano_prefix_s FSS_BASIC_WRITE_program_version_nano_s
+
+ #define FSS_BASIC_WRITE_program_version_s_length FSS_BASIC_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_WRITE_program_version_micro_s_length + FSS_BASIC_WRITE_program_version_nano_prefix_s_length + FSS_BASIC_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t fss_basic_write_program_version_s;
#endif // _di_fss_basic_write_program_version_
#ifndef _di_fss_basic_write_program_name_
- #define fss_basic_write_program_name_s "fss_basic_write"
- #define fss_basic_write_program_name_long_s "FSS Basic Write"
+ #define FSS_BASIC_WRITE_program_name_s "fss_basic_write"
+ #define FSS_BASIC_WRITE_program_name_long_s "FSS Basic Write"
+
+ #define FSS_BASIC_WRITE_program_name_s_length 15
+ #define FSS_BASIC_WRITE_program_name_long_s_length 15
+
+ extern const f_string_static_t fss_basic_write_program_name_s;
+ extern const f_string_static_t fss_basic_write_program_name_long_s;
#endif // _di_fss_basic_write_program_name_
#ifndef _di_fss_basic_write_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_basic_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_content_s, main->error.notable);
+ fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_basic_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
#endif // _di_fss_basic_write_error_parameter_same_times_print_
#ifndef _di_fss_basic_write_error_parameter_value_missing_print_
- void fss_basic_write_error_parameter_value_missing_print(fss_basic_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_basic_write_error_parameter_value_missing_print(fss_basic_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[' in objects.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (block.string[range.start] == fss_basic_write_pipe_content_start_s) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_supported_not);
status = fss_basic_write_process(main, output, quote, &object, &content, buffer);
}
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
return status;
}
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_basic_write_error_parameter_value_missing_print_
- void fss_basic_write_error_parameter_value_missing_print(fss_basic_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_basic_write_error_parameter_value_missing_print(fss_basic_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_error_parameter_value_missing_print_
/**
extern "C" {
#endif
+#ifndef _di_fss_embedded_list_read_program_version_
+ const f_string_static_t fss_embedded_list_read_program_version_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_READ_program_version_s, 0, FSS_EMBEDDED_LIST_READ_program_version_s_length);
+#endif // _di_fss_embedded_list_read_program_version_
+
+#ifndef _di_fss_embedded_list_read_program_name_
+ const f_string_static_t fss_embedded_list_read_program_name_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_READ_program_name_s, 0, FSS_EMBEDDED_LIST_READ_program_name_s_length);
+ const f_string_static_t fss_embedded_list_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_READ_program_name_long_s, 0, FSS_EMBEDDED_LIST_READ_program_name_long_s_length);
+#endif // _di_fss_embedded_list_read_program_name_
+
#ifndef _di_fss_embedded_list_read_print_help_
f_status_t fss_embedded_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_embedded_list_read_program_name_long_s, fss_embedded_list_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric index.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Content (default).");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of columns.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate how to handle applying delimits.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric depth.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include empty Content when processing.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Content at the given line.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Object.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print using the special pipe format.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print with the original quotes and escapes.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select sub-Content at this index.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of lines.");
- fll_program_print_help_option(file, context, fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names on select or print.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
fll_program_print_help_usage(file, context, fss_embedded_list_read_program_name_s, "filename(s)");
if (main->parameters[fss_embedded_list_read_parameter_columns_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_embedded_list_read_parameter_at_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_depth_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_line_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_line_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_name_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, main->error.notable);
fl_print_format("%[' requires a string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_line_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_line_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, main->error.notable);
fl_print_format("%[' requires a value.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_embedded_list_read_parameter_delimit_e].result == f_console_result_additional_e) {
const f_array_length_t location = main->parameters[fss_embedded_list_read_parameter_delimit_e].values.array[0];
- f_array_length_t length = strnlen(arguments->argv[location], f_console_parameter_size);
+ f_array_length_t length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (length == 0) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, main->error.notable);
fl_print_format("%[' must not be empty.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_embedded_list_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, main->error.notable);
fl_print_format("%[' parameter requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
// Clear buffers before continuing.
macro_f_fss_nest_t_delete_simple(main->nest);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
}
if (F_status_is_error_not(status) && main->remaining.used > 0) {
// Clear buffers before repeating the loop.
macro_f_fss_nest_t_delete_simple(main->nest);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
} // for
if (F_status_is_error(status)) {
macro_f_fss_nest_t_delete_simple(main->nest);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
}
}
macro_f_fss_comments_t_delete_simple(comments);
}
else {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
for (f_array_length_t i = 0; i < fss_embedded_list_read_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
macro_f_fss_nest_t_delete_simple(main->nest);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_string_dynamic_resize(0, &main->buffer);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This processes in accordance to the FSS-0008 Embedded List specification.
*/
#ifndef _fss_embedded_list_read_h
+#define _fss_embedded_list_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/fss_embedded_list.h>
#endif
#ifndef _di_fss_embedded_list_read_program_version_
- #define fss_embedded_list_read_program_version_major_s F_string_ascii_0_s
- #define fss_embedded_list_read_program_version_minor_s F_string_ascii_5_s
- #define fss_embedded_list_read_program_version_micro_s F_string_ascii_8_s
+ #define FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_0_s
+ #define FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
+ #define FSS_EMBEDDED_LIST_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_embedded_list_read_program_version_nano_prefix_s
- #define fss_embedded_list_read_program_version_nano_prefix_s
- #endif
+ #define FSS_EMBEDDED_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_EMBEDDED_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_EMBEDDED_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_embedded_list_read_program_version_nano_s
- #define fss_embedded_list_read_program_version_nano_s
- #endif
+ #if !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length))
+ #define FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s
+ #define FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length))
- #define fss_embedded_list_read_program_version_s fss_embedded_list_read_program_version_major_s F_string_ascii_period_s fss_embedded_list_read_program_version_minor_s F_string_ascii_period_s fss_embedded_list_read_program_version_micro_s fss_embedded_list_read_program_version_nano_prefix_s fss_embedded_list_read_program_version_nano_s
+ #if !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s_length))
+ #define FSS_EMBEDDED_LIST_READ_program_version_nano_s
+ #define FSS_EMBEDDED_LIST_READ_program_version_nano_s_length 0
+ #endif // !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s_length))
+
+ #define FSS_EMBEDDED_LIST_READ_program_version_s FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EMBEDDED_LIST_READ_program_version_micro_s FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s FSS_EMBEDDED_LIST_READ_program_version_nano_s
+
+ #define FSS_EMBEDDED_LIST_READ_program_version_s_length FSS_EMBEDDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_READ_program_version_micro_s_length + FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length + FSS_EMBEDDED_LIST_READ_program_version_nano_s_length
+
+ extern const f_string_static_t fss_embedded_list_read_program_version_s;
#endif // _di_fss_embedded_list_read_program_version_
#ifndef _di_fss_embedded_list_read_program_name_
- #define fss_embedded_list_read_program_name_s "fss_embedded_list_read"
- #define fss_embedded_list_read_program_name_long_s "FSS Embedded List Read"
+ #define FSS_EMBEDDED_LIST_READ_program_name_s "fss_embedded_list_read"
+ #define FSS_EMBEDDED_LIST_READ_program_name_long_s "FSS Embedded List Read"
+
+ #define FSS_EMBEDDED_LIST_READ_program_name_s_length 22
+ #define FSS_EMBEDDED_LIST_READ_program_name_long_s_length 22
+
+ extern const f_string_static_t fss_embedded_list_read_program_name_s;
+ extern const f_string_static_t fss_embedded_list_read_program_name_long_s;
#endif // _di_fss_embedded_list_read_program_name_
#ifndef _di_fss_embedded_list_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_embedded_list_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
depths->array[depths->used].value_name.used = 0;
if (main->parameters[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_rip(arguments->argv[values_order[i]], strnlen(arguments->argv[values_order[i]], f_console_parameter_size), &depths->array[depths->used].value_name);
+ status = fl_string_rip(arguments->argv[values_order[i]], strnlen(arguments->argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fl_string_rip", F_true);
}
}
else {
- status = f_string_append(arguments->argv[values_order[i]], strnlen(arguments->argv[values_order[i]], f_console_parameter_size), &depths->array[depths->used].value_name);
+ status = f_string_append(arguments->argv[values_order[i]], strnlen(arguments->argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
if (depths->array[i].depth == depths->array[j].depth) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, depths->array[i].depth, main->error.notable);
fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.notable, main->error.notable);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (depths->array[i].depth > depths->array[j].depth) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, main->error.notable);
fl_print_format("%[' may not have the value '%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, depths->array[i].depth, main->error.notable);
fl_print_format("%[' before the value '%]", main->error.to.stream, main->error.notable, main->error.notable);
}
else if (status == F_data_not_stop || status == F_data_not_eos) {
macro_f_fss_nest_t_delete_simple(main->nest);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
if (main->parameters[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
fll_print_format("0%q", main->output.to.stream, f_string_eol_s);
if (F_status_is_error(status)) {
macro_f_fss_nest_t_delete_simple(main->nest);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
return status;
}
extern "C" {
#endif
+#ifndef _di_fss_embedded_list_write_program_version_
+ const f_string_static_t fss_embedded_list_write_program_version_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_WRITE_program_version_s, 0, FSS_EMBEDDED_LIST_WRITE_program_version_s_length);
+#endif // _di_fss_embedded_list_write_program_version_
+
+#ifndef _di_fss_embedded_list_write_program_name_
+ const f_string_static_t fss_embedded_list_write_program_name_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_WRITE_program_name_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_s_length);
+ const f_string_static_t fss_embedded_list_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EMBEDDED_LIST_WRITE_program_name_long_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length);
+#endif // _di_fss_embedded_list_write_program_name_
+
#ifndef _di_fss_embedded_list_write_print_help_
f_status_t fss_embedded_list_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_embedded_list_write_program_name_long_s, fss_embedded_list_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The Content to file.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Ignore a given range within a Content.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The Object to file.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Do not file end of Object/Content character.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Prepend the given whitespace characters to the start of each multi-line Content.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
- fll_program_print_help_option(file, context, fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names.");
fll_program_print_help_usage(file, context, fss_embedded_list_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used || main->parameters[fss_embedded_list_write_parameter_content_e].locations.used) {
if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used) {
if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters[fss_embedded_list_write_parameter_object_e].values.used) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_embedded_list_write_long_object_s);
+ fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters[fss_embedded_list_write_parameter_content_e].values.used) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_embedded_list_write_long_content_s);
+ fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_embedded_list_write_parameter_object_e].locations.used != main->parameters[fss_embedded_list_write_parameter_content_e].locations.used && main->parameters[fss_embedded_list_write_parameter_partial_e].result == f_console_result_none_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter only allows either the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter or the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter, but not both.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must be specified before a '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used) {
if (main->parameters[fss_embedded_list_write_parameter_content_e].locations.used != main->parameters[fss_embedded_list_write_parameter_content_e].values.used) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_embedded_list_write_long_content_s);
+ fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_embedded_list_write_parameter_partial_e].locations.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter cannot be used when processing a pipe.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_embedded_list_write_parameter_prepend_e].values.array[main->parameters[fss_embedded_list_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
if (length) {
f_string_range_t range = macro_f_string_range_t_initialize(length);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must only contain whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, main->error.notable);
fl_print_format("%[' was specified, but no values were given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (total_locations * 2 > total_arguments) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, main->error.notable);
fl_print_format("%[' requires two values.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
object.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
status = fss_embedded_list_write_process(main, output, quote, &object, 0, 0, &buffer);
if (F_status_is_error(status)) break;
content.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_embedded_list_write_process(main, output, quote, 0, &content, &ignore, &buffer);
if (F_status_is_error(status)) break;
object.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
content.string = arguments->argv[main->parameters[fss_embedded_list_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_embedded_list_write_process(main, output, quote, &object, &content, &ignore, &buffer);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
macro_f_string_ranges_t_delete_simple(ignore);
// Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
}
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
fss_embedded_list_write_main_delete(main);
return status;
for (f_array_length_t i = 0; i < fss_embedded_list_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides FSS-0008 Embedded List write functionality.
*/
#ifndef _fss_embedded_list_write_h
+#define _fss_embedded_list_write_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/fss_embedded_list.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#endif
#ifndef _di_fss_embedded_list_write_program_version_
- #define fss_embedded_list_write_program_version_major_s F_string_ascii_0_s
- #define fss_embedded_list_write_program_version_minor_s F_string_ascii_5_s
- #define fss_embedded_list_write_program_version_micro_s F_string_ascii_8_s
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_embedded_list_write_program_version_nano_prefix_s
- #define fss_embedded_list_write_program_version_nano_prefix_s
- #endif
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_embedded_list_write_program_version_nano_s
- #define fss_embedded_list_write_program_version_nano_s
- #endif
+ #if !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length))
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length))
- #define fss_embedded_list_write_program_version_s fss_embedded_list_write_program_version_major_s F_string_ascii_period_s fss_embedded_list_write_program_version_minor_s F_string_ascii_period_s fss_embedded_list_write_program_version_micro_s fss_embedded_list_write_program_version_nano_prefix_s fss_embedded_list_write_program_version_nano_s
+ #if !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length))
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_s
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length))
+
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_s FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EMBEDDED_LIST_WRITE_program_version_micro_s FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s FSS_EMBEDDED_LIST_WRITE_program_version_nano_s
+
+ #define FSS_EMBEDDED_LIST_WRITE_program_version_s_length FSS_EMBEDDED_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_micro_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t fss_embedded_list_write_program_version_s;
#endif // _di_fss_embedded_list_write_program_version_
#ifndef _di_fss_embedded_list_write_program_name_
- #define fss_embedded_list_write_program_name_s "fss_embedded_list_write"
- #define fss_embedded_list_write_program_name_long_s "FSS Embedded List Write"
+ #define FSS_EMBEDDED_LIST_WRITE_program_name_s "fss_embedded_list_write"
+ #define FSS_EMBEDDED_LIST_WRITE_program_name_long_s "FSS Embedded List Write"
+
+ #define FSS_EMBEDDED_LIST_WRITE_program_name_s_length 23
+ #define FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length 23
+
+ extern const f_string_static_t fss_embedded_list_write_program_name_s;
+ extern const f_string_static_t fss_embedded_list_write_program_name_long_s;
#endif // _di_fss_embedded_list_write_program_name_
#ifndef _di_fss_embedded_list_write_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_embedded_list_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[' in objects.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
#endif // _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_embedded_list_write_error_parameter_value_missing_print_
- void fss_embedded_list_write_error_parameter_value_missing_print(fss_embedded_list_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_embedded_list_write_error_parameter_value_missing_print(fss_embedded_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
for (;;) {
if (fss_embedded_list_write_signal_received(main)) {
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
return F_status_set_error(F_interrupt);
}
if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_supported_not);
status = fss_embedded_list_write_process(main, output, quote, &object, &content, ignore, buffer);
}
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
return status;
}
index = main->parameters[fss_embedded_list_write_parameter_ignore_e].values.array[i * 2];
range.start = 0;
- range.stop = strnlen(arguments->argv[index], f_console_parameter_size) - 1;
+ range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1;
// allow and ignore the positive sign.
if (range.stop > 0 && arguments->argv[index][0] == '+') {
index = main->parameters[fss_embedded_list_write_parameter_ignore_e].values.array[(i * 2) + 1];
range.start = 0;
- range.stop = strnlen(arguments->argv[index], f_console_parameter_size) - 1;
+ range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1;
// allow and ignore the positive sign.
if (range.stop > 0 && arguments->argv[index][0] == '+') {
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_embedded_list_write_error_parameter_value_missing_print_
- void fss_embedded_list_write_error_parameter_value_missing_print(fss_embedded_list_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_embedded_list_write_error_parameter_value_missing_print(fss_embedded_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_error_parameter_value_missing_print_
/**
extern "C" {
#endif
+#ifndef _di_fss_extended_list_read_program_version_
+ const f_string_static_t fss_extended_list_read_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_READ_program_version_s, 0, FSS_EXTENDED_LIST_READ_program_version_s_length);
+#endif // _di_fss_extended_list_read_program_version_
+
+#ifndef _di_fss_extended_list_read_program_name_
+ const f_string_static_t fss_extended_list_read_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_READ_program_name_s, 0, FSS_EXTENDED_LIST_READ_program_name_s_length);
+ const f_string_static_t fss_extended_list_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_READ_program_name_long_s, 0, FSS_EXTENDED_LIST_READ_program_name_long_s_length);
+#endif // _di_fss_extended_list_read_program_name_
+
#ifndef _di_fss_extended_list_read_print_help_
f_status_t fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_list_read_program_name_long_s, fss_extended_list_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric index.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Content (default).");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of columns.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate how to handle applying delimits.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric depth.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include empty Content when processing.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Content at the given line.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Object.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print using the special pipe format.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print with the original quotes and escapes.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select sub-Content at this index.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of lines.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names on select or print.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
fll_program_print_help_usage(file, context, fss_extended_list_read_program_name_s, "filename(s)");
if (main->parameters[parameter_code[i]].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' requires a %s.%]%q", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_extended_list_read_parameter_total_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_extended_list_read_long_depth_s,
fss_extended_list_read_long_line_s,
fss_extended_list_read_long_pipe_s,
if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_extended_list_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_line_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_line_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
location = main->parameters[fss_extended_list_read_parameter_delimit_e].values.array[i];
- length = strnlen(arguments->argv[location], f_console_parameter_size);
+ length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (!length) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit_s, main->error.notable);
fl_print_format("%[' must not be empty.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, main->error.notable);
fl_print_format("%[' parameter requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_extended_list_read_data_delete_simple(&data);
}
else {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
for (f_array_length_t i = 0; i < fss_extended_list_read_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
return F_none;
* This processes in accordance to the FSS-0003 Extended List specification.
*/
#ifndef _fss_extended_list_read_h
+#define _fss_extended_list_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/fss_extended_list.h>
#endif
#ifndef _di_fss_extended_list_read_program_version_
- #define fss_extended_list_read_program_version_major_s F_string_ascii_0_s
- #define fss_extended_list_read_program_version_minor_s F_string_ascii_5_s
- #define fss_extended_list_read_program_version_micro_s F_string_ascii_8_s
+ #define FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_0_s
+ #define FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
+ #define FSS_EXTENDED_LIST_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_extended_list_read_version_nano_prefix_s
- #define fss_extended_list_read_version_nano_prefix_s
- #endif
+ #define FSS_EXTENDED_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_EXTENDED_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_EXTENDED_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_extended_list_read_version_nano_s
- #define fss_extended_list_read_version_nano_s
- #endif
+ #if !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length))
+ #define FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s
+ #define FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length))
- #define fss_extended_list_read_program_version_s fss_extended_list_read_program_version_major_s F_string_ascii_period_s fss_extended_list_read_program_version_minor_s F_string_ascii_period_s fss_extended_list_read_program_version_micro_s fss_extended_list_read_version_nano_prefix_s fss_extended_list_read_version_nano_s
+ #if !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
+ #define FSS_EXTENDED_LIST_READ_program_version_nano_s
+ #define FSS_EXTENDED_LIST_READ_program_version_nano_s_length 0
+ #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
+
+ #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_version_nano_prefix_s FSS_EXTENDED_LIST_READ_version_nano_s
+
+ #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_version_nano_s_length
+
+ extern const f_string_static_t fss_extended_list_read_program_version_s;
#endif // _di_fss_extended_list_read_program_version_
#ifndef _di_fss_extended_list_read_program_name_
- #define fss_extended_list_read_program_name_s "fss_extended_list_read"
- #define fss_extended_list_read_program_name_long_s "FSS Extended List Read"
+ #define FSS_EXTENDED_LIST_READ_program_name_s "fss_extended_list_read"
+ #define FSS_EXTENDED_LIST_READ_program_name_long_s "FSS Extended List Read"
+
+ #define FSS_EXTENDED_LIST_READ_program_name_s_length 22
+ #define FSS_EXTENDED_LIST_READ_program_name_long_s_length 22
+
+ extern const f_string_static_t fss_extended_list_read_program_name_s;
+ extern const f_string_static_t fss_extended_list_read_program_name_long_s;
#endif // _di_fss_extended_list_read_program_name_
#ifndef _di_fss_extended_list_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_extended_list_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
fss_extended_list_read_depths_resize(0, &data->depths);
- macro_f_string_dynamic_t_delete_simple(data->buffer);
+ f_string_dynamic_resize(0, &data->buffer);
macro_f_fss_contents_t_delete_simple(data->contents);
macro_f_fss_objects_t_delete_simple(data->objects);
macro_f_fss_delimits_t_delete_simple(data->delimits_object);
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, main->error.notable);
fl_print_format("%[' may not have the value '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' before the value '%]", main->error.to.stream, main->error.context, main->error.context);
if (main->parameters[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], f_console_parameter_size));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
extern "C" {
#endif
+#ifndef _di_fss_extended_list_write_program_version_
+ const f_string_static_t fss_extended_list_write_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_WRITE_program_version_s, 0, FSS_EXTENDED_LIST_WRITE_program_version_s_length);
+#endif // _di_fss_extended_list_write_program_version_
+
+#ifndef _di_fss_extended_list_write_program_name_
+ const f_string_static_t fss_extended_list_write_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_WRITE_program_name_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_s_length);
+ const f_string_static_t fss_extended_list_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_LIST_WRITE_program_name_long_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_long_s_length);
+#endif // _di_fss_extended_list_write_program_name_
+
#ifndef _di_fss_extended_list_write_print_help_
f_status_t fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_list_write_program_name_long_s, fss_extended_list_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The Content to file.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Ignore a given range within a Content.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The Object to file.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Do not file end of Object/Content character.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Prepend the given whitespace characters to the start of each multi-line Content.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
- fll_program_print_help_option(file, context, fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names.");
fll_program_print_help_usage(file, context, fss_extended_list_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
else if (main->parameters[fss_extended_list_write_parameter_file_e].result == f_console_result_found_e) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_list_write_long_file_s);
+ fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used || main->parameters[fss_extended_list_write_parameter_content_e].locations.used) {
if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used) {
if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used != main->parameters[fss_extended_list_write_parameter_object_e].values.used) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_list_write_long_object_s);
+ fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used != main->parameters[fss_extended_list_write_parameter_content_e].values.used) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_list_write_long_content_s);
+ fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_extended_list_write_parameter_object_e].locations.used != main->parameters[fss_extended_list_write_parameter_content_e].locations.used && main->parameters[fss_extended_list_write_parameter_partial_e].result == f_console_result_none_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter only allows either the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter or the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter, but not both.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must be specified before a '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used) {
if (main->parameters[fss_extended_list_write_parameter_content_e].locations.used != main->parameters[fss_extended_list_write_parameter_content_e].values.used) {
- fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_list_write_long_content_s);
+ fss_extended_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_extended_list_write_parameter_partial_e].locations.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter cannot be used when processing a pipe.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters[fss_extended_list_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
if (length) {
f_string_range_t range = macro_f_string_range_t_initialize(length);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must only contain whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, main->error.notable);
fl_print_format("%[' was specified, but no values were given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (total_locations * 2 > total_arguments) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, main->error.notable);
fl_print_format("%[' requires two values.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
object.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
status = fss_extended_list_write_process(main, output, quote, &object, 0, 0, &buffer);
if (F_status_is_error(status)) break;
content.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_extended_list_write_process(main, output, quote, 0, &content, &ignore, &buffer);
if (F_status_is_error(status)) break;
object.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
content.string = arguments->argv[main->parameters[fss_extended_list_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_extended_list_write_process(main, output, quote, &object, &content, &ignore, &buffer);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
macro_f_string_ranges_t_delete_simple(ignore);
// Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
}
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
fss_extended_list_write_main_delete(main);
return status;
for (f_array_length_t i = 0; i < fss_extended_list_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides FSS-0003 Extended List write functionality.
*/
#ifndef _fss_extended_list_write_h
+#define _fss_extended_list_write_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/fss_extended_list.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#endif
#ifndef _di_fss_extended_list_write_program_version_
- #define fss_extended_list_write_program_version_major_s F_string_ascii_0_s
- #define fss_extended_list_write_program_version_minor_s F_string_ascii_5_s
- #define fss_extended_list_write_program_version_micro_s F_string_ascii_8_s
+ #define FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
+ #define FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define FSS_EXTENDED_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_extended_list_write_program_version_nano_prefix_s
- #define fss_extended_list_write_program_version_nano_prefix_s
- #endif
+ #define FSS_EXTENDED_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_EXTENDED_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_EXTENDED_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_extended_list_write_program_version_nano_s
- #define fss_extended_list_write_program_version_nano_s
- #endif
+ #if !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length))
+ #define FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s
+ #define FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length))
- #define fss_extended_list_write_program_version_s fss_extended_list_write_program_version_major_s F_string_ascii_period_s fss_extended_list_write_program_version_minor_s F_string_ascii_period_s fss_extended_list_write_program_version_micro_s fss_extended_list_write_program_version_nano_prefix_s fss_extended_list_write_program_version_nano_s
+ #if !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length))
+ #define FSS_EXTENDED_LIST_WRITE_program_version_nano_s
+ #define FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length))
+
+ #define FSS_EXTENDED_LIST_WRITE_program_version_s FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_WRITE_program_version_micro_s FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s FSS_EXTENDED_LIST_WRITE_program_version_nano_s
+
+ #define FSS_EXTENDED_LIST_WRITE_program_version_s_length FSS_EXTENDED_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_WRITE_program_version_micro_s_length + FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length + FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t fss_extended_list_write_program_version_s;
#endif // _di_fss_extended_list_write_program_version_
#ifndef _di_fss_extended_list_write_program_name_
- #define fss_extended_list_write_program_name_s "fss_extended_list_write"
- #define fss_extended_list_write_program_name_long_s "FSS Extended List Write"
+ #define FSS_EXTENDED_LIST_WRITE_program_name_s "fss_extended_list_write"
+ #define FSS_EXTENDED_LIST_WRITE_program_name_long_s "FSS Extended List Write"
+
+ #define FSS_EXTENDED_LIST_WRITE_program_name_s_length 23
+ #define FSS_EXTENDED_LIST_WRITE_program_name_long_s_length 23
+
+ extern const f_string_static_t fss_extended_list_write_program_name_s;
+ extern const f_string_static_t fss_extended_list_write_program_name_long_s;
#endif // _di_fss_extended_list_write_program_name_
#ifndef _di_fss_extended_list_write_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_extended_list_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, main->error.notable);
+ fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[' in objects.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
#endif // _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_extended_list_write_error_parameter_value_missing_print_
- void fss_extended_list_write_error_parameter_value_missing_print(fss_extended_list_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_extended_list_write_error_parameter_value_missing_print(fss_extended_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_supported_not);
status = fss_extended_list_write_process(main, output, quote, &object, &content, ignore, buffer);
}
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
return status;
}
index = main->parameters[fss_extended_list_write_parameter_ignore_e].values.array[i * 2];
range.start = 0;
- range.stop = strnlen(arguments->argv[index], f_console_parameter_size) - 1;
+ range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1;
// allow and ignore the positive sign.
if (range.stop > 0 && arguments->argv[index][0] == '+') {
index = main->parameters[fss_extended_list_write_parameter_ignore_e].values.array[(i * 2) + 1];
range.start = 0;
- range.stop = strnlen(arguments->argv[index], f_console_parameter_size) - 1;
+ range.stop = strnlen(arguments->argv[index], F_console_parameter_size_d) - 1;
// allow and ignore the positive sign.
if (range.stop > 0 && arguments->argv[index][0] == '+') {
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_extended_list_write_error_parameter_value_missing_print_
- void fss_extended_list_write_error_parameter_value_missing_print(fss_extended_list_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_extended_list_write_error_parameter_value_missing_print(fss_extended_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_error_parameter_value_missing_print_
/**
extern "C" {
#endif
+#ifndef _di_fss_extended_read_program_version_
+ const f_string_static_t fss_extended_read_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_READ_program_version_s, 0, FSS_EXTENDED_READ_program_version_s_length);
+#endif // _di_fss_extended_read_program_version_
+
+#ifndef _di_fss_extended_read_program_name_
+ const f_string_static_t fss_extended_read_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_READ_program_name_s, 0, FSS_EXTENDED_READ_program_name_s_length);
+ const f_string_static_t fss_extended_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_READ_program_name_long_s, 0, FSS_EXTENDED_READ_program_name_long_s_length);
+#endif // _di_fss_extended_read_program_name_
+
#ifndef _di_fss_extended_read_print_help_
f_status_t fss_extended_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_read_program_name_long_s, fss_extended_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_extended_read_short_at_s, fss_extended_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric index.");
- fll_program_print_help_option(file, context, fss_extended_read_short_content_s, fss_extended_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Content (default).");
- fll_program_print_help_option(file, context, fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of columns.");
- fll_program_print_help_option(file, context, fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate how to handle applying delimits.");
- fll_program_print_help_option(file, context, fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric depth.");
- fll_program_print_help_option(file, context, fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include empty Content when processing.");
- fll_program_print_help_option(file, context, fss_extended_read_short_line_s, fss_extended_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Content at the given line.");
- fll_program_print_help_option(file, context, fss_extended_read_short_name_s, fss_extended_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_extended_read_short_object_s, fss_extended_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Object.");
- fll_program_print_help_option(file, context, fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print using the special pipe format.");
- fll_program_print_help_option(file, context, fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print with the original quotes and escapes.");
- fll_program_print_help_option(file, context, fss_extended_read_short_select_s, fss_extended_read_long_select_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select sub-Content at this index.");
- fll_program_print_help_option(file, context, fss_extended_read_short_total_s, fss_extended_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of lines.");
- fll_program_print_help_option(file, context, fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names on select or print.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_at_s, fss_extended_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_content_s, fss_extended_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(file, context, fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_line_s, fss_extended_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_name_s, fss_extended_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_object_s, fss_extended_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_select_s, fss_extended_read_long_select_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_total_s, fss_extended_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
fll_program_print_help_usage(file, context, fss_extended_read_program_name_s, "filename(s)");
fss_extended_read_parameter_delimit_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_extended_read_long_at_s,
fss_extended_read_long_depth_s,
fss_extended_read_long_line_s,
if (main->parameters[parameter_code[i]].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' requires a %s.%]%q", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_extended_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_line_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_line_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
location = main->parameters[fss_extended_read_parameter_delimit_e].values.array[i];
- length = strnlen(arguments->argv[location], f_console_parameter_size);
+ length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (!length) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, main->error.notable);
fl_print_format("%[' must not be empty.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, main->error.notable);
fl_print_format("%[' parameter requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_extended_read_data_delete_simple(&data);
}
else {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
for (f_array_length_t i = 0; i < fss_extended_read_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
return F_none;
* This processes in accordance to the FSS-0001 Extended specification.
*/
#ifndef _fss_extended_read_h
+#define _fss_extended_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/fss_extended.h>
#endif
#ifndef _di_fss_extended_read_program_version_
- #define fss_extended_read_program_version_major_s F_string_ascii_0_s
- #define fss_extended_read_program_version_minor_s F_string_ascii_5_s
- #define fss_extended_read_program_version_micro_s F_string_ascii_8_s
+ #define FSS_EXTENDED_READ_program_version_major_s F_string_ascii_0_s
+ #define FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_5_s
+ #define FSS_EXTENDED_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_extended_read_program_version_nano_prefix_s
- #define fss_extended_read_program_version_nano_prefix_s
- #endif
+ #define FSS_EXTENDED_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_EXTENDED_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_EXTENDED_READ_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_extended_read_program_version_nano_s
- #define fss_extended_read_program_version_nano_s
- #endif
+ #if !(defined(FSS_EXTENDED_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_READ_program_version_nano_prefix_s_length))
+ #define FSS_EXTENDED_READ_program_version_nano_prefix_s
+ #define FSS_EXTENDED_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_EXTENDED_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_READ_program_version_nano_prefix_s_length))
- #define fss_extended_read_program_version_s fss_extended_read_program_version_major_s F_string_ascii_period_s fss_extended_read_program_version_minor_s F_string_ascii_period_s fss_extended_read_program_version_micro_s fss_extended_read_program_version_nano_prefix_s fss_extended_read_program_version_nano_s
+ #if !(defined(FSS_EXTENDED_READ_program_version_nano_s) && defined(FSS_EXTENDED_READ_program_version_nano_s_length))
+ #define FSS_EXTENDED_READ_program_version_nano_s
+ #define FSS_EXTENDED_READ_program_version_nano_s_length 0
+ #endif // !(defined(FSS_EXTENDED_READ_program_version_nano_s) && defined(FSS_EXTENDED_READ_program_version_nano_s_length))
+
+ #define FSS_EXTENDED_READ_program_version_s FSS_EXTENDED_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_READ_program_version_micro_s FSS_EXTENDED_READ_program_version_nano_prefix_s FSS_EXTENDED_READ_program_version_nano_s
+
+ #define FSS_EXTENDED_READ_program_version_s_length FSS_EXTENDED_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_READ_program_version_micro_s_length + FSS_EXTENDED_READ_program_version_nano_prefix_s_length + FSS_EXTENDED_READ_program_version_nano_s_length
+
+ extern const f_string_static_t fss_extended_read_program_version_s;
#endif // _di_fss_extended_read_program_version_
#ifndef _di_fss_extended_read_program_name_
- #define fss_extended_read_program_name_s "fss_extended_read"
- #define fss_extended_read_program_name_long_s "FSS Extended Read"
+ #define FSS_EXTENDED_READ_program_name_s "fss_extended_read"
+ #define FSS_EXTENDED_READ_program_name_long_s "FSS Extended Read"
+
+ #define FSS_EXTENDED_READ_program_name_s_length 17
+ #define FSS_EXTENDED_READ_program_name_long_s_length 17
+
+ extern const f_string_static_t fss_extended_read_program_name_s;
+ extern const f_string_static_t fss_extended_read_program_name_long_s;
#endif // _di_fss_extended_read_program_name_
#ifndef _di_fss_extended_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_extended_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, main->error.notable);
fl_print_format("%[' may not have the value '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' before the value '%]", main->error.to.stream, main->error.context, main->error.context);
if (main->parameters[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], f_console_parameter_size));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
extern "C" {
#endif
+#ifndef _di_fss_extended_write_program_version_
+ const f_string_static_t fss_extended_write_program_version_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_WRITE_program_version_s, 0, FSS_EXTENDED_WRITE_program_version_s_length);
+#endif // _di_fss_extended_write_program_version_
+
+#ifndef _di_fss_extended_write_program_name_
+ const f_string_static_t fss_extended_write_program_name_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_WRITE_program_name_s, 0, FSS_EXTENDED_WRITE_program_name_s_length);
+ const f_string_static_t fss_extended_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_EXTENDED_WRITE_program_name_long_s, 0, FSS_EXTENDED_WRITE_program_name_long_s_length);
+#endif // _di_fss_extended_write_program_name_
+
#ifndef _di_fss_extended_write_print_help_
f_status_t fss_extended_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_write_program_name_long_s, fss_extended_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_extended_write_short_file_s, fss_extended_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, fss_extended_write_short_content_s, fss_extended_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The Content to file.");
- fll_program_print_help_option(file, context, fss_extended_write_short_double_s, fss_extended_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Ignore a given range within a Content.");
- fll_program_print_help_option(file, context, fss_extended_write_short_object_s, fss_extended_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The Object to file.");
- fll_program_print_help_option(file, context, fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Do not file end of Object/Content character.");
- fll_program_print_help_option(file, context, fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Prepend the given whitespace characters to the start of each multi-line Content.");
- fll_program_print_help_option(file, context, fss_extended_write_short_single_s, fss_extended_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
- fll_program_print_help_option(file, context, fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_file_s, fss_extended_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_content_s, fss_extended_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_double_s, fss_extended_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_object_s, fss_extended_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_single_s, fss_extended_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names.");
fll_program_print_help_usage(file, context, fss_extended_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_extended_write_parameter_object_e].locations.used || main->parameters[fss_extended_write_parameter_content_e].locations.used) {
if (main->parameters[fss_extended_write_parameter_object_e].locations.used) {
if (main->parameters[fss_extended_write_parameter_object_e].locations.used != main->parameters[fss_extended_write_parameter_object_e].values.used) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_write_long_object_s);
+ fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_object_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_extended_write_parameter_content_e].locations.used != main->parameters[fss_extended_write_parameter_content_e].values.used) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_write_long_content_s);
+ fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_extended_write_parameter_content_e].locations.used && main->parameters[fss_extended_write_parameter_partial_e].result == f_console_result_none_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter only allows either the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter or the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter, but not both.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must be specified before a '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must have at least one '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_extended_write_parameter_content_e].locations.used) {
if (main->parameters[fss_extended_write_parameter_content_e].locations.used != main->parameters[fss_extended_write_parameter_content_e].values.used) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_extended_write_long_content_s);
+ fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_extended_write_parameter_partial_e].locations.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter cannot be used when processing a pipe.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_extended_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_extended_write_parameter_prepend_e].values.array[main->parameters[fss_extended_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
// Even though this standard does not utilize this parameter, provide the validation for consistency.
if (length) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must only contain whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, main->error.notable);
fl_print_format("%[' was specified, but no values were given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (total_locations * 2 > total_arguments) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, main->error.notable);
fl_print_format("%[' requires two values.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
object.string = arguments->argv[main->parameters[fss_extended_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
status = fss_extended_write_process(main, output, quote, &object, 0, &buffer);
for (; i < main->parameters[fss_extended_write_parameter_content_e].values.used; ++i) {
contents.array[contents.used].string = arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[i]];
- contents.array[contents.used].used = strnlen(contents.array[contents.used].string, f_console_parameter_size);
+ contents.array[contents.used].used = strnlen(contents.array[contents.used].string, F_console_parameter_size_d);
contents.array[contents.used].size = contents.array[contents.used].used;
++contents.used;
} // for
}
object.string = arguments->argv[main->parameters[fss_extended_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
contents.used = 0;
contents.array[contents.used].used = 0;
}
- status = f_string_append(arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[j]], strnlen(arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[j]], f_console_parameter_size), &contents.array[contents.used]);
+ status = f_string_append(arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[j]], strnlen(arguments->argv[main->parameters[fss_extended_write_parameter_content_e].values.array[j]], F_console_parameter_size_d), &contents.array[contents.used]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
// Object, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
object.string = 0;
}
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamics_t_delete_simple(contents);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamics_resize(0, &contents);
fss_extended_write_main_delete(main);
return status;
for (f_array_length_t i = 0; i < fss_extended_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides fss basic write functionality.
*/
#ifndef _fss_extended_write_h
+#define _fss_extended_write_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/fss_extended.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/fss_extended.h>
#include <fll/level_2/print.h>
#endif
#ifndef _di_fss_extended_write_program_version_
- #define fss_extended_write_program_version_major_s F_string_ascii_0_s
- #define fss_extended_write_program_version_minor_s F_string_ascii_5_s
- #define fss_extended_write_program_version_micro_s F_string_ascii_8_s
+ #define FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_0_s
+ #define FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define FSS_EXTENDED_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_extended_write_program_version_nano_prefix_s
- #define fss_extended_write_program_version_nano_prefix_s
- #endif
+ #define FSS_EXTENDED_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_EXTENDED_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_EXTENDED_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_extended_write_program_version_nano_s
- #define fss_extended_write_program_version_nano_s
- #endif
+ #if !(defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length))
+ #define FSS_EXTENDED_WRITE_program_version_nano_prefix_s
+ #define FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length))
- #define fss_extended_write_program_version_s fss_extended_write_program_version_major_s F_string_ascii_period_s fss_extended_write_program_version_minor_s F_string_ascii_period_s fss_extended_write_program_version_micro_s fss_extended_write_program_version_nano_prefix_s fss_extended_write_program_version_nano_s
+ #if !(defined(FSS_EXTENDED_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_s_length))
+ #define FSS_EXTENDED_WRITE_program_version_nano_s
+ #define FSS_EXTENDED_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(FSS_EXTENDED_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_s_length))
+
+ #define FSS_EXTENDED_WRITE_program_version_s FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_WRITE_program_version_micro_s FSS_EXTENDED_WRITE_program_version_nano_prefix_s FSS_EXTENDED_WRITE_program_version_nano_s
+
+ #define FSS_EXTENDED_WRITE_program_version_s_length FSS_EXTENDED_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_WRITE_program_version_micro_s_length + FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length + FSS_EXTENDED_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t fss_extended_write_program_version_s;
#endif // _di_fss_extended_write_program_version_
#ifndef _di_fss_extended_write_program_name_
- #define fss_extended_write_program_name_s "fss_extended_write"
- #define fss_extended_write_program_name_long_s "FSS Extended Write"
+ #define FSS_EXTENDED_WRITE_program_name_s "fss_extended_write"
+ #define FSS_EXTENDED_WRITE_program_name_long_s "FSS Extended Write"
+
+ #define FSS_EXTENDED_WRITE_program_name_s_length 18
+ #define FSS_EXTENDED_WRITE_program_name_long_s_length 18
+
+ extern const f_string_static_t fss_extended_write_program_name_s;
+ extern const f_string_static_t fss_extended_write_program_name_long_s;
#endif // _di_fss_extended_write_program_name_
#ifndef _di_fss_extended_write_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_extended_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_content_s, main->error.notable);
+ fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_extended_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[' in objects.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
status = fss_extended_write_process(main, output, quote, &object, &contents, buffer);
}
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamics_t_delete_simple(contents);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamics_resize(0, &contents);
return status;
}
extern "C" {
#endif
+#ifndef _di_fss_identify_program_version_
+ const f_string_static_t fss_identify_program_version_s = macro_f_string_static_t_initialize2(FSS_IDENTIFY_program_version_s, 0, FSS_IDENTIFY_program_version_s_length);
+#endif // _di_fss_identify_program_version_
+
+#ifndef _di_fss_identify_program_name_
+ const f_string_static_t fss_identify_program_name_s = macro_f_string_static_t_initialize2(FSS_IDENTIFY_program_name_s, 0, FSS_IDENTIFY_program_name_s_length);
+ const f_string_static_t fss_identify_program_name_long_s = macro_f_string_static_t_initialize2(FSS_IDENTIFY_program_name_long_s, 0, FSS_IDENTIFY_program_name_long_s_length);
+#endif // _di_fss_identify_program_name_
+
#ifndef _di_fss_identify_print_help_
f_status_t fss_identify_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_identify_program_name_long_s, fss_identify_program_version);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_identify_short_content_s, fss_identify_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print the Identifier content (the 4-digit hexidecimal type code).");
- fll_program_print_help_option(file, context, fss_identify_short_object_s, fss_identify_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Identifier object (the name).");
+ fll_program_print_help_option(file, context, fss_identify_short_content_s, fss_identify_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the Identifier content (the 4-digit hexidecimal type code).");
+ fll_program_print_help_option(file, context, fss_identify_short_object_s, fss_identify_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Identifier object (the name).");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_identify_short_line_s, fss_identify_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Identifier at the given line.");
- fll_program_print_help_option(file, context, fss_identify_short_name_s, fss_identify_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_identify_short_total_s, fss_identify_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print the total Identifiers found.");
+ fll_program_print_help_option(file, context, fss_identify_short_line_s, fss_identify_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Identifier at the given line.");
+ fll_program_print_help_option(file, context, fss_identify_short_name_s, fss_identify_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_identify_short_total_s, fss_identify_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the total Identifiers found.");
fll_program_print_help_usage(file, context, fss_identify_program_name_s, "filename(s)");
if (main->parameters[fss_identify_parameter_line_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_line_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_line_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_identify_parameter_line_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_identify_parameter_line_e].values.array[main->parameters[fss_identify_parameter_line_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], f_console_parameter_size));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &data.line);
if (main->parameters[fss_identify_parameter_object_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_identify_parameter_content_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_content_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_content_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_identify_parameter_name_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
fl_print_format("%[' requires a string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_identify_parameter_name_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_identify_parameter_name_e].values.array[main->parameters[fss_identify_parameter_name_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
const f_string_range_t range = macro_f_string_range_t_initialize(length);
if (length == 0) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
fl_print_format("%[' does not allow zero length strings.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (status == F_false) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, arguments->argv[index], main->error.notable);
fl_print_format("%[' for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
fl_print_format("%[' may only contain word characters.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
for (f_array_length_t i = 0; i < fss_identify_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program utilizes the Featureless Linux Library.
*/
#ifndef _fss_identify_h
+#define _fss_identify_h
-// libc includes.
+// Libc includes.
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/fss.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/fss.h>
#include <fll/level_2/print.h>
#endif
#ifndef _di_fss_identify_program_version_
- #define fss_identify_program_version_major_s F_string_ascii_0_s
- #define fss_identify_program_version_minor_s F_string_ascii_5_s
- #define fss_identify_program_version_micro_s F_string_ascii_8_s
+ #define FSS_IDENTIFY_program_version_major_s F_string_ascii_0_s
+ #define FSS_IDENTIFY_program_version_minor_s F_string_ascii_5_s
+ #define FSS_IDENTIFY_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_identify_program_version_nano_prefix_s
- #define fss_identify_program_version_nano_prefix_s
- #endif
+ #define FSS_IDENTIFY_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_IDENTIFY_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_IDENTIFY_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_identify_program_version_nano_s
- #define fss_identify_program_version_nano_s
- #endif
+ #if !(defined(FSS_IDENTIFY_program_version_nano_prefix_s) && defined(FSS_IDENTIFY_program_version_nano_prefix_s_length))
+ #define FSS_IDENTIFY_program_version_nano_prefix_s
+ #define FSS_IDENTIFY_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_IDENTIFY_program_version_nano_prefix_s) && defined(FSS_IDENTIFY_program_version_nano_prefix_s_length))
- #define fss_identify_program_version fss_identify_program_version_major_s F_string_ascii_period_s fss_identify_program_version_minor_s F_string_ascii_period_s fss_identify_program_version_micro_s fss_identify_program_version_nano_prefix_s fss_identify_program_version_nano_s
+ #if !(defined(FSS_IDENTIFY_program_version_nano_s) && defined(FSS_IDENTIFY_program_version_nano_s_length))
+ #define FSS_IDENTIFY_program_version_nano_s
+ #define FSS_IDENTIFY_program_version_nano_s_length 0
+ #endif // !(defined(FSS_IDENTIFY_program_version_nano_s) && defined(FSS_IDENTIFY_program_version_nano_s_length))
+
+ #define FSS_IDENTIFY_program_version_s FSS_IDENTIFY_program_version_major_s F_string_ascii_period_s FSS_IDENTIFY_program_version_minor_s F_string_ascii_period_s FSS_IDENTIFY_program_version_micro_s FSS_IDENTIFY_program_version_nano_prefix_s FSS_IDENTIFY_program_version_nano_s
+
+ #define FSS_IDENTIFY_program_version_s_length FSS_IDENTIFY_program_version_major_s_length + F_string_ascii_period_s_length + FSS_IDENTIFY_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_IDENTIFY_program_version_micro_s_length + FSS_IDENTIFY_program_version_nano_prefix_s_length + FSS_IDENTIFY_program_version_nano_s_length
+
+ const f_string_static_t fss_identify_program_version_s;
#endif // _di_fss_identify_program_version_
#ifndef _di_fss_identify_program_name_
- #define fss_identify_program_name_s "fss_identify"
- #define fss_identify_program_name_long_s "FSS Identify"
+ #define FSS_IDENTIFY_program_name_s "fss_identify"
+ #define FSS_IDENTIFY_program_name_long_s "FSS Identify"
+
+ #define FSS_IDENTIFY_program_name_s_length 12
+ #define FSS_IDENTIFY_program_name_long_s_length 12
+
+ const f_string_static_t fss_identify_program_name_s;
+ const f_string_static_t fss_identify_program_name_long_s;
#endif // _di_fss_identify_program_name_
#ifndef _di_fss_identify_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_identify_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
extern "C" {
#endif
+#ifndef _di_fss_payload_read_program_version_
+ const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length);
+#endif // _di_fss_payload_read_program_version_
+
+#ifndef _di_fss_payload_read_program_name_
+ const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length);
+ const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
+#endif // _di_fss_payload_read_program_name_
+
#ifndef _di_fss_payload_read_print_help_
f_status_t fss_payload_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_payload_program_name_long_s, fss_payload_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_payload_read_short_at_s, fss_payload_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric index.");
- fll_program_print_help_option(file, context, fss_payload_read_short_content_s, fss_payload_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Content (default).");
- fll_program_print_help_option(file, context, fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of columns.");
- fll_program_print_help_option(file, context, fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Designate how to handle applying delimits.");
- fll_program_print_help_option(file, context, fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object at this numeric depth.");
- fll_program_print_help_option(file, context, fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Include empty Content when processing.");
- fll_program_print_help_option(file, context, fss_payload_read_short_line_s, fss_payload_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the Content at the given line.");
- fll_program_print_help_option(file, context, fss_payload_read_short_name_s, fss_payload_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select Object with this name.");
- fll_program_print_help_option(file, context, fss_payload_read_short_object_s, fss_payload_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the Object.");
- fll_program_print_help_option(file, context, fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print using the special pipe format.");
- fll_program_print_help_option(file, context, fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print with the original quotes and escapes.");
- fll_program_print_help_option(file, context, fss_payload_read_short_select_s, fss_payload_read_long_select_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select sub-Content at this index.");
- fll_program_print_help_option(file, context, fss_payload_read_short_total_s, fss_payload_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of lines.");
- fll_program_print_help_option(file, context, fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names on select or print.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_at_s, fss_payload_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_content_s, fss_payload_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(file, context, fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_line_s, fss_payload_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_name_s, fss_payload_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_object_s, fss_payload_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_select_s, fss_payload_read_long_select_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_total_s, fss_payload_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
fll_program_print_help_usage(file, context, fss_payload_program_name_s, "filename(s)");
fss_payload_read_parameter_delimit_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_payload_read_long_at_s,
fss_payload_read_long_depth_s,
fss_payload_read_long_line_s,
if (main->parameters[parameter_code[i]].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' requires a %s.%]%q", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_columns_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_columns_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[fss_payload_read_parameter_total_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_line_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_line_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
location = main->parameters[fss_payload_read_parameter_delimit_e].values.array[i];
- length = strnlen(arguments->argv[location], f_console_parameter_size);
+ length = strnlen(arguments->argv[location], F_console_parameter_size_d);
if (!length) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, main->error.notable);
fl_print_format("%[' must not be empty.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (F_status_is_error_not(status) && main->parameters[fss_payload_read_parameter_select_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, main->error.notable);
fl_print_format("%[' parameter requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_payload_read_data_delete_simple(&data);
}
else {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
status = F_status_set_error(F_parameter);
}
for (f_array_length_t i = 0; i < fss_payload_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
return F_none;
* This processes in accordance to the FSS-0002 Basic List specification.
*/
#ifndef _fss_payload_read_h
+#define _fss_payload_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/fss_extended.h>
#endif
#ifndef _di_fss_payload_read_program_version_
- #define fss_payload_program_version_major_s F_string_ascii_0_s
- #define fss_payload_program_version_minor_s F_string_ascii_5_s
- #define fss_payload_program_version_micro_s F_string_ascii_8_s
+ #define FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_0_s
+ #define FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_5_s
+ #define FSS_PAYLOAD_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_payload_program_version_nano_prefix_s
- #define fss_payload_program_version_nano_prefix_s
- #endif
+ #define FSS_PAYLOAD_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_PAYLOAD_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_PAYLOAD_READ_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_payload_program_version_nano_s
- #define fss_payload_program_version_nano_s
- #endif
+ #if !(defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s_length))
+ #define FSS_PAYLOAD_READ_program_version_nano_prefix_s
+ #define FSS_PAYLOAD_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s_length))
- #define fss_payload_program_version_s fss_payload_program_version_major_s F_string_ascii_period_s fss_payload_program_version_minor_s F_string_ascii_period_s fss_payload_program_version_micro_s fss_payload_program_version_nano_prefix_s fss_payload_program_version_nano_s
+ #if !(defined(FSS_PAYLOAD_READ_program_version_nano_s) && defined(FSS_PAYLOAD_READ_program_version_nano_s_length))
+ #define FSS_PAYLOAD_READ_program_version_nano_s
+ #define FSS_PAYLOAD_READ_program_version_nano_s_length 0
+ #endif // !(defined(FSS_PAYLOAD_READ_program_version_nano_s) && defined(FSS_PAYLOAD_READ_program_version_nano_s_length))
+
+ #define FSS_PAYLOAD_READ_program_version_s FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_period_s FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_period_s FSS_PAYLOAD_READ_program_version_micro_s FSS_PAYLOAD_READ_program_version_nano_prefix_s FSS_PAYLOAD_READ_program_version_nano_s
+
+ #define FSS_PAYLOAD_READ_program_version_s_length FSS_PAYLOAD_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_READ_program_version_micro_s_length + FSS_PAYLOAD_READ_program_version_nano_prefix_s_length + FSS_PAYLOAD_READ_program_version_nano_s_length
+
+ extern const f_string_static_t fss_payload_read_program_version_s;
#endif // _di_fss_payload_read_program_version_
#ifndef _di_fss_payload_read_program_name_
- #define fss_payload_program_name_s "fss_payload_read"
- #define fss_payload_program_name_long_s "FSS Basic List Read"
+ #define FSS_PAYLOAD_READ_program_name_s "fss_payload_read"
+ #define FSS_PAYLOAD_READ_program_name_long_s "FSS Payload Read"
+
+ #define FSS_PAYLOAD_READ_program_name_s_length 16
+ #define FSS_PAYLOAD_READ_program_name_long_s_length 16
+
+ extern const f_string_static_t fss_payload_read_program_name_s;
+ extern const f_string_static_t fss_payload_read_program_name_long_s;
#endif // _di_fss_payload_read_program_name_
#ifndef _di_fss_payload_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_payload_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
fss_payload_read_depths_resize(0, &data->depths);
- macro_f_string_dynamic_t_delete_simple(data->buffer);
+ f_string_dynamic_resize(0, &data->buffer);
macro_f_fss_contents_t_delete_simple(data->contents);
macro_f_fss_contents_t_delete_simple(data->contents_header);
macro_f_fss_objects_t_delete_simple(data->objects);
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' may only be specified once for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, main->error.notable);
fl_print_format("%[' may not have the value '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, data->depths.array[i].depth, main->error.notable);
fl_print_format("%[' before the value '%]", main->error.to.stream, main->error.context, main->error.context);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, file_name, main->error.notable);
+ fl_print_format("%q%[%QThe file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, file_name, main->error.notable);
fl_print_format("%[' does not have the required Object '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%]", main->error.to.stream, main->error.notable, F_fss_string_payload_s, main->error.notable);
+ fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, f_fss_string_payload_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->parameters[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[parameter].values.array[main->parameters[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], f_console_parameter_size));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
signal_check = 0;
}
- is_payload = fl_string_dynamic_partial_compare_string(F_fss_string_payload_s, data->buffer, F_fss_string_payload_s_length, data->objects.array[i]) == F_equal_to;
+ is_payload = fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, data->buffer, f_fss_string_payload_s.used, data->objects.array[i]) == F_equal_to;
fss_payload_read_print_at(main, is_payload, i, *delimits_object, *delimits_content, data);
} // for
funlockfile(main->output.to.stream);
}
else {
- is_payload = fl_string_dynamic_partial_compare_string(F_fss_string_payload_s, data->buffer, F_fss_string_payload_s_length, data->objects.array[i]) == F_equal_to;
+ is_payload = fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, data->buffer, f_fss_string_payload_s.used, data->objects.array[i]) == F_equal_to;
fss_payload_read_print_at(main, is_payload, i, *delimits_object, *delimits_content, data);
}
extern "C" {
#endif
+#ifndef _di_fss_payload_write_program_version_
+ const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length);
+#endif // _di_fss_payload_write_program_version_
+
+#ifndef _di_fss_payload_write_program_name_
+ const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length);
+ const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize2(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
+#endif // _di_fss_payload_write_program_name_
+
#ifndef _di_fss_payload_write_print_help_
f_status_t fss_payload_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_payload_write_program_name_long_s, fss_payload_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_payload_write_short_file_s, fss_payload_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, fss_payload_write_short_content_s, fss_payload_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The Content to file.");
- fll_program_print_help_option(file, context, fss_payload_write_short_double_s, fss_payload_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Ignore a given range within a Content.");
- fll_program_print_help_option(file, context, fss_payload_write_short_object_s, fss_payload_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The Object to file.");
- fll_program_print_help_option(file, context, fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Do not file end of Object/Content character.");
- fll_program_print_help_option(file, context, fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Prepend the given whitespace characters to the start of each multi-line Content.");
- fll_program_print_help_option(file, context, fss_payload_write_short_single_s, fss_payload_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
- fll_program_print_help_option(file, context, fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Trim Object names.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_file_s, fss_payload_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_content_s, fss_payload_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_double_s, fss_payload_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_object_s, fss_payload_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_single_s, fss_payload_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names.");
fll_program_print_help_usage(file, context, fss_payload_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
else if (main->parameters[fss_payload_write_parameter_file_e].result == f_console_result_found_e) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_payload_write_long_file_s);
+ fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
if (main->parameters[fss_payload_write_parameter_object_e].locations.used || main->parameters[fss_payload_write_parameter_content_e].locations.used) {
if (main->parameters[fss_payload_write_parameter_object_e].locations.used) {
if (main->parameters[fss_payload_write_parameter_object_e].locations.used != main->parameters[fss_payload_write_parameter_object_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_payload_write_long_object_s);
+ fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_payload_write_parameter_content_e].locations.used != main->parameters[fss_payload_write_parameter_content_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_payload_write_long_content_s);
+ fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_payload_write_parameter_object_e].locations.used != main->parameters[fss_payload_write_parameter_content_e].locations.used && main->parameters[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter only allows either the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter or the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter, but not both.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QEach '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter must be specified before a '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_payload_write_parameter_content_e].locations.used) {
if (main->parameters[fss_payload_write_parameter_content_e].locations.used != main->parameters[fss_payload_write_parameter_content_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string, fss_payload_write_long_content_s);
+ fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
status = F_status_set_error(F_parameter);
}
else if (!main->parameters[fss_payload_write_parameter_partial_e].locations.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThis requires either piped data or the use of the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QThis '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter cannot be used when processing a pipe.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
else if (main->parameters[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters[fss_payload_write_parameter_prepend_e].values.array[main->parameters[fss_payload_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], f_console_parameter_size);
+ const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
if (length) {
f_string_range_t range = macro_f_string_range_t_initialize(length);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must only contain whitespace.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
+ fl_print_format("%q%[%QThe value for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
fl_print_format("%[' must not be an empty string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, main->error.notable);
fl_print_format("%[' was specified, but no values were given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (total_locations * 2 > total_arguments) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, main->error.notable);
fl_print_format("%[' requires two values.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input pipe%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
object.string = arguments->argv[main->parameters[fss_payload_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
status = fss_payload_write_process(main, output, quote, &object, 0, &buffer);
}
content.string = arguments->argv[main->parameters[fss_payload_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_payload_write_process(main, output, quote, 0, &content, &buffer);
}
object.string = arguments->argv[main->parameters[fss_payload_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
content.string = arguments->argv[main->parameters[fss_payload_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
status = fss_payload_write_process(main, output, quote, &object, &content, &buffer);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
+ fl_print_format("%q%[%QWhile processing the '%]%[input arguments%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, main->error.notable, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
// Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
object.string = 0;
}
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
fss_payload_write_main_delete(main);
return status;
for (f_array_length_t i = 0; i < fss_payload_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides fss basic list write functionality.
*/
#ifndef _fss_payload_write_h
+#define _fss_payload_write_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/fss_basic_list.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/fss_payload.h>
#include <fll/level_2/print.h>
#endif
#ifndef _di_fss_payload_write_program_version_
- #define fss_payload_write_program_version_major_s F_string_ascii_0_s
- #define fss_payload_write_program_version_minor_s F_string_ascii_5_s
- #define fss_payload_write_program_version_micro_s F_string_ascii_8_s
+ #define FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_0_s
+ #define FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define FSS_PAYLOAD_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_payload_write_program_version_nano_prefix_s
- #define fss_payload_write_program_version_nano_prefix_s
- #endif
+ #define FSS_PAYLOAD_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_PAYLOAD_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_PAYLOAD_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_payload_write_program_version_nano_s
- #define fss_payload_write_program_version_nano_s
- #endif
+ #if !(defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length))
+ #define FSS_PAYLOAD_WRITE_program_version_nano_prefix_s
+ #define FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length))
- #define fss_payload_write_program_version_s fss_payload_write_program_version_major_s F_string_ascii_period_s fss_payload_write_program_version_minor_s F_string_ascii_period_s fss_payload_write_program_version_micro_s fss_payload_write_program_version_nano_prefix_s fss_payload_write_program_version_nano_s
+ #if !(defined(FSS_PAYLOAD_WRITE_program_version_nano_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_s_length))
+ #define FSS_PAYLOAD_WRITE_program_version_nano_s
+ #define FSS_PAYLOAD_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(FSS_PAYLOAD_WRITE_program_version_nano_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_s_length))
+
+ #define FSS_PAYLOAD_WRITE_program_version_s FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_period_s FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_period_s FSS_PAYLOAD_WRITE_program_version_micro_s FSS_PAYLOAD_WRITE_program_version_nano_prefix_s FSS_PAYLOAD_WRITE_program_version_nano_s
+
+ #define FSS_PAYLOAD_WRITE_program_version_s_length FSS_PAYLOAD_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_WRITE_program_version_micro_s_length + FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length + FSS_PAYLOAD_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t fss_payload_write_program_version_s;
#endif // _di_fss_payload_write_program_version_
#ifndef _di_fss_payload_write_program_name_
- #define fss_payload_write_program_name_s "fss_payload_write"
- #define fss_payload_write_program_name_long_s "FSS Basic List Write"
+ #define FSS_PAYLOAD_WRITE_program_name_s "fss_payload_write"
+ #define FSS_PAYLOAD_WRITE_program_name_long_s "FSS Payload Write"
+
+ #define FSS_PAYLOAD_WRITE_program_name_s_length 17
+ #define FSS_PAYLOAD_WRITE_program_name_long_s_length 17
+
+ extern const f_string_static_t fss_payload_write_program_name_s;
+ extern const f_string_static_t fss_payload_write_program_name_long_s;
#endif // _di_fss_payload_write_program_name_
#ifndef _di_fss_payload_write_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_payload_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
+ fl_print_format("%q%[%QMust specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
+ fl_print_format("%[' parameter and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
+ fl_print_format("%[' parameter the same number of times when not specifying the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThis standard does not support end of line character '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[\\n%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[' in objects.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%S%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, symbol, parameter, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
// When payload is provided, all data at this point is part of the payload until the end of the pipe.
- if (fl_string_dynamic_compare_string(f_fss_string_payload_s, object, F_fss_string_payload_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(f_fss_string_payload_s, object) == F_equal_to) {
if (total > 1) {
// The first character is the terminating new line, which is not part of the payload.
if (block.string[range.start] == fss_payload_write_pipe_content_start_s) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThis standard only supports one content per object.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_supported_not);
status = fss_payload_write_process(main, output, quote, &object, &content, buffer);
}
- macro_f_string_dynamic_t_delete_simple(block);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
return status;
}
extern "C" {
#endif
+#ifndef _di_fss_status_code_program_version_
+ const f_string_static_t fss_status_code_program_version_s = macro_f_string_static_t_initialize2(FSS_STATUS_CODE_program_version_s, 0, FSS_STATUS_CODE_program_version_s_length);
+#endif // _di_fss_status_code_program_version_
+
+#ifndef _di_fss_status_code_program_name_
+ const f_string_static_t fss_status_code_program_name_s = macro_f_string_static_t_initialize2(FSS_STATUS_CODE_program_name_s, 0, FSS_STATUS_CODE_program_name_s_length);
+ const f_string_static_t fss_status_code_program_name_long_s = macro_f_string_static_t_initialize2(FSS_STATUS_CODE_program_name_long_s, 0, FSS_STATUS_CODE_program_name_long_s_length);
+#endif // _di_fss_status_code_program_name_
+
#ifndef _di_fss_status_code_print_help_
f_status_t fss_status_code_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_status_code_program_name_long_s, fss_status_code_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print F_true if the error code is not an error, F_false otherwise.");
- fll_program_print_help_option(file, context, fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print F_true if the error code is a warning, F_false otherwise.");
- fll_program_print_help_option(file, context, fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print F_true if the error code is an error, F_false otherwise.");
- fll_program_print_help_option(file, context, fss_status_code_short_number_s, fss_status_code_long_number_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Convert status code name to number.");
+ fll_program_print_help_option(file, context, fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is not an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print F_true if the error code is a warning, F_false otherwise.");
+ fll_program_print_help_option(file, context, fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, fss_status_code_short_number_s, fss_status_code_long_number_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number.");
fll_program_print_help_usage(file, context, fss_status_code_program_name_s, "status code(s)");
if (main->parameters[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_error_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_error_s, main->error.notable);
fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_warning_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_warning_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_error_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_error_s, main->error.notable);
fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_fine_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_fine_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[fss_status_code_parameter_is_warning_e].result == f_console_result_found_e && main->parameters[fss_status_code_parameter_is_fine_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_warning_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_warning_s, main->error.notable);
fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_fine_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_fine_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
for (f_array_length_t i = 0; i < fss_status_code_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides status code to/from string translation.
*/
#ifndef _fss_status_code_h
+#define _fss_status_code_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/signal.h>
#include <fll/level_0/status_string.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/fss_status_string.h>
#include <fll/level_2/print.h>
#endif
#ifndef _di_fss_status_code_program_version_
- #define fss_status_code_program_version_major_s F_string_ascii_0_s
- #define fss_status_code_program_version_minor_s F_string_ascii_5_s
- #define fss_status_code_program_version_micro_s F_string_ascii_8_s
+ #define FSS_STATUS_code_program_version_major_s F_string_ascii_0_s
+ #define FSS_STATUS_code_program_version_minor_s F_string_ascii_5_s
+ #define FSS_STATUS_code_program_version_micro_s F_string_ascii_8_s
- #ifndef fss_status_code_program_version_nano_prefix_s
- #define fss_status_code_program_version_nano_prefix_s
- #endif
+ #define FSS_STATUS_code_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_STATUS_code_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_STATUS_code_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef fss_status_code_program_version_nano_s
- #define fss_status_code_program_version_nano_s
- #endif
+ #if !(defined(FSS_STATUS_program_version_nano_prefix_s) && defined(FSS_STATUS_program_version_nano_prefix_s_length))
+ #define FSS_STATUS_program_version_nano_prefix_s
+ #define FSS_STATUS_program_version_nano_prefix_s_length 0
+ #endif // !(defined(FSS_STATUS_program_version_nano_prefix_s) && defined(FSS_STATUS_program_version_nano_prefix_s_length))
- #define fss_status_code_program_version_s fss_status_code_program_version_major_s F_string_ascii_period_s fss_status_code_program_version_minor_s F_string_ascii_period_s fss_status_code_program_version_micro_s fss_status_code_program_version_nano_prefix_s fss_status_code_program_version_nano_s
+ #if !(defined(FSS_STATUS_program_version_nano_s) && defined(FSS_STATUS_program_version_nano_s_length))
+ #define FSS_STATUS_program_version_nano_s
+ #define FSS_STATUS_program_version_nano_s_length 0
+ #endif // !(defined(FSS_STATUS_program_version_nano_s) && defined(FSS_STATUS_program_version_nano_s_length))
+
+ #define FSS_STATUS_code_program_version_length_s FSS_STATUS_code_program_version_major_s F_string_ascii_period_s FSS_STATUS_code_program_version_minor_s F_string_ascii_period_s FSS_STATUS_code_program_version_micro_s FSS_STATUS_code_program_version_nano_prefix_s FSS_STATUS_code_program_version_nano_s
+
+ extern const f_string_static_t fss_status_code_program_version_s;
#endif // _di_fss_status_code_program_version_
#ifndef _di_fss_status_code_program_name_
- #define fss_status_code_program_name_s "fss_status_code"
- #define fss_status_code_program_name_long_s "FSS Status Code"
+ #define FSS_STATUS_code_program_name_s "FSS_STATUS_code"
+ #define FSS_STATUS_code_program_name_long_s "FSS Status Code"
+
+ #define FSS_STATUS_CODE_program_name_s_length
+ #define FSS_STATUS_CODE_program_name_long_s_length
+
+ const f_string_static_t fss_status_code_program_name_s;
+ const f_string_static_t fss_status_code_program_name_long_s;
#endif // _di_fss_status_code_program_name_
#ifndef _di_fss_status_code_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = fss_status_code_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status) || status == F_false) {
- return 1;
- }
+ if (F_status_is_error(status) || status == F_false) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
extern "C" {
#endif
+#ifndef _di_iki_read_program_version_
+ const f_string_static_t iki_read_program_version_s = macro_f_string_static_t_initialize2(IKI_READ_program_version_s, 0, IKI_READ_program_version_s_length);
+#endif // _di_iki_read_program_version_
+
+#ifndef _di_iki_read_program_name_
+ const f_string_static_t iki_read_program_name_s = macro_f_string_static_t_initialize2(IKI_READ_program_name_s, 0, IKI_READ_program_name_s_length);
+ const f_string_static_t iki_read_program_name_long_s = macro_f_string_static_t_initialize2(IKI_READ_program_name_long_s, 0, IKI_READ_program_name_long_s_length);
+#endif // _di_iki_read_program_name_
+
#ifndef _di_iki_read_print_help_
f_status_t iki_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, iki_read_program_name_long_s, iki_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, iki_read_short_at_s, iki_read_long_at_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select variable at this numeric index.");
- fll_program_print_help_option(file, context, iki_read_short_line_s, iki_read_long_line_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print only the variables at the given line within the file.");
- fll_program_print_help_option(file, context, iki_read_short_name_s, iki_read_long_name_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Select variables with this name.");
- fll_program_print_help_option(file, context, iki_read_short_whole_s, iki_read_long_whole_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print all of the data instead of just the IKI variable data.");
+ fll_program_print_help_option(file, context, iki_read_short_at_s, iki_read_long_at_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select variable at this numeric index.");
+ fll_program_print_help_option(file, context, iki_read_short_line_s, iki_read_long_line_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the variables at the given line within the file.");
+ fll_program_print_help_option(file, context, iki_read_short_name_s, iki_read_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select variables with this name.");
+ fll_program_print_help_option(file, context, iki_read_short_whole_s, iki_read_long_whole_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print all of the data instead of just the IKI variable data.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, iki_read_short_content_s, iki_read_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print the variable content (default).");
- fll_program_print_help_option(file, context, iki_read_short_literal_s, iki_read_long_literal_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print the entire variable (aka: object, content, and syntax).");
- fll_program_print_help_option(file, context, iki_read_short_object_s, iki_read_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the variable name (aka: object).");
- fll_program_print_help_option(file, context, iki_read_short_total_s, iki_read_long_total_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print the total number of variables.");
+ fll_program_print_help_option(file, context, iki_read_short_content_s, iki_read_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the variable content (default).");
+ fll_program_print_help_option(file, context, iki_read_short_literal_s, iki_read_long_literal_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the entire variable (aka: object, content, and syntax).");
+ fll_program_print_help_option(file, context, iki_read_short_object_s, iki_read_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the variable name (aka: object).");
+ fll_program_print_help_option(file, context, iki_read_short_total_s, iki_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of variables.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, iki_read_short_substitute_s, iki_read_long_substitute_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Substitute the entire variable for the given name and content value with the given string.");
+ fll_program_print_help_option(file, context, iki_read_short_substitute_s, iki_read_long_substitute_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Substitute the entire variable for the given name and content value with the given string.");
fll_program_print_help_usage(file, context, iki_read_program_name_s, "filename(s)");
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_at_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_at_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_at_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_at_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_whole_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_whole_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_line_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_line_s, main->error.notable);
fl_print_format("%[' requires a positive number.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_name_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_name_s, main->error.notable);
fl_print_format("%[' requires a string.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_substitute_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_substitute_s, main->error.notable);
fl_print_format("%[' requires 3 strings.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_substitute_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_substitute_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_literal_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_literal_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_object_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_literal_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_literal_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_literal_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_literal_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_content_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_object_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_whole_s, main->error.notable);
+ fl_print_format("%q%[%QCannot specify the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_whole_s, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total_s, main->error.notable);
fl_print_format("%[' parameter.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
// Clear buffers before continuing.
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
}
if (F_status_is_fine(status) && main->remaining.used > 0) {
if (F_status_is_error(status)) break;
// Clear buffers before repeating the loop.
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_string_dynamic_resize(0, &main->buffer);
} // for
}
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QYou failed to specify one or more files.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_parameter);
for (f_array_length_t i = 0; i < iki_read_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_type_array_lengths_resize(0, &main->remaining);
+ f_string_dynamic_resize(0, &main->buffer);
macro_f_color_context_t_delete_simple(main->context);
* This processes in accordance to the IKI specification.
*/
#ifndef _iki_read_h
+#define _iki_read_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/iki.h>
#include <fll/level_1/signal.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/print.h>
#endif
#ifndef _di_iki_read_program_version_
- #define iki_read_program_version_major_s F_string_ascii_0_s
- #define iki_read_program_version_minor_s F_string_ascii_5_s
- #define iki_read_program_version_micro_s F_string_ascii_8_s
+ #define IKI_READ_program_version_major_s F_string_ascii_0_s
+ #define IKI_READ_program_version_minor_s F_string_ascii_5_s
+ #define IKI_READ_program_version_micro_s F_string_ascii_8_s
- #ifndef iki_read_program_version_nano_prefix_s
- #define iki_read_program_version_nano_prefix_s
- #endif
+ #define IKI_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define IKI_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define IKI_READ_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef iki_read_program_version_nano_s
- #define iki_read_program_version_nano_s
- #endif
+ #if !(defined(IKI_READ_program_version_nano_prefix_s) && defined(IKI_READ_program_version_nano_prefix_s_length))
+ #define IKI_READ_program_version_nano_prefix_s
+ #define IKI_READ_program_version_nano_prefix_s_length 0
+ #endif // !(defined(IKI_READ_program_version_nano_prefix_s) && defined(IKI_READ_program_version_nano_prefix_s_length))
- #define iki_read_program_version_s iki_read_program_version_major_s F_string_ascii_period_s iki_read_program_version_minor_s F_string_ascii_period_s iki_read_program_version_micro_s iki_read_program_version_nano_prefix_s iki_read_program_version_nano_s
+ #if !(defined(IKI_READ_program_version_nano_s) && defined(IKI_READ_program_version_nano_s_length))
+ #define IKI_READ_program_version_nano_s
+ #define IKI_READ_program_version_nano_s_length 0
+ #endif // !(defined(IKI_READ_program_version_nano_s) && defined(IKI_READ_program_version_nano_s_length))
+
+ #define IKI_READ_program_version_s IKI_READ_program_version_major_s F_string_ascii_period_s IKI_READ_program_version_minor_s F_string_ascii_period_s IKI_READ_program_version_micro_s IKI_READ_program_version_nano_prefix_s IKI_READ_program_version_nano_s
+
+ #define IKI_READ_program_version_s_length iki_read_program_version_major_s_length + F_string_ascii_period_s iki_read_program_version_minor_s_length + F_string_ascii_period_s_length + iki_read_program_version_micro_s_length + iki_read_program_version_nano_prefix_s_length + iki_read_program_version_nano_s_length
+
+ extern const f_string_static_t iki_read_program_version_s;
#endif // _di_iki_read_program_version_
#ifndef _di_iki_read_program_name_
- #define iki_read_program_name_s "iki_read"
- #define iki_read_program_name_long_s "IKI Read"
+ #define IKI_READ_program_name_s "iki_read"
+ #define IKI_READ_program_name_long_s "IKI Read"
+
+ #define IKI_READ_program_name_s_length 9
+ #define IKI_READ_program_name_long_s_length 9
+
+ extern const f_string_static_t iki_read_program_name_s;
+ extern const f_string_static_t iki_read_program_name_long_s;
#endif // _di_iki_read_program_name_
#ifndef _di_iki_read_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = iki_read_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
macro_iki_read_substitutions_t_delete_simple(substitutionss[i]);
} // for
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
funlockfile(main->output.to.stream);
} // for
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
if (unmatched) status = F_data_not;
else status = F_none;
for (f_array_length_t index = 0; i < main->parameters[iki_read_parameter_name_e].values.used; ++i) {
index = main->parameters[iki_read_parameter_name_e].values.array[i];
- length_argument = strnlen(arguments->argv[index], f_console_parameter_size);
+ length_argument = strnlen(arguments->argv[index], F_console_parameter_size_d);
for (j = 0, name_missed = F_true; j < names.used; ++j) {
macro_iki_read_substitutions_t_delete_simple(substitutionss[i]);
} // for
- macro_f_string_dynamics_t_delete_simple(names);
+ f_string_dynamics_resize(0, &names);
+
return status;
}
}
macro_iki_read_substitutions_t_delete_simple(substitutionss[i]);
} // for
- macro_f_string_dynamics_t_delete_simple(names);
+ f_string_dynamics_resize(0, &names);
return F_none;
}
if (!((++signal_check) % iki_read_signal_check_d)) {
if (iki_read_signal_received(main)) {
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return F_status_set_error(F_interrupt);
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
return status;
}
} // for
} // for
- macro_f_string_dynamic_t_delete_simple(name);
+ f_string_dynamic_resize(0, &name);
}
else {
total = iki_data->variable.used;
for (; i < parameter->values.used; i += 3) {
index = parameter->values.array[i];
- length = strnlen(arguments->argv[index], f_console_parameter_size);
+ length = strnlen(arguments->argv[index], F_console_parameter_size_d);
for (j = 0; j < vocabulary->used; ++j) {
index = parameter->values.array[i + 1];
index_2 = substitutionss[j].used;
substitutionss[j].array[index_2].replace.string = arguments->argv[index];
- substitutionss[j].array[index_2].replace.used = strnlen(arguments->argv[index], f_console_parameter_size);
+ substitutionss[j].array[index_2].replace.used = strnlen(arguments->argv[index], F_console_parameter_size_d);
substitutionss[j].array[index_2].replace.size = substitutionss[j].array[index_2].replace.used;
index = parameter->values.array[i + 2];
substitutionss[j].array[index_2].with.string = arguments->argv[index];
- substitutionss[j].array[index_2].with.used = strnlen(arguments->argv[index], f_console_parameter_size);
+ substitutionss[j].array[index_2].with.used = strnlen(arguments->argv[index], F_console_parameter_size_d);
substitutionss[j].array[index_2].with.size = substitutionss[j].array[index_2].with.used;
++substitutionss[j].used;
extern "C" {
#endif
+#ifndef _di_iki_write_program_version_
+ const f_string_static_t iki_write_program_version_s = macro_f_string_static_t_initialize2(IKI_WRITE_program_version_s, 0, IKI_WRITE_program_version_s_length);
+#endif // _di_iki_write_program_version_
+
+#ifndef _di_iki_write_program_name_
+ const f_string_static_t iki_write_program_name_s = macro_f_string_static_t_initialize2(IKI_WRITE_program_name_s, 0, IKI_WRITE_program_name_s_length);
+ const f_string_static_t iki_write_program_name_long_s = macro_f_string_static_t_initialize2(IKI_WRITE_program_name_long_s, 0, IKI_WRITE_program_name_long_s_length);
+#endif // _di_iki_write_program_name_
+
#ifndef _di_iki_write_print_help_
f_status_t iki_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, iki_write_program_name_long_s, iki_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, iki_write_short_file_s, iki_write_long_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Specify a file to send data to.");
- fll_program_print_help_option(file, context, iki_write_short_content_s, iki_write_long_content_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The content to file.");
- fll_program_print_help_option(file, context, iki_write_short_double_s, iki_write_long_double_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use double quotes (default).");
- fll_program_print_help_option(file, context, iki_write_short_object_s, iki_write_long_object_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The object to file.");
- fll_program_print_help_option(file, context, iki_write_short_single_s, iki_write_long_single_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use single quotes.");
+ fll_program_print_help_option(file, context, iki_write_short_file_s, iki_write_long_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send data to.");
+ fll_program_print_help_option(file, context, iki_write_short_content_s, iki_write_long_content_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The content to file.");
+ fll_program_print_help_option(file, context, iki_write_short_double_s, iki_write_long_double_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, iki_write_short_object_s, iki_write_long_object_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The object to file.");
+ fll_program_print_help_option(file, context, iki_write_short_single_s, iki_write_long_single_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes.");
fll_program_print_help_usage(file, context, iki_write_program_name_s, f_string_empty_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file_s, main->error.notable);
fl_print_format("%[' may only be specified once.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
fl_print_format("%[' is specified, but no value is given.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sNo main provided, either pipe the main or use the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
+ fl_print_format("%q%[%QNo main provided, either pipe the main or use the '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
fl_print_format("%[' and the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
fl_print_format("%[' parameters.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content_s, main->error.notable);
fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object_s, main->error.notable);
fl_print_format("%[' must be specified the same number of times.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
}
}
- uint8_t quote = f_iki_syntax_quote_double_s.string[0];
+ data->quote = f_iki_syntax_quote_double_s.string[0];
if (F_status_is_error_not(status)) {
if (main->parameters[iki_write_parameter_double_e].result == f_console_result_found_e) {
if (main->parameters[iki_write_parameter_single_e].result == f_console_result_found_e) {
if (main->parameters[iki_write_parameter_double_e].location < main->parameters[iki_write_parameter_single_e].location) {
- quote = f_iki_syntax_quote_single_s.string[0];
+ data->quote = f_iki_syntax_quote_single_s.string[0];
}
}
}
else if (main->parameters[iki_write_parameter_single_e].result == f_console_result_found_e) {
- quote = f_iki_syntax_quote_single_s.string[0];
+ data->quote = f_iki_syntax_quote_single_s.string[0];
}
}
if (!((++signal_check) % iki_write_signal_check_d)) {
if (iki_write_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_to", F_true, "-", "read", fll_error_file_type_pipe_e);
status = F_status_set_error(F_pipe);
+
break;
}
if (!buffer.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThe pipe has no main.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe pipe has no main.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_parameter);
+
break;
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_seek_line", F_true);
+
break;
}
status = F_status_set_error(F_parameter);
fll_error_print(main->error, F_parameter, "f_string_dynamic_seek_line", F_true);
+
break;
}
if (object_ended && previous == range.start) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThe pipe has incorrectly placed newlines.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe pipe has incorrectly placed newlines.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_parameter);
+
break;
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
+
break;
}
}
- status = iki_write_process(main, file, object, content, quote, &escaped);
+ status = iki_write_process(main, file, object, content, &escaped);
if (F_status_is_error(status)) break;
fll_print_dynamic(f_string_eol_s, file.stream);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
+
break;
}
if (F_status_is_error_not(status) && object_ended) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%q%[%sThe pipe has an object without content.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QThe pipe has an object without content.%]%q", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
status = F_status_set_error(F_parameter);
}
- macro_f_string_dynamic_t_delete_simple(buffer);
- macro_f_string_dynamic_t_delete_simple(object);
- macro_f_string_dynamic_t_delete_simple(content);
+ f_string_dynamic_resize(0, &buffer);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
}
if (F_status_is_error_not(status)) {
}
object.string = arguments->argv[main->parameters[iki_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, f_console_parameter_size);
+ object.used = strnlen(object.string, F_console_parameter_size_d);
object.size = object.used;
content.string = arguments->argv[main->parameters[iki_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, f_console_parameter_size);
+ content.used = strnlen(content.string, F_console_parameter_size_d);
content.size = content.used;
- status = iki_write_process(main, file, object, content, quote, &escaped);
+ status = iki_write_process(main, file, object, content, &escaped);
if (F_status_is_error(status)) break;
fll_print_dynamic(f_string_eol_s, file.stream);
}
}
- macro_f_string_dynamic_t_delete_simple(escaped);
+ f_string_dynamic_resize(0, &escaped);
}
if (main->parameters[iki_write_parameter_file_e].result == f_console_result_additional_e) {
for (f_array_length_t i = 0; i < iki_write_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
- macro_f_string_dynamic_t_delete_simple(main->buffer);
+ f_type_array_lengths_resize(0, &main->remaining);
+ f_string_dynamic_resize(0, &main->buffer);
macro_f_color_context_t_delete_simple(main->context);
* This processes in accordance to the IKI specification.
*/
#ifndef _iki_write_h
+#define _iki_write_h
-// libc includes.
+// Libc includes.
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/iki.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/iki.h>
#endif
#ifndef _di_iki_write_program_version_
- #define iki_write_program_version_major_s F_string_ascii_0_s
- #define iki_write_program_version_minor_s F_string_ascii_5_s
- #define iki_write_program_version_micro_s F_string_ascii_8_s
+ #define IKI_WRITE_program_version_major_s F_string_ascii_0_s
+ #define IKI_WRITE_program_version_minor_s F_string_ascii_5_s
+ #define IKI_WRITE_program_version_micro_s F_string_ascii_8_s
- #ifndef iki_write_program_version_nano_prefix_s
- #define iki_write_program_version_nano_prefix_s
- #endif
+ #define IKI_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+ #define IKI_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define IKI_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef iki_write_program_version_nano_s
- #define iki_write_program_version_nano_s
- #endif
+ #if !(defined(IKI_WRITE_program_version_nano_prefix_s) && defined(IKI_WRITE_program_version_nano_prefix_s_length))
+ #define IKI_WRITE_program_version_nano_prefix_s
+ #define IKI_WRITE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(IKI_WRITE_program_version_nano_prefix_s) && defined(IKI_WRITE_program_version_nano_prefix_s_length))
- #define iki_write_program_version_s iki_write_program_version_major_s F_string_ascii_period_s iki_write_program_version_minor_s F_string_ascii_period_s iki_write_program_version_micro_s iki_write_program_version_nano_prefix_s iki_write_program_version_nano_s
+ #if !(defined(IKI_WRITE_program_version_nano_s) && defined(IKI_WRITE_program_version_nano_s_length))
+ #define IKI_WRITE_program_version_nano_s
+ #define IKI_WRITE_program_version_nano_s_length 0
+ #endif // !(defined(IKI_WRITE_program_version_nano_s) && defined(IKI_WRITE_program_version_nano_s_length))
+
+ #define IKI_WRITE_program_version_s IKI_WRITE_program_version_major_s F_string_ascii_period_s IKI_WRITE_program_version_minor_s F_string_ascii_period_s IKI_WRITE_program_version_micro_s IKI_WRITE_program_version_nano_prefix_s IKI_WRITE_program_version_nano_s
+
+ #define IKI_WRITE_program_version_s_length IKI_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + IKI_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + IKI_WRITE_program_version_micro_s_length + IKI_WRITE_program_version_nano_prefix_s_length + IKI_WRITE_program_version_nano_s_length
+
+ extern const f_string_static_t iki_write_program_version_s;
#endif // _di_iki_write_program_version_
#ifndef _di_iki_write_program_name_
#define iki_write_program_name_s "iki_write"
#define iki_write_program_name_long_s "IKI Write"
+
+ #define IKI_WRITE_program_name_s_length 9
+ #define IKI_WRITE_program_name_long_s_length 9
+
+ extern const f_string_static_t iki_write_program_name_s;
+ extern const f_string_static_t iki_write_program_name_long_s;
#endif // _di_iki_write_program_name_
#ifndef _di_iki_write_defines_
f_signal_t signal;
+ f_string_static_t quote;
f_string_dynamic_t buffer;
f_color_context_t context;
macro_fl_print_t_initialize_error(), \
macro_fl_print_t_initialize_warning(), \
f_signal_t_initialize, \
+ f_string_static_t_initialize, \
f_string_dynamic_t_initialize, \
f_color_context_t_initialize, \
}
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = iki_write_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status)) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
#endif
#ifndef _di_iki_write_process_
- f_status_t iki_write_process(iki_write_main_t * const main, const f_file_t output, const f_string_static_t object, const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped) {
+ f_status_t iki_write_process(iki_write_main_t * const main, const f_file_t output, const f_string_static_t object, const f_string_static_t content, f_string_dynamic_t *escaped) {
if (!object.used) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe object is missing, it must not have a length of %]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe object is missing, it must not have a length of %]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[0%]", main->error.to.stream, main->error.notable, main->error.notable);
fl_print_format("%[.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe object '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%q%[%QThe object '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, object, main->error.notable);
fl_print_format("%[' is not a valid IKI object.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
escaped->used = 0;
- status = fll_iki_content_escape(content, quote, escaped);
+ status = fll_iki_content_escape(content, main->quote, escaped);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_iki_content_escape", F_true);
- macro_f_string_dynamic_t_delete_simple((*escaped));
+ f_string_dynamic_resize(0, &escaped);
return F_status_set_error(F_failure);
}
- fl_print_format("%Q%q%c%Q%c", output.stream, object, f_iki_syntax_separator_s, quote, *escaped, quote);
+ fl_print_format("%Q%q%q%Q%q", output.stream, object, f_iki_syntax_separator_s, main->quote, *escaped, main->quote);
return F_none;
}
* The object to validate and print.
* @param content
* The content to escape and print.
- * @param quote
- * The quote character to use.
- * This is either F_iki_syntax_quote_single_s or F_iki_syntax_quote_double_s.
* @param escaped
* A string buffer used as a string cache to save the string into while escaping.
*
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_iki_write_process_
- extern f_status_t iki_write_process(iki_write_main_t * const main, const f_file_t output, const f_string_static_t object, const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped) F_attribute_visibility_internal_d;
+ extern f_status_t iki_write_process(iki_write_main_t * const main, const f_file_t output, const f_string_static_t object, const f_string_static_t content, f_string_dynamic_t *escaped) F_attribute_visibility_internal_d;
#endif // _di_iki_write_process_
#ifdef __cplusplus
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = status_code_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status) || status == F_false) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
flockfile(main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
fl_print_format("%[.%]%q", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
extern "C" {
#endif
+#ifndef _di_status_code_program_version_
+ const f_string_static_t status_code_progam_version_s = macro_f_string_static_t_initialize2(STATUS_CODE_progam_version_s, 0, STATUS_CODE_progam_version_s_length);
+#endif // _di_status_code_program_version_
+
+#ifndef _di_status_code_program_name_
+ const f_string_static_t status_code_program_name_s = macro_f_string_static_t_initialize2(STATUS_CODE_program_name_s, 0, STATUS_CODE_program_name_s_length);
+ const f_string_static_t status_code_program_name_long_s = macro_f_string_static_t_initialize2(STATUS_CODE_program_name_long_s, 0, STATUS_CODE_program_name_long_s_length);
+#endif // _di_status_code_program_name_
+
#ifndef _di_status_code_print_help_
f_status_t status_code_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, status_code_progam_name_long_s, status_code_progam_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, status_code_short_is_fine_s, status_code_long_is_fine_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print F_true if the error code is not an error, F_false otherwise.");
- fll_program_print_help_option(file, context, status_code_short_is_warning_s, status_code_long_is_warning_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Print F_true if the error code is a warning, F_false otherwise.");
- fll_program_print_help_option(file, context, status_code_short_is_error_s, status_code_long_is_error_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print F_true if the error code is an error, F_false otherwise.");
- fll_program_print_help_option(file, context, status_code_short_number_s, status_code_long_number_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Convert status code name to number.");
+ fll_program_print_help_option(file, context, status_code_short_is_fine_s, status_code_long_is_fine_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is not an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, status_code_short_is_warning_s, status_code_long_is_warning_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print F_true if the error code is a warning, F_false otherwise.");
+ fll_program_print_help_option(file, context, status_code_short_is_error_s, status_code_long_is_error_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, status_code_short_number_s, status_code_long_number_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number.");
fll_program_print_help_usage(file, context, status_code_progam_name_s, "status code(s)");
if (main->parameters[status_code_parameter_is_warning_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_error_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_error_s, main->error.notable);
fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_warning_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_warning_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[status_code_parameter_is_fine_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_error_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_error_s, main->error.notable);
fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_fine_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_fine_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
else if (main->parameters[status_code_parameter_is_warning_e].result == f_console_result_found_e && main->parameters[status_code_parameter_is_fine_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
- fl_print_format("%q%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_warning_s, main->error.notable);
+ fl_print_format("%q%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_warning_s, main->error.notable);
fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%q%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_fine_s, main->error.notable);
+ fl_print_format("%[%q%q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_fine_s, main->error.notable);
fl_print_format("%['.%]%q", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
for (f_array_length_t i = 0; i < status_code_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* This program provides status code to/from string translation.
*/
#ifndef _status_code_h
+#define _status_code_h
-// libc includes.
+// Libc includes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/signal.h>
#include <fll/level_0/status_string.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#endif
#ifndef _di_status_code_program_version_
- #define status_code_program_version_major_s F_string_ascii_0_s
- #define status_code_program_version_minor_s F_string_ascii_5_s
- #define status_code_program_version_micro_s F_string_ascii_8_s
+ #define STATUS_CODE_program_version_major_s F_string_ascii_0_s
+ #define STATUS_CODE_program_version_minor_s F_string_ascii_5_s
+ #define STATUS_CODE_program_version_micro_s F_string_ascii_8_s
- #ifndef status_code_progam_version_nano_prefix_s
- #define status_code_progam_version_nano_prefix_s
- #endif
+ #define STATUS_CODE_program_version_major_s_length F_string_ascii_0_s_length
+ #define STATUS_CODE_program_version_minor_s_length F_string_ascii_5_s_length
+ #define STATUS_CODE_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef status_code_progam_version_nano_s
- #define status_code_progam_version_nano_s
- #endif
+ #if !(defined(STATUS_CODE_program_version_nano_prefix_s) && defined(STATUS_CODE_program_version_nano_prefix_s_length))
+ #define STATUS_CODE_program_version_nano_prefix_s
+ #define STATUS_CODE_program_version_nano_prefix_s_length 0
+ #endif // !(defined(STATUS_CODE_program_version_nano_prefix_s) && defined(STATUS_CODE_program_version_nano_prefix_s_length))
- #define status_code_progam_version_s status_code_program_version_major_s F_string_ascii_period_s status_code_program_version_minor_s F_string_ascii_period_s status_code_program_version_micro_s status_code_progam_version_nano_prefix_s status_code_progam_version_nano_s
+ #if !(defined(STATUS_CODE_program_version_nano_s) && defined(STATUS_CODE_program_version_nano_s_length))
+ #define STATUS_CODE_program_version_nano_s
+ #define STATUS_CODE_program_version_nano_s_length 0
+ #endif // !(defined(STATUS_CODE_program_version_nano_s) && defined(STATUS_CODE_program_version_nano_s_length))
+
+ #define STATUS_CODE_progam_version_s STATUS_CODE_program_version_major_s F_string_ascii_period_s STATUS_CODE_program_version_minor_s F_string_ascii_period_s STATUS_CODE_program_version_micro_s STATUS_CODE_progam_version_nano_prefix_s STATUS_CODE_progam_version_nano_s
+
+ #define STATUS_CODE_progam_version_s_length STATUS_CODE_program_version_major_s_length + F_string_ascii_period_s_length + STATUS_CODE_program_version_minor_s_length + F_string_ascii_period_s_length + STATUS_CODE_program_version_micro_s_length + STATUS_CODE_progam_version_nano_prefix_s_length + STATUS_CODE_progam_version_nano_s_length
+
+ extern const f_string_static_t status_code_program_version_s;
#endif // _di_status_code_program_version_
#ifndef _di_status_code_program_name_
- #define status_code_progam_name_s "status_code"
- #define status_code_progam_name_long_s "FSS Status Code"
+ #define STATUS_CODE_progam_name_s "status_code"
+ #define STATUS_CODE_progam_name_long_s "FSS Status Code"
+
+ #define STATUS_CODE_program_name_s_length 11
+ #define STATUS_CODE_program_name_long_s_length 15
+
+ extern const f_string_static_t status_code_program_name_s;
+ extern const f_string_static_t status_code_program_name_long_s;
#endif // _di_status_code_program_name_
#ifndef _di_status_code_defines_
data.process_pipe = F_true;
}
- // Handle signals so that program can cleanly exit, deallocating as appropriate.
- {
- f_signal_set_empty(&data.signal.set);
- f_signal_set_add(F_signal_abort, &data.signal.set);
- f_signal_set_add(F_signal_broken_pipe, &data.signal.set);
- f_signal_set_add(F_signal_hangup, &data.signal.set);
- f_signal_set_add(F_signal_interrupt, &data.signal.set);
- f_signal_set_add(F_signal_quit, &data.signal.set);
- f_signal_set_add(F_signal_termination, &data.signal.set);
-
- f_status_t status = f_signal_mask(SIG_BLOCK, &data.signal.set, 0);
-
- if (F_status_is_error_not(status)) {
- status = f_signal_open(&data.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, &data.signal.set, 0);
- f_signal_close(&data.signal);
- }
- }
- }
+ fll_program_standard_setup(&data.signal);
const f_status_t status = utf8_main(&data, &arguments);
- // Flush output pipes before closing.
- fflush(F_type_output_d);
- fflush(F_type_error_d);
-
- // Close all open file descriptors.
- close(F_type_descriptor_output_d);
- close(F_type_descriptor_input_d);
- close(F_type_descriptor_error_d);
+ fll_program_standard_setdown(&data.signal);
- f_signal_close(&data.signal);
-
- if (F_status_is_error(status) || status == F_false) {
- return 1;
- }
+ if (F_status_is_error(status)) return 1;
return 0;
}
if (data->main->parameters[utf8_parameter_strip_invalid_e].result == f_console_result_found_e) return;
if (data->main->parameters[utf8_parameter_verify_e].result == f_console_result_found_e) return;
- fl_print_format("%q%[%SFailed to decode character code '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
+ fl_print_format("%q%[%QFailed to decode character code '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
if (character.used) {
fl_print_format("%[0x", data->main->error.to.stream, data->main->context.set.notable);
if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
- fl_print_format("%q%[%SFailed to encode Unicode codepoint '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
+ fl_print_format("%q%[%QFailed to encode Unicode codepoint '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
fl_print_format("%[U+%_U%]", data->main->error.to.stream, data->main->context.set.notable, codepoint, data->main->context.set.notable);
if (F_status_set_fine(status) == F_utf) {
if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%q%[%sNo from sources are specified, please pipe data, designate a file, or add parameters.%]%q", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context, f_string_eol_s);
+ fll_print_format("%q%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%q", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context, f_string_eol_s);
}
#endif // _di_utf8_print_error_no_from_
flockfile(data->main->error.to.stream);
- fl_print_format("%q%[%SThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
- fl_print_format("%[%q%S%]", data->main->error.to.stream, data->main->context.set.notable, f_console_symbol_long_enable_s, parameter, data->main->context.set.notable);
+ fl_print_format("%q%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
+ fl_print_format("%[%q%q%]", data->main->error.to.stream, data->main->context.set.notable, f_console_symbol_long_enable_s, parameter, data->main->context.set.notable);
fl_print_format("%[' is specified, but no value was given.%]%q", data->main->error.to.stream, data->main->context.set.error, data->main->context.set.error, f_string_eol_s);
funlockfile(data->main->error.to.stream);
flockfile(data->main->error.to.stream);
- fl_print_format("%q%[%SNo file specified at parameter index %]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
+ fl_print_format("%q%[%QNo file specified at parameter index %]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, data->main->context.set.error);
fl_print_format("%[%ul%]", data->main->error.to.stream, data->main->context.set.notable, index, data->main->context.set.notable);
fl_print_format("%[.%]%q", data->main->error.to.stream, data->main->context.set.error, data->main->context.set.error, f_string_eol_s);
flockfile(data->main->error.to.stream);
- fl_print_format("%q%[%SFailed to find the %s file '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, from ? utf8_string_from_s : utf8_string_to_s, data->main->context.set.error);
+ fl_print_format("%q%[%QFailed to find the %s file '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, from ? utf8_string_from_s : utf8_string_to_s, data->main->context.set.error);
fl_print_format("%[%S%]", data->main->error.to.stream, data->main->context.set.notable, name, data->main->context.set.notable);
fl_print_format("%['.%]%q", data->main->error.to.stream, data->main->context.set.error, data->main->context.set.error, f_string_eol_s);
if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%q%[%SToo many %s files specified, there may only be one to file.%]%q", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, utf8_string_to_s, data->main->context.set.error, f_string_eol_s);
+ fll_print_format("%q%[%QToo many %q files specified, there may only be one to file.%]%q", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, utf8_string_to_s, data->main->context.set.error, f_string_eol_s);
}
#endif // _di_utf8_print_error_parameter_file_to_too_many_
flockfile(data->main->warning.to.stream);
- fl_print_format("%]%c%c%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
+ fl_print_format("%]%q%q%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
fl_print_format("%[.%]%q", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
f_file_stream_close(F_true, &data->file);
}
- macro_f_string_dynamic_t_delete_simple(data->buffer);
- macro_f_string_dynamic_t_delete_simple(data->text);
+ f_string_dynamic_resize(0, &data->buffer);
+ f_string_dynamic_resize(0, &data->text);
}
#endif // _di_utf8_data_delete_
// When headers are printed, they are printed with a newline so only print this newline when separate is used without headers being printed.
if (data->main->parameters[utf8_parameter_headers_e].result == f_console_result_none_e && data->main->parameters[utf8_parameter_separate_e].result == f_console_result_found_e) {
- f_print_terminated(f_string_eol_s, data->file.stream);
+ f_print_dynamic(f_string_eol_s, data->file.stream);
}
}
extern "C" {
#endif
+#ifndef _di_utf8_program_version_
+ const f_string_static_t utf8_program_version_s = macro_f_string_static_t_initialize2(UTF8_program_version_s, 0, UTF8_program_version_s_length);
+#endif // _di_utf8_program_version_
+
+#ifndef _di_utf8_program_name_
+ const f_string_static_t utf8_program_name_s = macro_f_string_static_t_initialize2(UTF8_program_name_s, 0, UTF8_program_name_s_length);
+ const f_string_static_t utf8_program_name_long_s = macro_f_string_static_t_initialize2(UTF8_program_name_long_s, 0, UTF8_program_name_s_long_length);
+#endif // _di_utf8_program_name_
+
#ifndef _di_utf8_print_help_
f_status_t utf8_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, utf8_program_name_long_s, utf8_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, "Do not file in color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Set verbosity to normal file.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, f_console_symbol_short_disable_s.string, f_console_symbol_long_disable_s.string, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, utf8_short_from_binary_s, utf8_long_from_binary_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The expected input format is binary (character data).");
- fll_program_print_help_option(file, context, utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The expected input format is codepoint (such as U+0000).");
- fll_program_print_help_option(file, context, utf8_short_from_file_s, utf8_long_from_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use the given file as the input source.");
+ fll_program_print_help_option(file, context, utf8_short_from_binary_s, utf8_long_from_binary_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The expected input format is binary (character data).");
+ fll_program_print_help_option(file, context, utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The expected input format is codepoint (such as U+0000).");
+ fll_program_print_help_option(file, context, utf8_short_from_file_s, utf8_long_from_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use the given file as the input source.");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, utf8_short_to_binary_s, utf8_long_to_binary_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The output format is binary (character data).");
- fll_program_print_help_option(file, context, utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The output format is codepoint (such as U+0000).");
- fll_program_print_help_option(file, context, utf8_short_to_combining_s, utf8_long_to_combining_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "The output format is to print whether or not character is combining or not.");
- fll_program_print_help_option(file, context, utf8_short_to_file_s, utf8_long_to_file_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Use the given file as the output destination.");
- fll_program_print_help_option(file, context, utf8_short_to_width_s, utf8_long_to_width_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " The output format is to print the width of a character (either 0, 1, or 2).");
+ fll_program_print_help_option(file, context, utf8_short_to_binary_s, utf8_long_to_binary_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The output format is binary (character data).");
+ fll_program_print_help_option(file, context, utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The output format is codepoint (such as U+0000).");
+ fll_program_print_help_option(file, context, utf8_short_to_combining_s, utf8_long_to_combining_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The output format is to print whether or not character is combining or not.");
+ fll_program_print_help_option(file, context, utf8_short_to_file_s, utf8_long_to_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use the given file as the output destination.");
+ fll_program_print_help_option(file, context, utf8_short_to_width_s, utf8_long_to_width_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The output format is to print the width of a character (either 0, 1, or 2).");
f_print_dynamic(f_string_eol_s, file.stream);
- fll_program_print_help_option(file, context, utf8_short_headers_s, utf8_long_headers_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Print headers for each section (pipe, file, or parameter).");
- fll_program_print_help_option(file, context, utf8_short_separate_s, utf8_long_separate_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Separate characters by newlines (implied when printing headers).");
- fll_program_print_help_option(file, context, utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, "Strip invalid Unicode characters (do not print invalid sequences).");
- fll_program_print_help_option(file, context, utf8_short_verify_s, utf8_long_verify_s, f_console_symbol_short_enable_s.string, f_console_symbol_long_enable_s.string, " Only perform verification of valid sequences.");
+ fll_program_print_help_option(file, context, utf8_short_headers_s, utf8_long_headers_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print headers for each section (pipe, file, or parameter).");
+ fll_program_print_help_option(file, context, utf8_short_separate_s, utf8_long_separate_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Separate characters by newlines (implied when printing headers).");
+ fll_program_print_help_option(file, context, utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Strip invalid Unicode characters (do not print invalid sequences).");
+ fll_program_print_help_option(file, context, utf8_short_verify_s, utf8_long_verify_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Only perform verification of valid sequences.");
fll_program_print_help_usage(file, context, utf8_program_name_s, "filename(s)");
for (f_array_length_t i = 0; i < utf8_total_parameters_d; ++i) {
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
- macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations);
+ f_type_array_lengths_resize(0, &main->parameters[i].locations_sub);
+ f_type_array_lengths_resize(0, &main->parameters[i].values);
} // for
- macro_f_array_lengths_t_delete_simple(main->remaining);
+ f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
* - Convert from UTF-8 binary to Unicode Codepoint (such as U+0000).
*/
#ifndef _utf8_h
+#define _utf8_h
-// libc includes.
+// Libc includes.
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define PATH_MAX 4096
#endif /* PATH_MAX */
-// fll-0 includes.
+// FLL-0 includes.
#include <fll/level_0/type.h>
#include <fll/level_0/status.h>
#include <fll/level_0/memory.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
-// fll-1 includes
+// FLL-1 includes.
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
#include <fll/level_1/utf.h>
-// fll-2 includes
+// FLL-2 includes.
#include <fll/level_2/error.h>
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#endif
#ifndef _di_utf8_program_version_
- #define utf8_program_version_major_s F_string_ascii_0_s
- #define utf8_program_version_minor_s F_string_ascii_5_s
- #define utf8_program_version_micro_s F_string_ascii_8_s
+ #define UTF8_program_version_major_s F_string_ascii_0_s
+ #define UTF8_program_version_minor_s F_string_ascii_5_s
+ #define UTF8_program_version_micro_s F_string_ascii_8_s
- #ifndef utf8_program_version_nano_prefix_s
- #define utf8_program_version_nano_prefix_s
- #endif
+ #define UTF8_program_version_major_s_length F_string_ascii_0_s_length
+ #define UTF8_program_version_minor_s_length F_string_ascii_5_s_length
+ #define UTF8_program_version_micro_s_length F_string_ascii_8_s_length
- #ifndef utf8_program_version_nano_s
- #define utf8_program_version_nano_s
- #endif
+ #if !(defined(UTF8_program_version_nano_prefix_s) && defined(UTF8_program_version_nano_prefix_s_length))
+ #define UTF8_program_version_nano_prefix_s
+ #define UTF8_program_version_nano_prefix_s_length 0
+ #endif // !(defined(UTF8_program_version_nano_prefix_s) && defined(UTF8_program_version_nano_prefix_s_length))
- #define utf8_version_s utf8_program_version_major_s F_string_ascii_period_s utf8_program_version_minor_s F_string_ascii_period_s utf8_program_version_micro_s utf8_program_version_nano_prefix_s utf8_program_version_nano_s
+ #if !(defined(UTF8_program_version_nano_s) && defined(UTF8_program_version_nano_s_length))
+ #define UTF8_program_version_nano_s
+ #define UTF8_program_version_nano_s_length 0
+ #endif // !(defined(UTF8_program_version_nano_s) && defined(UTF8_program_version_nano_s_length))
+
+ #define UTF8_program_version_s UTF8_program_version_major_s F_string_ascii_period_s UTF8_program_version_minor_s F_string_ascii_period_s UTF8_program_version_micro_s UTF8_program_version_nano_prefix_s UTF8_program_version_nano_s
+
+ #define UTF8_program_version_s_length UTF8_program_version_major_s_length + F_string_ascii_period_s_length + UTF8_program_version_minor_s_length + F_string_ascii_period_s_length + UTF8_program_version_micro_s_length + UTF8_program_version_nano_prefix_s_length + UTF8_program_version_nano_s_length
+
+ extern const f_string_static_t utf8_program_version_s;
#endif // _di_utf8_program_version_
#ifndef _di_utf8_program_name_
- #define utf8_program_name_s "utf8"
- #define utf8_program_name_long_s "UTF-8"
+ #define UTF8_program_name_s "utf8"
+ #define UTF8_program_name_long_s "UTF-8"
+
+ #define UTF8_program_name_s_length 4
+ #define UTF8_program_name_long_s_length 5
+
+ extern const f_string_static_t utf8_program_name_s;
+ extern const f_string_static_t utf8_program_name_long_s;
#endif // _di_utf8_program_name_
/**